Re: Clojure Quizzes?

2011-01-18 Thread Michael Wood
On 17 January 2011 17:42, Robert McIntyre r...@mit.edu wrote: [...] You can then actually run your program by making a shell script with something like #!/bin/bash java -Xmn500M -Xms2000M -Xmx2000M -server -cp ./lib/*:./src clojure.main your-namespace-file.clj  $@ Put $@ in double quotes.

Re: Clojure Quizzes?

2011-01-18 Thread Chris Riddoch
On Mon, Jan 17, 2011 at 8:42 AM, Robert McIntyre r...@mit.edu wrote: You can then actually run your program by making a shell script with something like #!/bin/bash java -Xmn500M -Xms2000M -Xmx2000M -server -cp ./lib/*:./src clojure.main your-namespace-file.clj  $@ I've found that Hashdot is

Re: Clojure Quizzes?

2011-01-17 Thread Robert McIntyre
Taking a page out of the python book , I like to include a statement at the end that checks to see if the program is being run as a command-line program and then respond accordingly. As an example, (if (command-line?) (your-awesome-function (read-integer (first *command-line-args* Might

Re: Clojure Quizzes?

2011-01-17 Thread Alan
On Jan 17, 7:42 am, Robert McIntyre r...@mit.edu wrote: You can then actually run your program by making a shell script with something like #!/bin/bash java -Xmn500M -Xms2000M -Xmx2000M -server -cp ./lib/*:./src clojure.main your-namespace-file.clj  $@ A little known fact is that the above

Re: Clojure Quizzes?

2011-01-17 Thread Robert McIntyre
Because there is a limit on the length of the shebang line to as short as 80 characters in some distributions (notably ubuntu), and the posix standard for the shebang line does not allow you to pass any arguments to the interperter to modify its behaviour --- so no classpath or anything else for

Re: Clojure Quizzes?

2011-01-16 Thread Randy J. Ray
On 01/12/2011 11:50 PM, Robert McIntyre wrote: They seem to allow you to include anything in a lib directory that you'd want. I sometimes include apache commons-io and clojure-contrib1.2 without any problems. I also included a sql connection library for one of the problems, so it seems fine :)

Re: Clojure Quizzes?

2011-01-16 Thread Benny Tsai
Hi Randy, You can access a seq of the command line args via the *command-line- args* var. On Jan 16, 3:03 pm, Randy J. Ray randy.j@gmail.com wrote: On 01/12/2011 11:50 PM, Robert McIntyre wrote: They seem to allow you to include anything in a lib directory that you'd want. I

Re: Clojure Quizzes?

2011-01-16 Thread John Svazic
Benny already answered, but here's the common block that I'm using for my Clojure submissions: (import '(java.io BufferedReader FileReader)) (defn process-file [file-name] (let [rdr (BufferedReader. (FileReader. file-name))] (line-seq rdr))) (defn my-func [col] ; Do something interesting

Re: Clojure Quizzes?

2011-01-13 Thread John Svazic
They do seem to allow whatever you like if you upload your own package. I'm hooked on using their built-in editor, so in some cases I copy-and-paste code until they get around to updating their version of Clojure. The one nice thing about the site is that they do seem rather responsive to

Re: Clojure Quizzes?

2011-01-13 Thread Ken Wesson
On Thu, Jan 13, 2011 at 10:04 PM, John Svazic jsva...@gmail.com wrote: They do seem to allow whatever you like if you upload your own package.  I'm hooked on using their built-in editor, so in some cases I copy-and-paste code until they get around to updating their version of Clojure.  The one

Re: Clojure Quizzes?

2011-01-13 Thread Robert McIntyre
As HTML-y as it it is, PHP is Turing complete and thus a real programming language. It's got foreach loops, mutable arrays, and boolean logic, and that's one particular set of operations to simulate a Turing machine. http://en.wikipedia.org/wiki/Turing_machine http://aturingmachine.com/

Re: Clojure Quizzes?

2011-01-13 Thread Ken Wesson
On Fri, Jan 14, 2011 at 1:13 AM, Robert McIntyre r...@mit.edu wrote: As HTML-y as it it is, PHP is Turing complete and thus a real programming language. So are LaTeX, Javascript, and a few others, but from what I've seen they're all meant for specific purposes rather than general-purpose

Re: Clojure Quizzes?

2011-01-12 Thread Stuart Campbell
On 12 January 2011 14:07, Robert McIntyre r...@mit.edu wrote: You can use the latest version of clojure if you include it as a dependency in your submission, so even though they say they only support clojure1.0 they really support all of them. Are other 3rd-party libs allowed, too? Cheers,

Re: Clojure Quizzes?

2011-01-12 Thread Robert McIntyre
They seem to allow you to include anything in a lib directory that you'd want. I sometimes include apache commons-io and clojure-contrib1.2 without any problems. I also included a sql connection library for one of the problems, so it seems fine :) --Robert McIntyre On Thu, Jan 13, 2011 at 2:00

Re: Clojure Quizzes?

2011-01-11 Thread Sean Corfield
Ah, that does look like more fun - thanx for the link, hadn't heard of it before! On Wed, Jan 5, 2011 at 10:11 PM, benjamin.s.r benjamin.s.rho...@gmail.com wrote: http://coderloop.com/ like Project Euler but more modern -- You received this message because you are subscribed to the Google

Re: Clojure Quizzes?

2011-01-11 Thread Robert McIntyre
Coderloop is a lot of fun. I'm wondering how people are submitting their code? You can use the latest version of clojure if you include it as a dependency in your submission, so even though they say they only support clojure1.0 they really support all of them. I wrote a short clojure program

Re: Clojure Quizzes?

2011-01-11 Thread Robert McIntyre
hurrr. teh codes are at https://gist.github.com/775623 sorry for leaving that out. I'm rather new at this; all criticisms are welcome. ---Robert McIntyre On Tue, Jan 11, 2011 at 10:07 PM, Robert McIntyre r...@mit.edu wrote: Coderloop is a lot of fun.  I'm wondering how people are submitting

Re: Clojure Quizzes?

2011-01-09 Thread John Svazic
Thanks Sean and Benjamin. I've started at Coderloop and I must admit that I'm hooked. I'll take a look at Project Euler next, once I'm done providing suggestions and finishing a few more quizzes at Coderloop. :-) Now I'll have to hit the IRC channel to get help on some minor issues so as not

Re: Clojure Quizzes?

2011-01-06 Thread benjamin.s.r
http://coderloop.com/ like Project Euler but more modern -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first

Clojure Quizzes?

2011-01-05 Thread John Svazic
I'm new to the Clojure community (admittedly, I'm only on chapter 6 of Clojure in Action, so my Clojure skills are sub-sub-par at the moment), but I was wondering if there were any weekly challenges for writing Clojure code like there is (was?) for Ruby, i.e: http://rubyquiz.com/ When I was

Re: Clojure Quizzes?

2011-01-05 Thread Sean Corfield
On Wed, Jan 5, 2011 at 8:04 PM, John Svazic jsva...@gmail.com wrote: I'm new to the Clojure community (admittedly, I'm only on chapter 6 of Welcome!! Clojure in Action, so my Clojure skills are sub-sub-par at the moment), but I was wondering if there were any weekly challenges for writing