Re: clojure, not the go to for data science
Not sure how helpful this will to be to others, but just started using some new tools to expedite in my data normalization/ cleansing/prep: https://www.bisok.com/data-science-workbench/ On Sunday, 20 December 2015 15:37:11 UTC-6, Matt Revelle wrote: > > Hey all, just chiming in that I use Clojure for exploratory analysis, > prototyping, and "production." Most of my work involves social networks and > aside from my own libs I use: core.matrix, Loom, and gg4clj (ggplot!). I'm > also a big fan of core.typed type annotations and Schema for data > validation and coercion. > > I used Clojure for implementing the method described in this paper: > Revelle, Matt, et al. "Finding Community Topics and Membership in Graphs." > *Machine > Learning and Knowledge Discovery in Databases*. Springer International > Publishing, 2015. 625-640. > > And the code is available at: > https://github.com/gmu-dmml-lab/senc > > I also have a utility library that will likely become a few separate > libraries in the future: > https://github.com/mattrepl/munge > > It has some basic IO for common formats (Matrix Market, various graph > formats, R tables), helper functions (some of which are no longer needed) > for core.matrix and Loom, and simple text processing. > > My biggest pain point with using Clojure is the kludgy access to decent > plots (nothing on the JVM comes close to ggplot) as well as missing > functions for probability distributions and model fitting. I've tried > various substitutes (or written my own), but nothing is as polished as R. > > -Matt > > On Sunday, December 20, 2015 at 1:11:12 AM UTC-5, Christopher Small wrote: >> >> You're quite welcome; I was happy to add your work there :-) It's always >> wonderful seeing folks using Clojure for scientific research. I'm happy to >> add similar showcasings to the list. >> >> I should add that I've been wanting to make it easier for folks to submit >> suggestions through the site, and add interactive features, but I've been a >> bit busy. If anyone else is interested in contributing, I'd be grateful. >> >> Cheers >> >> Chris >> >> >> >> On Sat, Dec 19, 2015 at 11:31 AM, Boris V. Schmid >> wrote: >> >>> Just noticed one of my research paper made it to the showcase :-). >>> Thanks for that! >>> >>> As for clojure resources: I have been mainly used clojure itself, and >>> visualization libraries, (incanter, quil and gg4clj [to make plots in R >>> with ggplot2, but you can use it to run any R code]), and sometimes a stray >>> java library for smoothing or clustering things. The inter-op with java is >>> often not too bad. I use light table as an IDE. >>> >>> Boris >>> >>> >>> On Thursday, April 9, 2015 at 3:17:44 AM UTC+2, Christopher Small wrote: Made some updates to http://clojure-datascience.herokuapp.com/. In particular, went with the tagline "Resources for the budding Clojure Data Scientist." Couldn't come up with anything else sufficiently punny and appropriate. Again; please contribute! I'll be starting a list in the about page mentioning everyone who's contributed. Chris On Tuesday, April 7, 2015 at 8:24:27 PM UTC-7, Emrehan Tüzün wrote: > > Clojure isn't the first tool coming into mind on data science at the > moment but the number of useful libraries are growing up. You can check > out > https://github.com/razum2um/awesome-clojure#science-and-data-analysis. -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clo...@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+u...@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 a topic in the >>> Google Groups "Clojure" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/clojure/vsjUlAWm64g/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> clojure+u...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. To view this discussion
Re: clojars down?
Anyone know if there are any mirrors available that we can use in the time being? Our production deploys are broken right now because lein won't be able to fetch the dependencies during build. We can't tolerate the risk of not being able to make new deployments for an extended period of time, and a mirror we could point to would be the easiest way to get builds working again for now. On Friday, January 1, 2016 at 2:00:40 PM UTC-5, Nicolás Berger wrote: > > Clojars is down because of the ongoing DDoS attacks on linode. Please > check http://status.linode.com/ for status on that > El 1 ene. 2016 15:53, "Angel Java Lopez"> escribió: > >> It's down here... chrome, page not available, from Buenos Aires, Argentina >> >> On Fri, Jan 1, 2016 at 3:51 PM, Mimmo Cosenza > > wrote: >> >>> it’s down here too. >>> >>> http://status.linode.com/ >>> >>> mimmo >>> >>> On 01 Jan 2016, at 19:49, Bobby Eickhoff >> > wrote: >>> >>> Is anyone else having trouble connecting to clojars.org? Firefox can't >>> connect: "The connection has timed out". Neither can lein: >>> >>> INFO: I/O exception (java.net.NoRouteToHostException) caught when >>> processing request to {s}->https://clojars.org:443: No route to host >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send >>> an email to clojure+u...@googlegroups.com . >>> For more options, visit https://groups.google.com/d/optout. >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send >>> an email to clojure+u...@googlegroups.com . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+u...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Count vowels in a string
keep is cool, thanks for showing me that :) On Wednesday, May 21, 2014 2:35:50 AM UTC-5, Vesa Marttila wrote: On Wednesday, May 21, 2014 2:03:14 AM UTC+3, Brad Kurtz wrote: I saw a rant online about interviewing developers that mentioned candidates not being able to count the number of vowels in a string. So naturally, I decided to see if I could do it in Clojure! I wanted to see others' opinions on other ways of doing it. *https://gist.github.com/bradkurtz/6ce500d0361ccdc08c8e https://gist.github.com/bradkurtz/6ce500d0361ccdc08c8e* Hi, I ended up with this: https://gist.github.com/ponzao/7399c08bb3b40d349289 (def vowels #{\a \e \i \o \u}) (defn count-vowels [s] (count (keep vowels (.toLowerCase s Vesa -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Count vowels in a string
I saw a rant online about interviewing developers that mentioned candidates not being able to count the number of vowels in a string. So naturally, I decided to see if I could do it in Clojure! I wanted to see others' opinions on other ways of doing it. *https://gist.github.com/bradkurtz/6ce500d0361ccdc08c8e* -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Count vowels in a string
I like the one-liner. That was the kind of feedback I was looking for, thanks. On Tuesday, May 20, 2014 6:13:48 PM UTC-5, puzzler wrote: You're seriously overthinking this if it's any more than a one-liner. (defn count-vowels [s] (count (filter #{\a \e \i \o \u \A \E \I \O \U} (seq s On Tue, May 20, 2014 at 4:03 PM, Brad Kurtz bkurt...@gmail.comjavascript: wrote: I saw a rant online about interviewing developers that mentioned candidates not being able to count the number of vowels in a string. So naturally, I decided to see if I could do it in Clojure! I wanted to see others' opinions on other ways of doing it. *https://gist.github.com/bradkurtz/6ce500d0361ccdc08c8e https://gist.github.com/bradkurtz/6ce500d0361ccdc08c8e* -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Looking for help with a Stack Overflow error
I've seen David Nolen talk a bit about core.logic and I admit it seems interesting. Since I'm new to Clojure I didn't think to look into it. I'll take a look at your solution Leif. Thanks for the suggestions everyone. On Sunday, May 18, 2014 6:28:15 PM UTC-5, Leif wrote: Hi, Brad (and Karsten). I solved the problem with core.logic, to try out its CLP(FD) features. It took about 220-230ms to find a solution. It took about 400ms to find all solutions. Here it is for you to peek at after you try it: https://gist.github.com/leifp/b4af5f4cd7289c38b55a The code looked very similar to the problem statement, no careful hand-crafting required. The one minor irritation is that there is no way to easily specify equations involving vectors of logic vars. I think I could've done it in this case with macros, but I wouldn't want to do that if I had hundreds or thousands of variables. Maybe I'm just not experienced enough with core.logic, experts chime in if so. --Leif On Friday, May 16, 2014 3:31:26 PM UTC-4, Brad Kurtz wrote: I'm pretty new to Clojure so I'm trying out simple examples to see if I can get myself in the functional programming/Lisp mindset. My team lead sends out puzzles from his Mensa calendar, and every once in a while I find one that seems fun to solve as a Clojure program. With this particular puzzle, I've tried a couple of different ways of solving the puzzle, and I decided to try a recursive function. I'm fairly certain that what I've done here is not anywhere near ideal, and I'm looking for insight into how to better write this solution. Also, with my latest attempt I seem to be getting a stack overflow error, and I'm not quite sure why. I'm pretty sure it has to do with the permutation sequence (it's basically 10 factorial, or around 3 million sequences), but I don't really know how to better represent this problem in Clojure. Can anyone help? Thanks! https://github.com/bradkurtz/clojure-puzzles/tree/master/billiards -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Looking for help with a Stack Overflow error
I'm pretty new to Clojure so I'm trying out simple examples to see if I can get myself in the functional programming/Lisp mindset. My team lead sends out puzzles from his Mensa calendar, and every once in a while I find one that seems fun to solve as a Clojure program. With this particular puzzle, I've tried a couple of different ways of solving the puzzle, and I decided to try a recursive function. I'm fairly certain that what I've done here is not anywhere near ideal, and I'm looking for insight into how to better write this solution. Also, with my latest attempt I seem to be getting a stack overflow error, and I'm not quite sure why. I'm pretty sure it has to do with the permutation sequence (it's basically 10 factorial, or around 3 million sequences), but I don't really know how to better represent this problem in Clojure. Can anyone help? Thanks! https://github.com/bradkurtz/clojure-puzzles/tree/master/billiards -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Looking for help with a Stack Overflow error
I have since fixed the original stack overflow error I was getting, it was a result of not using recur. However, I'm still trying to find the best way to actually iterate through the permutations to find the result... On Friday, May 16, 2014 2:31:26 PM UTC-5, Brad Kurtz wrote: I'm pretty new to Clojure so I'm trying out simple examples to see if I can get myself in the functional programming/Lisp mindset. My team lead sends out puzzles from his Mensa calendar, and every once in a while I find one that seems fun to solve as a Clojure program. With this particular puzzle, I've tried a couple of different ways of solving the puzzle, and I decided to try a recursive function. I'm fairly certain that what I've done here is not anywhere near ideal, and I'm looking for insight into how to better write this solution. Also, with my latest attempt I seem to be getting a stack overflow error, and I'm not quite sure why. I'm pretty sure it has to do with the permutation sequence (it's basically 10 factorial, or around 3 million sequences), but I don't really know how to better represent this problem in Clojure. Can anyone help? Thanks! https://github.com/bradkurtz/clojure-puzzles/tree/master/billiards -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Monitoring a Clojure app, possibly with New Relic
I need to implement some performance monitoring and exception tracking for my Clojure app. My first thought was to just use New Relic. I implemented it according to Heroku's New Relic instructions for Clojurehttps://devcenter.heroku.com/articles/newrelic#clojure-configuration. It initialized the dashboard successfully, but no data is ever sent. I've seen two other https://groups.google.com/forum/#!topic/clojure/mfwIvW1KZAM reports http://stackoverflow.com/q/13420912/425313 of no data being received as well. The logs note the capture of things such as SQL queries, but the agent doesn't seem to send them in the report back. I filed a ticket with them, but their customer support has been awful; they responded only once a week ago and have ignored requests for updates. Has anyone had this issue with New Relic on a Clojure app, and did you find a way to resolve it? Does anyone use something different for monitoring that works well? -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
How to go about 'proving' why dynamically typed languages are better
zcaudate z...@caudate.me Oct 05 08:35PM -0700 I'm a little bit miffed over this current craze of `types` and `correctness` of programs. It smells to me of the whole `object` craze of the last two decades. I agree that types (like objects) have their uses, especially in very well defined problems, but they have got me in trouble over and over again when I am working in an area where the goal is unclear and requirements are constantly changing. Joe Armstrong and Simon Peyton Jones discuss Erlang and Haskell http://www.infoq.com/interviews/armstrong-peyton-jones-erlang-haskell This interview covers some of the strong-types vs flexible development (apparent) dichotomy, but in a playful, open and non-dogmatic way. (catmatic?) Simon Peyton Jones is one of the Haskell leaders, yet admits to being envious of type-free generics. Joe Armstrong of Erlang fame also sees the benefit to thinking in and annotating types. These two are both leaders of typed or dynamic cults but have a pleasant friendly and frank conversation about the issues. (Erlang's Dialyzer sounds somewhat like core.typed) A sample: SPJ: So, I've told you what I most envy about Erlang. What do you most envy about Haskell? JA: All the types. I mean they're very nice. I wish we had them. On the other hand, wouldn't you love to have all these generic turn-to-binary, these sort of things? How can you live without them? SPJ: I have a little bit of residual envy about generics. JA: You just take anything and compare it to the serializer and then send it? SPJ: That's sinfully easy, and shouldn't be allowed. So if these two can agree that there's strengths and weaknesses in both approaches, that settles it for me. It's a matter of knowing your trade-offs and choosing your tools appropriately. My suspicion is that type affinity is related to some trait of personality, and so trying to prove superiority is a likely to work as proving you are right in any other clash of personalities. Brad -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: What people want from Clojure error messages
On Friday, January 25, 2013 6:27:48 AM UTC+11, Michael Klishin wrote: [..] Because poor error messages primarily trip newcomers to the language, I am a bit surprised to see this issue discussed on the closed mailing list said beginners cannot join [quickly or at all]. So, if you have something specific to say on the topic, say it here. As a Clojure beginner with no Java experience, I find the error messages to often be very Java-centric, usually needing my best-guess interpretation into the Clojure in front of me (nil and NullPointer being the only specific I can recall right now). I'll collect any more I come across, especially since I'm sure I can generate weirder, why would you even type that? code than people who have already learned Clojure. It looks like the Java-ness was touched on in the clojure-dev discussion also. When Perl, after 15 or so years, finally included the variable name in uninitialized warnings it was truly a blessed day. Perl also has a use diagnositics pragma that nicely decrypts and decorates error messages: perl -Mdiagnostics -Mstrict -E 'my $x; print $x' This opt-in feature is newbie-friendly without burdening more experienced users. Brad -- -- 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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.
On Thursday, June 21, 2012 12:58:19 PM UTC+10, John Gabriele wrote: On Jun 18, 10:23 pm, Chris Zheng zcaud...@gmail.com wrote: {snip} So basically, if a 'lead clojure evangelist' can either 'officially' or 'unofficially' recommend ONE emacs setup, along with a bunch of videos/tutorials that demonstrate how to code and how fast it is to design and code using the repl. Then that be enough to get people at least interested. People are very opinionated about their editor/IDE. I think the Getting +Started docs are good --- they separate: * if you want just Emacs plus the repl, here you go (clojure-mode readme) * if you want Emacs + inferior-lisp, do this (this doc needs work) * if you want Emacs + swank/slime, do this (swank-clojure readme) and of course also info on Eclipse, Clooj, and other editors/ide's as well. I'm right at the start of this process, completely unfamiliar with Clojure, Leiningen, Emacs, Java and all of the projects with cute names. I don't even know what I want. I've cut and pasted various git-clone and lein commands, but have no idea about the bigger picture. I'm happy to dawdle along on my own, but if my current (and hopefully temporary) ignorance can provide feedback on a start-up guide then let me know. At present I'm often wondering what is this thing? why do I want it?. Slime for example. I don't especially want answers here, but something like a glossary for the clojure ecosystem would be handy (not that I've looked hard). Another document that might useful is a platform Rosetta stone matching clojure tools and libraries to those that fill a similar role in other languages (Java and Ruby for starters). This is more of a nice to have. Thanks, Brad -- 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: Alan Kay talk
The link Tim provided is the direct link but it doesn't 'work' unless you are already on the site. I had the same problem. Try going to the main page for the video here http://tele-task.de/archive/lecture/overview/5819/ There is a group of links of which one of is the flash link which will then 'work'. Try http://tele-task.de/archive/video/flash/14029/ - Brad -- 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
PersistentHashMap vs PersistentArrayMap in Postal Question
I'm using Postal (https://github.com/drewr/postal) and found something I don't know how to fix. I have my application working fine if I have a var with my smtp properties created as follows: (def smtp-original {:host foo.com :port 2525 :user me :pass pwd }) Since I want to release my project for others I thought to modify it to read the smtp values from a Properties file. I used the routine from Dave Ray's answer on StackOverFlow (http://stackoverflow.com/a/ 7781443/406220). ;; Load smtp information out of a file from http://stackoverflow.com/a/7781443/406220 (defn load-props [file-name] (with-open [^java.io.Reader reader (clojure.java.io/reader file- name)] (let [props (java.util.Properties.)] (.load props reader) (into {} (for [[k v] props] [(keyword k) (read-string v)]) This works well in that it returns a Map that looks just like the smtp- original when reading the following file. host=foo.com port=2525 user=me pass=pwd The trouble is when I run my app and it calls into Postal I get a java.lang.ClassCastException. I notice that the smtp-original created with a def is a clojure.lang.PersistentHashMap while the return from load-props is a clojure.lang.PersistentArrayMap. I looked into Postal but don't see why this matters. So, I guess I have a few questions. Can I convert the PersistentArrayMap to a PersistentHashMap? Is this the right way to go? Is load-props doing something unusual? It seems fine. Does anyone understand the internals of Postal? Why would it not work with the PersistentArrayMap? Any ideas or pointers would be greatly appreciated. I'm looking to understand what is going on. 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: PersistentHashMap vs PersistentArrayMap in Postal Question
That did the trick. Thanks. Oh and I'll be careful on StackOverflow :) - Brad On Mar 4, 12:51 pm, Dave Ray dave...@gmail.com wrote: Brad, As Kevin points out, because the values in the property file go through read-string, they're read as Clojure literals, symbols in this case. One solution is to make the string values look like string literals to the reader: host=foo.com port=2525 user=me pass=pwd Try that and never believe anything you read on StackOverflow :) Dave On Sun, Mar 4, 2012 at 10:23 AM, Brad Lucas b...@beaconhill.com wrote: I'm using Postal (https://github.com/drewr/postal) and found something I don't know how to fix. I have my application working fine if I have a var with my smtp properties created as follows: (def smtp-original {:host foo.com :port 2525 :user me :pass pwd }) Since I want to release my project for others I thought to modify it to read the smtp values from a Properties file. I used the routine from Dave Ray's answer on StackOverFlow (http://stackoverflow.com/a/ 7781443/406220). ;; Load smtp information out of a file fromhttp://stackoverflow.com/a/7781443/406220 (defn load-props [file-name] (with-open [^java.io.Reader reader (clojure.java.io/reader file- name)] (let [props (java.util.Properties.)] (.load props reader) (into {} (for [[k v] props] [(keyword k) (read-string v)]) This works well in that it returns a Map that looks just like the smtp- original when reading the following file. host=foo.com port=2525 user=me pass=pwd The trouble is when I run my app and it calls into Postal I get a java.lang.ClassCastException. I notice that the smtp-original created with a def is a clojure.lang.PersistentHashMap while the return from load-props is a clojure.lang.PersistentArrayMap. I looked into Postal but don't see why this matters. So, I guess I have a few questions. Can I convert the PersistentArrayMap to a PersistentHashMap? Is this the right way to go? Is load-props doing something unusual? It seems fine. Does anyone understand the internals of Postal? Why would it not work with the PersistentArrayMap? Any ideas or pointers would be greatly appreciated. I'm looking to understand what is going on. 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 -- 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
ANN: quote-downloader 1.0.0
Yahoo provides downloadable historical quote data if you exercise a properly formatted URL. The data is returned in CSV format and is easily stored in a file. I wrote quote-downloader to accept stock symbols from the command line and request and store the data in symbol.csv files locally. The program demonstrates reading from the command line, building a unique URL and reading from it as well as saving the results to a file and The code is on github here https://github.com/bradlucas/quote-downloader -- 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: clj-time and clojure 1.3
Thanks. It would be nice if KirinDave id put a notice up. Also, it would be nice if when you search for clj-time and go to getwoven rather than 404-ing it pointed to your version. I have an idea. I notice that you have a pointer to Clojars under Installation. This seems like a nice standard for people to follow. You find the source of something which you try quickly this way. I think the reverse would be nice. If you find clj-time for example by going to Clojars first it would be nice if there was a pointer back to the source that was used to build the jar submitted to Clojars. - Brad On Nov 17, 12:48 pm, Sean Corfield seancorfi...@gmail.com wrote: On Wed, Nov 16, 2011 at 5:39 PM, Sean Corfield seancorfi...@gmail.com wrote: I have taken over clj-time from Mark McGranahan: https://github.com/seancorfield/clj-time (although github seems to be omitting the navigation bar on that repo - I'll open a support ticket). github fixed that problem - apparently it was a weird caching issue... Now if we can get KirinDave to put a notice on his repo saying mine's the master, given that in the absence of the getwoven repo, github now says mine's a clone of his, rather than the getwoven one... -- Sean A Corfield -- (904) 302-SEAN An Architect's View --http://corfield.org/ World Singles, LLC. --http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- 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
clj-time and clojure 1.3
Just curious what happened with getwoven and clj-time. It seems that Sean has updated clj-time over on Clojars and this version works fine under 1.3. If you search on clj-time though you get links to a getwoven project. https://github.com/getwoven/clj-time/ with 404s. This is the one I originally used. Now when I search github I see https://github.com/KirinDave/clj-time. Just wondering what is happening and where the appropriate project is? -- 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
where is defvar?
I'm working on moving to Clojure 1.3 Some code is using defvar which use to be in clojure.contrib.def http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go mentions that contrib.def partially migrated to clojure.core.incubator but this new library doesn't appear to have it. Is there somewhere else I should look? -- 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: where is defvar?
Thanks. I couldn't find this mentioned anywhere so I added a comment on clojuredocs http://clojuredocs.org/clojure_contrib/clojure.contrib.def/defvar On Nov 14, 7:26 pm, Alan Malloy a...@malloys.org wrote: (def name doc init) On Nov 14, 4:03 pm, Brad b...@beaconhill.com wrote: I'm working on moving to Clojure 1.3 Some code is using defvar which use to be in clojure.contrib.def http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go mentions that contrib.def partially migrated to clojure.core.incubator but this new library doesn't appear to have it. Is there somewhere else I should look? -- 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
extend already refers to: #'clj-time.core/extend in namespace
I started using the clj-time library and found that it works great. Only issue I don't understand is this one about extend already refers to another version of extend. It seems that clj-time has a function called extend that conflicts with the same named function in clojure.core. The recommendation online is to put (:refer-clojure :exclude [extend]) in your ns declaration. I've done this. My core.clj file looks like the following: (ns test.core test project (:refer-clojure :exclude (extend)) (:use clj-time.core)) (defn foo [] (print asdf)) It sounded like doing this would inside my project use the extend inside of clj-time.core rather than the clojure one. The following two scenarios happen and don't make sense to me. The first is I slime-connect to a new swank session. The repl is in user. I open my test/core.clj file and compile it. When I return to the repl and (ns test.core) I get a sldb trace which I need to quit. It has the following complaint: extend already refers to: #'clj-time.core/extend in namespace: test.core The second is a variation where I start a new swank session and in the repl change the name space to test.core (ns test.core). Then I open test/core.clj and compile it. This time I just a warning printed to the REPL as follows: WARNING: extend already refers to: #'clojure.core/extend in namespace: test.core, being replaced by: #'clj-time.core/extend Can anyone explain what is going on here. I don't quite get it. - Brad -- 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: extend already refers to: #'clj-time.core/extend in namespace
Btw, I'm using clojure-1.2.0.jar clj-time-0.3.0.jar - Brad On Sep 8, 5:03 pm, Brad b...@beaconhill.com wrote: I started using the clj-time library and found that it works great. Only issue I don't understand is this one about extend already refers to another version of extend. It seems that clj-time has a function called extend that conflicts with the same named function in clojure.core. The recommendation online is to put (:refer-clojure :exclude [extend]) in your ns declaration. I've done this. My core.clj file looks like the following: (ns test.core test project (:refer-clojure :exclude (extend)) (:use clj-time.core)) (defn foo [] (print asdf)) It sounded like doing this would inside my project use the extend inside of clj-time.core rather than the clojure one. The following two scenarios happen and don't make sense to me. The first is I slime-connect to a new swank session. The repl is in user. I open my test/core.clj file and compile it. When I return to the repl and (ns test.core) I get a sldb trace which I need to quit. It has the following complaint: extend already refers to: #'clj-time.core/extend in namespace: test.core The second is a variation where I start a new swank session and in the repl change the name space to test.core (ns test.core). Then I open test/core.clj and compile it. This time I just a warning printed to the REPL as follows: WARNING: extend already refers to: #'clojure.core/extend in namespace: test.core, being replaced by: #'clj-time.core/extend Can anyone explain what is going on here. I don't quite get it. - Brad -- 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: Convert Map to string for use in URL as parameters question
Thanks. This is much more succinct. On Aug 2, 12:19 am, Sean Corfield seancorfi...@gmail.com wrote: On Mon, Aug 1, 2011 at 3:47 PM, Brad b...@beaconhill.com wrote: ;; My test input map (def input {:a 1 :b 2 :c 3 :d 4}) ... Is there a simpler, better way to do this? How about: (require '[clojure.string :as str]) (defn map-to-query-string [m] (str/join (map (fn [[k v]] (str (name k) = v)) m))) -- Sean A Corfield -- (904) 302-SEAN An Architect's View --http://corfield.org/ World Singles, LLC. --http://worldsingles.com/ Railo Technologies, Inc. --http://www.getrailo.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- 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: Convert Map to string for use in URL as parameters question
Great. Encoding the parameters was the next thing to figure out. Thank you. On Aug 2, 12:51 am, Matjaz Gregoric gre...@gmail.com wrote: Depending on your input, you might also want to make sure to properly urlencode the keys and values. There is a function in hiccup that does what you want (including urlencoding): https://github.com/weavejester/hiccup/blob/10c3ebe175edc80eed1a0792ec... On Tue, Aug 2, 2011 at 12:47 AM, Brad b...@beaconhill.com wrote: I wanted to take a Map and convert it to a string suitable for use as parameters in a URL. I have got it working below two different ways but wondered if there was a better or more idiomatic way to do this. ;; My test input map (def input {:a 1 :b 2 :c 3 :d 4}) ;; What I'd like the input map convert into. A string that looks like keyword=valuekeyword=value, (def output a=1b=2c=3d=4) ;; This function converts each MapEntry to the key=value (defn map-entry-to-string-pair Convert a key value from a map into a string that looks like key=value. For example, (def input {:a 1 :b 2 :c 3 :d 4}) (map-entry-to-string-pair (first input)) = \a=1\ [mapentry] (str (name (first mapentry)) = (second mapentry))) ;; The following two functions build the result string. There is not much of a difference between them. The first uses ;; let to hold a variable after mapping map-entry-to-string-pair over the input map. The other just uses the same mapping ;; after converting it to a vector. (defn convert-map-to-url-string1 Convert a map from keyword values to a string that consists of keyword=value pairs separated by s for use in a URL For example, (def input {:a 1 :b 2 :c 3 :d 4}) (convert-map-to-url-string1 input) = \a=1b=2c=3d=4\ [m] (let [pairs (map map-entry-to-string-pair m)] (join pairs))) (defn convert-map-to-url-string2 Convert a map from keyword values to a string that consists of keyword=value pairs separated by s for use in a URL For example, (def input {:a 1 :b 2 :c 3 :d 4}) (convert-map-to-url-string2 input) = \a=1b=2c=3d=4\ [m] (join (vec (map map-entry-to-string-pair m Is there a simpler, better way to do this? - Brad -- 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
Convert Map to string for use in URL as parameters question
I wanted to take a Map and convert it to a string suitable for use as parameters in a URL. I have got it working below two different ways but wondered if there was a better or more idiomatic way to do this. ;; My test input map (def input {:a 1 :b 2 :c 3 :d 4}) ;; What I'd like the input map convert into. A string that looks like keyword=valuekeyword=value, (def output a=1b=2c=3d=4) ;; This function converts each MapEntry to the key=value (defn map-entry-to-string-pair Convert a key value from a map into a string that looks like key=value. For example, (def input {:a 1 :b 2 :c 3 :d 4}) (map-entry-to-string-pair (first input)) = \a=1\ [mapentry] (str (name (first mapentry)) = (second mapentry))) ;; The following two functions build the result string. There is not much of a difference between them. The first uses ;; let to hold a variable after mapping map-entry-to-string-pair over the input map. The other just uses the same mapping ;; after converting it to a vector. (defn convert-map-to-url-string1 Convert a map from keyword values to a string that consists of keyword=value pairs separated by s for use in a URL For example, (def input {:a 1 :b 2 :c 3 :d 4}) (convert-map-to-url-string1 input) = \a=1b=2c=3d=4\ [m] (let [pairs (map map-entry-to-string-pair m)] (join pairs))) (defn convert-map-to-url-string2 Convert a map from keyword values to a string that consists of keyword=value pairs separated by s for use in a URL For example, (def input {:a 1 :b 2 :c 3 :d 4}) (convert-map-to-url-string2 input) = \a=1b=2c=3d=4\ [m] (join (vec (map map-entry-to-string-pair m Is there a simpler, better way to do this? - Brad -- 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: Pure-functional N-body benchmark implementation
On 2009-08-17, at 8:58 PM, FFT fft1...@gmail.com wrote: On Mon, Aug 17, 2009 at 9:25 AM, Bradbevbrad.beveri...@gmail.com wrote: On Aug 17, 1:32 am, Nicolas Oury nicolas.o...@gmail.com wrote: I was referring to the rules of the benchmark game. When you benchmark language, using another language is not fair. If you were to do your own program, of course you could use Java. However, in the particular circumstance, it is a bit annoying to use Java just to create a data structure type. Ah, that makes more sense re the cheating then. Your insight for array range check elimination got me thinking - why can't the accessor macros (posx, etc) that use aset/aget have their ranges eliminated by the JVM? After all, it should be a simple constant fold. I found another 2-3x speed up by coercing the indexes with (int x), ie (defmacro mass [p] `(double (aget ~p (int 0 I'm not seeing this. Maybe you are running this on -client? I'm running Java 1.5 32bit on OS X 10.5 with -server. I don't have the Java version running on my machine, but I saw runtimes go from 833ms to 295ms for 10 iterations, a 2.8x speed up, which should put the no cheating version on the same standing as the Java implementation. You can't get a consistent timing for anything less than 1-10M iterations here. Why do you think that? Everything I've read says that hotspot kicks in at 10,000, and I always do a warmup run. I see consistent enough timings, within 50ms each run. When coerced ints gives an immediate 3x speedup something is happening. What JVM are you running what settings? I'll compile the java version soon so I can do a direct compare on a single machine. I take it that your setup is showing clojure 3x slower than the java version? Brad --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---