Re: [racket] string->bytes/locale on an HMAC-SHA1 hash returns error

2012-05-13 Thread Veer Singh
In racket you are applying function "base64-encode" and in python you are not. Sorry if I didn't get your question. Veer. On Mon, May 14, 2012 at 9:38 AM, Shawn Smith wrote: > Having issues with mailing list.  Trying again: > > I've gotten a bit of help in #racket on freenode so far, but I'm st

Re: [racket] string->bytes/locale on an HMAC-SHA1 hash returns error

2012-05-13 Thread Shawn Smith
Having issues with mailing list. Trying again: I've gotten a bit of help in #racket on freenode so far, but I'm still facing a problem with this. In Racket, I expect that this will get me a SHA1 hash (as bytes) of a string, using a key: (require web-server/stuffers/hmac-sha1 net/bas

[racket] [REMINDER] Boston Lisp Meeting: Thursday 2012-05-17 Zach Beane on Quicklisp

2012-05-13 Thread Francois-Rene Rideau
Boston Lisp Meeting: Thursday 2012-05-17 Zach Beane on Quicklisp http://fare.livejournal.com/166595.html A Boston Lisp Meeting will take place on Thursday, May 17th 2012 at 1800 at MIT 32-D4

[racket] string->bytes/locale on an HMAC-SHA1 hash returns error

2012-05-13 Thread Shawn Smith
Hi, I'm trying to generate a SHA1 hash using a private key and a given string, like so: (define a-hash (HMAC-SHA1 (string->bytes/locale "foo") (string->bytes/locale "bar"))) This returns bytes, but when I try to turn those bytes into a string with: (bytes->string/locale a-hash) I get: bytes->

Re: [racket] paren-shape

2012-05-13 Thread Robby Findler
I think you probably have to recur when it is a pair, as the properties can get cons'd together multiple times. On Sun, May 13, 2012 at 2:57 PM, Jens Axel Søgaard wrote: > 2012/5/13 Danny Yoo : >> Does this apply? >>  http://lists.racket-lang.org/dev/archive/2012-March/009205.html > > Yes! > > Th

Re: [racket] Is there a better way to do this in Racket?

2012-05-13 Thread Harry Spier
Thanks Eli, This is what I was looking for, something short and crystal clear. I've shortened it even more. My data is actually a list of lists which I had converted to a vector of vectors, so I've deferred that for now. I've also used Matthias' macro of let** he shared the other day so now I've

Re: [racket] Is this a bug in procedure 'primitive?' ?

2012-05-13 Thread Danny Yoo
On Sun, May 13, 2012 at 1:01 AM, Jay McCarthy wrote: > primitive? is only defined on values. > > thunk, let, lambda, etc are not values. > > They are syntactic forms and thus, for example, the expression > > (primitive? let) > > represents an ill-formed let expression (indeed, so does 'let') Ano

Re: [racket] Is there a better way to do this in Racket?

2012-05-13 Thread Eli Barzilay
Just now, Harry Spier wrote: > Thanks Neil, > > Each vector is in the order of about a thousand cells and there are > about a thousand of these vectors that are processed at one time. > So as long as I can do that in 10 or 20 seconds thats fine. So as > long as its "relatively efficient" I think

Re: [racket] Is there a better way to do this in Racket?

2012-05-13 Thread Harry Spier
Thanks Neil, Each vector is in the order of about a thousand cells and there are about a thousand of these vectors that are processed at one time. So as long as I can do that in 10 or 20 seconds thats fine. So as long as its "relatively efficient" I think I'm OK. Whats just as important to me,

Re: [racket] Is there a better way to do this in Racket?

2012-05-13 Thread Danny Yoo
> The problem "feels" like a state machine problem, in that we can > imagine a machine in either one of two states: we're searching for the > start of a sequence of ones, or looking for the end of a sequence of > ones.  We can represent being in a state via function call.  The > following code is o

Re: [racket] Is there a better way to do this in Racket?

2012-05-13 Thread Danny Yoo
On Sun, May 13, 2012 at 4:47 PM, Harry Spier wrote: > Is there a better way to do this iin Racket (shorter, clearer, more readable)? The problem "feels" like a state machine problem, in that we can imagine a machine in either one of two states: we're searching for the start of a sequence of ones,

Re: [racket] Is there a better way to do this in Racket?

2012-05-13 Thread Neil Van Dyke
Harry Spier wrote at 05/13/2012 04:47 PM: Is there a better way to do this iin Racket (shorter, clearer, more readable)? If this you are doing large numbers of this operation, and you are performance-sensitive, I suggest that one of your top criteria for ``better'' should be *efficiency*.

Re: [racket] Is there a better way to do this in Racket?

2012-05-13 Thread Michael W.
Here's my shot using generators. It's probably much slower than yours due to all the continuation jumps. This way keeps all four states in your "state machine" in one place. ;; (require racket/generator) (define (list-of-ranges-of-ones v) (define vec (append (vec

Re: [racket] remote tasks

2012-05-13 Thread Neil Van Dyke
HP Wei wrote at 05/13/2012 03:53 PM: Suppose I am on a master machine A and there are two other machines B and C. On A, in racket, I would like to programatically initiate one server on B and another on C. The 'server' is presumably a 'repl' that can execute a block of code, sent from A. [ Let

[racket] Is there a better way to do this in Racket?

2012-05-13 Thread Harry Spier
Is there a better way to do this iin Racket (shorter, clearer, more readable)? I have vectors of 1's and 0's (each vector representing a row of black and white pixels. I need to transform each vector into a list of pairs. Each pair containing the start and end vector-ref's of a contiguous segmen

Re: [racket] paren-shape

2012-05-13 Thread Eli Barzilay
A few minutes ago, Danny Yoo wrote: > Does this apply?  http://lists.racket-lang.org/dev/archive/2012-March/ > 009205.html Looks like it -- I change `curly?' to (define-for-syntax (curly? stx) (eprintf ">>> ~s -> ~s\n" stx (syntax-property stx 'paren-shape)) (eq? (syntax-property stx 'p

Re: [racket] paren-shape

2012-05-13 Thread Jens Axel Søgaard
2012/5/13 Danny Yoo : > Does this apply? >  http://lists.racket-lang.org/dev/archive/2012-March/009205.html Yes! The test for curliness must take the (cons orig new) new possibility into account, and then it just works. Thanks. /Jens Axel (define-for-syntax (curly? stx) (let ([p (syntax-pr

[racket] remote tasks

2012-05-13 Thread HP Wei
Would you please suggest to me some links so that I can get some info or even better some sample racket codes for below task ? --- Suppose I am on a master machine A and there are two other machines B and C. On A, in racket, I would like to

Re: [racket] Scribble Warning / "on this page"

2012-05-13 Thread Quentin Rinaldi
Thank you !! Yes, now it's better... but i'm not sure to understand the "library" concept... On my project, I have 3 files : projet_class.rkt : all class are defined here (porte% etc...) it starts with (provide (all-defined-out)) projet_definitions.rkt : most of all definitions I use in projet_i

Re: [racket] paren-shape

2012-05-13 Thread Danny Yoo
Does this apply? http://lists.racket-lang.org/dev/archive/2012-March/009205.html On Sunday, May 13, 2012, Jens Axel Søgaard wrote: > Hi All, > > I am playing around with the paren-shape syntax property > in order to use {} for polynomials. > > The case {+ p q r ...} is causing me problems. > > I

[racket] paren-shape

2012-05-13 Thread Jens Axel Søgaard
Hi All, I am playing around with the paren-shape syntax property in order to use {} for polynomials. The case {+ p q r ...} is causing me problems. I have reduced the problem to the example below. I'd like {+ 2 3 5} to expand to (* (* 2 3) 5) and thus evaluate to 30. However as is {+ 2 3 5} exp

Re: [racket] Scribble Warning / "on this page"

2012-05-13 Thread Matthew Flatt
Do you have a `defmodule' declaration? That is, your documentation source should look something like this: #lang scribble/manual @(require (for-label racket mylib)) @title{Documentation} ... @defmodule[mylib] ... @(defclass porte% object% {and% or% not% nand%}

[racket] Scribble Warning / "on this page"

2012-05-13 Thread Quentin Rinaldi
Hi I'm writing a Scheme project documentation with Scribble, and I have this error : WARNING: no declared exporting libraries for definition I've understood that I should write something like "declare-exporting ..." but I don't understand why... I don't need to export anything, all my documentat