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.
Questions tagged [seq]
730 questions
0
votes
0 answers
Big difference in performance between two uses of Seq.iter
The following is an MWE that illustrates my problem:
let f (n : int) : unit =
{1 .. n}
|> Seq.iter (fun s ->
// Do something memory intensive, without retaining anything
()
)
()
// First call
f 100
// Second…

Shredderroy
- 2,860
- 2
- 29
- 53
0
votes
3 answers
generate 5 minutes interval
I need to write a shell script that will create a list of 5 minutes interval times.
00-00
00-05
00-10
00-15
...
...
23-50
23-55
Here are the commands I have started with.
# date
Fri Sep 21 18:14:35 IST 2012
# date '+%H-%M'
18-14
# date '+%H-%M'…

shantanuo
- 31,689
- 78
- 245
- 403
0
votes
1 answer
numerical arrays sequenced by seconds
I have a sequence from 1 to 2 which actually represents 1 to 2 minutes. I would like the increments to be in seconds. I don't think the 'chron' package will answer my problem here, because I want to make an array of numerical, decimal values not…

Doug
- 597
- 2
- 7
- 22
-1
votes
2 answers
Use output number of echo as input for seq
So as an input, i get echo [number]. For example: echo 5.
I need to get as output the sequence of numbers from 1 to [number].
So if I get 5 as input, I need: 1 2 3 4 5 (all on a separate line).
I know I can use seq 5 to get 1 2 3 4 5 but the issue…

Mr_BananaPants
- 47
- 1
- 5
-1
votes
1 answer
Filter out empty Map from a Seq[Map]
I have this Seq[Map[String,String]] :
Seq(Map("Name"-> "Laura", "City" -> "Paris"), Map("Country" -> "Italy"), Map())
I want to remove the empty Map so I can obtain:
Seq(Map("Name"-> "Laura", "City" -> "Paris"), Map("Country" -> "Italy"))
How do I…

Didi
- 53
- 5
-1
votes
1 answer
Special sequence in R
I would like to create the follow sequence without a loop for a value d greater equal 1:
c(d:2, d:3, d:4, ..., d:(d-1), d)
Is this possible?
Thank you in advance!

anjo1659
- 41
- 5
-1
votes
2 answers
Seq[String, Int] to Seq[Int] in Scala
My problem is to create suffix array for a given string.
So far I've taken the tails of the string paired them with indexes and sorted them by strings.
I need to drop the string part of the tuple so I can return Seq[Int], but I don't know how to do…

turjake
- 3
- 3
-1
votes
2 answers
using seq in bash commands
I have a script "epsmat_hdf5_merge.py" that merges contents of several files. However, those files are in their individual folders, each named with a number (0001 0002 ...). I am using the most primitive method to identify the files in the…

Jacek
- 571
- 1
- 3
- 12
-1
votes
2 answers
Is any ways to speedup work of Map.getOrElse(val, 0) on big tuple maps?
I has simple immutable Map in Scala:
// ... - mean and so on
val myLibrary = Map("qwe" -> 1.2, "qasd" -> -0.59, ...)
And for that myMap i calling MyFind method which call getOrElse(val, 0):
def MyFind (srcMap: Map[String,Int], str: String): Int…

Gudsaf
- 289
- 3
- 12
-1
votes
3 answers
Count used occurrences of custom sequence field in MS Word
I've created a custom sequence field for formula numbers:
({STYLEREF "Heading 1" \s}.{SEQ Formula \* ARABIC \s 1}) (produces following: (3.1)).
I need to count all formulas in current document to use it in Abstract. Is there a way to do it…

Egor Shulga
- 5
- 2
- 4
-1
votes
1 answer
How to check if the value matches the one from previous ?th row? (? is dynamic)
Here is my data set.
Data in
I'd like to check if the gender with "Potential Original" matched the gender with "Potential Duplicate'. There is no specified group but 1 duplicate + 1 or more original acted like a group.
Here is the output I want…

Mira Shen
- 1
- 2
-1
votes
2 answers
How to generate word sequence
1.I want to generate combinations of characters from a given word with each letter being repeated consecutively utmost 2 times and at least 1.The resultant words are of unequal lengths. For example from
"cat"
to
"cat", "catt", "caat", "caatt",…

M L
- 106
- 6
-1
votes
2 answers
How to convert the x of for x in seq to seq
This is a follow-up question to this SO-post.
Given this block of code (csvData1 is a .csv file.)
let mappedSeq1 = seq { for csvRow in csvData1 do yield (csvRow.[2], csvRow.[5]) }
for x in mappedSeq1 do
printfn "%A" x
What if I don't want to…

octopusgrabbus
- 10,555
- 15
- 68
- 131
-1
votes
1 answer
creating all permutations of a list with a limited range in Scala
I am trying to create a sequence of n-element lists comprising all permutations for a given range. Would like to parameterize both the number of elements and range. Example:
Length: 4, Range: [0, 3]
Seq(List(0, 0, 0, 0), List(0, 0, 0, 1), ...,…

tmesis
- 347
- 1
- 3
- 8
-1
votes
1 answer
In R, using for loop seq(), getting strange results/behaviour
I'm looping through a sequence of 1 to 1.9 by increments of 0.1 to find these valued positions in my data (datapositions1). However, when looping through, the value "1.7" is not being picked up although its definitely in the data. However, if I use…

Emily Davies
- 19
- 3