Re: [ANN] Jig

2013-10-25 Thread Timothy Washington
This is great. I tried digging into the code and saw the repo changing. So I'm glad I didn't get too far down a path. I'll definitely have a look in the next few days and have feedback for you. Tim Washington Interruptsoftware.ca / Bkeeping.com On Thu, Oct 24, 2013 at 8:54 PM, Malcolm Sparks w

How to use core.cache to store the results of expensive computations?

2013-10-25 Thread dgrnbrg
I've been looking through examples of usages of core.cache, and I have not been able to understand how to make a ref or atom backed cache that offers a simple API to the application programmer: I want to provide a key and a thunk, and have the cache either return me the cached value (if it's in

Re: Request for help optimising a Clojure program

2013-10-25 Thread Mark Engelberg
On Fri, Oct 25, 2013 at 9:11 AM, Stuart Halloway wrote: > To save others from having to read this whole thread, is the following > summary correct? > > 1. We believe that the performance issue Paul first encountered is > substantially / entirely caused by hash collisions. > Yes. > > 2. The hash

Re: Request for help optimising a Clojure program

2013-10-25 Thread Cedric Greevey
I don't see a general solution for idiomatic Clojure data (so, often not records) other than making the hashes of small integers a spread-out, nonlinear function of them. On Fri, Oct 25, 2013 at 2:11 PM, Mark Engelberg wrote: > On Fri, Oct 25, 2013 at 9:56 AM, David Nolen wrote: > >> What I sugg

Re: Request for help optimising a Clojure program

2013-10-25 Thread Mark Engelberg
On Fri, Oct 25, 2013 at 9:56 AM, David Nolen wrote: > What I suggested is far, far more conservative than anything else proposed > on this or on the dev thread. > I understand your point that records are a separate "island" unique to Clojure-land, whereas the other Clojure types need to align wi

Re: Request for help optimising a Clojure program

2013-10-25 Thread David Nolen
What I suggested is far, far more conservative than anything else proposed on this or on the dev thread. Changing the hash implementation of sets and vectors etc. is likely to have unintended consequences for performance - http://www.scala-lang.org/old/node/8510.html The original Scala code used

Re: Request for help optimising a Clojure program

2013-10-25 Thread Andy Fingerhut
Two partial answers in-line below, but as it says there, Mark Engelberg has more experimental data than I do right now on proposed changes. On Fri, Oct 25, 2013 at 9:11 AM, Stuart Halloway wrote: > To save others from having to read this whole thread, is the following > summary correct? > > 1. W

Re: Request for help optimising a Clojure program

2013-10-25 Thread Ben Mabey
On 10/24/13 5:46 AM, Paul Butcher wrote: On 24 Oct 2013, at 11:34, Phillip Lord > wrote: What does Scala do? I mean, given that it doesn't have the same problem, perhaps it has a solution? By default, Scala uses a tree-based set, not a hash-based set. So t

Re: Request for help optimising a Clojure program

2013-10-25 Thread Stuart Halloway
To save others from having to read this whole thread, is the following summary correct? 1. We believe that the performance issue Paul first encountered is substantially / entirely caused by hash collisions. 2. The hash collisions could be improved by spreading the hashes of numbers (and not needi

Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Mark Tomko
Looks like that was a success. Thanks for the help! On Fri, Oct 25, 2013 at 11:26 AM, Mark Tomko wrote: > Thanks Sean. I'll give it a try! > > > > > On Fri, Oct 25, 2013 at 11:21 AM, Sean Corfield wrote: > >> Second bug in your code: (delete-scores-for-column db cid) >> >> Should be: (delete-sc

Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Mark Tomko
Thanks Sean. I'll give it a try! On Fri, Oct 25, 2013 at 11:21 AM, Sean Corfield wrote: > Second bug in your code: (delete-scores-for-column db cid) > > Should be: (delete-scores-for-column t cid) > > Sorry I didn't see that (additional) bug first time around when I > suggested removing :trans

Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Sean Corfield
Second bug in your code: (delete-scores-for-column db cid) Should be: (delete-scores-for-column t cid) Sorry I didn't see that (additional) bug first time around when I suggested removing :transaction? from delete! execute! does not call with-open if it can find an active connection in the passe

Re: Overwrite equals in defrecord

2013-10-25 Thread Andrii V. Mishkovskyi
On Fri, Oct 25, 2013 at 4:41 PM, Marc Dzaebel wrote: > However, if you need the multiple features of records, you would need to > have the generated code of defrecord in order to reimplement records with > deftype. Is there something available? Hey Marc, I've recently been using this little li

Re: Overwrite equals in defrecord

2013-10-25 Thread Marc Dzaebel
>> use deftype which is more low-level and I think doesn't define equals or put y in meta data that don't participate in equality...:) Hi Jim, this works! However, if you need the multiple features of records, you would need to have the generated code of defrecord in order to reimplement recor

Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Mark
Scratch that aside, I think I have that part working. It was a little gnarly because the datasource provider was written in Scala and posed a few potentially confusing interop problems, and I must have gotten it wrong on at least one account. However, I'm still seeming to commit automatically.

Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Mark
That doesn't seem to work. Neither does explicitly setting :transaction? to false. Looking at the source of execute!, it looks like the statement is running within a "with-open" on the java.sql.Connection, which is where a commit or rollback would occur. I presume that the with-open is closing

[ANN] - Major update of Tutorial 21 Learning by Collaborating of the modern-cljs series

2013-10-25 Thread Mimmo Cosenza
Hi all, I made a major update of the Tutorial-21. It now brings the reader to brepl with the enfocus project. https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-21.md HIH Mimmo -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: Clojure(script) countdown like the one on clojurecup.com?

2013-10-25 Thread Bastien
Hi Cedric, Cedric Greevey writes: > Why the hell did this message just mark itself as unread in my gmail > inbox? I read it hours ago and I'm quite certain I didn't > subsequently take any action to unmark it as read...yet here it is, > suddenly showing as new again. My bad -- I wasn't sure my

Re: Clojure(script) countdown like the one on clojurecup.com?

2013-10-25 Thread Cedric Greevey
Why the hell did this message just mark itself as unread in my gmail inbox? I read it hours ago and I'm quite certain I didn't subsequently take any action to unmark it as read...yet here it is, suddenly showing as new again. On Fri, Oct 25, 2013 at 4:30 AM, Bastien wrote: > I'm trying to imple

Clojure(script) countdown like the one on clojurecup.com?

2013-10-25 Thread Bastien
I'm trying to implement a countdown like the one there was on clojurecup.com: is there a way to access to the website code, or is there any pointer where I could learn how to do this? Thanks in advance for your help! -- Bastien -- -- You received this message because you are subscribed to th