Re: [racket] deceptive perfomance for typed racket in integer division

2012-12-11 Thread Veer Singh
Sorry my mistake , it is 6.8 seconds. :) . Veer On Tue, Dec 11, 2012 at 9:52 PM, daniel rupis wrote: > Veer Singh writes: > >> >> I am getting 6.8 ms without modifying the code. >> When I change modulo to remainder I get 6.3 ms consistently. > > >

Re: [racket] deceptive perfomance for typed racket in integer division

2012-12-11 Thread Veer Singh
I am getting 6.8 ms without modifying the code. When I change modulo to remainder I get 6.3 ms consistently. Veer. On Tue, Dec 11, 2012 at 8:33 PM, daniel rupis wrote: > > I was comparing some code in Qi with that of sbcl, I posted a question in > comp.lang.lisp asking for a way to im

Re: [racket] Inserting menu between two other menu

2012-06-28 Thread Veer Singh
; to re-order them yourself (and note that DrRacket currently doesn't > provide any guarantees about the precise set of menus in the menubar). > > Robby > > On Thu, Jun 28, 2012 at 6:47 AM, Veer Singh wrote: >> Just tried it , the menu  is inserted before Tab menu , which

Re: [racket] Inserting menu between two other menu

2012-06-28 Thread Veer Singh
Just tried it , the menu is inserted before Tab menu , which is where I wanted. I assume that new menu's are inserted before Tab menu in DrRacket. Thanks. On Thu, Jun 28, 2012 at 4:28 PM, Veer Singh wrote: > Is it possible to insert a menu between two other menu in menu-bar but >

[racket] Inserting menu between two other menu

2012-06-28 Thread Veer Singh
Is it possible to insert a menu between two other menu in menu-bar but not at the end? More specifically if I want to add a new menu in DrRacket between "Racket" and "Insert" how do I do that? Thanks Veer Racket Users list: http://lists.racket-lang.org/users

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 #racke

Re: [racket] Program runs fine in console , but not in drracket.

2012-02-08 Thread Veer Singh
Hurray! it works just fine now . Thanks a lot Neil. On Wed, Feb 8, 2012 at 3:16 PM, Neil Van Dyke wrote: > Veer Singh wrote at 02/08/2012 04:27 AM: > > Well actual program is here : >> >> https://github.com/veer-**public/Predicate-Dispatch<https://github.com/veer-p

Re: [racket] Program runs fine in console , but not in drracket.

2012-02-08 Thread Veer Singh
Well actual program is here : https://github.com/veer-public/Predicate-Dispatch Running example1.rkt produces the error in DrRacket , but runs fine in console. Thanks. On Wed, Feb 8, 2012 at 2:41 PM, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 08

Re: [racket] Program runs fine in console , but not in drracket.

2012-02-08 Thread Veer Singh
My First line is #lang racket and the control in the lower left of the DrRacket window says "Determine language from source custom?" On Wed, Feb 8, 2012 at 2:48 PM, Neil Van Dyke wrote: > What happens if you make the first line of the file be "#lang racket", and > you make sure that the contro

[racket] Program runs fine in console , but not in drracket.

2012-02-07 Thread Veer Singh
I just recently downloaded racket version 5.2.1. Now when running a "particular" program in drracket I get following error : compile: unbound identifier in the transformer environment (and no #%app syntax transformer is bound) in: #%require But when same program is run in console , it works just

Re: [racket] Conditional compilation ?

2012-01-18 Thread Veer Singh
Ignore the above post , I figured this out after reading little bit more , just need to properly structure the code , sorry for the noise :) Thanks. On Wed, Jan 18, 2012 at 1:20 PM, Veer Singh wrote: > Hello , > > How do I during compilation stop propagation of shared state

Re: [racket] filtering syntax

2012-01-18 Thread Veer Singh
Add (require (for-syntax syntax/parse)) or use syntax-case and wrap it in begin i.e (begin define id-lst .) On Wed, Jan 18, 2012 at 5:36 PM, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 18-01-12 11:36, Veer Singh wrote: > > This seems t

Re: [racket] filtering syntax

2012-01-18 Thread Veer Singh
This seems to work (blind hack), I really don't know what syntax-local-make-definition-context and syntax-local-bind-syntaxes does I can only assume that they introduce some kind of bindings in particular context. (define-syntax (depgraph stx) (syntax-parse stx [(_ ((id:id expr:expr ...) ..

[racket] Conditional compilation ?

2012-01-17 Thread Veer Singh
Hello , How do I during compilation stop propagation of shared state in a some module and allow propagation of shared state in other modules. Consider the following normal and compiled modules given below where applying (add) produces list of symbols. Now in module m2 if there is some form like

Re: [racket] Help with phases

2012-01-17 Thread Veer Singh
little bit but I think its because the `phases' macro is > expanded at phase 2 before `set-compile' is called. If you put > (set-compile) before the definition of `phases' then you get '(1 2). > > > On 01/17/2012 12:06 AM, Veer Singh wrote: > > > W

[racket] Help with phases

2012-01-16 Thread Veer Singh
Why macro call (phases) produces '(1 0) and not '(1 2) ? (module mod1 racket (require (for-syntax syntax/parse)) ;"mod-compile.rkt")) (require (for-syntax (for-syntax syntax/parse racket ))) ;"mod-compile.rkt"))) (provide set-compile phases)

