Questions tagged [sequence]

A sequence is an ordered list of objects (or events). Like a set, it contains members (also called elements or terms), and the number of terms (possibly infinite) is called the length of the sequence. Unlike a set, order matters, and exactly the same elements can appear multiple times at different positions in the sequence. In a relational database, a sequence is an object that is used to generate unique numbers for a primary key.

A sequence is an ordered list of objects (or events). Like a set, it contains members (also called elements or terms), and the number of terms (possibly infinite) is called the length of the sequence. Unlike a set, order matters, and exactly the same elements can appear multiple times at different positions in the sequence.

Sometimes, sequence is used as a generic name for both list, array and set for convenience.

In a , a sequence is an object that is used to generate unique numbers for a .

5959 questions
2
votes
3 answers

How to create an algorithm type?

Say I have two sequences of numbers, A and B. How can I create an object to describe the relationship between the two sequences? For example: A: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9... B: 0, 2, 4, 6, 8, 10, 12, 14, 16, 18... B = 2A The relationship, f()…
Nobody
  • 4,731
  • 7
  • 36
  • 65
2
votes
3 answers

Find Repeating Substring In a List

I have a long list of sub-strings (close to 16000) that I want to find where the repeating cycle starts/stops. I have come up with this code as a starting point: strings= ['1100100100000010', '1001001000000110', '0010010000001100', …
paperstsoap
  • 335
  • 4
  • 13
2
votes
2 answers

order dataset by exact numeric sequence in r

I have, what I think is a very simple question but can't figure it out or find the exact problem online. I want to order my dataset by id and time 1:4 so that it is in the sequence 1,2,3,4 not 1,1,1,2,2,2,3,4. See example: dff <- data.frame…
user63230
  • 4,095
  • 21
  • 43
2
votes
1 answer

how to represent multichannel event sequences

I'm trying to use TraMineR but am open to feedback/references/links to more info as to how to represent multi-channel or hierarchical event sequences and algorithms that deal with it. I have a complex event structure that I'm trying to figure out…
jojo
  • 83
  • 7
2
votes
3 answers

Unique formula for even and odd for this sequence

Before compiling my code, I got stuck while generating a general formula. Can anyone help me get the general formula of the sequence below? when n=3 the value is 0 when n=4 the value is 1 when n=5 the value is 0 when n=6 the value is -1 when n=7 the…
babs
  • 31
  • 6
2
votes
3 answers

creating sequence Id in hibernate

I wanted to generate sequence using hibernate tool ( pojo to sql). And definitely it works fine. @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqid-gen") @SequenceGenerator(name = "seqid-gen", sequenceName = "RTDS_ADSINPUT_SEQ"…
Mohan
  • 699
  • 1
  • 11
  • 27
2
votes
1 answer

Generate unique contiguous sequence number based on specific criteria without using TABLOCKX

A new entry is inserted in a table called 'Confirmation' each time a message is sent to my clients. During the insertion, I need to get the MAX value of the 'SequenceNumber' column of confirmations sent during the day to my specific client. This…
2
votes
3 answers

r - retrieve distinct sequence pattern

I would like to retrieve the different states of a sequence, get rid of the repetitions but still keep the order. Let me explain with an example. My 2 sequences look like this : library(reshape2) library(dplyr) dt %>% melt(id.vars = 'id')…
giac
  • 4,261
  • 5
  • 30
  • 59
2
votes
1 answer

primary key sequence does not exist

I have a postgresql database and after migrating to a newer version and importing my old data I have a problem with the primary key: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "browser_link_pkey" …
sveri
  • 1,372
  • 1
  • 13
  • 28
2
votes
2 answers

INSERT fails because primary key already exists

I'm using PostgreSQL 9.4 and pgAdminIII 1.20 client. When launching an INSERT on a particular table, I get an error message saying: Details: the key (gid)=(31509) already exists. (SQL State: 23505). I do not enter a gid value in the command in…
wiltomap
  • 3,933
  • 8
  • 37
  • 54
2
votes
1 answer

How do I use Mallet for my sequence labeling task?

I am trying to incorporate the mallet package into my java code for my sequence labeling task. However, I am not very sure how should I do it with just the data import guideline on the mallet website. Can anybody help me out of it? My first question…
faz
  • 313
  • 5
  • 12
2
votes
5 answers

Iterate over an array in a certain order, so that it is sampled fairly

I want to iterate over an array in a certain fashion: Starting with the first and the last element of the array, the next element I want to visit is the one furthest from all previously visited elements. For an array of length n+1, the sequence…
HugoRune
  • 13,157
  • 7
  • 69
  • 144
2
votes
2 answers

Looking for C++ Regex optionally including whitespaces

I'm having a string like "Anna" or "Anna Lena" and I want to use Regex to get the name out of it (so only "Anna" or "Anna Lena"). Currently I'm using: std::regex reg1…
Saftkeks
  • 181
  • 2
  • 15
2
votes
4 answers

How do I generate this specific sequence of numbers?

Apparently there is no predefined list available in .net. I'd like to use a number of standard colors, e.g. something like red, green, blue, yellow, ... i.e. the typical colors consisting of 00 and FF components, followed by those with additional 7F…
mafu
  • 31,798
  • 42
  • 154
  • 247
2
votes
3 answers

Oracle - Sequence dependent on another column?

How do I create a sequence that is dependent on another column? For example: I have a table CAR MAKE | CAR_NO | COLOR | MODEL _____________________________ Honda 1 S Civic Honda 2 B Civic Honda 3 W …
Alan
  • 9,331
  • 14
  • 52
  • 97
1 2 3
99
100