Re: [racket] Json pretty-print

2013-04-16 Thread Grant Rettke
On Tue, Apr 16, 2013 at 4:23 PM, Nick Shelley wrote: > The thing is, the system call to python works for our needs and is easier > than rolling my own. FWIW it is so pleasant in Python that at work the .NET guys use Python to do the same thing! :) Racket Users list: http

Re: [racket] Json pretty-print

2013-04-16 Thread Nick Shelley
First off, thanks Carl and Danny for the code. The thing is, the system call to python works for our needs and is easier than rolling my own. The reason I started this thread in the first place is because it seems like outputting human-readable json is common and often desired (see the upvotes in t

Re: [racket] Json pretty-print

2013-04-16 Thread Eli Barzilay
That's not really relevant in this case: there is no problem here comparing the keys since they are all symbols. 10 minutes ago, Danny Yoo wrote: > Racket provides a generic order predicate: see data/order: > > http://docs.racket-lang.org/data/Orders_and_Ordered_Dictionaries.html > > For e

Re: [racket] Json pretty-print

2013-04-16 Thread Danny Yoo
Racket provides a generic order predicate: see data/order: http://docs.racket-lang.org/data/Orders_and_Ordered_Dictionaries.html For example, https://gist.github.com/dyoo/5398549#file-pretty-print-json-rkt-L5 https://gist.github.com/dyoo/5398549#file-pretty-print-json-rkt-L12 ht

Re: [racket] Json pretty-print

2013-04-16 Thread Eli Barzilay
40 minutes ago, Nick Shelley wrote: > I'm pretty sure what I want is the easy thing. We have data > represented as json, and we want changes to it to be easy to see in > a difftool. Everything on one line makes this hard. We just have a > bunch of nested arrays and dictionaries that need to be tabb

Re: [racket] Json pretty-print

2013-04-16 Thread Danny Yoo
Similar forking going on. :) Here's another version (based on the json library in the standard library, but hacked up a bit): https://gist.github.com/dyoo/5398549 I think the point is: it should be very easy to do this; it's just a matter of knowing what behavior you want. _

Re: [racket] Json pretty-print

2013-04-16 Thread Carl Eastlund
Nick, I've just built pretty-printing for JSON in a Gist you can see here: https://gist.github.com/carl-eastlund/5398440 It's built on top of my own "stylish printing" library, mischief/stylish, that you can install by running: raco pkg install mischief I'll add this to the mischief packag

Re: [racket] Json pretty-print

2013-04-16 Thread Nick Shelley
I'm pretty sure what I want is the easy thing. We have data represented as json, and we want changes to it to be easy to see in a difftool. Everything on one line makes this hard. We just have a bunch of nested arrays and dictionaries that need to be tabbed and newlined with no regard to width. As

Re: [racket] Json pretty-print

2013-04-16 Thread Sean McBeth
I've had good luck porting simple Python examples to Racket. Perhaps you could start with the Python code that works as you expect, port it to Racket, then refactor it to more Rackety ways: http://hg.python.org/cpython/file/cc0e72082e52/Lib/json On Tue, Apr 16, 2013 at 1:54 PM, Eli Barzilay wrot

Re: [racket] Json pretty-print

2013-04-16 Thread Eli Barzilay
Just now, Nick Shelley wrote: > In talking with an experienced Racketeer, I realized that > pretty-print has a specific meaning in Racket that takes width into > account. That's exactly what I thought you were talking about. Doing it from scratch seems wrong, and I thought that the right way to d

Re: [racket] Json pretty-print

2013-04-16 Thread Nick Shelley
In talking with an experienced Racketeer, I realized that pretty-print has a specific meaning in Racket that takes width into account. What I really want is json with properly placed newlines and tabs (or spaces). I'm willing to take a stab at it if it doesn't exist. I just wanted to make sure I w

Re: [racket] Json pretty-print

2013-04-16 Thread Nick Shelley
I ended up just doing a system call to Python as suggested here: http://stackoverflow.com/questions/352098/how-to-pretty-print-json-from-the-command-line . When one of my coworkers (who I've been trying to convince that Racket is a real language) reviewed my code, he laughed at that line because h

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] slideshow-latex installation problems

