Re: [racket-users] Racket Package Server Security Vulnerabilities

2015-09-24 Thread Michael Wilber
(sorry Sam, forgot to Cc list) Thank you for disclosing these vulnerabilities! Responsible disclosure helps everyone. Sam Tobin-Hochstadt writes: > * Check any packages you have uploaded to the site, to ensure that no > unexpected changes have been made to them. Is package signing on Racket's r

Re: [racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread Michael Wilber
If you're on linux, one dirty trick you could try is to start up a local "web server" like netcat to just listen on the HTTP port and show you the request that's happening: nc -l -p 80 Then, point Curl and your Racket script to localhost and compare the request sent by each. bruc...@gmail.co

Re: [racket] the typed Values restriction

2015-03-18 Thread Michael Wilber
To expand a little bit on Sam's answer, this doesn't work in vanilla Racket either. > (define (my-apply f) (let ([tmp (f)]) f)) > (my-apply (lambda () (values 1 2))) result arity mismatch; expected number of values not received expected: 1 received: 2 values...:

Re: [racket] Calculating cumulative sum of the list

2015-01-22 Thread Michael Wilber
Here's one way, but it's not tail-recursive: racket@> (define (cumsum lst [so-far 0]) (match lst ['() '()] [(cons first rest) (cons (+ so-far first) (cumsum rest (+ so-far first)))])) racket@> (cumsum '(1 3 5 7)) '(1 4 9 16)

Re: [racket] Windows FFI Problem

2015-01-16 Thread Michael Wilber
Does this work if you place the .DLL in the same directory as the Racket executable? What if it's placed in your System32 folder? If you need to put the library in a nonstandard path (I think putting the .dll in the same folder as the .rkt script is nonstandard), try registering the DLL. See http

Re: [racket] LINQ

2014-12-13 Thread Michael Wilber
Do you mean (map), (filter), and (cartesian-product)? Or more like some simple DSL written on top of these primitives? http://docs.racket-lang.org/unstable/list.html#%28def._%28%28lib._unstable%2Flist..rkt%29._cartesian-product%29%29 Sean Kanaley writes: > Hello all, > > Does anybody know of a w

Re: [racket] Code that double checks is good, bad, other?

2014-10-03 Thread Michael Wilber
My opinion: Which will waste less time over all uses of your program? A few extra CPU-minutes of double checks, or a few extra man-weeks of debugging when one of your code's assumptions fails? Sean Kanaley writes: > Hello all, > > Sometimes I run into situations where a callee has certain input >

[racket] Bugfix for opengl package: load-shader erroneously strips newlines

2013-09-22 Thread Michael Wilber
Hey there! I found a bug in the `opengl` package. (Not the sgl bindings! The opengl you get by doing raco pkg install opengl) Since http://pkg.racket-lang.org is down, and because there's no authorship information in the README or info.rkt, I can't find the maintainer of the `opengl` package. (Jay

[racket] Bugfix for opengl package: load-shader erroneously strips newlines

2013-09-21 Thread Michael Wilber
(sorry about the possible duplicate; I sent this from the wrong email address...) Hey there! I found a bug in the `opengl` package. (Not the sgl bindings! The opengl you get by doing raco pkg install opengl) Since http://pkg.racket-lang.org is down, and because there's no authorship information i

Re: [racket] net/http-client

2013-09-16 Thread Michael Wilber
Interesting. Does this replace get-pure-port and friends? If not, maybe we should include some wording in the docs for new users: "These functions are for those who need low-level control over their HTTP requests. For a friendlier and more conventional HTTP interface, see ..." Jay McCarthy writes

Re: [racket] music mini-language

2013-08-12 Thread Michael Wilber
See https://github.com/mental/bloopsaphone which (IIRC) uses a variant of ABC notation. Neil Van Dyke writes: > Anyone currently working with music mini-languages in Racket? > > Reason I ask... In my iRobot Roomba Racket interface, I currently have a > simple music mini-language that lets you sp

Re: [racket] Try Racket

2013-04-25 Thread Michael Wilber
This is great, but it really needs some security improvements. (file->string "/etc/passwd") works fine, as does (system "rm /tmp/try-racket/main.rkt") John Clements writes: > On Apr 24, 2013, at 4:16 AM, manu d wrote: > >> Hello >> >> I got my web-based Racket tutorial off the ground. >> >> You c

Re: [racket] image on frame

2013-04-16 Thread Michael Wilber
Try something like: #lang racket/gui (require racket/draw) (define f (new frame% [label "This Space For Rent"])) (define l (new message% [parent f] [label (make-object bitmap% "/tmp/130414_005.jpg")])) (send f show #t) deepak verma writes: > how c

Re: [racket] how to get sandbox to drop errors

2013-04-12 Thread Michael Wilber
You're evaluating the (/ 1 0) before you make your evaluator. You have to quote it. The following works for me: (define my-eval (parameterize ([sandbox-output #f] [sandbox-error-output #f] [sandbox-propagate-exceptions #f] [sandbox-propagate-br

Re: [racket] Non threadsafe Fortran library (ARPACK) vs Racket 5.3.3

2013-04-02 Thread Michael Wilber
Without places, racket is single-threaded, so non-threadsafe code shouldn't be a problem unless you're using places. When the presence or absence of JIT compilation is significant, that tells me that maybe you're doing something undefined with memory. Would you mind showing us the source code? "

Re: [racket] current-output encoding

2013-03-26 Thread Michael Wilber
Does this do what you want? > (display (string->bytes/latin-1 "à")) à See also: http://docs.racket-lang.org/reference/encodings.html?q=locale I know that UTF-8 and Latin-1 are supported, at least. Other encodings might be in extra libraries, eg. http://docs.racket-lang.org/r6rs-lib-std/r6rs-lib-

Re: [racket] parallel-map, for/parallel etc.

2013-03-18 Thread Michael Wilber
Hey there! I have a half-baked implementation of something like this on PLaneT, but it doesn't use places or any of the nice things that Racket has. You can replace for/list loops with for/work loops and, under some (major) constraints, have an instant networked mapreduce setup. http://planet.rac

Re: [racket] Formatting reals

2013-03-13 Thread Michael Wilber
+10! Using just ~r can get close, but ...well... > (~r (- pi) #:min-width 12 #:precision 6) "-3.141593" Pierpaolo Bernardi writes: > Hello, > > suppose I want to format a real number, with a fixed number of digits > after the comma, rigth-padded in a given width, and I want the sign to > be

[racket] Is (read) safe?

2013-03-08 Thread Michael Wilber
With all these discussions about serialization safety in different languages (see http://news.ycombinator.com/item?id=5343704 for some commentary on clojure's default reader for example), I have to wonder: 1. Is racket's (read) "safe" to use in an unsafe context? 2. If not, how can I (read) a valu

Re: [racket] looking for a simple ssh library.

2013-02-28 Thread Michael Wilber
Oh geez, that's a very good point. Thanks for catching that before an attacker does, Eli. Eli Barzilay writes: > 30 minutes ago, Michael Wilber wrote: >> I know it's a hack but for my needs, I just spawn a synchronous ssh >> process, like this: >> >> (defin

Re: [racket] looking for a simple ssh library.

2013-02-28 Thread Michael Wilber
I know it's a hack but for my needs, I just spawn a synchronous ssh process, like this: (define (get-remote-file file) (define success? #t) (define remote-bytes (with-output-to-bytes (λ() (set! success? (system (format "ssh machinename cat ~a" file)) (and success

[racket] Linking to docs for Planet2 packages

2013-02-25 Thread Michael Wilber
Hey there! Is there any convention for linking to docs from planet2's online list of packages? E.g. as a user, it would be nice to have a "Click here to see documentation" link from, say, https://pkg.racket-lang.org/info/disassemble that either links to the scribbled docs in the source or to a UR

[racket] Racket's getting some coverage on HN

2013-02-21 Thread Michael Wilber
Specifically, Matthew Flatt's RacketCon presentation: http://news.ycombinator.com/item?id=5256999 Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Checking whether running from DrRacket.

2013-02-13 Thread Michael Wilber
Why not have a `run.rkt` that does something like #lang racket (require "main.rkt") (main) than you tell your users to run, and then just develop main.rkt inside DrRacket? Pierpaolo Bernardi writes: > On Wed, Feb 13, 2013 at 5:59 PM, Danny Yoo wrote: >>> Is there a way for a program to know if

Re: [racket] how to stop canvas% from refreshing after on-event

2013-02-12 Thread Michael Wilber
Your OpenGL example still doesn't flash for me when I move the mouse over it, on 64-bit linux. It does, however, flash when I change window focus... for some reason? What OS are you using? Philipp Dikmann writes: > I'm sorry, I should have been more specific – it happens when using a > gl-enabl

Re: [racket] R7RS and Racket in the (far) future

2013-02-09 Thread Michael Wilber
ad a very mixed reception. Scheme dialect implementors will still try to support R6RS as a checklist item, or to get some library support they don't want to implement themselves, but R6RS is not revered doctrine like language standards tend to be. Michael Wilber writes: > (disc

Re: [racket] R7RS and Racket in the (far) future

2013-02-09 Thread Michael Wilber
(disclaimer: i'm just a user; what i say doesn't reflect the rest of the community) "Racket" is a programming language lab. Both RxRS, and the rest of the "separate Racket language" that you allude to, are built on top of it, not the other way around. What would be the advantage of being built on

Re: [racket] Fun with the FFI

2013-01-09 Thread Michael Wilber
Try this (untested): (_fun [a : _double] [b : _double] [c : (_ptr o _double)] [d : (_ptr o _double)] -> [result : _int] -> (list c d result)) You can change (list c d result) to return any value that refers to the a, b, c, and d bindings you just made. Pierpaolo Ber

Re: [racket] JSON datetime value?

2013-01-05 Thread Michael Wilber
(sorry for the duplicate) JSON doesn't specify a way of encoding dates. See http://json.org/ You have to convert your date to a string first, like this: racket> (jsexpr->string (date->string (current-date))) "\"Sat Jan 05 11:20:35-0700 2013\"" Your Javascript code can then just parse the JSON st

Re: [racket] bitmap% size in memory

2012-12-19 Thread Michael Wilber
Just to clarify my understanding: The shadow bytestring takes up memory itself though, which means that if a 1MB bitmap is loaded with a 1MB shadow, then to the OS, Racket's using 2MB of memory but the garbage collector thinks it's only using 1MB. Is that right? Or since it's never accessed, does t

Re: [racket] [PATCH] Speeding up set-argb-pixels

2012-12-17 Thread Michael Wilber
idea why your numbers are > so different? > > At Sun, 16 Dec 2012 11:29:58 -0700, Michael Wilber wrote: >> TL;DR: About ~2.8x speedup from using local variables and unsafe >> functions. Copying each bitmap row could bring speedup to ~20x, but it >> doesn't quite work

Re: [racket] distributed places - throwing dcgm-type contract violation on *channel-get

2012-12-16 Thread Michael Wilber
This is just a shot in the dark, but do you have your SSH keys set up? If you get a password prompt when you 'ssh remote-node-name', I think it might not work. (From the looks of things, since you're spawning a node on localhost, I think you might have to get 'ssh localhost' working the same way.

[racket] [PATCH] Speeding up set-argb-pixels

2012-12-16 Thread Michael Wilber
TL;DR: About ~2.8x speedup from using local variables and unsafe functions. Copying each bitmap row could bring speedup to ~20x, but it doesn't quite work and I need your help. Pull request at https://github.com/plt/racket/pull/199 Hey there! I'm writing some FFmpeg bindings for Racket. It's fast

Re: [racket] Math library ready for testing

2012-12-07 Thread Michael Wilber
This is such an exciting time to be a Racket programmer! Thanks for all your work, Neil. During winter break once I'm finished with grad school apps, I'll convert my final Signals and Systems Matlab project to racket/math to get a feel for the library. One note off-hand: I really don't like the (

Re: [racket] bib file foreign letters conversion

2012-12-07 Thread Michael Wilber
Would some good old UNIX hackery and regular expressions be more appropriate here? cat your_file | sed -e "s:{'o}:ó:g" -e "s:{\"o}:ö:g" If you need it, there's always (regexp-replace). prad writes: > i have a .bib file with stuff like this that needs to be converted: > > W{\"o}lfle ->

Re: [racket] lang logo?

2012-11-26 Thread Michael Wilber
Do you mean actually mimicking the language, or just a library that provides turtle semantics? For the latter, see: http://docs.racket-lang.org/turtles/index.html?q=turtle Eric Tanter writes: > Hi there, > > Does anyone know of a `#lang logo' for Racket? yes, yes, the turtle :) > > Thanks, > > --

Re: [racket] [racket-dev] Survey for DrRacket users related to automatic parentheses behavior

2012-11-22 Thread Michael Wilber
I agree with all of these issues and your fix. This would get me back to using DrRacket's balanced paren option. A question: What happens when I type ) when I should type ]? E.g. (cond [(foo x) "one"] [(bar x) "two" |]) where | is the cursor position on the last line there, if I type a ) on

Re: [racket] planet package with DLLs

2012-10-19 Thread Michael Wilber
I'm not sure about the msvcp100.dll problem, but clements/portaudio distributes PortAudio for windows clients: http://planet.racket-lang.org/package-source/clements/portaudio.plt/3/1/ See the lib/ folder. Antonio Menezes Leitao writes: > Hi, > > I have a package that I uploaded to planet that de

Re: [racket] Function composition in Racket

2012-10-16 Thread Michael Wilber
Does surface3d and isosurface3d from racket/plot do what you want? file:///usr/share/racket/doc/plot/renderer3d.html?q=isosurface#(def._((lib._plot/main..rkt)._isosurface3d)) Gregory Woodhouse writes: > I'm intrigued. I suppose pattern based macros could be used to implement > operations like +

Re: [racket] 8ish

2012-09-10 Thread Michael Wilber
Good luck at your meeting! All of us on racket-user are cheering for you. :) Grant Rettke writes: > Hi Caleb, > > I'll head out at about 7:50 so I'll be there about 8:20. > > Grant > > Racket Users list: > http://lists.racket-lang.org/users Racket U

Re: [racket] "fra" status?

2012-09-06 Thread Michael Wilber
Something like this? http://dev.mysql.com/doc/refman/5.0/en/csv-storage-engine.html That seems somewhat unsupported though... John Clements writes: > On Sep 6, 2012, at 1:06 PM, Michael Wilber wrote: > >> CSV files? Do you mean importing a CSV file into a table? >> >

Re: [racket] "fra" status?

2012-09-06 Thread Michael Wilber
CSV files? Do you mean importing a CSV file into a table? Take a look at http://dev.mysql.com/doc/refman/5.1/en/load-data.html, the "LOAD DATA INFILE" command, which (iirc) takes a CSV file and imports it into a table, one shot. John Clements writes: > On Sep 6, 2012, at 11:08 AM, Jay McCarthy w

Re: [racket] Question

2012-09-05 Thread Michael Wilber
What's the difference between this and (reverse LS) ? Ashley Fowler writes: > Can anybody help me with this problem? I have an idea but would like some > suggestions on how to start. The problem is below... > > > Write a procedure (switch-one-and-three1 LS) that takes a list of > exactly three i

Re: [racket] [ANN] Geiser 0.2

2012-09-05 Thread Michael Wilber
It works with any file/convertible? value. Looks like sicp pictures seem to work: http://i.imgur.com/Vb4nT.png Eli Barzilay writes: > On Sunday, Jose A. Ortega Ruiz wrote: >> >> Hi, >> >> A quick note to let you know that i've just released Geiser 0.2, my >> Emacs-Racket/Guile interaction thingi

[racket] Fun with flomap: old folksy CRT televisions!

2012-08-27 Thread Michael Wilber
Thanks for the new Flomap library in Racket 5.3! I've been having tons of fun making old TV screens using this and the icons library: https://gist.github.com/3495088 (televise some-bitmap) See an example here: https://raw.github.com/gist/3495088/3de970869126047be245696c14e495e7258ce837/acat.png

Re: [racket] Racket blog post: Fully Inlined Merge Sort

2012-08-24 Thread Michael Wilber
Oh, I see it now. Thanks for the detailed explanation; I had misinterpreted earlier. On Fri, 24 Aug 2012 21:14:48 -0600, Neil Toronto wrote: > On 08/24/2012 06:23 PM, Michael Wilber wrote: > > This is interesting, but I don't understand how moving cons around keeps > > it

Re: [racket] Racket blog post: Fully Inlined Merge Sort

2012-08-24 Thread Michael Wilber
This is interesting, but I don't understand how moving cons around keeps it from allocating? In particular, why are the cons calls "evaluated at expansion time" when we may not even know the length of the list during macro expansion time? Near the top of the post, it says the code "would be slow b

Re: [racket] Notification when window is closed

2012-08-12 Thread Michael Wilber
Nice! Thank you, Matthew. Will such custodian shutdown callbacks be run when racket receives a SIGTERM? On Sun, 12 Aug 2012 20:36:36 -0600, Matthew Flatt wrote: > At Sun, 5 Aug 2012 15:02:10 -0600, Matthew Flatt wrote: > > Beware that FFI callback memory management is slightly tricky with > > sc

Re: [racket] First RacketCon 2011 video now available

2012-08-03 Thread Michael Wilber
Wow, thank you! I'm going to watch this right away. One of the silver linings of releasing these videos now is that we can better see how much our community has grown and changed since last year. On Fri, 3 Aug 2012 09:56:08 -0400, Sam Tobin-Hochstadt wrote: > I'm very pleased to announce that t

Re: [racket] Fun with denormalized floating point numbers

2012-08-01 Thread Michael Wilber
(oops, forgot to cc: the list) Oh wow, that's interesting. Your code on my computer: subnormal addition: cpu time: 8156 real time: 8171 gc time: 0 cpu time: 9009 real time: 9035 gc time: 0 cpu time: 7740 real time: 7765 gc time: 0 cpu time: 7276 real time: 7288 gc time: 0 cpu time: 10643 real tim

Re: [racket] Fun with denormalized floating point numbers

2012-08-01 Thread Michael Wilber
5th percentile >(define unsorted-times > (for/list ([i (in-range 100)]) >(define-values (results cputime realtime gctime) > (time-apply fun (list start-value))) > realtime)) >(define times (sort unsorted-times <)) >(define 5p (list-ref times

[racket] Fun with denormalized floating point numbers

2012-08-01 Thread Michael Wilber
So here's something fun to look out for in your own programs. On my slower 32-bit machine, very small numbers are much slower than slightly less small numbers. > (time-it (expt 2 -1000)) 126 - 235 > (time-it (expt 2 -1050)) 1187 - 2071 On my faster 64-bit machine, the performance difference is a

Re: [racket] Drawing PostScript file on slideshow

2012-07-03 Thread Michael Wilber
I don't know of any ways to import vector graphics in the standard library. Maybe an official developer can give pointers. There's a "pdf-render" package on planet. It's just FFI bindings to libpoppler. It only works on linux though, and who knows how stable it is. #lang racket (require slideshow

Re: [racket] What math do you want to do in Racket?

2012-07-01 Thread Michael Wilber
Just to second the thoughts of others, I will love you forever if you add basic vector / matrix operations. Ripping off NumPy would be a *huge* step forward toward encouraging scientific research in racket. On Sat, 30 Jun 2012 18:31:28 -0600, Neil Toronto wrote: > Being a glutton for punishment,

Re: [racket] Exception Stack Trace Troubles

2012-06-24 Thread Michael Wilber
If I understand correctly, by default, Racket doesn't provide forms with stack trace information when running from the CLI by default. Does it work from within DrRacket? If so, look into the errortrace module, or add (require errortrace) to the top of the .rkt, or run it like this: racket -l errort

Re: [racket] How to not escape html entities in xexpr->string ?

2012-06-09 Thread Michael Wilber
place to the xexpr. > > 2012/6/9 Michael Wilber > > > Strings aren't safe in XML by definition. > > > > Are you thinking of this, but with xexprs? > > (define title "Hello world") > > > > (string-append "" > >

[racket] Serializable struts and the quoted module path

2012-05-24 Thread Michael Wilber
Hey there! So I'm trying to use racket/serialize according to http://docs.racket-lang.org/reference/serialization.html?q=serialize#(def._((lib._racket/private/serialize..rkt)._deserialize)) According to the third bullet point, custom serializable structure types include a "quoted module path" po

Re: [racket] gl2d / gl-world: Debugging strange error / determining which libraries are missing

2012-05-17 Thread Michael Wilber
Can you run other OpenGL Racket programs? For example, try the gears example: racket /usr/lib/racket/collects/sgl/examples/gears.rkt On Thu, 17 May 2012 17:49:21 -0400, JP Verkamp wrote: > Hopefully someone out there can help me out, I've run into a a bit of > a problem with the gl2d and gl-worl