Re: [racket] why shift/reduce conflict?

2012-01-16 Thread Veer Singh
I think the conflict may be here(I may be wrong) : When parser encounter C , it can reduce to y or it can shift i.e it think there is A waiting to be read, hence shift/reduce conflict On Mon, Jan 16, 2012 at 2:49 PM, Dmitry Pavlov wrote: > Hello all, > > I am having trouble with yacc parser

Re: [racket] shortest paths, resource allocation/scheduling

2011-12-05 Thread Veer
I am not too sure if this is less than quadratic ?? (define points (list->vector '(a b c d e f))) (define l (vector-length points)) (define (gen org start end) (for/list ([n (in-range start end )]) (cons (vector-ref points org ) (vector-ref points n (for/fold ([accum empty]) ([i (in-r

Re: [racket] scribble problem?

2011-09-18 Thread Veer
Code is available here https://github.com/veer-public/OAuth-2.0 . Thanks. On Sat, Sep 17, 2011 at 7:55 PM, Matthew Flatt wrote: > I think we need "web-flow/web-server-flow.rkt" and its dependencies to > diagnose this problem. Is that code available somewhere? > > At Sun

Re: [racket] Racket style guide (was Re: Argument order conventions (was: Variable naming conventions))

2011-09-14 Thread Veer
Thank you so much , it is really inspiring and helpful and will read again and again. Hope to change my style , which is basically no tests , and no documentation and poor code organization . On Thu, Sep 15, 2011 at 6:17 AM, Matthias Felleisen wrote: > > > For the past few months, I have been w

[racket] scribble problem?

2011-09-10 Thread Veer
When I click Scribble HTML in DrRacket for code below #lang scribble/manual @(require (for-label racket "web-flow/web-server-flow.rkt")) @title{OAuth 2.0 Client Library} I get following error : #%plain-lambda: cannot bind identifier tainted by macro expansion at: l17069 in: (#%plain-lambda (l1

Re: [racket] External CSS w/ Templates?

2011-09-07 Thread Veer
Thank you for neat explanation , I was really confused and apology to OP. On Wed, Sep 7, 2011 at 9:08 PM, Nadeem Abdul Hamid wrote: > On Wed, Sep 7, 2011 at 1:40 AM, Veer wrote: >> If my link tag is >> >> Then browser does not find index.css , but when my li

Re: [racket] External CSS w/ Templates?

2011-09-06 Thread Veer
If my link tag is Then browser does not find index.css , but when my link tag is If it is : Then browser is able to apply the index.css . I am not too sure why is it so. Also add current directory to the #:extra-files-paths , assuming this is where html and css files resides. (serve/servlet st

Re: [racket] Adding dispatcher to serve/servlets may be?

2011-09-06 Thread Veer
, do something with it . On Tue, Sep 6, 2011 at 6:12 PM, Jay McCarthy wrote: > Can you give an example? > > Jay > > On Tue, Sep 6, 2011 at 6:39 AM, Veer wrote: >> But this will require duplicating most of what serve/servlet already does. >> >> I was thinking in t

Re: [racket] Adding dispatcher to serve/servlets may be?

2011-09-06 Thread Veer
, Jay McCarthy wrote: > That's what serve/launch/wait is. If serve/servlet isn't quite > customizable enough, you should use serve/launch/wait and perhaps > dispatch/servlet > > Jay > > On Tue, Sep 6, 2011 at 5:48 AM, Veer wrote: >> I wonder if it is good id

[racket] Adding dispatcher to serve/servlets may be?

2011-09-06 Thread Veer
I wonder if it is good idea for serve/servlet to take extra keyword argument for custom dispatcher. This might be useful for plugin type of application. Just a thought. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo

Re: [racket] send/suspend outside #lang web-server

2011-09-05 Thread Veer
d inside modules that use that language. > > The one from web-server/servlet/web is the stateful one. This is > implemented purely with native continuations, so it can be used > anywhere. > > Jay > > On Mon, Sep 5, 2011 at 12:44 AM, Veer wrote: >> Can I use send/suspend

[racket] send/suspend outside #lang web-server

2011-09-04 Thread Veer
Can I use send/suspend outside the #lang web-server module ? For example , the two modules below don't work , I get something like : "Attempt to capture a continuation from within an unsafe context: " For statefull servlets this type of example works fine. "Module test.rkt" #lang web-serve

Re: [racket] Bite-Size Racket Projects

2011-08-29 Thread Veer
h"; #:token-uri "https://accounts.google.com/o/oauth2/token"; #:redirect-uri "http://localhost:8000/oauth2callback.rkt"; #:response-type 'code)) Just substitute the client-id and client-secret that you got from google. Example should work now, if not just drop

Re: [racket] Bite-Size Racket Projects

2011-08-28 Thread Veer
I have put a very basic OAuth-2.0 protocol implementation at https://github.com/veer-public/OAuth-2.0 As I understand it more , I will try to improve it , at present it seems to work ok with google api and requires racket version 5.1.3 . Thanks On Fri, Aug 26, 2011 at 1:01 AM, Sam Tobin

Re: [racket] escaping binary data in url

2011-08-14 Thread Veer
I figured it out, it is not that complex as I thought initially , also I thought url constructor was escaping the data. Thanks all for the help. On Sat, Aug 13, 2011 at 9:37 AM, Veer wrote: > Since server part expects escaped data based on rfc 1738 , I "assume" > that it wil

Re: [racket] escaping binary data in url

2011-08-12 Thread Veer
This url http://localhost:8000/servlets/standalone.rkt?test=%ff causes server to close connection whereas http://localhost:8000/servlets/standalone.rkt?test=%23 does not , and works as expected. I suppose this is caused by use of net/url library, right? On Fri, Aug 12, 2011 at 11:43 PM, Jay McCar

Re: [racket] escaping binary data in url

2011-08-12 Thread Veer
Since server part expects escaped data based on rfc 1738 , I "assume" that it will not be able to interpret the data as base64 encoding. As per bittorrent spec , the get request to tracker must have info_hash(20 byte sha) escaped along with others. Is there any other way to insert query part in url

[racket] escaping binary data in url

2011-08-12 Thread Veer
e also , but could not follow it up (sorry for that) Veer _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] A function (in web-servlet) is expected to be invoked just once but seems to have more lives ...

2011-08-05 Thread Veer
I think #:servlet-regexp #rx"" will match anything , if I remove it the application runs fine. Otherwise http://localhost:8080/servlets/standalone.rkt will match , so will http://localhost:8080/servlets/standalone2.rkt and so on. Most probably the browser is also requesting favicon.ico . You can

Re: [racket] why do I get undefined , when using internal definition?

2011-07-10 Thread Veer
Thanks. Also I missed was that when a unit is invoked/inferred , one need not provide a another unit which implements import of first unit, only names should be visible to first unit when it is invoked. On Sun, Jul 10, 2011 at 1:53 PM, Ryan Culpepper wrote: > On 07/10/2011 01:04 AM, V

Re: [racket] why do I get undefined , when using internal definition?

2011-07-10 Thread Veer
Thanks for taking time out to explain. Now I got it that define introduces identifier binding before it evaluate it expression part, so that we can refer to it in the expression. Thanks again. On Sun, Jul 10, 2011 at 12:19 PM, Eli Barzilay wrote: > A few seconds ago, Veer wrote: >> I

Re: [racket] why do I get undefined , when using internal definition?

2011-07-10 Thread Veer
) > > Just between you and me, I never use internal "define".  I came from RnRS, > where "define" was only used at top level, and top level is fraught with > witchcraft.  "let", "let*", "let-values", and "let*-values" are more

