Questions tagged [sequences]

A sequence is any type for which there is a bijective relation between the integers `0..n` and the elements of the sequence, and the elements may be accessed in the order `0..n`, where `n` is the number of elements in the sequence.

A sequence is any type for which there is a bijective relation between the integers 0..n and the elements of the sequence, and the elements may be accessed in the order 0..n, where n is the number of elements in the sequence.

A sequence may be infinite, in which case, the relation is with the open range 0....

538 questions
11
votes
2 answers

Oracle: What permissions do I need to grant on a sequence?

I have a new sequence in my database. What permissions do I need to grant to my web user in order for the sequence to be used? I tried granting select on the sequence, but the web user still can't seem to see it.
chris
  • 36,094
  • 53
  • 157
  • 237
11
votes
2 answers

Seq seq type as a member parameter in F#

why does not this code work? type Test() = static member func (a: seq<'a seq>) = 5. let a = [[4.]] Test.func(a) It gives following error: The type 'float list list' is not compatible with the type 'seq>'
Oldrich Svec
  • 4,191
  • 2
  • 28
  • 54
11
votes
2 answers

idiom for padding sequences

To pad out a sequence with some value, this is what I've come up with: (defn pad [n coll val] (take n (concat coll (repeat val)))) (pad 10 [1 2 3] nil) ; (1 2 3 nil nil nil nil nil nil nil) I'm curious if there's a shorter idiom that does this…
Jegschemesch
  • 11,414
  • 4
  • 32
  • 37
10
votes
5 answers

How to delete unused sequences?

We are using PostgreSQL. My requirement is to delete unused sequences from my database. For example, if I create any table through my application, one sequence will be created, but for deleting the table we are not deleting the sequence, too. If…
user1023877
  • 193
  • 2
  • 3
  • 13
10
votes
2 answers

Incrementing multi-column sequence in PostgreSQL

Is there any built-in way (I mean, without need of triggers and/or functions) to have incrementing indexes per multiple columns? So after performing: INSERT INTO "table" ("month", "desc") VALUES (1, 'One thing') , (1, 'Another…
user1598585
10
votes
8 answers

F#: How do i split up a sequence into a sequence of sequences

Background: I have a sequence of contiguous, time-stamped data. The data-sequence has gaps in it where the data is not contiguous. I want create a method to split the sequence up into a sequence of sequences so that each subsequence contains…
Treefrog
  • 403
  • 4
  • 9
9
votes
1 answer

Probability computation and algorithm for subsequences

Here is a game where cards 1-50 are distributed to two players each having 10 cards which are in random order. Aim is to sort all the cards and whoever does it first is the winner. Every time a person can pick up the card from the deck and he has to…
kumar
  • 2,696
  • 3
  • 26
  • 34
9
votes
3 answers

Db2: How to update the current value of a sequence

We use a sequence in a Db2 database. Recently, we have migrated the data from an AIX server to a Linux server. During that the latest number of that sequence was not moved to the Linux system. As a consequence, we are seeing duplicates values…
9
votes
3 answers

Producing numeric sequences in R using standard patterns

I am working on a project where I need to enter a number of "T score" tables into R. These are tables used to convert raw test scores into standardized values. They generally follow a specific pattern, but not one that is simple. For instance, one…
TARehman
  • 6,659
  • 3
  • 33
  • 60
9
votes
2 answers

What is the proper JPA mapping for @Id in parent and unique sequence in base classes

I have a class hierarchy: abstract DomainObject { ... @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="SEQ") @SequenceGenerator(name="SEQ",sequenceName="SEQ_DB_NAME") @Column(name = "id", updatable = false, nullable…
Nathan Feger
  • 19,122
  • 11
  • 62
  • 71
8
votes
5 answers

Convert List of Numbers to String Ranges

I'd like to know if there is a simple (or already created) way of doing the opposite of this: Generate List of Numbers from Hyphenated.... This link could be used to do: >> list(hyphen_range('1-9,12,15-20,23')) [1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15,…
Scott B
  • 2,542
  • 7
  • 30
  • 44
8
votes
8 answers

IEnumerable: who disposes of what and when -- Did I get it right?

Here is a hypotetical scenario. I have very large number of user names (say 10,000,000,000,000,000,000,000. Yes, we are in the intergalactic age :)). Each user has its own database. I need to iterate through the list of users and execute some SQL…
Philip P.
  • 2,364
  • 2
  • 15
  • 16
8
votes
2 answers

Lazy cartesian product of multiple sequences (sequence of sequences)

Can you suggest simpler and clearer way to write this function? let cartesian_product sequences = let step acc sequence = seq { for x in acc do for y in sequence do yield Seq.append x [y] } Seq.fold step…
Vladimir Reshetnikov
  • 11,750
  • 4
  • 30
  • 51
8
votes
3 answers

Sequence increment by 50 instead of 1

I created an Oracle sequence: Create sequence seq_acteurs start with 1 increment by 1; Normally the sequence must be incremented by 1, but when insert into Acteurs table, the sequence s incremented by 50! That doesn't seem logical. Why is this…
cascadox
  • 893
  • 4
  • 14
  • 32
8
votes
1 answer

Tensorflow LSTM character by character sequence prediction

I am attempting to replicate the character level language modeling demonstrated in the excellent article http://karpathy.github.io/2015/05/21/rnn-effectiveness/ using Tensorflow. So far my attempts have failed. My network typically outputs a single…
curator23
  • 121
  • 6
1 2
3
35 36