Re: Clojure Quizzes?
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. Otherwise bash will split up your args on whitespace before calling java. /tmp$ cat java #!/bin/sh for arg; do echo \$arg\ done /tmp$ cat launcher #!/bin/sh /tmp/java $@ /tmp$ ./java This should be one arg This should be one arg /tmp$ ./launcher This should be one arg This should be one arg A little known fact is that the above can actually be embedded into a clojure source file with the following trick: Make this the first line of your clojure namespace to make it executable: :;exec java -verbose:gc -Xmn500M -Xms2000M -Xmx2000M -server -cp your-classpath clojure.main $0 $*; Similarly here, $* should be $@. Also, do you need the trailing semicolon? -- Michael Wood esiot...@gmail.com -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 a very nice solution to the problem of using Clojure as a shell script. http://hashdot.sourceforge.net/ I was using it before I could get leiningen to work, and it really does simplify things like this. -- Chris Riddoch -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 appear at the end of my file. command-line? and read-integer are listed below (ns coderloop.utils (:use [clojure.contrib [duck-streams :only [file-str read-lines]]]) (:use [clojure [string :only [trim blank? split]]])) (defn read-integer [file] (Integer/parseInt (trim (slurp (file-str file) (defn command-line? [] (.isAbsolute (java.io.File. *file*))) This has the advantage of also working when the namespace is being run on the command-line with no arguments, but not when the namespace is being used or required by another namespace. read-integer is just a simple example for how to read a single integer from a file. 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 can actually be embedded into a clojure source file with the following trick: Make this the first line of your clojure namespace to make it executable: :;exec java -verbose:gc -Xmn500M -Xms2000M -Xmx2000M -server -cp your-classpath clojure.main $0 $*; The trick is putting the :; at the beginning and then calling exec. To clojure this looks like a literal string followed by a comment. To bash it looks like a no-op followed by an invocation of java on the file itself, and no lines after the first ever get executed. You can make whatever class structure you cant and then just symlink the clojure file to be an executable file at the base of the directory. You can still always go the shell script route if you don't like the embedding trick. This technique is common with emacs-lisp to make things executable. Hope that helps. sincerely, --Robert McIntyre On Sun, Jan 16, 2011 at 9:56 PM, Stuart Campbell stu...@harto.org wrote: On 17 January 2011 13:48, John Svazic jsva...@gmail.com wrote: 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 ) (println (my-func (process-file (first *command-line-args* Basically I read the lines of the file into a sequence, then process that sequence in my function. Since I'm only dealing with the first parameter passed to my script, a (first *command-line-args*) call is equivalent to args[0] in other languages like Java. If you include clojure.contrib.io, you could use read-lines: (defn read-lines Like clojure.core/line-seq but opens f with reader. Automatically closes the reader AFTER YOU CONSUME THE ENTIRE SEQUENCE. [f] (let [read-line (fn this [^BufferedReader rdr] (lazy-seq (if-let [line (.readLine rdr)] (cons line (this rdr)) (.close rdr] (read-line (reader f Regards, Stuart -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 can actually be embedded into a clojure source file with the following trick: Make this the first line of your clojure namespace to make it executable: :;exec java -verbose:gc -Xmn500M -Xms2000M -Xmx2000M -server -cp your-classpath clojure.main $0 $*; The trick is putting the :; at the beginning and then calling exec. To clojure this looks like a literal string followed by a comment. To bash it looks like a no-op followed by an invocation of java on the file itself, and no lines after the first ever get executed. You can make whatever class structure you cant and then just symlink the clojure file to be an executable file at the base of the directory. You can still always go the shell script route if you don't like the embedding trick. This technique is common with emacs-lisp to make things executable. Instead of a trick, why not use the fact that clojure treats #! as a single-line comment? Then you can write your shebang line just like every other scripting language. -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 you! Try it --- you'll see that the standard shebang line just doesn't work for most project setups. Embedding shell gets around all these problems. sincerely, --Robert McIntyre On Tue, Jan 18, 2011 at 12:03 AM, Alan a...@malloys.org wrote: 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 can actually be embedded into a clojure source file with the following trick: Make this the first line of your clojure namespace to make it executable: :;exec java -verbose:gc -Xmn500M -Xms2000M -Xmx2000M -server -cp your-classpath clojure.main $0 $*; The trick is putting the :; at the beginning and then calling exec. To clojure this looks like a literal string followed by a comment. To bash it looks like a no-op followed by an invocation of java on the file itself, and no lines after the first ever get executed. You can make whatever class structure you cant and then just symlink the clojure file to be an executable file at the base of the directory. You can still always go the shell script route if you don't like the embedding trick. This technique is common with emacs-lisp to make things executable. Instead of a trick, why not use the fact that clojure treats #! as a single-line comment? Then you can write your shebang line just like every other scripting language. -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 :) For those puzzles that require command-line processing, have you used a library to do it? Looking in both Programming Clojure and Practical Clojure, the only instruction I can find on handling command-line args involves AOT compilation of your class and definition of a -main method. I'm not sure how well this would work with the submission model that Coderloop uses. I'm afraid I'm still *very* new to Clojure, and while it would be easy (for me) to solve the problems in other languages, the point of the exercise (for me) is to use Coderloop's problems to help myself in learning Clojure... Randy -- Randy J. Ray Sunnyvale, CA http://www.rjray.org rj...@blackperl.com http://www.svsm.org randy.j@gmail.com http://twitter.com/rjray -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 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 :) For those puzzles that require command-line processing, have you used a library to do it? Looking in both Programming Clojure and Practical Clojure, the only instruction I can find on handling command-line args involves AOT compilation of your class and definition of a -main method. I'm not sure how well this would work with the submission model that Coderloop uses. I'm afraid I'm still *very* new to Clojure, and while it would be easy (for me) to solve the problems in other languages, the point of the exercise (for me) is to use Coderloop's problems to help myself in learning Clojure... Randy -- Randy J. Ray Sunnyvale, CA http://www.rjray.org rj...@blackperl.com http://www.svsm.org randy.j@gmail.com http://twitter.com/rjray -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 ) (println (my-func (process-file (first *command-line-args* Basically I read the lines of the file into a sequence, then process that sequence in my function. Since I'm only dealing with the first parameter passed to my script, a (first *command-line-args*) call is equivalent to args[0] in other languages like Java. On Jan 16, 5: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 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 :) For those puzzles that require command-line processing, have you used a library to do it? Looking in both Programming Clojure and Practical Clojure, the only instruction I can find on handling command-line args involves AOT compilation of your class and definition of a -main method. I'm not sure how well this would work with the submission model that Coderloop uses. I'm afraid I'm still *very* new to Clojure, and while it would be easy (for me) to solve the problems in other languages, the point of the exercise (for me) is to use Coderloop's problems to help myself in learning Clojure... Randy -- Randy J. Ray Sunnyvale, CA http://www.rjray.org rj...@blackperl.com http://www.svsm.org randy.j@gmail.com http://twitter.com/rjray -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 questions, bugs and feature requests! I'm jsvazic on the site if anyone is interested. :-) Based on the list of recent submissions lately, it seems like Clojure is getting a lot of exposure! It's funny to see some language turf wars showing up, since I've seen Clojure dominate recent submissions list, then Scala gets a kick, then people go on a PHP binge for some reason. :-) In any case, I'm finding the site absolutely great, and it's been an absolute boon for updating my Clojure skills. I fully expect that in the next 6 months I'll look back at earlier submissions and say what was I thinking?! :-) On Jan 13, 2:50 am, Robert McIntyre r...@mit.edu 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 :) --Robert McIntyre On Thu, Jan 13, 2011 at 2:00 AM, Stuart Campbell stu...@harto.org wrote: 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, Stuart -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 nice thing about the site is that they do seem rather responsive to questions, bugs and feature requests! I'm jsvazic on the site if anyone is interested. :-) Based on the list of recent submissions lately, it seems like Clojure is getting a lot of exposure! It's funny to see some language turf wars showing up, since I've seen Clojure dominate recent submissions list, then Scala gets a kick, then people go on a PHP binge for some reason. :-) PHP? Isn't that a web page generation engine, rather than a general-purpose application programming language? In any case, I'm finding the site absolutely great, and it's been an absolute boon for updating my Clojure skills. I fully expect that in the next 6 months I'll look back at earlier submissions and say what was I thinking?! :-) I think we all get that at first. It may be because functional/Lisp is somewhat alien to most other things you're likely to have had experience with beforehand, or just because C++ is to chess as Lisp is to go -- fewer moves and simpler rules, but oh so much depth as your Lisp-fu grows strong. -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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/ sincerely, --Robert McIntyre On Thu, Jan 13, 2011 at 10:07 PM, Ken Wesson kwess...@gmail.com wrote: 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 nice thing about the site is that they do seem rather responsive to questions, bugs and feature requests! I'm jsvazic on the site if anyone is interested. :-) Based on the list of recent submissions lately, it seems like Clojure is getting a lot of exposure! It's funny to see some language turf wars showing up, since I've seen Clojure dominate recent submissions list, then Scala gets a kick, then people go on a PHP binge for some reason. :-) PHP? Isn't that a web page generation engine, rather than a general-purpose application programming language? In any case, I'm finding the site absolutely great, and it's been an absolute boon for updating my Clojure skills. I fully expect that in the next 6 months I'll look back at earlier submissions and say what was I thinking?! :-) I think we all get that at first. It may be because functional/Lisp is somewhat alien to most other things you're likely to have had experience with beforehand, or just because C++ is to chess as Lisp is to go -- fewer moves and simpler rules, but oh so much depth as your Lisp-fu grows strong. -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 software engineering. It's got foreach loops, mutable arrays, and boolean logic, and that's one particular set of operations to simulate a Turing machine. I read somewhere that it suffices to have a program counter, a register, four stacks, jump-back-or-forth-N-steps with a small bounded N, if register zero then next instruction otherwise skip one instruction, increment register (which wraps at some value), and peek or pop for each of the four stacks (to the register). Alternatively, a program counter, a stack, a cursor into an infinite deque, and these eight instructions: increment at cursor, decrement at cursor, jump amount at cursor, if zero at cursor next instruction else skip, cursor left one, cursor right one, push program counter, pop program counter. The universal Turing machine concept suggests that there's an instruction set for which only the infinite deque is needed, with cursor-left, cursor-right, and some additional instructions, but no long range jumps within the deque, and instructions also fetched from the deque with no separate program counter. It would be a real bitch to program, though. The general rule seems to be that a) there has to be at least one if-something condition that alters flow, say by optionally skipping one instruction that can be a longer-range jump and may be followed by another such; b) there has to be a backward jump possibility; and c) there has to be some kind of memory -- either bidirectionally infinite and cursor-navigable like a giant ArrayList, or at least four stacks that can be separately peeked and popped. With just one stack you can apparently get a big subset of fully general computation but not the whole deal. There also has to be d) arithmetic of some kind, on the memory content and interacting in some way with the if condition. http://en.wikipedia.org/wiki/Turing_machine http://aturingmachine.com/ I see your Turing machine and raise you this: http://www.rezmason.net/wireworld/ -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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, Stuart -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 AM, Stuart Campbell stu...@harto.org wrote: 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, Stuart -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 that automatically packages a clojure namespace and it's particular minimal set of dependencies into a tar.bz2 file with the executable that they want. If anyone's interested, I'd love to hear his/her thoughts on this code. A few thoughts: Should it automatically AOT compile everything and package it all in an executable jar? Can I use a pure java implementation of bzip and tar without calling out to the system's tar command? (I'm bortreb on coderloop btw) sincerely, --Robert McIntyre On Tue, Jan 11, 2011 at 9:17 PM, Sean Corfield seancorfi...@gmail.com wrote: 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 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 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 that automatically packages a clojure namespace and it's particular minimal set of dependencies into a tar.bz2 file with the executable that they want. If anyone's interested, I'd love to hear his/her thoughts on this code. A few thoughts: Should it automatically AOT compile everything and package it all in an executable jar? Can I use a pure java implementation of bzip and tar without calling out to the system's tar command? (I'm bortreb on coderloop btw) sincerely, --Robert McIntyre On Tue, Jan 11, 2011 at 9:17 PM, Sean Corfield seancorfi...@gmail.com wrote: 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 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 to spoil any of the quizzes I'm trying to take on. Thanks again. On Jan 6, 1:11 am, 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 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure Quizzes?
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 Clojure code like there is (was?) for Ruby, i.e: http://rubyquiz.com/ When I was starting my investigation into Ruby I found this type of weekly quiz incredibly insightful. Is there something similar for Clojure? Even Lisp would be fine, and I would think it would be interesting to compare approaches from others in the group. Thoughts? Project Euler is something you might look at - it offers a variety of interesting problems that you can solve in any language (and I think it's particularly good for solving the same problem in multiple languages so you can compare them in the same context, which I find really helps me 'get' new languages). I think the Ruby Quiz is a great idea but I suspect it is a huge amount of work behind the scenes... -- Sean A Corfield -- (904) 302-SEAN Railo Technologies, Inc. -- http://getrailo.com/ An Architect's View -- http://corfield.org/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood -- 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 post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en