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
1 answer
2
votes
0 answers

Generating Code Based on a Table in Julia

I have a sequence of code: TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:dc ATTR=ID:minSEARCH_CLOSED_DATE CONTENT=1-1-2010 TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:dc ATTR=ID:maxSEARCH_CLOSED_DATE CONTENT=1-2-2010 I need to change TAG POS=1 TYPE=INPUT:TEXT…
Alejandro Braun
  • 590
  • 6
  • 15
2
votes
1 answer

Why does flatMap used via an extension return different results than when called directly?

Consider this code... import Foundation let source = ["A", "B", nil, "D"] print(type(of:source)) let result1 = source.flatMap{ $0 } print(type(of:result1)) print(result1) extension Array { func sameThing() -> Array { return…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
2
votes
1 answer

Why does the sequence operator 0-2:-4 lead to -2 -1 0 1 2 3 4?

Typing in 0-2:-4 returns [1] -2 -1 0 1 2 3 4 in the console. Can anyone explain the logic behind this?
2
votes
3 answers

Integer sequences in Iterator of Iterators (Java)

I'm a beginner in programming and I have such thing as Iterator> it. Each iterator in it is a sequence of numbers. Like: Iterator1 - (1, 2, 3) Iterator2 - (4, 5, 6) Iterator3 - (7, 8, 9) When viewed from a different angle, it…
blackHorsie
  • 127
  • 10
2
votes
1 answer

Filling NA values with a sequence in R data.table

I have a data table that looks something like the following. Note that the flag is 1 when vals is 0 and missing elsewhere. dt <- data.table(vals = c(0,2,4,1,0,4,3,0,3,4)) dt[vals == 0, flag := 1] > dt vals flag 1: 0 1 2: 2 NA 3: …
3novak
  • 2,506
  • 1
  • 17
  • 28
2
votes
2 answers

liquibase creates duplicate sequence IDs in postgresql database

i am an amateur with postgresql and a newbie with liquibase. i am using puppet and liquibase to create postgresql database on rhel server. i drop the database (puppet resource postgresql_database ensure=absent) then run puppet to re-create the…
2
votes
1 answer

How to generate a well distributed normal distribution with a Sobol sequence in c++?

I have the following code: #include #include #include // #include "halton.cpp" #include "sobol.cpp" int main() { int n=5000; double* thisV; thisV = i8_sobol_generate(1,n,0); std::mt19937 generator; …
12oni
  • 85
  • 1
  • 1
  • 8
2
votes
1 answer

Skip some ranges in postgresql sequence?

I want to skip some ranges in sequence: Create sequence id_seq; Consider I have a sequence as Id_seq.. And it starts from 100.. When it reaches to 199.. Then it should start with 1000 and when it reaches 1999 .. It should start with…
Bhuvanesh
  • 1,269
  • 1
  • 15
  • 25
2
votes
1 answer

SML - bidirectional infinite and finite sequence interleaving

I have the next declarations of datatype and functions: datatype direction = Back | Forward datatype 'a bseq = bNil | bCons of 'a * (direction -> 'a bseq) fun bHead (bCons (x, _)) = x | bHead bNil = raise EmptySeq fun bForward(bCons(_, xf)) = xf…
Avenger
  • 41
  • 4
2
votes
1 answer

How to generate a new numeric column to represent a sequence of characters in R?

The data I have is like sdf: s = c("aa", "bb", "cc","cc","cc","cc","aa", "bb", "cc", "bb", "bb", "bb", "bb") sdf = data.frame(s) What I want to do is generate a column that goes from 1 to whatever, but for every repeated character the number…
Marko
  • 387
  • 1
  • 3
  • 13
2
votes
2 answers

Algorithm to validate instruction execution order

I'd like to write some simple code that helps to determine if some instructions have been executed in the intended order client-side. This is to make things difficult for anyone wishing to alter behaviour by editing byte code. For example, using a…
James P.
  • 19,313
  • 27
  • 97
  • 155
2
votes
1 answer

SQL Generate Sequence Numbers

I have a table with 2 PK Columns that I need to populate. The first column "ID" is already populated, I need to generate and populate the "SeqNum" column with int's like in my example below. There obviously cannot be the same SeqNum in the same…
zanq
  • 105
  • 1
  • 3
  • 13
2
votes
3 answers

Adding specific numbers from one sequence to another

I feel like this task should not be done this way... My sequenceY length is not equal to number of steam numbers because you can't assign int[] length with int that have 0 as a starting value. Therefore my sequenceY have a lot of 0 inside and I…
2
votes
0 answers

Any Alternate/ Comparative named algorithm to find Probability of an observed sequence in HMM, beside Forward-Algorithm

Is there any other named algorithm to find Probability of an observed sequence, beside forward-algorithm. Any naive approach can resolve this, but i am looking for alternate named algorithm. Any idea, hint of the algorithm-name would be…