Re: Google AI winner uses lisp
CL On Dec 9, 7:09 pm, Ken Wesson kwess...@gmail.com wrote: On Thu, Dec 9, 2010 at 8:53 PM, Alec Battles alec.batt...@gmail.com wrote: I'm sure a few people have read this news already. It's been up for a week, though strangely ZDnet -- which, on principle, I refuse to link to Why? -- is one of the only places to write it up. http://pr-usa.net/index.php?option=com_contenttask=viewid=560484It... Nice news to read before bedtime. Yes, but was it Clojure, or another Lisp? -- 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: Moderately off-topic: installing emacs on OSX
javajosh javaj...@gmail.com writes: failing to load in the error message and all, I'd try that. I would still like to see slime in action, however. I have two emacs installed, GNU and Aquamacs. macports is still not able to do anything - I'm actually rather concerned about it's health. $ emacs --version GNU Emacs 22.1.1 I don't really know macports (or the native packager, pkgutil I think) well enough to know what is responsible for installing that emacs. Forget Macports etc. (though I personally use and like Homebrew). Just get a self-contained recent Emacs from http://emacsformacosx.com/, and stick it in your /Applications folder. Install slime and clojure-mode from elpa using Phil's instructions. Make sure that swank-clojure is included as a dev-dependency in your clojure project. If you have issues with emacs failing to pick up the right executables, you can use the following nifty trick to ensure Emacs' $PATH matches the one you've configured for Bash in Terminal: (defun set-exec-path-from-shell-PATH () (let ((path-from-shell (shell-command-to-string $SHELL -i -c 'echo $PATH'))) (setenv PATH path-from-shell) (setq exec-path (split-string path-from-shell path-separator (if window-system (set-exec-path-from-shell-PATH)) -Steve -- 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: Null-safe threading macro?
On Dec 10, 6:35 am, Alex Baranosky alexander.barano...@gmail.com wrote: Thanks, it is so hard to google symbols. Use the search bar on ClojureDocs: http://clojuredocs.org/ -- Daniel -- 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: Getting strange behavior when stubbing
Shameless Self-promotion Dept: Here's how I'd write your three tests in Midje. https://github.com/marick/Midje (fact chains of locations are handled (distances Boston,MA Albany,NY LosAngeles,CA) = [2.0, 2.0] (provided (dist-in-miles anything anything) = 2.0)) (fact can convert distances from origin to a map keyed by destination (map-of-distances ...origin... Newport, LA) = { Newport 55, LA 3000 } (provided (dist-in-miles ...origin... Newport) = 55 (dist-in-miles ...origin... LA) = 3000)) ;; (fact can also produce map of total distance (distance * number of visits) ;; (relative-distances ...origin..., Newport 1, LA 2) = { NewPort 365.0, LA 730.0 } ;; (provided ;; (dist-in-miles ...origin... anything) = 365.0)) The last test is commented out because you have a three argument fmap, which isn't the one from generic.functor. I didn't have the laziness problem. I don't know if that was by accident or because Midje applies an #'eagerly function before checking. (Note: I found that #'doall isn't always enough, because you can be bitten in the same way by laziness in nested expressions, so #'eagerly walks the whole tree, not just the top level.) - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://bit.ly/hfdf9T) www.exampler.com, www.exampler.com/blog, www.twitter.com/marick -- 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: Moderately off-topic: installing emacs on OSX
(conflicting advice snipped) If we can reach consensus on best (easiest, least error-prone) path to getting a working emacs clojure environment up on OSX I'll happily execute and even write up my experience. -- 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: Moderately off-topic: installing emacs on OSX
javajosh javaj...@gmail.com writes: (conflicting advice snipped) If we can reach consensus on best (easiest, least error-prone) path to getting a working emacs clojure environment up on OSX I'll happily execute and even write up my experience. I think there is consensus; the respondents to this thread seem to have suggested that you should: 1. Get a working recent version of emacs 2. Install slime clojure-mode from elpa (aka package.el) 3. Follow Phil's swank-clojure docs (https://github.com/technomancy/swank-clojure) Which particular Emacs you install isn't a big deal, but the implicit build of emacs via port install slime clearly isn't working. You should even be able to follow steps 2 and 3 with your currently working installation of Aquamacs. -Steve -- 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
Posted the Bowling Game Kata in Clojure w/ Video. Thoughts welcome. EOM
-- 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: Posted the Bowling Game Kata in Clojure w/ Video. Thoughts welcome. EOM
Because posting the link would make some modicum of sense… http://blog.twonegatives.com/post/2168030248/kata ^_^ -- 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: Moderately off-topic: installing emacs on OSX
On Fri, Dec 10, 2010 at 11:20 AM, javajosh javaj...@gmail.com wrote: (conflicting advice snipped) If we can reach consensus on best (easiest, least error-prone) path to getting a working emacs clojure environment up on OSX I'll happily execute and even write up my experience. I don't use OS X so I can't comment on such a consensus, but while I appreciate the sentiment, it's actually harmful to some degree to have lots of blog posts scattered around everywhere that all have slightly different advice, especially since that advice usually becomes outdated within the year. I strongly suggest improving the docs on the Clojure wiki instead; that way errors can be fixed by the community. thanks, Phil -- 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: Null-safe threading macro?
Daniel, I actually did use that search and a search of -? doesn't come find -? -- 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: Null-safe threading macro?
On 10 December 2010 22:08, Alex Baranosky alexander.barano...@gmail.com wrote: I actually did use that search and a search of -? doesn't come find -? The incremental search feature actually suggests -? while you're still typing, and clicking on the suggestion will take you to the correct docs for clojure.contrib.core/-?. However, I just now went ahead and pressed Return to search, and indeed the search results are rather unhelpful -- ClojureDocs seems to search for clojure.contrib in case the search string consists only of certain punctuation marks. -- 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: Google AI winner uses lisp
What is FFI? On Dec 9, 10:47 pm, Ken Wesson kwess...@gmail.com wrote: On Fri, Dec 10, 2010 at 12:43 AM, javajosh javaj...@gmail.com wrote: It does beg the question, though: what is a reasonable bare minimum function set that a real-life lisp would require? I think different people might give different answers to that. The academic computer scientist is likely to consider lambda, the function-call operator, nil, if, and eval to suffice. After all those suffice for anything you can express in lambda calculus. A Lisper interested in Lisp hacking as an end in itself will want to add cons, car/cdr or first/rest, =, cond, etc. The application programmer is going to additionally require FFI with, particularly, GUI libraries, not to mention various forms of disk, networking, keyboard, and mouse I/O. The systems programmer is going to additionally require being able to get at the bare metal and run tight, efficient, non-interpreted code in kernel mode. Ultimately I suppose it hinges on what someone means by a real-life Lisp. I'd say the application programmer's needs are probably th best answer there, since Lisp hacking for its own sake and academic computer science are more mathematics than real-world, and systems programming can be accomodated by a combination of C and a Lisp with some kind of FFI. (Clojure as the Lisp requires Java as well, and Clojure and C calling each other indirectly via Java and JNI as a go-between.) -- 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: Google AI winner uses lisp
Foreign function interface. To call C/C++ libs. On Dec 10, 2010, at 6:52 PM, javajosh javaj...@gmail.com wrote: What is FFI? On Dec 9, 10:47 pm, Ken Wesson kwess...@gmail.com wrote: On Fri, Dec 10, 2010 at 12:43 AM, javajosh javaj...@gmail.com wrote: It does beg the question, though: what is a reasonable bare minimum function set that a real-life lisp would require? I think different people might give different answers to that. The academic computer scientist is likely to consider lambda, the function-call operator, nil, if, and eval to suffice. After all those suffice for anything you can express in lambda calculus. A Lisper interested in Lisp hacking as an end in itself will want to add cons, car/cdr or first/rest, =, cond, etc. The application programmer is going to additionally require FFI with, particularly, GUI libraries, not to mention various forms of disk, networking, keyboard, and mouse I/O. The systems programmer is going to additionally require being able to get at the bare metal and run tight, efficient, non-interpreted code in kernel mode. Ultimately I suppose it hinges on what someone means by a real-life Lisp. I'd say the application programmer's needs are probably th best answer there, since Lisp hacking for its own sake and academic computer science are more mathematics than real-world, and systems programming can be accomodated by a combination of C and a Lisp with some kind of FFI. (Clojure as the Lisp requires Java as well, and Clojure and C calling each other indirectly via Java and JNI as a go-between.) -- 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: Null-safe threading macro?
On Chrome, the Javascript search popup extends off the top of the page... Hence I can not see all of the entries in it. -- 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: Getting strange behavior when stubbing
Hey Brian, I just got your latest version of Midje via lein, and I'm able to use it. I had been getting a stack trace previously. Midje is nice, because I can do more specialized stubbing with it than with the code I got from Amit Rathore's blog/book. Also, this is the fmap I wrote (with the list's help) to that takes multiple maps. It only works for maps. (defn fmap [f maps] (into {} (for [k (keys (first maps))] [k (apply f (map #(get % k) maps))]))) Best, Alex On Fri, Dec 10, 2010 at 11:02 AM, Brian Marick mar...@exampler.com wrote: Shameless Self-promotion Dept: Here's how I'd write your three tests in Midje. https://github.com/marick/Midje (fact chains of locations are handled (distances Boston,MA Albany,NY LosAngeles,CA) = [2.0, 2.0] (provided (dist-in-miles anything anything) = 2.0)) (fact can convert distances from origin to a map keyed by destination (map-of-distances ...origin... Newport, LA) = { Newport 55, LA 3000 } (provided (dist-in-miles ...origin... Newport) = 55 (dist-in-miles ...origin... LA) = 3000)) ;; (fact can also produce map of total distance (distance * number of visits) ;; (relative-distances ...origin..., Newport 1, LA 2) = { NewPort 365.0, LA 730.0 } ;; (provided ;; (dist-in-miles ...origin... anything) = 365.0)) The last test is commented out because you have a three argument fmap, which isn't the one from generic.functor. I didn't have the laziness problem. I don't know if that was by accident or because Midje applies an #'eagerly function before checking. (Note: I found that #'doall isn't always enough, because you can be bitten in the same way by laziness in nested expressions, so #'eagerly walks the whole tree, not just the top level.) - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://bit.ly/hfdf9T) www.exampler.com, www.exampler.com/blog, www.twitter.com/marick -- 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.comclojure%2bunsubscr...@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: Google AI winner uses lisp
On Thu, Dec 9, 2010 at 8:53 PM, Alec Battles alec.batt...@gmail.com wrote: I'm sure a few people have read this news already. It's been up for a week, though strangely ZDnet -- which, on principle, I refuse to link to Why? Because of the website's close ties to Washington. This blog post is exemplary: http://www.zdnet.com/blog/government/is-wikileaks-julian-assange-worse-than-osama-bin-laden/9578 -- 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: Moderately off-topic: installing emacs on OSX
I don't use OS X so I can't comment on such a consensus, but while I appreciate the sentiment, it's actually harmful to some degree to have lots of blog posts scattered around everywhere that all have slightly different advice, especially since that advice usually becomes outdated within the year. Speak for yourself. Whenever I need to install SCIM on someone's computer I pull up three conflicting blog posts and just combine elements of all of them. I strongly suggest improving the docs on the Clojure wiki instead; that way errors can be fixed by the community. Why does the one preclude the other? Also, if people aren't going to blog about Clojure, what future does it have? Sorry if this is a bit academic, but I was rather looking forward to javajosh's blog post... Alec -- 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: Lisp history
For those who were not around when the Common Lisp standard was being debated you might find this interesting: http://lisp.geek.nz/weekly-repl/ Common Lisp Standardization: The good, the bad, and the ugly by Peter Seibel Thanks for sharing this. Anyone whose name pulls up a profile page on Ward's Wiki is worth a read in my book. -- 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: Moderately off-topic: installing emacs on OSX
On Fri, Dec 10, 2010 at 5:07 PM, Alec Battles alec.batt...@gmail.com wrote: I strongly suggest improving the docs on the Clojure wiki instead; that way errors can be fixed by the community. Why does the one preclude the other? Also, if people aren't going to blog about Clojure, what future does it have? Sorry; I'm not saying don't blog about Clojure; I'm saying you should consider whether what you want to write indicates a deficiency in the official documentation. If there's something lacking in the documentation, it's much more profitable to everyone to improve it. For instance, it sounds like it's confusing for Mac users to decide which Emacs to use, so it sounds like the swank readme should have some advice about that. This is something I didn't consider as an Ubuntu user where we don't have that problem. If you just put it on your blog, then you're the only one who can fix it, and experience has shown that this generally does not happen. Documentation is a project and requires maintenance just like code. The context I'm coming from is the fact that the single-most-common issue people ask about on the swank-clojure mailing list is people finding confusing blog posts, most of which are largely out-of-date by the time they've gained enough google juice to make the front page of search results. Another thing that would help would be to link to the official docs from your blog in order to boost the search ranking. -Phil -- 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
command line options parser
oh hi, i needed (well, wanted) a command line parser more like opt parser in ruby so i threw one together: https://github.com/gar3thjon3s/clargon thought i would share in case anyone else finds it useful. im aware of with-command-line but it didnt quite do what i wanted as i needed functions that parse things and i generally want the config as a map. suggestions for improvements welcome. cheers, gaz Example: (clargon args (required [-p --port the port for the server] #(Integer. %) (optional [--host hostname of server :default localhost]) (optional [--verbose run in chatty mode :default true]) (optional [--log-directory where you put logs :default /some/path]))) with args of: '(-p 8080 --no-verbose --log-directory /tmp) will produce a clojure map with the names picked out for you as keywords: {:port 8080 :host localhost :verbose false :log-directory /tmp} A flag of -h or --help is provided which will currently give a documentation string: Usage: Switches Desc Default Required --- -p, --port the port for the server Yes --host hostname of server localhost No --verboserun in chatty mode trueNo --log-directory where you put logs /some/path No -- 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: Moderately off-topic: installing emacs on OSX
On Sat, 11 Dec 2010 01:07:51 + Alec Battles alec.batt...@gmail.com wrote: I don't use OS X so I can't comment on such a consensus, but while I appreciate the sentiment, it's actually harmful to some degree to have lots of blog posts scattered around everywhere that all have slightly different advice, especially since that advice usually becomes outdated within the year. Speak for yourself. Whenever I need to install SCIM on someone's computer I pull up three conflicting blog posts and just combine elements of all of them. I do that as well. And then, after a couple of days trying all the various combinations and having none of them work, I give up and ask the on the list to get an answer that actually works with the current versions of all the tools. Of course, if a typical howto was more than a recipe of steps with no explanations, but actually documented why you wanted to take each step and what it achieved, then you might have a chance of figuring out how to mix them to be right for your environment. I strongly suggest improving the docs on the Clojure wiki instead; that way errors can be fixed by the community. Why does the one preclude the other? Much as I hate wiki's, an up-to-date wiki is *much* better than a collection of out of date blog entries. It makes the reading the out-of-date blog entries that google returns a waste of time. If the wiki isn't up to date, then it just becomes a part of the trial-and-error process that's the norm for getting things done in the Linux world. Also, if people aren't going to blog about Clojure, what future does it have? If people can't figure out how to get Clojure installed because all they can find on the web is out of date blog entries, what future does it have? There's *lots* of good thing in clojure to blog about without writing yet another howto that's going to be out of date in a few months. You can write about what you're doing with it: how the Java interop helps with that, how the nifty data structures and functions that work with them assist the process of creating a program, etc. Basically, it's a simple choice - do you help yourself by writing an entry for your blog, or do you help the clojure community by writing an entry for the wiki? I claim the subject matter should determine which: if you're documenting how to use clojure, put it on the wiki. If you're documenting how you're using clojure, put it in your blog. mike -- Mike Meyer m...@mired.org http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O ascii ribbon campaign - stop html mail - www.asciiribbon.org -- 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: Moderately off-topic: installing emacs on OSX
brew install emacs --cocoa worked pretty well for me. and then my fork of emacs-starter-kit if that is useful to anyone: https://github.com/gar3thjon3s/emacs-starter-kit my default-profile.el has a few settings for making the brew installed emacs work better with os x. by the way thanks for the set-exec-path-from-shell-PATH function, that is awesome. If you have issues with emacs failing to pick up the right executables, you can use the following nifty trick to ensure Emacs' $PATH matches the one you've configured for Bash in Terminal: (defun set-exec-path-from-shell-PATH () (let ((path-from-shell (shell-command-to-string $SHELL -i -c 'echo $PATH'))) (setenv PATH path-from-shell) (setq exec-path (split-string path-from-shell path-separator (if window-system (set-exec-path-from-shell-PATH)) On Fri, Dec 10, 2010 at 8:39 PM, Mike Meyer mwm-keyword-googlegroups.620...@mired.org wrote: On Sat, 11 Dec 2010 01:07:51 + Alec Battles alec.batt...@gmail.com wrote: I don't use OS X so I can't comment on such a consensus, but while I appreciate the sentiment, it's actually harmful to some degree to have lots of blog posts scattered around everywhere that all have slightly different advice, especially since that advice usually becomes outdated within the year. Speak for yourself. Whenever I need to install SCIM on someone's computer I pull up three conflicting blog posts and just combine elements of all of them. I do that as well. And then, after a couple of days trying all the various combinations and having none of them work, I give up and ask the on the list to get an answer that actually works with the current versions of all the tools. Of course, if a typical howto was more than a recipe of steps with no explanations, but actually documented why you wanted to take each step and what it achieved, then you might have a chance of figuring out how to mix them to be right for your environment. I strongly suggest improving the docs on the Clojure wiki instead; that way errors can be fixed by the community. Why does the one preclude the other? Much as I hate wiki's, an up-to-date wiki is *much* better than a collection of out of date blog entries. It makes the reading the out-of-date blog entries that google returns a waste of time. If the wiki isn't up to date, then it just becomes a part of the trial-and-error process that's the norm for getting things done in the Linux world. Also, if people aren't going to blog about Clojure, what future does it have? If people can't figure out how to get Clojure installed because all they can find on the web is out of date blog entries, what future does it have? There's *lots* of good thing in clojure to blog about without writing yet another howto that's going to be out of date in a few months. You can write about what you're doing with it: how the Java interop helps with that, how the nifty data structures and functions that work with them assist the process of creating a program, etc. Basically, it's a simple choice - do you help yourself by writing an entry for your blog, or do you help the clojure community by writing an entry for the wiki? I claim the subject matter should determine which: if you're documenting how to use clojure, put it on the wiki. If you're documenting how you're using clojure, put it in your blog. mike -- Mike Meyer m...@mired.org http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O ascii ribbon campaign - stop html mail - www.asciiribbon.org -- 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
OOM with Agents
Hi, I've cobbled together some grungy code to attempt to work out the number of employees in different ranges - the code is a horrible mess of side effects: https://gist.github.com/737179 (pmap process-company (take 1500 companies)) results in: Exception in thread pool-2-thread-3905 java.lang.OutOfMemoryError: Java heap space Exception in thread pool-2-thread-4458 java.lang.IllegalStateException: Pop without matching push at clojure.lang.Var.popThreadBindings(Var.java:297) at clojure.lang.Agent$Action.doRun(Agent.java:145) at clojure.lang.Agent$Action.run(Agent.java:150) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Exception in thread pool-2-thread-4549 java.lang.OutOfMemoryError: Java heap space Exception in thread pool-2-thread-3723 java.lang.OutOfMemoryError: Java heap space There are 54874 companies in the companies var. The OOM tends to take place when there are 1000 or so companies to process. What is likely to be causing this issue? Cheers, mike -- 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: command line options parser
Have you considered instead providing a clojure wrapper around a well- known java command-line parser? The only one I've used is apache- commons-cli, which I found to be pretty lackluster, but http://www.freebsdsoftware.org/java/java-getopt.html is from FreeBSD and claims to be a 100% compatible port of getopt. I enjoy writing code as much as the next guy, but I'd rather have a clojure wrapper around a well-tested library than something I threw together that seems to work. On Dec 10, 6:40 pm, gaz jones gareth.e.jo...@gmail.com wrote: oh hi, i needed (well, wanted) a command line parser more like opt parser in ruby so i threw one together: https://github.com/gar3thjon3s/clargon thought i would share in case anyone else finds it useful. im aware of with-command-line but it didnt quite do what i wanted as i needed functions that parse things and i generally want the config as a map. suggestions for improvements welcome. cheers, gaz Example: (clargon args (required [-p --port the port for the server] #(Integer. %) (optional [--host hostname of server :default localhost]) (optional [--verbose run in chatty mode :default true]) (optional [--log-directory where you put logs :default /some/path]))) with args of: '(-p 8080 --no-verbose --log-directory /tmp) will produce a clojure map with the names picked out for you as keywords: {:port 8080 :host localhost :verbose false :log-directory /tmp} A flag of -h or --help is provided which will currently give a documentation string: Usage: Switches Desc Default Required --- -p, --port the port for the server Yes --host hostname of server localhost No --verbose run in chatty mode true No --log-directory where you put logs /some/path No -- 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: OOM with Agents
On Sat, Dec 11, 2010 at 1:05 AM, Michael Ossareh ossa...@gmail.com wrote: I've cobbled together some grungy code to attempt to work out the number of employees in different ranges - the code is a horrible mess of side effects: https://gist.github.com/737179 ... There are 54874 companies in the companies var. The OOM tends to take place when there are 1000 or so companies to process. What is likely to be causing this issue? Holding onto the head of a seq. Failing that, your horrible mess of side effects. -- 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: Getting strange behavior when stubbing
Hi Brian, Can you explain this in more detail : I didn't have the laziness problem. I don't know if that was by accident or because Midje applies an #'eagerly function before checking. Because it seems that if code has a laziness problem, Midje will actually hide it in tests? Thanks. -- 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: Getting strange behavior when stubbing
On Sat, Dec 11, 2010 at 1:16 AM, ka sancha...@gmail.com wrote: Hi Brian, Can you explain this in more detail : I didn't have the laziness problem. I don't know if that was by accident or because Midje applies an #'eagerly function before checking. Because it seems that if code has a laziness problem, Midje will actually hide it in tests? The problem in this case came from the *test itself* temporarily rebinding some stuff to mock things up for the test. In theory, though, for this sort of case it should suffice to just have the binding enclose not just the expression that may return a lazy seq or something containing one, but also the test expression that examines the result and decides if it is correct. -- 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: OOM with Agents
Michael Ossareh ossa...@gmail.com writes: There are 54874 companies in the companies var. The OOM tends to take place when there are 1000 or so companies to process. What is likely to be causing this issue? I replied on IRC but just recapping here. I think you've probably been bitten by the way Java strings share data. The gotcha is described here better than I can: http://fishbowl.pastiche.org/2005/04/27/the_string_memory_gotcha/ One thing you can do to try to debug this sort of thing is to add -XX:+HeapDumpOnOutOfMemoryError to the JVM command-line. Then when you run into an OOM this will happen: java.lang.OutOfMemoryError: GC overhead limit exceeded Dumping heap to java_pid8706.hprof ... Heap dump file created [14429104 bytes in 0.154 secs] You can then load that .hprof file into jvisualvm (shipped with the JDK) to show what objects are using up the heap. It'll let you drill right down and even inspect individual objects. -- 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