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
2 answers
Plot a vector against a generated date sequence
Suppose I have a vector of numbers from 1:12 and want to plot them over period of time ranged from Jan. 2013 to Dec. 2013. I used the following code to generate the data and plotting:
dates<-seq(as.Date("2013/1/1"), by = "month", length.out = 12)…

mallet
- 2,454
- 3
- 37
- 64
0
votes
1 answer
Unfathomable error using F# sequences
I had some reliably working code using lists like:
let rec srch (tzs : pqCell list) =
match tzs with
| h :: t ->
// process h and recurse on t if needed
| [] -> None
let zs =…

stephensong
- 277
- 1
- 12
0
votes
3 answers
Compare strings inside in the two different directories using array
I don't get the scenario of this given code. All I wanted is to compare the files that is given below. But, in this script nothings happen. I assume that this given code can executed wherever like in /root and it will run. Please check this…

user3626800
- 23
- 6
0
votes
2 answers
Project a sequence of 'Left's from a sequence of Eithers?
(Caveat - I'm a scala noob) Given a sequence of Eithers, viz
theResults : Seq[Either[Error, String]]
I am trying to extract all the Errors by using a map on the left(s)
theResults match {
case r if r.exists(_.isLeft) => {
val errors =…

StuartLC
- 104,537
- 17
- 209
- 285
0
votes
1 answer
Process infinite sequence with delay
How can I process an infinite sequence in ClojureScript, doing DOM manipulations per element, and then waiting some time before continuing (for example, if I wanted to have a div on a page that was showing a number that incremented once per…

wes
- 1,577
- 1
- 14
- 32
0
votes
1 answer
How to find period of a vector in MATLAB?
By the period I mean this :
Say I have a vector
v = [1,1,1 , 2,2,2 , 3,3,3];
period(v)
ans = 3
This vector should return 3 since the value changes in every 3rd item.
I can simply return the first index where the value changes, but I'm wondering if…

jeff
- 13,055
- 29
- 78
- 136
0
votes
1 answer
Implicit definition working for Seq but not for Set
So I've made some utility classes and implicit conversions for them. However, it works fine when converting from a Seq but not from a Set, although the code is the same, and those two traits seem rather similar at first sight. What could be the…

Lionel Parreaux
- 1,115
- 1
- 9
- 22
0
votes
1 answer
How to create an indexed vector base on another vector?
I'm trying to create an indexed vector based on another vector. Here is the source vector:
a <- c("A", "A", "B", "C", "D", "E", "E", "E")
and the resulting indexing vector should look like this:
x <- c(1, 2, 1, 1, 1, 1, 2, 3)
I tried this, but…

jrara
- 16,239
- 33
- 89
- 120
0
votes
0 answers
Scala Seq override ++
In Scala 2.10, I'm trying to create my own SeqLike class which disallows duplicates. I'm attempting to do this by overriding the methods which add to it, calling distinct() at the end of each of them:
sealed class UniqueSeq[A] private ( private val…

paulmdavies
- 1,248
- 3
- 12
- 28
0
votes
1 answer
Need to perform seq.Minby on property of a object sequence
So I have a Parent object that has a sequence of child objects. Each of these child objects contains a 'date' property. I want to find out which of these objects has the earliest 'date' property. This is the code I've tried, but it doesn't compile -…

ChargerIIC
- 1,620
- 1
- 33
- 47
0
votes
1 answer
Calculate Run Length Sequence and Maximum by Subject ID
We have time series data in which repeated observations were measured for several subjects. I would like to calculate the number of occasions in which the variable positive == 1 occurs for each subject (variable id).
A second aim is to identify the…

Entropy
- 378
- 6
- 16
0
votes
3 answers
Syntax error near unexpected token "(", indirect expansion variable declaration
In BASH,
I should note that the variables $Lambda0_List etc, are read from an input file earlier in the code.
PARAM_ARRAY=("Lambda0" "N" "M" "Sigma")
for i in "${PARAM_ARRAY[@]}"
do
List="$i"_List
Vary="$i"_Vary
Use_Range="$i"_Use_Range
…

Mr.Weathers
- 398
- 1
- 5
- 19
0
votes
1 answer
How to parse object during asynchronously processing function?
What should I do in case when I want to call seqEach on two_objects:
Seq()
.seq(function() {
pivotal.getProjects(this);
})
.flatten()
.seqEach(function(data) {
var project_ids = data.project.map(function(x) { return…

tomekfranek
- 6,852
- 8
- 45
- 80
0
votes
1 answer
How to pass into Seq reponse of function?
I want to pass into Seq([644511,340755]) an response from async function getProjects.
So I tried
...
var ids = pivotal.getProjects(function (err, data) {
var ids = data.project.map(function(x) { return parseInt(x.id); });
console.log("IDS_i:…

tomekfranek
- 6,852
- 8
- 45
- 80
0
votes
1 answer
How do I configure notification alerts on a job property?
I want to receive an email when a job completes or fails.