Re: [racket] why do I get undefined , when using internal definition?

2011-07-09 Thread Veer
nters the identifier color and then value of color is returned. Sorry if I am using wrong terminology. Thanks. On Sun, Jul 10, 2011 at 11:28 AM, Eli Barzilay wrote: > 10 minutes ago, Veer wrote: >> Following code returns # : >> >> (define (make-color color) >>

[racket] why do I get undefined , when using internal definition?

2011-07-09 Thread Veer
Following code returns # : (define (make-color color) (define color color) color) (make-color 'red) ;; => # >From the guide , I get that internal definition of color is not initialized therefore the result is # . What does not initialized means in this context. My assumption was that interna

Re: [racket] RacketCon: Web app tutorial

2011-06-27 Thread Veer
Just a suggestion , not request. How about web application for multiple choice tests. For example you can have a online test for "How well you know Racket" or "Simple algebra" etc. Each question has choices and one answer. Any one can submit a test and anyone can take test or only registered users

Re: [racket] Strange behavior of web application , or may be not

2011-06-27 Thread Veer
ation is > > (begin [] (error 'oops ...) (recur)) > > When you click "View", the value > > (response/xexpr >     `(html)) > > gets returned to the continuation, so you get an error, because begin > ignores the value and drops through to the error. > > Jay >

[racket] Strange behavior of web application , or may be not

2011-06-27 Thread Veer
Hello, When I run this web application (given below) , I get strange behavior , don't know if this is correct behavior or not. Follow/click the link in sequence : 1. Create Something 2. Start again 3. View So , when I click "view" I get exception instead of blank page. code : #lang web-server/

Re: [racket] what this compile time error mean?

2011-06-16 Thread Veer
Hello Sam, Choosing "No debugging or profiling" did the trick. I assume that this error(now gone) is not specific to my system. Thanks!!! a lot. Veer. On Thu, Jun 16, 2011 at 5:30 PM, Sam Tobin-Hochstadt wrote: > Try the following: > > 1. Open the "Choose La

Re: [racket] what this compile time error mean?

2011-06-16 Thread Veer
Ok , problem is still there , I get the same error , on new ubuntu system 11.04 and newly downloaded racket 5.1.1 . Any other idea , on how to troubleshoot it ? On Tue, Jun 14, 2011 at 6:55 PM, Veer wrote: > Removing compiled directory also does not work , same error. > I am upgrad

Re: [racket] what this compile time error mean?

2011-06-14 Thread Veer
led' directory > from wherever "filename.rkt" is. > > On Tue, Jun 14, 2011 at 4:01 AM, Veer wrote: >> Thanks for replying. >> Problem still persist , even after running raco setup . >> I did not compiled the racket from the source, I downloaded the binary >

Re: [racket] what this compile time error mean?

2011-06-14 Thread Veer
2011 at 10:26 AM, Veer wrote: >> When I run the code(shown below) in DrRacket , I get the error : >> >> compile: access from an uncertified context to unexported variable >> from module: "/home/vvv/racket/collects/racket/contract/private/base.rkt" >> in: appl

[racket] what this compile time error mean?

2011-06-13 Thread Veer
iring "web-utils1.rkt" , but cannot understand why is it so and what this error means. My Racket Version is 5.1.1 Thanks Veer. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] How to use structure inside define-syntax ?

2011-04-21 Thread Veer
Thanks Jos for trying out the code. Thank you for your suggestion for keeping struct in separate module, which is what I want to do. Veer. On Thu, Apr 21, 2011 at 6:56 PM, Jos Koot wrote: > Well, I didn't try it. > It appears that you cannot define a syntax within a begin for sy

Re: [racket] How to use structure inside define-syntax ?

2011-04-21 Thread Veer
s loe) #:omit-define-syntaxes)) I get error : "expand: unbound identifier in module (in phase 1, transformer environment) in: proc-struct " But this works : (begin-for-syntax (struct proc-struct (name args loe) #:omit-define-syntaxes #:constructor-name make-proc-struct)) Th

