Re: [racket-users] Predictable random...so to say

2016-12-02 Thread Meino . Cramer
Hi Gustavo, oh YEAH - WHOW...what a *MACHINE* ! :) 8) Thanks a lot! Cheers Meino Gustavo Massaccesi [16-12-03 03:18]: > I suggest to use the current-pseudo-random-generator, because otherwise the > shuffle/seed will change globally the random sequence of all the

Re: [racket-users] Cleanest way to locate contiguous sequences? (as part of reuniting segments of a file)

2016-12-02 Thread David Storrs
Hi Jon, That sounds excellent. Always preferable to find a better algorithm, and I wasn't familiar with interval trees. Thanks for the pointer. Dave On Fri, Dec 2, 2016 at 3:18 PM, Jon Zeppieri wrote: > You could use an interval tree instead of a list. Before inserting

Re: [racket-users] Cleanest way to locate contiguous sequences? (as part of reuniting segments of a file)

2016-12-02 Thread Jon Zeppieri
You could use an interval tree instead of a list. Before inserting into it, you could check to see if your current chunk number is contiguous with an existing interval in the tree. If so, merge the chunks and expand the existing interval. Otherwise, insert an interval of size 1 into the tree.

Re: [racket-users] Cleanest way to locate contiguous sequences? (as part of reuniting segments of a file)

2016-12-02 Thread David Storrs
Thanks, Dan. Working with shifted lists is an interesting technique that I'll keep in my quiver. I appreciate you taking the time. On Fri, Dec 2, 2016 at 1:56 PM, Daniel Prager wrote: > Perhaps this is a more elegant approach to the tactical problem: >

Re: [racket-users] Cleanest way to locate contiguous sequences? (as part of reuniting segments of a file)

2016-12-02 Thread Daniel Prager
Perhaps this is a more elegant approach to the tactical problem: simultaneously iterating over displaced versions of the original list. E.g. _x '(1 1 2 3 5 7 200 201 202) ; shifted right x '(1 2 3 5 7 200 201 202 203) ; original list x_ '(2 3 5 7 200 201 202 203 203) ; shifted left When

[racket-users] Reducing Program Startup Time

2016-12-02 Thread Lehi Toskin
I have a GUI program (located here, for reference: https://github.com/lehitoskin/ivy.git ) I'm working on and I've found that the time it takes to go from clicking on the binary (or calling from CLI) to getting a fully loaded window takes about 2.5 ~ 3 seconds. What I would like is to get it

[racket-users] Re: Methods for least squares

2016-12-02 Thread Bradley Lucier
For the benefit of people on the Racket Users list, we're discussing the Conjugate Gradient (CG) method applied to Least Squares problems, as described in the original paper by Hestenes and Stiefel: http://www.math.purdue.edu/~lucier/jresv49n6p409_A1b.pdf The formulas to use are (10:2) on

[racket-users] Cleanest way to locate contiguous sequences? (as part of reuniting segments of a file)

2016-12-02 Thread David Storrs
This is a more business-logic as opposed to syntax/technique question than usually shows up on this list, but hopefully folks won't mind. I started off to ask "what's the best way to find contiguous sequences of numbers in a list?" and then realized that maybe I should answer the "What are you

Re: [racket-users] Predictable random...so to say

2016-12-02 Thread Gustavo Massaccesi
I suggest to use the current-pseudo-random-generator, because otherwise the shuffle/seed will change globally the random sequence of all the program. For example: ;--- #lang racket ;; shuffle/seed : list? integer -> list? (define (shuffle/seed lst seed) (random-seed seed) (shuffle lst))

Re: [racket-users] Re: Methods for least squares

2016-12-02 Thread Jens Axel Søgaard
In case you get interested in implementing fitting for non-linear problems as well, consider taking a look at this survey: "Methods for non-linear least squares problems" by K. Madsen, H.B. Nielsen, O. Tingleff. http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/3215/pdf/imm3215.pdf The first

Re: [racket-users] Predictable random...so to say

2016-12-02 Thread Meino . Cramer
Daniel Feltey [16-12-02 09:28]: > I think something like this works: > > ;; shuffle/seed : list? integer -> list? > (define (shuffle/seed lst seed) > (random-seed seed) > (shuffle lst)) > > > (define a-list (list 1 2 3 4 5 6 7 8 9 10)) > > (shuffle/seed a-list 0) > '(3

Re: [racket-users] Predictable random...so to say

2016-12-02 Thread Daniel Feltey
I think something like this works: ;; shuffle/seed : list? integer -> list? (define (shuffle/seed lst seed) (random-seed seed) (shuffle lst)) > (define a-list (list 1 2 3 4 5 6 7 8 9 10)) > (shuffle/seed a-list 0) '(3 4 9 8 5 1 10 7 6 2) > (shuffle/seed a-list 0) '(3 4 9 8 5 1 10 7 6 2) >

Re: [racket-users] Syntax for hash contracts

2016-12-02 Thread Ben Greenman
On Thu, Dec 1, 2016 at 7:29 PM, David Storrs wrote: > I'm having trouble understanding the docs on hash contracts ( > https://docs.racket-lang.org/reference/data-structure- > contracts.html#%28def._%28%28lib._racket%2Fcontract% > 2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29)

[racket-users] Predictable random...so to say

2016-12-02 Thread Meino . Cramer
Hi, is there a racket function, which shuffles a list of items based on a seed value...that is: Same seed value results in same shuffle results? Cheers Meino -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and