sequences Questions
4
Solved
Here is the question (link: http://opc.iarcs.org.in/index.php/problems/FINDPERM) :
A permutation of the numbers 1, ..., N is a rearrangment of these numbers. For example
2 4 5 1 7 6 3 8
is a...
3
Solved
I create a table and sequence in order to replace identity in the table I use SQL Server 2012 Express but I get this error while I tried to insert data to the table
Msg 11719, Level 15, State 1,...
Multiphase asked 5/10, 2012 at 11:13
1
Solved
I want to number certain combinations of row in a dataframe (which is ordered on ID and on Time)
tc <- textConnection('
id time end_yn
abc 10 0
abc 11 0
abc 12 1
abc 13 0
def 10 0
def 15 1
def ...
Terramycin asked 19/10, 2012 at 7:57
1
Solved
Find the n'th term of DJ(i).
Given DJ(i) is the number of times i is present in DJ(i)
The array DJ(i) is as shown:
i 1 2 3 4 5 6 7 8 9 10 .....
DJ(i) 1 2 2 3 3 4 4 4 5 5 .....
I want the nth...
Donnydonnybrook asked 14/10, 2012 at 11:57
3
Solved
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 patt...
5
Solved
If I have an array of [1, 2, 3, 5, 10, 9, 8, 9, 10, 11, 7] and wanted to find each case of 3 consecutive numbers (whether ascending or descending), how would I do that?
Second part would be then t...
Trave asked 24/5, 2012 at 20:6
5
Solved
Given a starting number, imagine an infinite sequence of its successive halves.
1, 0.5, 0.25, 0.125, ...
(Ignore any numerical instabilities inherent in double.)
Can this be done in a single ex...
Suspensoid asked 22/2, 2012 at 17:17
5
Solved
I read that Vectors are not seqs, but Lists are. I'm not sure what the rationale is for using one over the other. It seems that vectors are used the most, but is there a reason for that?
1
Solved
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 per...
Keratitis asked 22/9, 2011 at 17:16
3
Solved
I have a list of integer values X and I want a primary key for my table Y to come from that list of integer values. I was wondering if this could be done using sequences. In other words: is there a...
Disagree asked 17/10, 2011 at 9:39
2
Solved
Reading the Wikipedia article on UTF-8, I've been wondering about the term overlong. This term is used various times but the article doesn't provide a definition or reference for its meaning.
I wo...
Tabathatabb asked 18/8, 2011 at 19:37
3
Solved
I have a sequence of 'endpoints', e.g.:
c(7,10,5,11,15)
that I want to expand to a sequence of 'elapsed time' between the endpoints, e.g.
c(7,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,1,2,3,4,5,6,7,8,9...
2
Solved
If possible, I would like someone to give an analytic explanation of the algorithm.
For example, given the sequence
-2, 4, -1, 3, 5, -6, 1, 2
the maximum subsequence sum would be
4 + -1 + 3...
2
Solved
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] ...
1
Solved
So I'm writing a stored procedure and am having trouble getting the next value of a sequence into a variable.
The sequence name is passed into the function and is stored as a varchar2 variable. H...
2
Solved
I have the following requirements:
The sequence is unique to a host (no shared incrementing is necessary)
The sequence must be monotonically increasing.
The sequence must be persistent across pro...
Apomict asked 9/6, 2011 at 19:22
1
Solved
Lets say I have a table like this.
A | B
-----
1 | 4
7 | 8
1 | 3
1 | 2
4 | 5
3 | 5
2 | 5
7 | 8
Even though 1 is the most common value in column A and 5 is the most common value in column B (whic...
4
I've got an array of integers we're getting from a third party provider. These are meant to be sequential but for some reason they miss a number (something throws an exception, its eaten and the lo...
Myrick asked 24/3, 2011 at 0:19
4
Solved
If I have sequence of sequences (maybe a list of tuples) I can use itertools.chain() to flatten it. But sometimes I feel like I would rather write it as a comprehension. I just can't figure o...
Arronarrondissement asked 19/1, 2009 at 10:47
4
Solved
my asp.net application uses some sequences to generate tables primary keys. Db administrators have set the cache size to 20. Now the application is under test and a few records are added daily (say...
Subtype asked 16/2, 2011 at 11:43
2
Solved
Why there is no List.skip and List.take? There is of course Seq.take and Seq.skip, but they does not create lists as a result.
One possible solution is: mylist |> Seq.skip N |> Seq.toList
But thi...
1
Solved
I have a table, foo. For the purposes of a quick upgrade/deploy of my site, I made a new table, tmp_foo, to contain some new data, by doing:
create table tmp_foo (like foo including constraints in...
Inculpable asked 1/12, 2010 at 20:38
12
Solved
I have a list of numbers e.g. 21,4,7,9,12,22,17,8,2,20,23
I want to be able to pick out sequences of sequential numbers (minimum 3 items in length), so from the example above it would be 7,8,9 and...
8
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 ...
10
If I am writing a library and I have a function that needs to return a sequence of values, I could do something like:
std::vector<int> get_sequence();
However, this requires the library us...
© 2022 - 2024 — McMap. All rights reserved.