00:58 (join) leo2007 01:41 (quit) abbe|AFK: Quit: /quit 01:43 (join) blomqvist 01:46 (quit) dnolen: Quit: dnolen 02:12 (quit) ckrailo: Quit: Computer has gone to sleep. 03:50 (join) PLT_Notify 03:50 PLT_Notify: racket: master Eli Barzilay * f0d1b6b (7 files in 4 dirs): New Racket version 5.1.0.6. - http://bit.ly/dZHtRK 03:50 (part) PLT_Notify 04:53 (quit) leo2007: Ping timeout: 264 seconds 05:04 (join) masm 06:01 (join) Eren` 06:01 Eren`: how can I get the binary representation of a number? 06:02 Eren`: what I am doing is to return Boolean if the given number is a power of 2, without using any arithmetic operation 06:03 Eren`: it's just a left-shift operation to multiply a number by 2, so I will control if the number has only one "1" in it 06:03 Eren`: but I couldn't find a binary representation of a number in racket :) 06:09 Eren`: ok, "bitwise-bit-count" does the work, it counts a number of 1s in the number 06:10 Eren`: however, I get procedure is not defined error 06:10 Eren`: although it is documented in the website 06:19 (join) misterncw 06:39 (join) chturne 07:18 (join) tauntaun 07:19 (join) leo2007 07:22 (quit) rudybot: Ping timeout: 248 seconds 07:24 (join) rudybot 07:27 (quit) masm: Quit: Leaving. 07:36 eli: Eren`: That depends on what you mean by "get the binary representation". 07:37 eli: (Since numbers are already represented in binary form.) 07:59 (join) lucian 08:06 (quit) tauntaun: Ping timeout: 264 seconds 08:32 Eren`: eli: I mean, in python you can see binary representation with "bin(6)" 08:32 Eren`: I was referring to a function like "bin()" in python 08:38 DT``: Eren`, (format "~B") (or printf), or (string->number number 2) 08:39 eli: Eren`: That's not a "binary representation" -- that's a base-2 ASCII representation. 08:39 eli: And yes -- what DT`` said. 08:39 eli: rudybot: (format "~b" 6) 08:39 rudybot: eli: your sandbox is ready 08:39 rudybot: eli: ; Value: "110" 08:40 (join) tauntaun 08:50 (quit) tauntaun: Ping timeout: 246 seconds 08:57 (join) tauntaun 08:58 (quit) tauntaun: Read error: Connection reset by peer 09:06 (join) dnolen 09:09 (join) lucian_ 09:10 (quit) clklein: Ping timeout: 264 seconds 09:11 (quit) lucian: Ping timeout: 258 seconds 09:23 (quit) lucian_: Remote host closed the connection 09:24 (join) lucian 09:25 Eren`: thank you 09:44 (join) clklein 09:48 (quit) chturne: Ping timeout: 260 seconds 10:00 (quit) misterncw: Quit: Leaving... 10:10 (join) chturne 10:27 (join) tauntaun 10:28 (join) masm 10:29 (nick) samth_away -> samth 10:33 tauntaun: A bit of confusion may be caused by a typo in http://docs.racket-lang.org/reference/threads.html?q=mailbox&q=thread-receive#%28part._threadmbox%29 10:33 rudybot: http://tinyurl.com/3zvy3ll 10:34 tauntaun: The first sentence should read either "can receive an arbitrary message" or "can receive arbitrary messages." 10:34 tauntaun: Which leads to the question: how many messages can a thread's mailbox hold? 10:48 eli: rudybot: (define t (thread (lambda () (sync (make-semaphore 0))))) (for ([i (in-range 100000)]) (thread-send t i)) 10:48 rudybot: eli: why not use in-range directly? 10:48 eli: rudybot: eval (define t (thread (lambda () (sync (make-semaphore 0))))) (for ([i (in-range 100000)]) (thread-send t i)) 10:48 rudybot: eli: Done. 10:48 eli: rudybot: eval (define t (thread (lambda () (sync (make-semaphore 0))))) (for ([i (in-range 1000000)]) (thread-send t i)) 10:48 rudybot: eli: Done. 10:48 eli: rudybot: eval (define t (thread (lambda () (sync (make-semaphore 0))))) (for ([i (in-range 10000000)]) (thread-send t i)) 10:48 rudybot: eli: error: evaluator: terminated (out-of-memory) 10:49 eli: tauntaun: ^ 10:49 offby1: .oO("why not use in-range directly?" .... heh) 10:50 eli: Yeah, that auto-guessing-when-you-should-eval can be confusing when combined with come-up-with-a-reasonable-looking-random-nonsense. 10:52 eli: tauntaun: fixed. 10:52 (join) PLT_Notify 10:52 PLT_Notify: racket: master Eli Barzilay * 000e52d (1 files in 1 dirs): Minor but potentially confusing typo - http://bit.ly/hT9yAr 10:52 (part) PLT_Notify 11:00 (quit) dnolen: Quit: dnolen 11:10 tauntaun: Thread mailboxes appear to lose messages when the thread sleeps for more than about 1 second. Why? (Am I missing something obvious?) 11:15 (join) ckrailo 11:18 (join) mwolfe 11:24 (join) anRch 11:32 (quit) mwolfe: Remote host closed the connection 12:02 (quit) chturne: Read error: Operation timed out 12:09 (join) MayDaniel 12:30 (join) chturne 12:30 (quit) tauntaun: Ping timeout: 246 seconds 12:31 (quit) anRch: Quit: anRch 12:39 (quit) Eren`: Ping timeout: 276 seconds 12:40 (join) dnolen 12:46 (join) PLT_Notify 12:46 PLT_Notify: racket: master Ryan Culpepper * 0bec757 (2 files in 1 dirs): syntax/parse: fixed bug in ~literal uncovered by litset changes 12:46 PLT_Notify: racket: master Ryan Culpepper * a19a034 (1 files in 1 dirs): added ffi/unsafe/security 12:46 PLT_Notify: racket: master Ryan Culpepper * 73ab167 (46 files in 25 dirs): created racket/syntax from parts of unstable/syntax 12:46 PLT_Notify: racket: master Ryan Culpepper * 86f6546 (3 files in 3 dirs): removed define-pattern-variable 12:46 PLT_Notify: racket: master Ryan Culpepper * 76c75d5 (2 files in 2 dirs): added stx-map to syntax/stx from unstable/syntax 12:46 PLT_Notify: racket: master Ryan Culpepper * 3e5a54c (3 files in 3 dirs): unstable/syntax: removed unused code and exports 12:46 PLT_Notify: racket: master Ryan Culpepper * eb60d3d (1 files in 1 dirs): fixed bug in expansion of (this-package-in main) 12:46 PLT_Notify: racket: master Ryan Culpepper * ae8d945 (1 files in 1 dirs): added line breaks 12:46 PLT_Notify: racket: master commits 000e52d...ae8d945 - http://bit.ly/h8Fq0c 12:46 (part) PLT_Notify 12:50 (join) anRch 12:51 (join) PLT_Notify 12:51 PLT_Notify: racket: master Stephen Chang * 9f84886 (3 files in 3 dirs): fix lazy stepper to work with print and write output-styles ... - http://bit.ly/efwC1H 12:51 (part) PLT_Notify 12:55 (join) tauntaun 12:57 (join) mceier 13:06 (quit) tauntaun: Quit: Ex-Chat 13:27 (quit) anRch: Quit: anRch 13:37 (join) shofetim 13:51 (quit) evhan: Quit: Lost terminal 13:51 (join) carleastlund 13:54 (join) evhan 14:02 (quit) dnolen: Ping timeout: 252 seconds 14:05 (quit) mceier: Quit: leaving 14:08 (join) dnolen 14:34 (quit) MayDaniel: Read error: Connection reset by peer 14:49 (join) PLT_Notify 14:49 PLT_Notify: racket: master Casey Klein * 143e1e6 (3 files in 2 dirs): Improves error for references to not-yet-defined metafunctions ... 14:49 PLT_Notify: racket: master Casey Klein * 989103c (2 files in 2 dirs): Improves term-let's "too few ellipses" error ... 14:49 PLT_Notify: racket: master commits 9f84886...989103c - http://bit.ly/glBMHG 14:49 (part) PLT_Notify 14:54 (quit) dnolen: Ping timeout: 252 seconds 14:55 (quit) chturne: Ping timeout: 252 seconds 15:11 (join) PLT_Notify 15:11 PLT_Notify: racket: master Stephen Chang * 5238c33 (3 files in 2 dirs): fix stepper tests broken by lazy stepper - http://bit.ly/gtlIzG 15:11 (part) PLT_Notify 15:21 (join) chturne 16:02 (join) dnolen 16:22 (join) tauntaun 16:30 (join) MayDaniel 16:39 (quit) MayDaniel: 16:46 (join) Bennit 16:46 (part) Bennit 16:57 (quit) chturne: Ping timeout: 240 seconds 17:05 (quit) lucian: Read error: Connection reset by peer 17:21 tauntaun: Consider a thread that echoes what it receives in its mailbox: 17:21 tauntaun: (define t 17:21 tauntaun: (thread (lambda () 17:21 tauntaun: (let loop () 17:21 tauntaun: (if (thread-try-receive) 17:21 tauntaun: (printf "I heard: ~a\n" (thread-receive)) 17:21 tauntaun: (sleep 2)) 17:21 tauntaun: (flush-output) 17:21 tauntaun: (loop))))) 17:22 tauntaun: Why does the following not print a, then b, then c? 17:22 tauntaun: (thread-send t 'a) 17:22 tauntaun: (thread-send t 'b) 17:22 tauntaun: (thread-send t 'c) 17:29 (join) chturne 17:34 stamourv: I don't think there are any ordering guarantees on thread mailboxes 17:45 tauntaun: stamourv: Are you sure about this? I should also be more clear about what the code does: the problem is not that a, b, c get printed out of order, but that two of the sent messages somehow get dropped altogether. 17:46 stamourv: tauntaun: no, I'm not sure about this 17:46 stamourv: I briefly looked at the docs, and they didn't mention ordering 17:46 tauntaun: What about thread-rewind-receive? 17:48 stamourv: good point 17:49 stamourv: and you say two of the messages are dropped? 17:49 tauntaun: Yes. 17:49 tauntaun: Usually I just get "I heard: b" 17:51 stamourv: got it 17:51 stamourv: thread-try-receive consumes the 'a message 17:51 stamourv: then thread-receive consumes and prints the 'b message 17:51 tauntaun: Doh! 17:52 tauntaun: Sorry. 17:52 stamourv: no problem 17:52 tauntaun: Thanks for restoring my sanity... 17:52 stamourv: was a pleasure 17:59 lithpr: i'm not a student, but i'm working my way though HTDP.. i am a little stumped by: 17:59 lithpr: Define the program convert3. It consumes three digits, starting with the least significant digit, 17:59 lithpr: followed by the next most significant one, and so on. The program produces the corresponding number. For example, the expected value of (convert3 1 2 3) 17:59 lithpr: 17:59 lithpr: 17:59 lithpr: sorry 17:59 lithpr: i was trying not to flood 18:00 lithpr: this is easily done with a string append operation, but it says there is some algebra that can be used to solve it 18:00 (quit) leo2007: Ping timeout: 260 seconds 18:01 lithpr: anyone have any hints? 18:02 bremner: isn't this just the 1's digit, the 10's digit, and the 100's digit? 18:02 lithpr: yes 18:02 lithpr: DOH 18:02 bremner: "algebra" might be overstating it ;) 18:02 lithpr: nm, thank you, i get it now :) 18:02 (join) anRch 18:02 lithpr: i was thinking too hard :) 18:02 bremner: consider a right-module over an algebraicly complete field... 18:02 lithpr: appreaciate it bremner :) 18:03 bremner: sure 18:12 (join) mwolfe 18:22 (quit) mwolfe: Read error: No route to host 18:25 (join) Fare 18:47 (join) loopole 18:48 loopole: Hi racket people 18:49 loopole: anybody could tell me how to get the first from (current-command-line-arguments) 18:50 bremner: at a guess, (car (current-command-line-arguments)) 18:50 bremner: or (first (current-command-line-arguments)) in #lang racket 18:50 carleastlund: I believe it is a vector, so (first (vector->list (current-command-line-arguments))) is the most obvious way 18:50 carleastlund: (vector-ref (current-command-line-arguments) 0) would of course be much faster, but less mnemonic. 18:51 bremner: dunno, appeals to this C programmer ;) 18:55 samth: also, the first element is unlikely to be what you want, it's usually the program name 18:55 samth: you probably want the second element 18:57 loopole: (first (vector->list (current-command-line-arguments))) seamed to do it... thanks! 19:00 (quit) chturne: Ping timeout: 240 seconds 19:00 (quit) dnolen: Ping timeout: 252 seconds 19:06 carleastlund: samth, I don't think that's true in Racket, is it? 19:07 carleastlund: Checking at the REPL, the program name does not appear to be in (current-command-line-arguments). 19:08 (quit) anRch: Quit: anRch 19:08 (quit) carleastlund: Quit: carleastlund 19:13 samth: weird 19:36 (join) mwolfe 19:40 (quit) mwolfe: Remote host closed the connection 20:03 (quit) masm: Quit: Leaving. 20:15 (quit) saint_cypher: Quit: Leaving. 20:53 (quit) tauntaun: Quit: Ex-Chat 21:06 (join) Guest80233 21:10 (quit) ckrailo: Quit: Computer has gone to sleep. 21:14 Guest80233: hi all...i have a little example i have laid out about an issue ;m having..basically i want to have a racket file loaded as a config file..the idea was that prog-settings defines some skeletel variables and then another user created file would be loaded overtop of the skeletel config..here is a pastebin: (require "catalogd-settings.rkt") 21:15 Guest80233: (test-param #t) 21:15 (nick) Guest80233 -> rekahsoft 21:16 samth: rekahsoft, i don't see what the problem is 21:20 rekahsoft: srry just sec 21:20 rekahsoft: lol having an issue with my keyboard 21:20 rekahsoft: http://pastebin.com/50vu5NnX 21:20 rekahsoft: there is the pastebin 21:21 rekahsoft: now when i run the little program with "racket prog.rkt" it fails with an error (which i can produce if you'd like) 21:22 samth: almost certainly the problem is that you don't want to use `load' 21:23 samth: you should read this section: http://docs.racket-lang.org/guide/eval.html 21:25 rekahsoft: samth: awe...alright..knew something was up :S still a little new to racket :P 21:43 (nick) samth -> samth_away 21:43 (join) ckrailo 21:51 (nick) samth_away -> samth 21:58 (quit) Fare: Quit: Leaving 22:48 (quit) shofetim: Ping timeout: 260 seconds 22:50 (quit) ckrailo: Quit: Computer has gone to sleep. 23:00 (join) dnolen 23:06 (join) ckrailo 23:27 (quit) rekahsoft: Ping timeout: 248 seconds 23:34 (join) rekahsoft 23:39 (quit) rekahsoft: Ping timeout: 252 seconds 23:49 (join) Lajla 23:49 (part) Lajla 23:50 (join) rekahsoft