Questions tagged [sequencing]

137 questions
16
votes
1 answer

Sequencing of function parameter destruction

According to C++14 [expr.call]/4: The lifetime of a parameter ends when the function in which it is defined returns. This seems to imply that a parameter's destructor must run before the code which called the function goes on to use the function's…
M.M
  • 138,810
  • 21
  • 208
  • 365
8
votes
1 answer

Do the Requirements Placed on Function Arguments Also Apply to Initializer Lists?

So I've read here: https://stackoverflow.com/a/598150/2642059 that this is illegal: foo(i++, i++); But I believe that's because there is not a forced sequence, which I understand is the case for Initializer Lists. So is this legal code? const int…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
7
votes
5 answers

How do I reset sequence numbers to become consecutive?

I've got a mysql table where each row has its own sequence number in a "sequence" column. However, when a row gets deleted, it leaves a gap. So... 1 2 3 4 ...becomes... 1 2 4 Is there a neat way to "reset" the sequencing, so it becomes…
Urbycoz
  • 7,247
  • 20
  • 70
  • 108
6
votes
5 answers

Haskell tail-recursion performance question for Levenshtein distances

I'm playing around with calculating Levenshtein distances in Haskell, and am a little frustrated with the following performance problem. If you implement it most 'normal' way for Haskell, like below (dist), everything works just fine: dist :: (Ord…
jdo
  • 255
  • 2
  • 9
5
votes
1 answer

Python recursive function exceeds recursion limit. How can I convert it to iteration

I have created a function that reads lists of ID pairs (i.e. [("A","B"),("B","C"),("C","D"),...] and sequences the ID's from start to finish including any branches. Each list of ordered ID's is held in a class called an Alignment and this function…
Brian
  • 2,702
  • 5
  • 37
  • 71
5
votes
1 answer

Cropping MIDI file using AudioKit

I am trying to crop and loop a certain part of a MIDI file using AudioKit. I am using a sequencer and found a couple of things that are close to what I need, but not exactly. I found a method in AKSequencer called clearRange. With this method I am…
5
votes
4 answers

List of integer ranges in C#

I have a few classes that have a sequence of integer, those sequences are registered in another class that checks if a number in the sequence isn't already used. The sequences are for the most contiguous, going from a number to another. For now I've…
Dennis
  • 83
  • 7
5
votes
3 answers

waf copy a file from source tree to the build tree

I have the following snippet, to copy a file as-is to the build dir: for m in std_mibs: print("Copying", m) bld(name = 'cpstdmib', rule = 'cp -f ${SRC} ${TGT}', #source = m + '.mib', source = …
Ani
  • 1,448
  • 1
  • 16
  • 38
4
votes
3 answers

Haskell >> operator with two lists

For a college assignment I am learning Haskell and when reading about the do-notation and sequencing with >>= and >> I came across this behaviour that I did not expect. [1,2,3] >> [1] -- returns [1,1,1] Can anyone explain why every element of the…
4
votes
1 answer

How does the messenger maintain the sequencing of the messages during chat and when users log in again?

I was asked this question in an interview and was unable to answer it. How does FB messenger order the messages on user side when two messages are concurrent in order to avoid view difference in display order during the chat period and when user…
4
votes
2 answers

C++17 sequencing in assignment: still not implemented in GCC?

I tried the following code as a naive attempt to implement swapping of R and B bytes in an ABGR word #include #include uint32_t ABGR_to_ARGB(uint32_t abgr) { return ((abgr ^= (abgr >> 16) & 0xFF) ^= (abgr & 0xFF) << 16) ^=…
AnT stands with Russia
  • 312,472
  • 42
  • 525
  • 765
4
votes
4 answers

Comma operator in C++11 (sequencing)

The standard mentions f(a,(t=3,t+2),c); which would be an assignment-expression followed by an expression for the 2nd operator according to my understanding. But the grammar lists it juxtaposed: expression: assignment-expression expression,…
Starhowl
  • 434
  • 5
  • 14
3
votes
0 answers

Trimmomatic-0.39 error message "Unknown option -baseout ..."

I have used Trimmomatic-0.39 few times already for trimming some sequencing data. This time I tried the option -baseout as stated in the manual but it does not recognise it as a valid option and the command does not run. If I run the command, as I…
AVO
  • 31
  • 3
3
votes
2 answers

Extracting multiple sequences from a 7 GB fasta file using IDs from a separate text file

After searching this website for hours and trying many different things that didn't work, I have decided to post my own question. I currently have a text file (id.txt) that contains about 100 lines of the following IDS in this…
Emily W
  • 31
  • 2
3
votes
2 answers

Is int a = ++i + ++i undefined behaviour?

Consider the following code: int main(){ int i = 0; int a = ++i + ++i; } I can't find any information that says that the operands of + are unsequenced. So according to the standard, the sequence of operands of binary + are indeterminately…
xmh0511
  • 7,010
  • 1
  • 9
  • 36
1
2 3
9 10