Questions tagged [continuation]

53 questions
3
votes
5 answers

How to limit lenght of a complicated line in Python?

I'm formatting my code according to PEP8, but I have a little issue; this is it: print ("DB Updated: " + datetime.datetime.fromtimestamp(int(stats_dict["db_update"])).strftime('%a %b %d %H:%M:%S %Y')) How to break it into lines with 72-79…
3
votes
2 answers

How to combine state and continuation monads in F#

I'm trying to sum a tree using the Task Parallel Library where child tasks are spawned only until the tree is traversed until a certain depth, and otherwise it sums the remaining child nodes using continuation passing style, to avoid stack…
user575606
  • 31
  • 3
2
votes
1 answer

Continuation when one or more tasks in an array is cancelled or fails?

If I have an array of tasks, Task[]. How can I write a continuation that only runs when one or more tasks in the array fails(or is cancelled)?
Erik Z
  • 4,660
  • 6
  • 47
  • 74
2
votes
4 answers

Python str.format with string contatenation and continuation

I'd like to specify a string with both line continuation and catenation characters. this is really useful if I'm echoing a bunch of related values. Here is a simple example with only two parameters: temp = "here is\n"\ +"\t{}\n"\ …
James A. Foster
  • 141
  • 1
  • 1
  • 6
2
votes
0 answers

Boost future continuation never changes state

i have a question concerning the boost future continuations. Consider the following code: #define BOOST_THREAD_PROVIDES_FUTURE #define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION #define BOOST_THREAD_PROVIDES_FUTURE_UNWRAP #include…
IcePic
  • 293
  • 1
  • 10
2
votes
2 answers

F# tail recursion and continuation with lists

I'm struggling with some assignments in F# while I prepare for the exam. The assignment says: Consider the following F# declaration: let rec f i = function | [] -> [i] | x::xs -> i+x :: f (i+1) xs The type of f is int -> int list ->…
Frederik
  • 637
  • 2
  • 8
  • 21
2
votes
3 answers

Call Continuation CC in Scheme

I'm completly lost with the call continuation in Scheme. Can someone help me with this example ? #lang scheme (define a-continuation '*dummy-value*) (define (myfunction what? l) (cond ((null? l) 0) ((what? (car l)) (+ 1…
Jean
  • 601
  • 1
  • 10
  • 26
2
votes
1 answer

What is the Redis command line (redis-cli) continuation character?

I am trying to build a redis 'stored procedure' in lua that will update a keyvalue store when one of the map fields changes, and will also extract a value from another key when said value changes. I have built this lua(redis) script and it…
ChuckCottrill
  • 4,360
  • 2
  • 24
  • 42
1
vote
1 answer

Amb using continuations

I have just started studying Racket/Scheme continuations and found a helpful resource - Matt Mights page. I understood everything till the nondeterministic Amb example. Can anyone explain me how continuations work in this example? Currently looks…
1
vote
2 answers

Pep8 and multiline while conditions

I had to add extraneous parens to a while condition today to avoid pep8 complaints: while not found and not something and \ (time_left is None or time_left > 0): (one, two, three, four) = self.gimme(timeout=time_left) My solution: while…
Quantum Mechanic
  • 625
  • 1
  • 6
  • 20
1
vote
2 answers

Running python script in command prompt: syntax error unexpected character after line continuation character

I'm new to Python and have been trying to run a Python script through the cmd terminal (after invoking Python 3.6 in the Anaconda 4.3 distribution). I've looked through various forums which have outlined how to do this. I tried entering the…
himi64
  • 1,069
  • 3
  • 12
  • 23
1
vote
1 answer

How do I save the state of a java program and pick it up later?

I am trying to run a java program that uses WEKA libraries on a cluster. This cluster times out submitted jobs after 12 hours, and I can't change this fact because I am a student and not in charge of the cluster. What I want to do is save the state…
1
vote
1 answer

Azure Table query returns empty result with not null continuation token

As it said there https://msdn.microsoft.com/en-us/library/azure/dd135718.aspx "It is possible for a query to return no results but to still return a continuation header." So my question is - what then should the behaviour of caller be? Retry…
1
vote
2 answers

Scrapy - handling ajax continuation response data in shell and spider

I'm trying to scrape data that is loaded after an ajax request. For example, the first 30 videos of this youtube page are seen in html and then the user must click a "load more" button which triggers ajax and gets more…
ProGirlXOXO
  • 2,170
  • 6
  • 25
  • 47
1
vote
2 answers

Fortran: FORMAT statement over two lines

I have an old Fortran 77 code, which I would like to run in a F90-Compiler, and my goal is to change the code as less as possible. It works quite well, but I have some problem with format statements in the code. And I don't understand what's the…