Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-08 Thread Max Penet
Thanks! This looks really good. I hope this ends up in contrib at some point, also looking forward to its extension (guards & co). On Aug 9, 7:49 am, David Nolen wrote: > Ambrose and I have been working on a high performance pattern matching > library for Clojure. There's much left to do but it'

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-08 Thread László Török
David, this looks great! sent from my mobile device On Aug 9, 2011 7:58 AM, "Tuba Lambanog" wrote: > Awesome! > > Thanks for the great work. > Tuba > > On Mon, Aug 8, 2011 at 11:49 PM, David Nolen wrote: > >> Ambrose and I have been working on a high performance pattern matching >> library for

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-08 Thread Tuba Lambanog
Awesome! Thanks for the great work. Tuba On Mon, Aug 8, 2011 at 11:49 PM, David Nolen wrote: > Ambrose and I have been working on a high performance pattern matching > library for Clojure. There's much left to do but it's already in a place > where it's fun to play around with and we think some

ANN: Optimized Pattern Matching Library for Clojure

2011-08-08 Thread David Nolen
Ambrose and I have been working on a high performance pattern matching library for Clojure. There's much left to do but it's already in a place where it's fun to play around with and we think some of you might even find it useful even in this early form. Some highlights: * Literal patterns * Seq

Re: Optimizing JDBC code

2011-08-08 Thread Shantanu Kumar
> So {:result-type :forward-only :fetch-size 1000} in the vector before your > SQL string should provide the same optimization as in the Java code. Please > let us know the results of your next test with those options added. As per this post http://blog.lishman.com/2008/03/jdbc-fetch-size.html act

Re: Optimizing JDBC code

2011-08-08 Thread Sean Corfield
On Mon, Aug 8, 2011 at 5:12 PM, Dmitry Gutov wrote: > Like the doc says, `with-query-results` takes additional options > before the query string. > Yup, this is a recent enhancement. You can either pass a PreparedStatement that you've built and configured instead of a SQL string or you can pass

Re: Howto automate tests w/ ClojusreScript?

