Questions tagged [seq]

seq is short for 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. Sometimes, sequence is used as a generic name for both list, array and set for convenience.

730 questions
0
votes
1 answer

Assigning a value for each dataset and plot it with ggplot

It can be complicated problem but I will try to explain it as much as I could. I have a sequenced dataset containing number of observations which should be processed before plotting. I want do it with a function. because I have another datasets in…
Alexander
  • 4,527
  • 5
  • 51
  • 98
0
votes
4 answers

add numbers to beginning of each line increasing by 1 every nth line

Starting with number 1, how to add this number in front of the direct following next x lines, followed by number 2 also for the following next x lines, and so on, end must be by y lines, how to do that? 1 jeriro ieieie ieiue 1 ieirirp wzwezeg 1…
0
votes
1 answer

SQL DENSE_RANK not suitable because of existing table- how to get min/max dates in sequence when val changes

I have an existing @table ID Date Val 1 2014-10-01 1 2 2014-10-02 1 3 2014-10-03 1 4 2014-10-04 1 5 2014-10-05 1 6 2014-10-06 1 7 2014-10-07 1 8 2014-10-08 1 9 2014-10-09 1 The Date sequence is of importance. I need…
Peter PitLock
  • 1,823
  • 7
  • 34
  • 71
0
votes
1 answer

Copy files with new sequential name (Linux)

I have this file named checkinout100.php and need to copy it to another 100 files following the numbered sequence like checkinout101.php, checkinout102.php and so on until 200. I've been looking to do it with seq but can't figure it out on my…
Filipe YaBa Polido
  • 1,656
  • 1
  • 17
  • 39
0
votes
1 answer

How to prevent myvector[3:(L-2)] reading backwards when L<5?

I am processing records from a large dataset with varying lengths using data.table[, somefunc(someseries), by=]. The length L of each record someseries could be anything from 1 to 50. I want to handle the following efficiently without needlessly…
smci
  • 32,567
  • 20
  • 113
  • 146
0
votes
2 answers

Perl regular expression to match '>'

This is how data is arranged in my…
The Last Word
  • 203
  • 1
  • 7
  • 24
0
votes
1 answer

Apply consecutive patch to a file in shell script

I'm doing a little versioning system in shell for school. The teacher tell us to use seq but I didn' t find how to use it. I've: patch $2 .version/$2.{`seq -s"," 2 $3`} where $2 is the file I need to patch, .version/$2. are the patch I need to…
marc3825
  • 3
  • 3
0
votes
1 answer

"The input sequence has an insufficient number of elements" on a Seq.length call?

I'm working on the Matasano Crypto Challenges but I'm running into an odd bug. I have a Seq of integers, and on a call to Seq.length (or Seq.sum), I get a 'System.InvalidOperationException' with the explanation of "The input sequence has an…
Arcsech
  • 36
  • 4
0
votes
1 answer

Byte array to int16 conversion

How would one take a byte array and convert it into a multidimensional integer array. The real data would actually be the results of a System.IO.BinaryReader using ReadBytes. The function would take the byte array and output the new array. For…
dgp
  • 185
  • 1
  • 9
0
votes
4 answers

Scala how to append or remove item in Seq

I have following classes case class User(userId: Int, userName: String, email: String, password: String) { def this() = this(0, "", "", "") } case class Team(teamId: Int, teamName: String, teamOwner: Int, teamMembers: Seq[User]) { def…
masiboo
  • 4,537
  • 9
  • 75
  • 136
0
votes
1 answer

Bindings inside lazy prime number generator function in Clojure

I have implemented a lazy prime number generator (nextprime returns the next prime starting from the number passed): (defn allprimes ([] (allprimes 2)) ([x] (lazy-seq (cons (nextprime x) (allprimes (nextprime x)))))) Let's assume nextprime…
lightlazer
  • 133
  • 1
  • 5
0
votes
1 answer

Clojurescript, how to access a map within a indexed sequence

(println (get-in @app-state ["my-seq"])) Returns the following sequence with type cljs.core/IndexedSeq ([-Jg95JpA3_N3ejztiBBM {create_date 1421803605375, website "www.example.com", first_name "one"}] [-Jg95LjI7YWiWE233eK1 {create_date…
hzhu
  • 3,759
  • 5
  • 29
  • 39
0
votes
1 answer

R create an array result of cutting (seq) of a data frame

I'm not comfortable with array manipulation (and english writing, sorry ..) I've this data frame (aa): aa<-data.frame(replicate(10,sample(0:17,30,rep=TRUE))) > aa X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 17 7 9 2 3 7 17 0 15 1 2 12 5 10 10…
user3355655
  • 463
  • 3
  • 15
0
votes
3 answers

How to convert (int* int) list to (int: list) in F#

I have a sequence pairwise like: Original = [(0,0); (1,2); (3,4)] I would like to convert this seq of (int *int) to a seq of int Final= [0,0,1,2,3,4] Can anyone please suggest me the way to do this ?
N.T.C
  • 658
  • 2
  • 9
  • 20
0
votes
1 answer

How to search a vector for a certain pattern

I would like to have a function that would seach the vector for a specific patern "1 after 4" (that is "1" "4"). It should list all the found sequences and the print out the ration for every each one, their length, where does it start and end. It…
user4110499