Re: ANN clojure.java.jdbc 0.2.0

2012-04-26 Thread Sean Corfield
It looks like there are two issues here... On Tue, Apr 24, 2012 at 8:04 PM, Michael wrote: > (defn- oracle-insert-sql [table pk-col-name pk-seq-name ks] >   (let [cols (apply str (interpose \, (map jdbc/as-identifier ks))) >         n (count ks) >         qmarks (apply str (interpose \, (repeat n

Re: ANN clojure.java.jdbc 0.2.0

2012-04-26 Thread Sean Corfield
On Tue, Apr 24, 2012 at 8:30 PM, Michael wrote: > Would it be possible to make resultset-seq a dynamic var No, that certainly is not going to happen. Dynamic vars are not the right way to build an API in Clojure. > bind in custom result set mapping without having to make two passes through > the

Re: lein-cljsbuild on Windows?

2012-04-26 Thread Sean Corfield
On Thu, Apr 26, 2012 at 10:09 PM, Guofeng Zhang wrote: > I need to copy or install lein-cljsbuild-0.1.8.jar to LEIN's plugins > directory. Then each steps works well. This command should do that for you: lein plugin install lein-cljsbuild 0.1.8 -- Sean A Corfield -- (904) 302-SEAN An Architect

Re: naming your project "clojure" with "lein new clojure" gives problems

2012-04-26 Thread Sean Corfield
It used to be that lein new would not allow you to create projects with "jure" in the name. I guess that restriction has disappeared, which is unfortunate since it would have prevented the problem you ran into... On Thu, Apr 26, 2012 at 10:57 PM, Sean Neilan wrote: > Hello Lisperati, > > Naming y

RE: new with clojure, need help!

2012-04-26 Thread Guofeng Zhang
See if the following is helpful: http://dev.clojure.org/display/doc/Getting+Started+with+Eclipse+and+Counterclockwise From: clojure@googlegroups.com [mailto:clojure@googlegroups.com] On Behalf Of omer Sent: Wednesday, April 25, 2012 10:37 PM To: clojure@googlegroups.com Subject: new with clojur

RE: lein-cljsbuild on Windows?

2012-04-26 Thread Guofeng Zhang
I need to copy or install lein-cljsbuild-0.1.8.jar to LEIN's plugins directory. Then each steps works well. Thanks for your help. -Original Message- From: clojure@googlegroups.com [mailto:clojure@googlegroups.com] On Behalf Of nchurch Sent: Friday, April 27, 2012 2:49 AM To: Clojure Sub

Re: Clauth - OAuth2 provider for Ring

2012-04-26 Thread Shantanu Kumar
That sounds quite interesting! Do you have a Github URL of the project to share? Shantanu On Apr 25, 12:29 am, Pelle Braendgaard wrote: > This is a simple OAuth 2 provider that is designed to be used as a primary > authentication provider for a Clojure Ring app. > > I am a relative Clojure novic

Re: Could not locate clojure/contrib/duck_streams__init.class or clojure/contrib/duck_streams.clj

2012-04-26 Thread Dave Sann
lein-eclipse works great for me. The problem is that "duck-streams" is part of the old consolidated clojure contrib. Which you can still get - but haven't referenced as a dependency. try adding [org.clojure/clojure-contrib "1.2.0"] to your dependencies. But be aware that this is all deprecat

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread kurtharriger
I think you are too concerned with micro optimizations. get-in is probably just as efficient as attempting to bubble the state change back up and certainly simpler to work with. In practice, optimizations like this do not have a significant impact on the overall performace. Measure before yo

Re: Convention for configuration files?

2012-04-26 Thread Brian Marick
On Apr 26, 2012, at 12:09 PM, Laurent PETIT wrote: > Le 26 avr. 2012 à 02:15, Brian Marick a écrit : > >> Midje is getting to the point where it probably wants some sort of >> configuration/customization file. Is there any sort of emerging idiom for >> those in Clojure-land? > I don't know w

Re: a goal succeeding when given another goal succeeds for all elements in a list

2012-04-26 Thread nchurch
For the benefit of bystanders, could anyone explain why and how Daniel's for-all function works? (I've gotten to chapter 4 of TRS.) On Apr 26, 2:04 pm, David Nolen wrote: > core.logic can remember previous results via tabling. > > As far as n-queens - that's a problem best left for constraint lo

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread David Nolen
On Thu, Apr 26, 2012 at 5:08 PM, blais wrote: > I receive events from a network. My application calls for storing these > events and doing different things based on the changing status of orders > attached to these events. I need to store them somewhere, I need to track > this state in my app. At

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread blais
On Thursday, April 26, 2012 4:59:31 PM UTC-4, David Nolen wrote: > > On Thu, Apr 26, 2012 at 4:52 PM, blais wrote: > >> I suppose I could elect to move refs for modifiable things towards the >> leaves, but that seems to me like going against the grain and may have >> implications for concurrency

Re: a goal succeeding when given another goal succeeds for all elements in a list

2012-04-26 Thread David Nolen
core.logic can remember previous results via tabling. As far as n-queens - that's a problem best left for constraint logic programming (CLP). core.logic doesn't have constraint programming facilities yet, but I've mentioned the desire to implement cKanren many times on this list. Haven't really c

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread David Nolen
On Thu, Apr 26, 2012 at 4:52 PM, blais wrote: > I suppose I could elect to move refs for modifiable things towards the > leaves, but that seems to me like going against the grain and may have > implications for concurrency (there are few but some threads running in > parallel in this application)

Re: a goal succeeding when given another goal succeeds for all elements in a list

2012-04-26 Thread Daniel Kwiecinski
So how would you tackle, lets say n-queen problem on m square board (for realy huge m) knowing that additional small set of chess pieces can be added to the problem (let's say K K N N B) the new pieces attack fraction of the board potentially not taken by any queens so far. Some of prev solutions w

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread blais
On Thursday, April 26, 2012 4:36:52 PM UTC-4, David Nolen wrote: > > On Thu, Apr 26, 2012 at 4:30 PM, blais wrote: > >> (Generally I find I get too little "cultural osmosis" when it comes to >> practical application of Clojure, so questions like this one come up all >> the time while I'm coding.

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread David Nolen
On Thu, Apr 26, 2012 at 4:30 PM, blais wrote: > (Generally I find I get too little "cultural osmosis" when it comes to > practical application of Clojure, so questions like this one come up all > the time while I'm coding. Meetups and books touch on topics I understand > well but rarely do people

Re: new with clojure, need help!

2012-04-26 Thread John Gabriele
On Apr 25, 10:37 am, omer wrote: > hello im need to learn how to use clojure and how it works, > i found some videos the helped me a bit to understand how clojure works, > but i need a more basic guidence on how to install the nessecery plugins > to eclipse, and what to do with them... > any tutor

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread blais
Thanks Andy, Two comments: 1. Your version does not use a transient/mutable, which is great, but it does create one vector for each level. I thought that since this would be wrapped and hidden from external view, a mutable would have been more appropriate. More generally, I still don't know ye

Re: a goal succeeding when given another goal succeeds for all elements in a list

2012-04-26 Thread David Nolen
On Thu, Apr 26, 2012 at 1:38 PM, Daniel Kwiecinski < daniel.kwiecin...@gmail.com> wrote: > Does it make sense at all to you. > Makes sense, but sounds outside the scope of what core.logic currently does. David -- You received this message because you are subscribed to the Google Groups "Clojur

lein-cljsbuild on Windows?

2012-04-26 Thread nchurch
It sounds like lein deps is not getting all the dependencies (there should be four files to .lein-plugins and one to lib); it must be a windows-specific issue as I have no problem cloning the project on Mac; and unfortunately I do not have access to Windows, so can't say what the problem may be. T

Re: Having Problems with excercise noob.

2012-04-26 Thread Jim - FooBar();
On 26/04/12 19:15, Asranz wrote: Hi tahnks! i just need to do that operation. to conbert that string. for example for sums i did (defn sum [s] (apply + (map #(- (int (first %)) (int \0)) (re-seq #"[0-9]" s and it just sums the the numbers but if a have also multiplications, substracyi

Re: Having Problems with excercise noob.

2012-04-26 Thread Asranz
Hi tahnks! i just need to do that operation. to conbert that string. for example for sums i did (defn sum [s] (apply + (map #(- (int (first %)) (int \0)) (re-seq #"[0-9]" s and it just sums the the numbers but if a have also multiplications, substracyions and divsions how i do it?? On

Re: Having Problems with excercise noob.

2012-04-26 Thread Jim - FooBar();
On 26/04/12 19:06, Asranz wrote: Oh sorry i mean i didt wit sums and multiplications but i dont get how it can do it conbined in the same line On 25 abr, 22:18, Asranz wrote: Hi. im having a little problem i need to do a parser like to do operations but i dont get how to do it very well ex.

Re: Clojure-Specific Emacs Environment

2012-04-26 Thread Phil Hagelberg
Tim King writes: > I have been working on a fork of Phil's nrepl.el for the past few > nights. > So far I have gotten the basic bencode/bdecode transport working and > am able to send and receive to an nREPL server. > Beyond that, it isn't really in anything close to a usable state yet, > but I p

Re: Having Problems with excercise noob.

2012-04-26 Thread Jim - FooBar();
On 26/04/12 04:18, Asranz wrote: Hi. im having a little problem i need to do a parser like to do operations but i dont get how to do it very well ex. "1+2*3+4-5*6+7*8-9" = 431 i have to do it with sums but i dont get it how i can take all the operations. any advices? if you need a macro th

Re: Could not locate clojure/contrib/duck_streams__init.class or clojure/contrib/duck_streams.clj

2012-04-26 Thread Alex Ott
lein-eclipse was released 2 years ago... I think, that now it's better to work via pom.xml - generate it with 'lein pom' and import into eclipse On Wed, Apr 25, 2012 at 2:55 PM, Chirag Ghiyad wrote: > hi, > > I have created one lein project, > than updating its project.clj with dev-dependency of

Re: Having Problems with excercise noob.

2012-04-26 Thread Asranz
Oh sorry i mean i didt wit sums and multiplications but i dont get how it can do it conbined in the same line On 25 abr, 22:18, Asranz wrote: > Hi. im having a little problem i need to do a parser like to do > operations but i dont get how to do it very well > > ex. > >  "1+2*3+4-5*6+7*8-9" = 431

Re: a goal succeeding when given another goal succeeds for all elements in a list

2012-04-26 Thread David Nolen
Oops didn't read closely enough. Yes, your solution looks good to me. On Thu, Apr 26, 2012 at 1:08 PM, Daniel Kwiecinski < daniel.kwiecin...@gmail.com> wrote: > Is there such standard goal in clojure.logic or do I need to write > something like: > > > (defn for-all > > > > "A goal that succeeds

Re: Exception when trying to run the REPL

2012-04-26 Thread Phil Hagelberg
Cole Rowland writes: > I'm new to Clojure and anything having to do with Java or the JVM. It looks like you're trying to use gcj or something; you'll be better off with OpenJDK. Also, using Clojure from the raw jar file is very cumbersome; if you are getting started I recommend Leiningen: http:/

Re: ClojureScript Reflection

2012-04-26 Thread David Nolen
Just hasn't been implemented yet. Patch welcome :) On Wed, Apr 25, 2012 at 3:18 AM, Sean Nilan wrote: > Hi, I was wondering what support there is in ClojureScript for reflection. > Is there any way to get a constructor function from just the name of the > record / class? ClojureScript doesn't ha

Re: a goal succeeding when given another goal succeeds for all elements in a list

2012-04-26 Thread David Nolen
Depends on what you're doing but one simple way is: (defn for-all [gs] (if (seq gs) (all gs (for-all (rest gs))) s#)) On Thu, Apr 26, 2012 at 1:08 PM, Daniel Kwiecinski < daniel.kwiecin...@gmail.com> wrote: > Is there such standard goal in clojure.logic or do I need to writ

Re: Clojure alternatives to Esper

2012-04-26 Thread Toby DiPasquale
On Monday, April 23, 2012 9:51:39 AM UTC-4, Rogier wrote: > > My question is: is there an alternative for this in the clojure > ecosystem (since clojure seems like a good fit for this), and if not, > what kind of clojure components/libraries would be a good starting > point to implement someting si

Re: Clojure alternatives to Esper

2012-04-26 Thread Yann Schwartz
Since rxjs is being considered with ClojureScript ( https://github.com/Reactive-Extensions/rxjs-jquery/blob/master/examples/KonamiCode.html), I would love to see something akin to Reactive Extensions ( http://msdn.microsoft.com/en-us/data/gg577609 and http://www.codefornuts.com/2010/05/reactive-ext

Re: ANN: ClojureScript Synonyms

2012-04-26 Thread mega
I made a version of synonym with a fixed repl at the bottom and a run button for the code examples (also made them editable with codemirror). https://github.com/megakorre/himera I haven't updated all the code examples to be runnable yet. Anny thoughts? -- You received this message because you

[ANN] Clauth - OAuth2 provider for Ring

2012-04-26 Thread Pelle Braendgaard
This is a simple OAuth 2 provider that is designed to be used as a primary authentication provider for a Clojure Ring app. I am a relative Clojure novice, but have am very experienced in OAuth. Please help give feedback on use of idiomatic clojure. It currently handles OAuth2 bearer authenticatio

Exception when trying to run the REPL

2012-04-26 Thread Cole Rowland
I'm new to Clojure and anything having to do with Java or the JVM. I downloaded and unzipped clojure 1.4 and when I run "java -cp clojure-1.4.0.jar clojure.main" I get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: clojure.main at gnu.java.lang.MainThread.run(l

ClojureScript Reflection

2012-04-26 Thread Sean Nilan
Hi, I was wondering what support there is in ClojureScript for reflection. Is there any way to get a constructor function from just the name of the record / class? ClojureScript doesn't have support for reading in records from a string like Clojure does. Basically what I'd like to do is: (defr

Could not locate clojure/contrib/duck_streams__init.class or clojure/contrib/duck_streams.clj

2012-04-26 Thread Chirag Ghiyad
hi, I have created one lein project, than updating its project.clj with dev-dependency of eclips I ran "lein deps" it downloaded all dependencies but into my.m2/repository directory there is no clojure directory. and this causes me leiningen.eclipse Problem loading: java.io.FileNotFoundExcept

new with clojure, need help!

2012-04-26 Thread omer
hello im need to learn how to use clojure and how it works, i found some videos the helped me a bit to understand how clojure works, but i need a more basic guidence on how to install the nessecery plugins to eclipse, and what to do with them... any tutorial will do! thats... p.s. im using windows

Re: Alan Kay talk

2012-04-26 Thread Kevin
On Apr 25, 6:47 am, Timothy Baldridge wrote: > > After seeing the talk I looked for the source code for this, and > couldn't find it. I have a fairly in-depth background in graphics > rendering and am interested to see how this all is implemented. In the > past few days I've been reading up on OM

Having Problems with excercise noob.

2012-04-26 Thread Asranz
Hi. im having a little problem i need to do a parser like to do operations but i dont get how to do it very well ex. "1+2*3+4-5*6+7*8-9" = 431 i have to do it with sums but i dont get it how i can take all the operations. any advices? -- You received this message because you are subscribed to

RE: Having trouble running clojurescript repl

2012-04-26 Thread Guofeng Zhang
Trying ctest. if I clone the project then run " lein cljsbuild auto" in it, I got: Copying 3 files to D:\projects\app\clojure\contrib\ctest\.lein-plugins Compiling ClojureScript. Error: Could not find or load main class clojure.main If I run "lein deps", then run "lein cljsbuild auto", I got: Tha

Question about "special" macroexpansions

2012-04-26 Thread Nahuel Greco
The (.method1 obj) => (. obj method1) macroexpansion is defined as an "special" one, and I suppose the macroexpansion (Integer/MAX_VALUE) => (. Integer MAX_VALUE) is another one. Correct me if I'm wrong, but I think they are "special" because you reference the macro not by the first symbol in the e

Re: When I use Agents for logging I have a different behavior in the REPL as in the program

2012-04-26 Thread Marcus Lindner
I tried it with doseq many times, but the behvior is the same. In the REPL I got a full map of information, but when I use the program the map with the agent logs is empty. Am 22.04.2012 19:51, schrieb Moritz Ulrich: Just a quick guess after a quick glimpse at the code you linked: (map #(se

Re: Convention for configuration files?

2012-04-26 Thread Laurent PETIT
Le 26 avr. 2012 à 02:15, Brian Marick a écrit : > Midje is getting to the point where it probably wants some sort of > configuration/customization file. Is there any sort of emerging idiom for > those in Clojure-land? > > - Naming convention? Beginning with a dot? Ending in "rc"? Etc. > > - If

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread Jay Fields
I would have written the fn like this, if I was following what you've been doing: (def m {:planet {:country {:state {:city {:borough 4}) (let [mm (update-in m [:planet :country :state :city :borough ] (fnil inc -1))] (get-in mm [:planet :country :state :city :borough ])) However, when I ru

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread Andy Fingerhut
Here is one way to do it called update-in+. It returns a vector consisting of the new udpated value, like update-in does, followed by the original value (in case you might want to see that for some reason), followed by the updated value. (defn update-in+ ([m [k & ks] f & args] (if ks

(update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread blais
Hi, I have this use-case for (update-in) which keeps showing up in my code which I don't have a solution for and I'm wondering if there isn't a solution. How do I _efficiently_ obtain the new value created by an invocation of (update-in), that is, without having to get the modified value by look

Re: Clojure-Specific Emacs Environment

2012-04-26 Thread Tim King
I have been working on a fork of Phil's nrepl.el for the past few nights. So far I have gotten the basic bencode/bdecode transport working and am able to send and receive to an nREPL server. Beyond that, it isn't really in anything close to a usable state yet, but I plan to continue plugging away a

How to use an Enlive template in ClojureScript file

2012-04-26 Thread Pierre-Henry Perret
Hi, In ClojureScriptOne view, the *snippets* macros are required (with 'require-macros' ) in the view.cljs file. My question is : how to use an Enlive *html/deftemplate* * *in this same file. For instance in snippets I have this macro: (html/deftemplate a-template & > forms...) If in the

Re: ClojureScriptOne remote

2012-04-26 Thread Pierre-Henry Perret
Yes, that was it, just adding a key solved it. Thanks Le mercredi 25 avril 2012 20:42:42 UTC+2, David Nolen a écrit : > > Perhaps you are calling 'get' on something which has not implemented or > not been extended to ILookup. > > On Wed, Apr 25, 2012 at 2:38 PM, Pierre-Henry Perret wrote: > >>