2013-04-16 Thread Matthew Flatt
I think the `slideshow-latex' package should probably have an "info.rkt" that contains (define setup-collects '("slideshow/latex")) so that only the "slideshow/latex" collection is set up. The package manager otherwise infers that "slideshow" should be set up. At Tue, 16 Apr 2013 14:50:01 +02

Re: [racket] image on frame

2013-04-16 Thread Matthew Flatt
At Tue, 16 Apr 2013 19:44:04 +0530, deepak verma wrote: > how can we show a image on frame ? (require racket/gui/base racket/class) (define (show-image i) (define f (new frame% [label "Image"])) (new message% [parent f] [label i]) (send f show #t)) Racket Us

Re: [racket] Handle variant VT_DATE

2013-04-16 Thread Matthew Flatt
At Tue, 16 Apr 2013 11:53:59 +0200 (CEST), "murat demirtas" wrote: > how can I handle  VT_DATE as return value in ffi/com scripting >   > I get an error like this:  > VariantTimeToSystemTime: implementation not found; arguments: 41353.5534375 > # Unfortunately, there are several problems with usi

[racket] library function available to make a hard link?

2013-04-16 Thread Steve Byan
The make-file-or-directory-link function looks like it makes symbolic links. Is there an existing library function to make hard links on unix (in particular, Mac OS X)? Best regards, -Steve -- Steve Byan Littleton, MA 01460 Racket Users list: http://lists.racket-l

[racket] image on frame

2013-04-16 Thread deepak verma
how can we show a image on frame ? Racket Users list: http://lists.racket-lang.org/users

[racket] drracket:unit

2013-04-16 Thread deepak verma
how do we use the methods given in drracket:units in drracket plugins Racket Users list: http://lists.racket-lang.org/users

[racket] slideshow-latex installation problems

2013-04-16 Thread Laurent
Trying to install slideshow-latex through raco pkg install, I got the following error: delete-file: cannot delete file path: /usr/bin/slideshow system error: Permission denied; errno=13 It's strange that a package would try to do that. Is this normal? Then, I could not manage to require the p

[racket] Cross compile to PowerPC

2013-04-16 Thread Tim Brown
Folks, I've just uploaded an (AFICT) working script to build racket on for PowerPC. https://github.com/tim-brown/racket-powerpc-cross I have racket running on a small embedded P1021 device. From a 300MB NFS installation! It runs small scripts, and has proven a neat little (ahem!) tool. I have

[racket] insert menu

2013-04-16 Thread deepak verma
how to call insert menu from racket tools Racket Users list: http://lists.racket-lang.org/users

[racket] Handle variant VT_DATE

2013-04-16 Thread murat demirtas
Hello friends,   how can I handle  VT_DATE as return value in ffi/com scripting   I get an error like this:  VariantTimeToSystemTime: implementation not found; arguments: 41353.5534375 #   Yours, Racket Users list: http://lists.racket-lang.org/users

Re: [racket] images from tcp

2013-04-16 Thread deepak verma
how can we get the insert menu in frame On Tue, Apr 16, 2013 at 12:26 PM, Danny Yoo wrote: > On Tue, Apr 16, 2013 at 12:32 AM, deepak verma > wrote: > > how will i extract the image from tcp-connect ? > > > > actually i was talking about objects of image-snip class > > [Aside: Please use you

Re: [racket] PLAI question

2013-04-16 Thread Manfred Lotz
On Tue, 16 Apr 2013 14:47:03 +0800 bhrgunatha wrote: > The plai-typed language isn't pre-installed with Racket (as far as I > know) You'll need to install it. > > http://cs.brown.edu/courses/cs173/2012/lang/ > > Bhrgunatha > > Yep, that solved it. There was neither a hint on the book page

Re: [racket] images from tcp

2013-04-16 Thread Danny Yoo
On Tue, Apr 16, 2013 at 12:32 AM, deepak verma wrote: > how will i extract the image from tcp-connect ? > > actually i was talking about objects of image-snip class [Aside: Please use your email client's "Reply to All" feature.] Ok, good, that's much more specific. Have you read the documenta