Re: [racket] How to use structure inside define-syntax ?

2011-04-21 Thread Veer
te: > Wrap the definition of the struct in begin-for-syntax. > Jos > >> -Original Message- >> From: users-boun...@racket-lang.org >> [mailto:users-boun...@racket-lang.org] On Behalf Of Veer >> Sent: 21 April 2011 14:22 >> To: users@racket-lang.org >&g

[racket] How to use structure inside define-syntax ?

2011-04-21 Thread Veer
How do I use structure's constructor in define-syntax . I want to do something like this : (struct proc-struct (name args loe)) (define-for-syntax (process ps) #'#t) (define-syntax (procedure stx) (syntax-case stx () [(_ name args e1 e2 ...) (process (proc-struct #'name (syntax->

Re: [racket] How does free-identifier=? and bound-identifier=? works?

2011-04-11 Thread Veer
1 exp1 (cond2 (pred2 exp2) ...)))])) ;;this is returns 7 (cond2 (#f 4) (else1 7)) ;;this cause error (cond2 (else1 3) (else1 4)) ;;returns 2 (let ((else1 1)) (cond2 (else1 2) (else1 3))) Thanks again for explaining in such detail and simplic

Re: [racket] How does free-identifier=? and bound-identifier=? works?

2011-04-11 Thread Veer
You are right, I misunderstood everything from syntax object to free-identifier=? and bound-identifier=? . Thank you for explaining it so nicely also for the references , I will read them soon. Veer. On Sun, Apr 10, 2011 at 4:53 PM, Marco Maggi wrote: > Veer wrote: >> I  am  u

[racket] How does free-identifier=? and bound-identifier=? works?

2011-04-09 Thread Veer
Hello, I am unable to understand how free-identifier=? and bound-identifier=? works? For example suppose I have a code : (lambda (x y) (let ([x 2]) x)) then how do I determine if last x in the body of let is not bound by first parameter to lambda? , using either free-identifier=? or bound-ide

Re: [racket] Handling bits

2011-01-24 Thread Veer
If your data is always a "string" over 0,1 then you can write like this (which is similar to yours) (define (bit-and b1 b2) (if (char=? b1 #\0) b1 b2)) (define (bitwise f str1 str2) (for/fold ((res "")) ((b1 str1) (b2 str2)) (string-append res (string (f b1 b2) (bitwise b

[racket] question on uri encode decode

2010-12-20 Thread Veer
Give a byte string, for example (bytes 211) , how do I encode it to "%D3" , using uri-encode , or any other existing function in racket. Also when i try to do (uri-decode "%D3") , it complains that : "bytes->string/utf-8: string is not a well-formed UTF-8 encoding: #"\323" Thanks _