2011-08-08 Thread Brenton
> load('out/goog/base.js'); > load('bkeeping.js'); This should be: load('out/goog/base.js'); load('out/goog/deps.js'); load('bkeeping.js'); On Aug 8, 11:05 pm, Timothy Washington wrote: > Sorry, I should have been clearer. > > In a JS shell (v8, for example), after running... *load('bkeeping.j

Re: Howto automate tests w/ ClojusreScript?

2011-08-08 Thread Timothy Washington
Sorry, I should have been clearer. In a JS shell (v8, for example), after running... *load('bkeeping.js');* , I expect to have a *bkeeping* object. But that's not there. So I tried a * goog.require('bkeeping.js');* , and a '*bkeeping*' object still wasn't there. Basically, I'd like to able to run

Howto automate tests w/ ClojusreScript?

2011-08-08 Thread Timothy Washington
Hey all, I'm digging into ClojureScript at the moment, and am trying to figure out how to automate generated JS code in a shell, like v8. In ClojureScript, I have been able to to pull in Google Closure's "* goog.testing.jsunit*" package. Next step is to take the generated JS code (optimized or

Re: Stanford AI Class

2011-08-08 Thread Mark Engelberg
On Mon, Aug 8, 2011 at 2:18 PM, daly wrote: > It is trivial to make Lisp look like Python, > just put each paren on its own line and move them hard right. > Add a few macros (e.g. for) and you could probably parse it. I agree with most of what you said, but not this. There's a big difference bet

Re: Optimizing JDBC code

2011-08-08 Thread Dmitry Gutov
Like the doc says, `with-query-results` takes additional options before the query string. In your case, it should be something like this: (sql/with-query-results recs `[{:fetch-size 1000} ~query-str ~@bvs] (doall recs)) -- You received this message because you are subscribed to the Google Gr

Re: Re: Stanford AI Class

2011-08-08 Thread labwork07
But it could also mean that you are expected to learn Python while taking the class. On Aug 8, 2011 4:17pm, Mark Engelberg wrote: The course website (for the actual classroom-based class that underlies the online class) doesn't list any programming language as a prerequisite. The only p

Re: Stanford AI Class

2011-08-08 Thread daly
I don't see where they specified a programming language but I know that Python is making huge inroads. Python is supposed to be "easier to understand" so I can see why it might be a factor in language choice. Another likely factor is that Google (where Norvig works) supports Python but not Lisp. I

Re: Concurrency design

2011-08-08 Thread jweiss
Ken, Thanks for your response! Those are some great suggestions. Some look quite promising, a few don't fit my purposes. For instance, I can't use pcalls because the user needs to be able to control the number of threads. Your method to skip tests using 'and' works, and is interesting, but I w

Re: Stanford AI Class

2011-08-08 Thread Mark Engelberg
BTW, Norvig's older AI book uses LISP. According to his website, he switched to Python because students complained that the LISP code did not look enough like the pseudocode outline of how a given algorithm works, and had trouble making the connection between the two. -- You received this messa

Re: Stanford AI Class

2011-08-08 Thread Mark Engelberg
The course website (for the actual classroom-based class that underlies the online class) doesn't list any programming language as a prerequisite. The only prerequisites listed are a strong understanding of probability and linear algebra. -- You received this message because you are subscribed t

Re: (:key map) lookup vs accessor functions in large applications

2011-08-08 Thread Tyler Perkins
> Renaming accessor functions has the benefit of help from the compiler, > which will tell me if the function is not defined so I can easily > change the client code to use new name. I think you could just define vars that evaluate to keywords. Adopting the convention as follows gives protection f

Re: "Elegant tools deserve elegant solutions." -- L. E. Gant

2011-08-08 Thread Resty Cena
Hi, Ken, Thanks for the suggestion. As I was looking at a suffix tree, it suddenly struck me that the following strategy may do just as well: 1. Use rest and next to generate the tentative suffix sets, thus for "directional", it will give the set of #{irectional rectional ectional ctional tiona

Re: Stanford AI Class

2011-08-08 Thread daly
I signed up for the course. Python is not the best choice but I'm sure that Peter Norvig knows that. I suppose it was chosen because it is popular. AI involves learning which, by definition, involves permanent changes of behavior. The best way to achieve that is to have the program self-modify. Th

Re: reverse a sequence without reverse or rseq

2011-08-08 Thread Aaron Cohen
On Mon, Aug 8, 2011 at 2:29 PM, MarisO wrote: > Do you know of any trick to reverse a sequence without reverse or > rseq ? > > I wrote it like this: > > ((fn rev > ([s] (rev '() s)) > ([r s] (if (seq s) (rev (cons (first s) r) (rest s)) r )) ) > '[1 2 3 5] ) > > > https://gist.github.com/11

Re: reverse a sequence without reverse or rseq

2011-08-08 Thread Alan Malloy
(into () [1 2 3 5]) On Aug 8, 11:29 am, MarisO wrote: > Do you know of any trick to reverse a sequence without reverse or > rseq ? > > I wrote it like this: > > ((fn rev >    ([s] (rev '() s)) >    ([r s] (if (seq s) (rev (cons (first s) r) (rest s)) r )) ) >  '[1 2 3 5]  ) > > https://gist.githu

Re: JSON library for clojure 1.3

2011-08-08 Thread Stuart Sierra
Thanks, Arthur. I've placed it in "Backlog" because it's a feature enhancement. Regards, -Stuart -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moder

Re: Referencing Clojure code from the ClojureScript namespace

2011-08-08 Thread Alen Ribic
Thanks Chouser for the clear explanation. When I stepped away from the screen and took some time to actually think, I came to a basic conclusion that you so well described; having that Clojure code is executed at a different time to the actual code that is targeted on the javascript vm. I am curre

Stanford AI Class

2011-08-08 Thread labwork07
As most of you probably already know, Peter Norvig and S. Thrun will offer a free online intro to AI class in the Fall. The problem is that it will probably require Python since the third edition of the book is in Python. I am somewhat upset that this will make Python the de facto language of

Re: reverse a sequence without reverse or rseq

2011-08-08 Thread Mark Rathwell
user> (source reverse) (defn reverse "Returns a seq of the items in coll in reverse order. Not lazy." {:added "1.0"} [coll] (reduce conj () coll)) On Mon, Aug 8, 2011 at 2:29 PM, MarisO wrote: > Do you know of any trick to reverse a sequence without reverse or > rseq ? > > I wrote i

Re: Referencing Clojure code from the ClojureScript namespace

2011-08-08 Thread Chouser
On Mon, Aug 8, 2011 at 12:59 PM, Alen Ribic wrote: > It seems that the only way to reference Clojure code [1] from the > ClojureScript namespace is via the ns require-macros keyword. > Is this correct and if so, why the reference to macros only and not to > general functions too. (I'm sure there i

Re: Concurrency design

2011-08-08 Thread jweiss
If I may reply to myself: Sometimes just stating the problem for someone else makes the solution clear. My false assumption was that I needed something as fancy as agents or ThreadPoolExecutor. The solution was simple Just queue up the tests with a BlockingQueue, start some plain java threads wi

reverse a sequence without reverse or rseq

2011-08-08 Thread MarisO
Do you know of any trick to reverse a sequence without reverse or rseq ? I wrote it like this: ((fn rev ([s] (rev '() s)) ([r s] (if (seq s) (rev (cons (first s) r) (rest s)) r )) ) '[1 2 3 5] ) https://gist.github.com/1132357 I wonder if it can be written more shortly. -- You recei

Re: Concurrency design

2011-08-08 Thread Ken Wesson
If the local bindings will never change, then why not just use (binding [whatever-setup ...] ...) wrapping the individual test bodies that need such setup? (Where explicit tear-down is required, you'd need try ... finally as well, or better yet a macro like with-open, but using binding instead of l

Re: JSON library for clojure 1.3

2011-08-08 Thread Arthur Edelstein
Hi Stuart, I've added a JIRA ticket (CLJ-826). Thanks, Arthur On Aug 7, 7:19 am, Stuart Sierra wrote: > Hi Arthur, > > I think thos would make a reasonable addition. If you'll make a JIRA ticket > in the backlog, I'll see if I can push it forward. Ultimately, it will be > Rich's decision, of co

Re: "Elegant tools deserve elegant solutions." -- L. E. Gant

2011-08-08 Thread Ken Wesson
On Mon, Aug 8, 2011 at 11:41 AM, Tuba Lambanog wrote: > Hi, > Thank you for the tip. It does look like the Patricia tree -- or suffix tree > -- is made-to-order for this kind of task. I'm reading up on it. You're welcome. > Would there be a Clojure implementation of this technology, I wonder. E

Concurrency design

2011-08-08 Thread jweiss
I'm having some trouble figuring out what clojure concurrency tools I can use to solve my problem. The application I'm trying to build is a functional test harness, like TestNG but for clojure. It takes an input a tree of tests to run (where child tests don't run unless the parent passed), and ru

Referencing Clojure code from the ClojureScript namespace

2011-08-08 Thread Alen Ribic
It seems that the only way to reference Clojure code [1] from the ClojureScript namespace is via the ns require-macros keyword. Is this correct and if so, why the reference to macros only and not to general functions too. (I'm sure there is a good reason if it is the case; I'm hoping to get a bette

Re: Optimizing JDBC code

2011-08-08 Thread Shoeb Bhinderwala
Sean/Stuart/Others - My apologies to the group. I found out why my Clojure code runs slower than Java. The Java code uses the setFetchSize() method to retrieve data in batch: myResultSet.setFetchSize(1000); myResultSet.setFetchDirection(ResultSet.FETCH_FORWARD); Without

Re: "Elegant tools deserve elegant solutions." -- L. E. Gant

2011-08-08 Thread Tuba Lambanog
Hi, Thank you for the tip. It does look like the Patricia tree -- or suffix tree -- is made-to-order for this kind of task. I'm reading up on it. Would there be a Clojure implementation of this technology, I wonder. Tuba On Mon, Aug 8, 2011 at 1:40 AM, Ken Wesson wrote: > On Mon, Aug 8, 2011 at

Re: standalone indentation tool

2011-08-08 Thread Lars Nilsson
On Mon, Aug 8, 2011 at 5:36 AM, Philipp Steinwender wrote: > thank you, that worked! > to re-indent all source files, I use it as bash script like: > $ find ./src ./test -name '*.clj' | xargs -I {} emacs --eval "(progn (setq > make-backup-files nil) (find-file \"{}\") (indent-region (point-min) >

Re: standalone indentation tool

2011-08-08 Thread Philipp Steinwender
thank you, that worked! to re-indent all source files, I use it as bash script like: $ find ./src ./test -name '*.clj' | xargs -I {} emacs --eval "(progn (setq make-backup-files nil) (find-file \"{}\") (indent-region (point-min) (point-max)) (untabify (point-min) (point-max)) (save-buffer) (kill

tasting pinot noir

2011-08-08 Thread faenvie
recently i took a closer look at noir (http://webnoir.org) and found it a quite promising and in the words best sense minimalistic approach of a clojure-based full-stack framework for building webapps. noir is in an early stage and lacks some of the features that established frameworks like rails,

Re: Optimizing JDBC code

2011-08-08 Thread Shoeb Bhinderwala
You are right Michael. I misunderstood Colin's statement. As Stuart suggested I am profiling the code and will share the results with the group soon. On Aug 8, 4:33 am, Michael Wood wrote: > Hi Shoeb > > On 7 August 2011 01:51, Shoeb Bhinderwala wrote: > > > I am not guessing. I measured the pe

Re: Optimizing JDBC code

2011-08-08 Thread Michael Wood
Hi Shoeb On 7 August 2011 01:51, Shoeb Bhinderwala wrote: > I am not guessing. I measured the performance of the query using plain > Java and Clojure. That's not what he was saying. In your first message you said: >>> I am assuming that most of the extra time is spent converting the results >>

Re: "Elegant tools deserve elegant solutions." -- L. E. Gant

2011-08-08 Thread Resty Cena
Hi, Andreas, << I don't quite understand what you mean by "I’m having a hard time thinking through the process of generating the candidate suffix set using set forms" >> It is my usual roundabout way of saying "I don't know how to do this." ;) I'm looking at your code as we speak. Thanks, Tuba

Re: Optimizing JDBC code

2011-08-08 Thread jaime
Thank you for your information! I think I will start with c.j.j's test code :) On Aug 7, 3:08 pm, Sean Corfield wrote: > On Sat, Aug 6, 2011 at 11:04 PM, jaime wrote: > > Hi guys, I just want to learn using databases in Clojure, can you > > suggest where to start? by looking at source code o

Re: "Elegant tools deserve elegant solutions." -- L. E. Gant

2011-08-08 Thread Ken Wesson
On Mon, Aug 8, 2011 at 2:46 AM, Tuba Lambanog wrote: > I’m having a hard time thinking through the process of generating the > candidate suffix set using set forms, and I’m beginning to think I > have selected an arduous path (for me). > > Thoughts? Store the prefixes in a patricia tree, and the

Re: "Elegant tools deserve elegant solutions." -- L. E. Gant

2011-08-08 Thread Andreas Kostler
Hi Tuba, I don't quite understand what you mean by "I’m having a hard time thinking through the process of generating the candidate suffix set using set forms" but I have created a porter stemmer for English in the past. I understand that's not what you're looking for but it is moreso a framwork fo