generator

How do I generate ids with NHibernate and Firebird?

天涯浪子 提交于 2020-01-06 02:49:08
问题 I'm trying to insert some new objects into a firebird database using NHibernate. I get the error "could not get next sequence value[SQL: SQL not available]" Here is the mapping I'm using at present. Note ANML_EVNT is the name of the generator I want to use. <id name="Id" column="ID" type="integer"> <generator class="sequence"> <param name="sequence">ANML_EVNT></param> </generator> </id> 回答1: If you still are looking for an answer here is how I've used it successfully. I use the "native"

Assign differing values to list generator results

社会主义新天地 提交于 2020-01-05 22:17:52
问题 I am using list generators as shown below. I would like to know how I can assign different text or values to the individual list generators. In the sample code, I can only assign values for all the list generators at once. For example, I would like to assign for v , row1[3]="value 1" , for k , row1[3]="value 2" and for m , row1[3]="value 3". How can I acheive that? v = (item for item in propadd if item[0]==row1[8] and harversine(custx,custy,item[2],item[3])<1500) k = (item for item in custadd

Assign differing values to list generator results

依然范特西╮ 提交于 2020-01-05 22:15:32
问题 I am using list generators as shown below. I would like to know how I can assign different text or values to the individual list generators. In the sample code, I can only assign values for all the list generators at once. For example, I would like to assign for v , row1[3]="value 1" , for k , row1[3]="value 2" and for m , row1[3]="value 3". How can I acheive that? v = (item for item in propadd if item[0]==row1[8] and harversine(custx,custy,item[2],item[3])<1500) k = (item for item in custadd

Generating scripts based on condition

折月煮酒 提交于 2020-01-05 09:08:32
问题 The inserts of a certain table(s) can be generated by using SQL Server Management Studio by right clicking on the database -> tasks -> generate scripts, choosing the tables and finally selecting data only. However the table gets bigger with time and I need only the inserts with a certain condition which would only return only a part of the data in that table. Example: there is a table FlightTickets ( TicketId(PK), BuyerId(FK to buyers), FlightId(FK to Flights) ) and I only need the insert

Generating scripts based on condition

核能气质少年 提交于 2020-01-05 09:08:07
问题 The inserts of a certain table(s) can be generated by using SQL Server Management Studio by right clicking on the database -> tasks -> generate scripts, choosing the tables and finally selecting data only. However the table gets bigger with time and I need only the inserts with a certain condition which would only return only a part of the data in that table. Example: there is a table FlightTickets ( TicketId(PK), BuyerId(FK to buyers), FlightId(FK to Flights) ) and I only need the insert

use generator as subprocess input; got “I/O operation on closed file” exception

。_饼干妹妹 提交于 2020-01-05 02:52:27
问题 I have a large file that needs to be processed before feeding to another command. I could save the processed data as a temporary file but would like to avoid it. I wrote a generator that processes each line at a time then following script to feed to the external command as input. however I got "I/O operation on closed file" exception at the second round of the loop: cmd = ['intersectBed', '-a', 'stdin', '-b', bedfile] p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,

How to use scalacheck prop generators in scalatest FlatSpec

风流意气都作罢 提交于 2020-01-04 16:58:10
问题 I'm trying to use the scalacheck property generators in a scalatest.FlatSpec test file. The test should fail and be reported by junit framework (and eclipse in my case) but the test pass and error is just displayed in console. import scala.collection.immutable.TreeSet import org.junit.runner.RunWith import org.raisercostin.namek.UnitSpec import org.scalatest.junit.JUnitRunner import org.scalatest.FlatSpec import org.scalatest._ @RunWith(classOf[JUnitRunner]) class SetsTest2 extends FlatSpec

How to use scalacheck prop generators in scalatest FlatSpec

烂漫一生 提交于 2020-01-04 16:57:05
问题 I'm trying to use the scalacheck property generators in a scalatest.FlatSpec test file. The test should fail and be reported by junit framework (and eclipse in my case) but the test pass and error is just displayed in console. import scala.collection.immutable.TreeSet import org.junit.runner.RunWith import org.raisercostin.namek.UnitSpec import org.scalatest.junit.JUnitRunner import org.scalatest.FlatSpec import org.scalatest._ @RunWith(classOf[JUnitRunner]) class SetsTest2 extends FlatSpec

Input Shape error when using Keras Functional API with fit_generator

时光总嘲笑我的痴心妄想 提交于 2020-01-04 09:23:10
问题 I've built a model using Keras Functional API and it was working correct when calling fit on train set. Now I decided to change model to use my generator def data_generator(): while 1: for i in range(len(sequences1)): yield ([sequences1[i], sequences2[i]], trainLabels[i]) and here is a sample data from my dataset sample = next(data_generator()) print(sample) print(sample[0][0].shape) # output: # ([array([ 0, 0, 0, ..., 10, 14, 16], dtype=int32), array([ 0, 0, 0, ..., 19, 1, 4], dtype=int32)],

Bug on Keras fit_generator, running few steps more than it should

瘦欲@ 提交于 2020-01-04 05:51:20
问题 I found fit_generator() would run few steps more than it should. I set steps_per_epoch=100 . i and k both start from 0. But at the end of training process, it will print out k = 109 . This situation only occurs when validation data are added. def data_generate(xfd, yfd, x_line_offset, y_line_offset): while True: k = 0 x_line_offset, y_line_offset = shuffle_list(x_line_offset, y_line_offset) for i in range(100): print('i = {}'.format(i)) print('k = {}'.format(k)) k += 1 x_train = get_line_by