Questions tagged [sequential]

790 questions
330
votes
29 answers

Resolve promises one after another (i.e. in sequence)?

Consider the following code that reads an array of files in a serial/sequential manner. readFiles returns a promise, which is resolved only once all files have been read in sequence. var readFile = function(file) { ... // Returns a…
XåpplI'-I0llwlg'I -
  • 18,987
  • 23
  • 96
  • 146
88
votes
8 answers

Notepad++ incrementally replace

Lets say I want to have a 10 rows of data but I want a value to increment for each row or piece of data. How do I increment that value? For example....If I have these rows, is there a regex way of replacing the id values to increment?
Travyguy9
  • 4,414
  • 6
  • 40
  • 63
60
votes
10 answers

How to generate a number sequence in file using vi or Vim?

Is there a way to generate a number sequence in vi or Vim? For example, for an arbitrary range of lines i  through j (where i < j) in a file opened in Vim, is there a way to generate a number sequence from number 1 on line i all the way through…
Sangeeth Saravanaraj
  • 14,309
  • 20
  • 66
  • 95
60
votes
10 answers

Using Moq to verify calls are made in the correct order

I need to test the following method: CreateOutput(IWriter writer) { writer.Write(type); writer.Write(id); writer.Write(sender); // many more Write()s... } I've created a Moq'd IWriter and I want to ensure that the Write() methods…
g t
  • 6,576
  • 6
  • 44
  • 83
47
votes
9 answers

How do I call a function twice or more times consecutively?

Is there a short way to call a function twice or more consecutively in Python? For example: do() do() do() maybe like: 3*do()
alwbtc
  • 23,407
  • 50
  • 123
  • 177
27
votes
3 answers

Difference between Closed and open Sequential Pattern Mining Algorithms

I want to use some algorithms to mine my log data. I found a pattern mining framework on: http://www.philippe-fournier-viger.com/spmf/index.php?link=algorithms.php I have tried several algorithms, the BIDE+ algorithm performs the best. The BIDE+…
leon
  • 8,725
  • 18
  • 57
  • 73
27
votes
11 answers

How to make all AJAX calls sequential?

I use jQuery. And I don't want parallel AJAX calls on my application, each call must wait the previous before starting. How to implement it? There is any helper? UPDATE If there is any synchronous version of the XMLHttpRequest or jQuery.post I would…
Jader Dias
  • 81,082
  • 147
  • 410
  • 611
25
votes
0 answers

many parallel applications of a sequential transform in repa

In Repa, I would like to apply a certain d-dimensional linear transform in parallel across the innermost dimension of my array, i.e., on all "column" vectors. In general, such a transformation can be expressed as a matrix M, and each entry of M*v is…
Chris Peikert
  • 433
  • 4
  • 8
22
votes
2 answers

What are the differences between sequential consistency and quiescent consistency?

Can anyone explain me the definitions and differences between sequential consistency and quiescent consistency? In the most dumb form possible :| I did read this: Example of execution which is sequentially consistent but not quiescently…
user4089193
20
votes
3 answers

How to write a PyTorch sequential model?

So far, I wrote my MLP, RNN and CNN in Keras, but now PyTorch is gaining popularity inside deep learning communities, and so I also started to learn this framework. I am a big fan of sequential models in Keras, which allow us to make simple models…
Eka
  • 10,884
  • 31
  • 98
  • 166
17
votes
2 answers

Sequentially number rows by keyed group in SQL?

Is there a way in SQL to sequentially add a row number by key group? Assume a table with arbitrary (CODE,NAME) tuples. Example table: CODE NAME ---- ---- A Apple A Angel A Arizona B Bravo C Charlie C Cat D Dog D …
Jé Queue
  • 9,627
  • 12
  • 50
  • 60
15
votes
7 answers

How do I sequentially chain promises with angularjs $q?

In the promise library Q, you can do the following to sequentially chain promises: var items = ['one', 'two', 'three']; var chain = Q(); items.forEach(function (el) { chain = chain.then(foo(el)); }); return chain; however, the following doesn't…
redgeoff
  • 2,675
  • 1
  • 20
  • 38
13
votes
1 answer

pytorch skip connection in a sequential model

I am trying to wrap my head around skip connections in a sequential model. With the functional API I would be doing something as easy as (quick example, maybe not be 100% syntactically correct but should get the idea): x1 = self.conv1(inp) x =…
powder
  • 1,123
  • 1
  • 15
  • 30
13
votes
1 answer

Sequential Consistency in Distributed Systems

I am learning Sequential Consistency in Distributed Systems but just could not understand the terms explained. I would appreciate if someone can shed some light in layman's term on why (a) and (c) below are sequentially consistent and (b) is…
user23
  • 395
  • 5
  • 22
12
votes
6 answers

How to wait for one jquery animation to finish before the next one begins?

I have the following jQuery: $("#div1").animate({ width: '160' }, 200).animate({ width: 'toggle' }, 300 ); $("#div2").animate({ width: 'toggle' }, 300).animate({ width: '150' }, 200); My issue is that both happen at the same time. I would like the…
Abe Miessler
  • 75,910
  • 89
  • 276
  • 451
1
2 3
52 53