Re: try* macro to catch multiple exception classes with one body. feedback is needed.

2013-06-19 Thread Max Gonzih
Right, simpler solution, thanks. Regards, Max On 20 Jun 2013 08:47, "Meikel Brandmeyer (kotarak)" wrote: > Hi, > > Am Mittwoch, 19. Juni 2013 17:00:17 UTC+2 schrieb Max Gonzih: >> >> Hi, I implemented small macro to catch multiple exception classes with >> one body. >> >> https://gist.github.com

Re: try* macro to catch multiple exception classes with one body. feedback is needed.

2013-06-19 Thread Meikel Brandmeyer (kotarak)
Hi, Am Mittwoch, 19. Juni 2013 17:00:17 UTC+2 schrieb Max Gonzih: > > Hi, I implemented small macro to catch multiple exception classes with one > body. > > https://gist.github.com/Gonzih/5814945 > > What do you think? Are there better ways to achieve similar results? > > I would just extend try

Re: ANN: Potemkin 0.3.0

2013-06-19 Thread Jason Wolfe
We're starting to use potemkin at Prismatic, and the part we've found most useful which Zach didn't mention in his post are the smart types. Especially definterface+, which is like a love child of defprotocol and definterface: - Same syntax as defprotocol, and defines functions in your namespa

Re: Clojure in production

2013-06-19 Thread Wei Hsu
Hi Plinio, I used Clojure at Airtime last year to do load testing and deploy infrastructure. More recently, I'm using Clojure to build Bitcoin-related projects backed by bitcoinj, including this bitcoin scratcher game for fun. On Monday, June 10, 2013 2:47:25 PM UTC

Re: ANN: Potemkin 0.3.0

2013-06-19 Thread Matthew Chadwick
> > If anyone has moral or aesthetic objections to 'import-vars', you're not > alone, but please remember you're under no obligation to use it. I used lein-clique to make a graph of Lamina's dependencies(huge PNG

Re: extending a protocol to arrays and handle nesting too

