Questions tagged [sequence-generators]
The sequence-generators tag has no usage guidance.
79
questions
0
votes
0
answers
16
views
How to Implement Numerical Inference in a Text Generation Problem
The crux of the question: is there a way to train a sequence generation model to have some degree of numerical inference.
Problem setup: a user is attempting to create an advertisement campaign ...
0
votes
1
answer
14
views
Tagging a Similar category with repeated sequence of numbers in pandas dataframe
Below is the reproducible code
colo = ['red', 'red', 'red','cross','cross','red', 'red', 'red','cross','cross','cross',
'cross','cross', 'red', 'red','cross', 'red','cross','cross']
dt ...
0
votes
0
answers
53
views
How to migrate data to new server? (Sequence generator issue)
What is the right way to backup and restore a MariaDB database that has sequence generation enabled (i.e. NOT autoincrement)? (This includes migrating to a new server.)
Is it possible to instruct the ...
-1
votes
1
answer
50
views
Cannot Auto Generate Sequence with postgreSQL
My Entity class:
@Entity
@Table(name = "songs", schema = "dbo")
public class Song {
@Id
// Try 1
@GeneratedValue(strategy = GenerationType.AUTO, generator = "...
0
votes
0
answers
101
views
How to setup Liquibase to use custom SequenceStyleGenerator
so I have custom IdGenerator like that:
@Service
public class IdGenerator extends SequenceStyleGenerator {
private final SequenceRepository sequenceRepository;
public IdGenerator(...
0
votes
1
answer
134
views
How does jpa annotation sequenceGenerator works and how to avoid duplicate entries?
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqGen")
@SequenceGenerator(name = "seqGen", sequenceName = "seq", initialValue = 1)
...
0
votes
1
answer
130
views
@SequenceGenerator, @GeneratedValue not working with auto increment primary key value with JPARepository
I'm trying to save a new record from Spring Boot JPA. My DB2 database has already created sequence (My_Sequence) which has to be used for autoincrement (tried for all generation types)
I'm facing an ...
1
vote
0
answers
130
views
Spring Boot - How to read application.properties in custom sequence generator which used in @GenericGenerator
I created a CustomSequenceGenerator for my model, everything is working fine.
Now i'm trying to read value from application.properties inside the CustomSequenceGenerator but failed.
I have tried many ...
0
votes
1
answer
107
views
Hibernate GeneratorSequence fails after 50 entries
I have an entity with the following id configuration:
public class Publication implements Serializable, Identifiable {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = &...
0
votes
0
answers
23
views
Is splitting a padded sequence into inputs and targets causing issues?
I am following loosely the Tensorflow tutorial for Text Generation with a Transformer model. I created the model and trained it for a bit a few times just to test it, but the model is getting >98% ...
3
votes
1
answer
1k
views
Custom data generator build from tf.keras.utils.Sequence doesn't work with tensorflow model's fit api
I implemented a sequence generator object according to guidelines from link.
import tensorflow as tf
from cv2 import imread, resize
from sklearn.utils import shuffle
from cv2 import imread, resize
...
3
votes
1
answer
3k
views
Spring Boot Hibernate not picking up use-new-id-generator-mappings property
I'm upgrading my project to Spring Boot 2.1.18 that uses Hibernate 5.3.18.
Previously, my entity looked like thus and would use the SequenceHiLoGenerator:
@Entity
@Table(name = "group_link")
...
1
vote
0
answers
93
views
Sequence generator in h2 does not provide unique values
For H2 database in my spring boot api test there is an insertion script that looks something like:
INSERT INTO STORES_TEMPLATE (ID, COUNTRY, TEMPLATE_NAME_1, STORES_1) VALUES(STORES_TEMPLATE_ID_SEQ....
1
vote
1
answer
61
views
Cassandra lightweight transaction based sequence generator consistency failure?
Summary
Our team inherited this sequence generator implemented using Cassandra;
Table
CREATE TABLE IF NOT EXISTS sequences (
id_name varchar,
next_id bigint,
instance_name varchar,
PRIMARY KEY ...
0
votes
0
answers
225
views
MappedSuperclass - Change SequenceGenerator in Subclass without @GeneratedValue on the Superclass
I have a base class:
@MappedSuperclass
public abstract class SuperClass{
@Id
protected Long id;
public Long getId() {
return id;
}
}
The @GeneratedValue is not used since ...
0
votes
1
answer
163
views
Spring Data JPA - Entities with composite key in which one column is an internal sequence related to the other
I have a table like the following in an Oracle database:
| GROUP | SEQ | OTHER_DATA |
|-------|-----|------------|
| 1 | 1 | ~~~~~~~~~~ |
| 1 | 2 | ~~~~~~~~~~ |
| 1 | 3 | ~~~~~~~~~~ ...
0
votes
1
answer
19
views
how can i iterate class objects while using generator in python?
i want to compare the 2000 pairs of a and b, and print the matching pairs and count of them.can anyone help me to get rid of it.it shows this error TypeError: 'seq_generator' object is not iterable at ...
0
votes
0
answers
18
views
Calling next(generatorObject) after print(list(generatorObject) throws a StopIteration exception
While using a generator, I noticed that if execute the following code, it throws a StopIteration exception :
evenIntegers = even_integers_generator(10)
print(list(evenIntegers))
for i in range(5):
...
0
votes
1
answer
232
views
SequenceGenerator with custom query to another database
Im using SequenceGenerator and GeneratedValue with sequence "seq_user_hierarchy" to do a "select nextval('NAME_OF_SEQUENCE')" in the ID field.
Is there any possibility to use a custom query like "...
1
vote
1
answer
137
views
Does Subclassing Keras Sequence Require implementing __next__ method?
The Keras Sequence class documentation says
Every Sequence must implement the __getitem__ and the __len__ methods. If you
want to modify your dataset between epochs you may implement on_epoch_end. ...
0
votes
3
answers
1k
views
How to write a Java sequence generator for UniqueId, which will Auto-Reset to '1' (base seq. number) at midnight everyday
We have a Spring boot service where we receive files everyday, because of some issue (on producer) we are receiving multiple files with same name & date appended.
The new file overwriting the old, ...
3
votes
0
answers
208
views
Error in HDF5 generator when using multiprocessing and more than one worker
I wrote a generator for Keras that uses Pytables for getting images from an HDF5 file (see code below).
It works fine, when calling it like so:
self._model.fit_generator(self.training_generator,
...
0
votes
0
answers
65
views
Hibernate - Recreating a table and assign primary key from one(beginning)
I am working with PostgreSQL database for a Spring RESTful API. I am using Spring Data, Spring JPA and Hibernate.
To produce a customized primary key, I am using SequenceGenerator. Everything works ...
0
votes
1
answer
45
views
Is there any chance that a oracle sequence may generate a value less than the latest generated value
I have a sequence generator in oracle .
cache-size 1000
INCREMENT_BY 1
I faced a issue wherein the latest value generated by the sequence was less than the prev latest
consider two columns with ID ...
0
votes
1
answer
353
views
Hibernate - Cannot insert new record when using composite primary key (@idClass), given keeping its auto-generated attribute
I'll try to put it simple. I have a table with a composite primary key composed of two Long attributes, wrapped by an @IdClass annotated class.
@IdClass Attributes:
public class MyPK implements ...
3
votes
2
answers
1k
views
Schema-validation: missing table [SEQUENCE_NAME] when using Hibernate Sequence Generator Strategy
I have some problems with the hibernate id generation and a ms sql server.
I am using the GenerationType.SEQUENCE in my application to generate Ids with hibernate.
@Id
@SequenceGenerator(name = "...
8
votes
2
answers
3k
views
asynchronous python itertools chain multiple generators
UPDATED QUESTION FOR CLARITY:
suppose I have 2 processing generator functions:
def gen1(): # just for examples,
yield 1 # yields actually carry
yield 2 # different computation weight
yield ...
0
votes
1
answer
1k
views
Same ID from sequence for 2 tables - JPA
I have 2 entities that use the same sequence as the primary key, how do I map?
Example:
@Entity
@Table("employeT")
public class Employe(){
@SequenceGenerator(name = "generator_id", ...
0
votes
1
answer
213
views
Sequence Generator Oracle not woking with import.sql
Im trying to get this tutorial (https://dzone.com/articles/spring-boot-jpa-hibernate-oracle) to work.
public class Player {
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "...
2
votes
1
answer
297
views
Javax persistence change IDENTITY to SEQUENCE on production level
Is it possible to change id generation from GenerationType.IDENTITY to GenerationType.SEQUENCE without pain for a production version of a service? DBMS is PostgreSQL.
I need to switch to SEQUENCE in ...
1
vote
0
answers
484
views
Why my MariaDB sequence generates a negative number?
I'm running the latest MariaDB 10.3.7 server which offers sequences.
I created my sequences as:
drop sequence if exists user_account_id_seq;
create sequence user_account_id_seq;
drop table if exists ...
0
votes
0
answers
98
views
@SequenceGenerator not generating sequence
Whatever I am gonna say is very strange and very true, Please don't give negative marking.
Hibernet-core : 5.2.14
Spring -boot 2.0
DB : Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - ...
2
votes
1
answer
1k
views
How can I implement a sequence generator using a universal shift register?
How can I implement a sequence generator that generates the following sequence
0000
1000
0001
0011
0110
1101
1110
1111
using a universal shift register? The shift register I need to use is the ...
0
votes
1
answer
222
views
@SequenceGenerator.schema in multitenancy JPA EclipseLink
I'm using Eclipselink with @Multitenant. everything is going well except for @SequenceGenerator
@Entity
@NamedQuery(name = "Ville.findAll", query = "SELECT v FROM Ville v")
@Multitenant(...
1
vote
1
answer
312
views
How to use the trained char-rnn to generate words?
When the char-rnn is trained, the weights of the network is fixed. If I use the same first char, how can I get the different sentence? Such as the two sentences "What is wrong?" and "What can I do for ...
3
votes
1
answer
148
views
Why is generator not identical to comprehension in 2D comprehension
What is the logic between one generator producing a 1D array and the other a 2D array in the following expressions (version 0.6.2):
julia> collect((a,b,c) for (a,b) in ((i,j) for i in 1:2 for j in ...
3
votes
0
answers
742
views
Sequence generation using pytorch RNN
I asked this over at the pytorch discussion forum as well (link) but I figured I'd ask here in case it gets more traction.
I trained a model using pytorch's nn.RNN() module by feeding it batches of ...
0
votes
1
answer
96
views
How to set the unique integer id in java for each request in the clustered environment?
I want to set the unique integer id in each request, that we will send to other system. This id should start from 1 and should increament until 2147483647. Once it reached 2147483647, it should again ...
2
votes
0
answers
2k
views
SequenceGenerator to SequenceStyleGenerator moving from hibernate 4.2 to 5
I've recently upgraded my project to use hibernate 5 which was earlier using hibernate 4.2. We have database sequence with naming convention followed as "SEQ_PrimaryKeyName". In hibernate 4.2 we were ...
0
votes
2
answers
679
views
How to spy on static generator functions?
I have an utility function that exposes a generator:
export class Utility {
// provides a generator that streams 2^n binary combinations for n variables
public static *...
9
votes
4
answers
413
views
Dynamically generating elements of list within list
I have a list, which is made up of the following elements,
list1 = [a1,a2,a3]
Where each element of this list can itself be a variable size list, eg,
a1 = [x1,y1,z1], a2 = [w2,x2,y2,z2], a3 = [p3,...
1
vote
0
answers
51
views
Developing an image frame sequence generator in MATLAB
I am doing a project where I have to create frames of images, to show a track path of an object and detect it. The end goal of my code is to create a line that shows the track path of the object as it ...
1
vote
1
answer
168
views
JPA generates negative sequence values generated for ID
I am creating a CRUD web application using JPA.
Technically every thing is working fine (no errors at all), but when checking my database I noticed that the after adding a new entry to my table, the ...
0
votes
0
answers
331
views
JPA auto generated ids of inherited entities not incremented as defined in sequence generator in super class
I have a strange behavior of auto generation id on persisting inherited entities. I have a person entity with sequence generator which increments by 4 and it works fine. I have two other entities ...
0
votes
2
answers
246
views
Is setting allocateSize as 1 in Sequence generator same as using an Identity Generator?
I moved from Identity generator to Sequence hoping that it would improve performance of my bulk inserts. I am doing bulk inserts using JPA EntityManager's persist method with a batch size of 50. ...
0
votes
3
answers
2k
views
How to generate a sequence between two values in java?
The two values that i have are:
firstval=200.000
Secondval=399.999,
I have to generate a numbers such that when the first decimal part should get incremented till 999 for the integral part, next ...
-5
votes
2
answers
73
views
How to generate a Sequence From a Given sequence [closed]
I am trying to generate a sequence
for Example as shown below ::
> s
[1] 1 5 7 10
>s.Generated_Seq
[1] 1 2 9 10 13 14 19 20
> s
[1] 2 5 7 10
>s.Generated_Seq
[1] 3 4 9 10 ...
0
votes
2
answers
1k
views
JPA SequenceGenerator: All generators in single table
I'm using 3 different JPA SequenceGenerators. Everyone creates its own table in datasource with given name:
@SequenceGenerator(name = "a_seq", sequenceName = "A_SEQ")
@SequenceGenerator(name = "b_seq"...
1
vote
3
answers
1k
views
Generate Sequence A to Z and then 0 to 9, from A to 999
Thanks in advance, I want to generate sequence from A to Z and after that 0 to 9 and after that it will move to AA, AB, AC ..... AZ, A0, A1 .... A9, BA and so on
i had tried to implement it as ...