2013-06-19 Thread Cedric Greevey
I doubt you can extend it to "all n-dimensional arrays of foo". What you can do, though, is (defmacro add-support-for-dimension [n] `(extend-protocol ...)) and document that users of your library should invoke this macro once for each number of dimensions that will need supporting. If that set's o

Re: Loosing a space from an XML document

2013-06-19 Thread Rob Day
On 19 June 2013 20:32, Stefan Kamphausen wrote: > Take a look at the last tag "wheredidmyspacego". The whitespace between the > span tags gets lost whereas the " dear " in the second example is preserved > including surrounding spaces. > > Is this on purpose and/or expected behavior? Stefan, I

Re: Namespace qualification of symbols

2013-06-19 Thread Colin Fleming
Thank you for this, you just fixed a bug for me :-) I was trying to do some tricky type hinting with definline using amolloy's great answer on StackOverflow. Notice that he uses `BufferedImage and not 'BufferedImage. I stupidly figured that this was just a typ

Factual is hiring Clojure developers

2013-06-19 Thread Zach Tellman
At Factual, we build and constantly refine a canonical index of real world entities: businesses, locations, and products [1]. We also provide ways for other data to be resolved against our index [2] [3], allowing our service to act as a join table for real-world entities, breaking down barrier

Re: Performance optimizations dealing with java collections

2013-06-19 Thread Tim Jones
That's it! Thanks so much for the help! In what cases is a function turned into a RestFn? variadic clojure or vararg java? I was confused about how clojure is turned into java, but things are a little clearer now. (make-array) uses java.lang.reflect.Array.newInstance, which is bad as well.

Loosing a space from an XML document

2013-06-19 Thread Stefan Kamphausen
Hi, Recently I found myself searching for a white space which got lost somewhere between reading an XML file and presenting some results from that via a little webapp. I think, I could track it down to the following example: user> (clojure.pprint/pprint (clojure.zip/xml-zip

Re: ANN: Potemkin 0.3.0

2013-06-19 Thread Zack Maril
We've been using Potemkin inside Titanium, Ogre, and Archimedes. It works well for importing functions, but I'm about to do a rewrite of Titanium and Ogre because of complications arising from being clever with importing dynamic vars. I would caution against trying to import dynamic vars (or fu

ANN: Potemkin 0.3.0

2013-06-19 Thread Zach Tellman
Potemkin [1] is a collection of facades and utilities that I've found helpful when writing larger-scale libraries or applications. I've never formally announced it before, but I think it's gotten to the point where others can benefit from it. A few highlights: * 'def-map-type', which allows f

Re: why clojure.lang.Compiler.LOADER is null in clojure 1.5.1

2013-06-19 Thread alexi
Hi Stream, I have resolved the problem you are referring to. See comment in the issue you have opened https://github.com/apolenur/vert.x-mod-lang-clojure/issues/1 Regards, Alexi On Monday, 17 June 2013 23:15:37 UTC-4, Stream wrote: > > > > 在 2013年5月9日星期四UTC+8下午2时00分54秒,Stream写道: >> >> Hi all

extending a protocol to arrays and handle nesting too

2013-06-19 Thread Jim - FooBar();
Hi again, quick question: Is it at all possible to extend a protocol to a particular primitive array type but also handle nesting of arrays? A double[] is not the same class as double[][] which in turn is not the same Class as double[][][] etc etc and there is no interface tying them togethe

Re: Namespace qualification of symbols

2013-06-19 Thread Leon Barrett
Yes, it's expected, and if you need unqualified names you need to carefully unquote and requote, e.g. (defmacro def-a-fn [body] `(defn ~'a-fn ;; you can only define unqualified names, I think [] ~@body)) On Wed, Jun 19, 2013 at 3:32 AM, Jim wrote: > On 19/06/13 09:46, Phillip Lord wrot

Software project estimation

2013-06-19 Thread Alan Thompson
Hi All, I saw a nice summation of software project estimation and thought some of you might like to view it: http://agile.dzone.com/articles/estimating-unknown-dates-or Enjoy! Alan Thompson -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

try* macro to catch multiple exception classes with one body. feedback is needed.

2013-06-19 Thread Max Gonzih
Hi, I implemented small macro to catch multiple exception classes with one body. https://gist.github.com/Gonzih/5814945 What do you think? Are there better ways to achieve similar results? Thanks! -- -- You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: Graph API

2013-06-19 Thread A
Thought I'd mention a really nice Graph visualization library that I like. It would be great to include this into any new Graph library project. https://github.com/pallix/lacij >From the readme: "Lacij is a graph visualization library written in Clojure. It allows the *display and the dynami

why is catch defined with bare symbols?

2013-06-19 Thread Ben Wolfson
It strikes me as a wart, albeit one that won't be much encountered, that there's no good way to discriminate between the user-defined function "catch" and the exception-catching magic symbol "catch" here: user> (defn kick [& o] (apply println "kick the" o)) #'user/kick user> (defn catch [& o] (app

Re: Clojure in production

2013-06-19 Thread Stuart Sierra
Hi Plínio, At Relevance, we use Clojure on many consulting projects for clients ranging from small startups to Fortune-500 companies. Datomic, a database, is written primarily in Clojure. http://thinkrelevance.com/ http://datomic.com/ http://clojure.com/ Good luck with your talk. Thanks, -S

Re: Clojure generates unnecessary and slow type-checks

2013-06-19 Thread Stuart Sierra
Jason Wolfe wrote: > We thought we were being very careful Sorry, didn't mean to imply that you weren't. ;) It was me who wasn't careful: when I started investigating this, I used a dead-code loop similar to the Gist I posted, which made it look like Clojure 1.2 was much faster than 1.5. I guesse

Re: anyone interested in authoring a book on "Clojure for machine-learning" ?

2013-06-19 Thread Jim
On 19/06/13 13:56, Mikera wrote: Not sure who approached you, but I've also been approached by a couple of companies in this space and they are essentially scams / not serious publishers. For example, they apparently offer only about 16% royalty to the author, and do essentially no vetting or q

Re: Graph API

2013-06-19 Thread Aysylu Biktimirova
If you'd like to take a stab at integrating your proposed protocol into Loom, I'd be happy to merge the changes. Thanks! On Tuesday, June 18, 2013 1:12:04 PM UTC-4, Stephen Kockentiedt wrote: > > That sounds great! I'll mail you my complete code in case you want to take > a look at it or want to

Re: anyone interested in authoring a book on "Clojure for machine-learning" ?

2013-06-19 Thread Mikera
Not sure who approached you, but I've also been approached by a couple of companies in this space and they are essentially scams / not serious publishers. For example, they apparently offer only about 16% royalty to the author, and do essentially no vetting or quality control. The fact that the

Re: New CSS library - Garden

2013-06-19 Thread JeremyS
Hi Joel, Thank for the interest ! You can also take a look at some code have done around css unit types there . It's got arithmetic for units and a namespace dedicated to colors. In it you'll find conversions between rgb en hsl (that I have taken from the color

anyone interested in authoring a book on "Clojure for machine-learning" ?

2013-06-19 Thread Jim
Hi all, I was approached by a publishing company last week and they proposed to me to author this book-title. Unfortunately, as soon as I mentioned this to my supervisor she completely flipped out! She is very much against me writing a book at this point in time, ad thus I've informed the pu

Re: Data vs API

2013-06-19 Thread dmirylenka
Great question and great answers, thank you. Regarding (3), what if want to process various customer order implementations (say, sort them) in a polymorphic way depending just on their total-price? Assuming I do not control the implementations.. Is it ok in this case to define *HasTotalPrice* pr

Re: 'foldcat' slower than 'mapv' even for 10,000 elements

2013-06-19 Thread Herwig Hochleitner
I've got a quadcore machine here: user=> (c/bench (porter-stem words)) Evaluation count : 2220 in 60 samples of 37 calls. Execution time mean : *27.571133 ms* Execution time std-deviation : 317.554208 mus Execution time lower quantile : 26.797791 ms ( 2.5%) Execution time

Re: Namespace qualification of symbols

2013-06-19 Thread Jim
On 19/06/13 09:46, Phillip Lord wrote: With the ' paul is not namespace qualified, while with the ` paul is. Turns out to be a bit of a pain, actually, although I have worked around it. But mostly I am surprised. Is this expected? Yes, this is very much expected! :) How else would you be abl

Re: 'foldcat' slower than 'mapv' even for 10,000 elements

2013-06-19 Thread Jim
On 19/06/13 11:15, Jim wrote: After letting the jvm warm up a bit I am getting: "Elapsed time: 68.498756 msecs" for mapv "Elapsed time: 49.066978 msecs" for foldcat (!!!) HmmI think I see what was happening 2 days ago...when measuring 'mapv' I'd like to reuse the same Object as everything

Re: 'foldcat' slower than 'mapv' even for 10,000 elements

2013-06-19 Thread Jim
I know I promised a representative example yesterday and didn't deliver...let's try it now even though I'm outside the comfort of my own house/desktop... Right ,we're gonna need a single external dependency which I propose we dynamically load via pomegranate. like so: (use '[cemerick.pomegra

Namespace qualification of symbols

2013-06-19 Thread Phillip Lord
So, I was thinking that ' and ` were basically the same, unless a ~ was involved somewhere. But I have discovered this. (ns john) (println '(paul)) (println `(paul)) ;;=> (paul) (john/paul) With the ' paul is not namespace qualified, while with the ` paul is. Turns out to be a bit of a

Re: core logic

2013-06-19 Thread Josh Kamau
Piotr i will as soon as am done. Josh On Wed, Jun 19, 2013 at 11:26 AM, 良ϖ wrote: > Hello Josh, I would be glad you share your code :) > > Piotr > > > 2013/6/18 David Nolen > >> This is a variant of the Zebra/Einstein Puzzle. You can probably Google >> for "miniKanren core.logic zebra" an

Re: core logic

2013-06-19 Thread 良ϖ
Hello Josh, I would be glad you share your code :) Piotr 2013/6/18 David Nolen > This is a variant of the Zebra/Einstein Puzzle. You can probably Google > for "miniKanren core.logic zebra" and find a solution if you get stuck ;) > > David > > > On Tue, Jun 18, 2013 at 7:57 AM, Josh Kamau wrot

Re: Clojure in production

2013-06-19 Thread Hussein B.
I mentioned that! :D On Wednesday, June 19, 2013 9:40:57 AM UTC+2, Florian Over wrote: > > Hi, > we at doo.net are using clojure and clojurescript for all our backend and > web development. > We are also still in need for clojure developers. :) > > Florian > > > 2013/6/19 Nikita Prokopov > > >> W

Re: Clojure in production

2013-06-19 Thread Florian Over
Hi, we at doo.net are using clojure and clojurescript for all our backend and web development. We are also still in need for clojure developers. :) Florian 2013/6/19 Nikita Prokopov > We're using Clojure for a year in one of our backend project (real-time > social feeds aggregation & processin

Re: 'foldcat' slower than 'mapv' even for 10,000 elements

2013-06-19 Thread Alan Busby
On Wed, Jun 19, 2013 at 4:03 PM, Tassilo Horn wrote: > I might be wrong, but I think reducers are only faster in situations > where you bash many filters/maps/mapcats/etc on top of each other. > Or use fold on a large vector with a multi-core machine. You might try fold-into-vec to see if there

Re: 'foldcat' slower than 'mapv' even for 10,000 elements

2013-06-19 Thread Tassilo Horn
"Jim - FooBar();" writes: Hi Jim, > I'm finding that (r/foldcat (r/map f coll)) is consistently slower > than a simple mapv, even for a collection of 10,000 elements and more! I might be wrong, but I think reducers are only faster in situations where you bash many filters/maps/mapcats/etc on to