Re: Clojure developer wanted for 4-6 week project ASAP
James, As you're in London I'd also ask on the London Clojurian Jobs list: https://groups.google.com/forum/?fromgroups#!forum/london-clojurian-jobs cheers, Bruce On Tue, May 7, 2013 at 1:11 AM, James Adams jxaad...@gmail.com wrote: Hi all, I'm looking for a Clojure developer to help me on a 4-6 week project starting ASAP. I'm based in London so if you are too that's a bonus, but otherwise remote working will be ok. You'll be helping me finish off the backend on a new multiplayer HTML5 poker game. Development is going well, but the deadline is a bit earlier than I previously thought so I'm looking for a bit of help. The codebase has been written from scratch for this project in Clojure so no nasty legacy stuff. You won't need to write any front end Javascript/CSS but if you can it's a bonus. The front end uses Javascript JQuery ClojureScript. There is the possibility of permanent position afterwards. Send me a message if you're interested, thanks James ja...@joyplay.com -- -- 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. -- @otfrom | CTO co-founder @MastodonC | mastodonc.com See recent coverage of us in the Economist http://econ.st/WeTd2i and the Financial Times http://on.ft.com/T154BA -- -- 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: I tripped out
atkaaz, you can do this: (fn [ {:keys [arg1 arg2 arg3]}] ...) On Mon, May 6, 2013 at 10:03 PM, AtKaaZ atk...@gmail.com wrote: I agree, I'm not sure what he means xD If you ask me, I'd rather have each arg be identified by a keyword instead of by order like: (somefn :arg1 somestr :arg3 100 :arg2 (+ 1 2)) or all those in a map I'll probably still do that for me, so that any function will take params like this. There's probably a way this can be done but it's not good enough for me, was it with :keys and :as map ? On Sun, May 5, 2013 at 10:52 PM, Alex Fowler alex.murat...@gmail.comwrote: Tell us more about it. On Sunday, May 5, 2013 11:54:32 AM UTC+4, JvJ wrote: Is anyone else tripped out when they realize that when you write args for a function you're basically just destructuring an arg vector? It trips me out. -- -- 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. -- -- 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. -- -- 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: Clojure developer wanted for 4-6 week project ASAP
Hi Ulises, I'm looking for an all round good Clojure developer that's willing to get stuck in and help get it all finished. I'm using Datomic for the persistence, so it might be a good opportunity for somebody interested in gaining experience using it. Thanks Vlad for your interest but given the short timescales I'm looking for someone that can hit the ground running in this instance. Cheers, Bruce, I didn't know about that list, I just posted there also :) On 7 May 2013 07:52, Bruce Durling b...@otfrom.com wrote: James, As you're in London I'd also ask on the London Clojurian Jobs list: https://groups.google.com/forum/?fromgroups#!forum/london-clojurian-jobs cheers, Bruce On Tue, May 7, 2013 at 1:11 AM, James Adams jxaad...@gmail.com wrote: Hi all, I'm looking for a Clojure developer to help me on a 4-6 week project starting ASAP. I'm based in London so if you are too that's a bonus, but otherwise remote working will be ok. You'll be helping me finish off the backend on a new multiplayer HTML5 poker game. Development is going well, but the deadline is a bit earlier than I previously thought so I'm looking for a bit of help. The codebase has been written from scratch for this project in Clojure so no nasty legacy stuff. You won't need to write any front end Javascript/CSS but if you can it's a bonus. The front end uses Javascript JQuery ClojureScript. There is the possibility of permanent position afterwards. Send me a message if you're interested, thanks James ja...@joyplay.com -- -- 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. -- @otfrom | CTO co-founder @MastodonC | mastodonc.com See recent coverage of us in the Economist http://econ.st/WeTd2i and the Financial Times http://on.ft.com/T154BA -- -- 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 a topic in the Google Groups Clojure group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/bRPMIHSFYa0/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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: Clojure on top of ObjC?
...but once that's done we should have a real Clojure repl running on the iPhone. Wow. This is awesome news Nathan. -- -- 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: Lisp 2013 summer programming contest
Oh heck, residents of Brazil cannot participate. Legalese things ruin all the fun. Plínio On Tue, May 7, 2013 at 2:28 AM, Andy Fingerhut andy.finger...@gmail.com wrote: I have not heard of this before. Wanted to pass on the word in case anyone was interested in applying. $2000 grand prize, and a chance to speak at a conference about your project. http://lispinsummerprojects.org Andy -- -- 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. -- -- 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: [ANN] java.jdbc 0.3.0-alpha2
Hey Sean, maybe you could clarify some choices made in 0.3, I needed to rewrite some SQL bits of my app anyhow and thought it was a good time to ditch 0.2.3 as well. 1) Why the keyword args to most functions? entities/identifiers in particular. My SQL Tables have columns like created_at, created_by, since SQL doesnt like - as separators, I still want to use - in Clojure so on insert I do (j/insert! db table {:created-by 1, :name test} :entities #(str/replace % #- _)) All is fine until I want to use the return value of insert (aka the inserted record + the generated id) which then equals {:created_by 1, :name test, :id 1} notice the incorrect underscore. In my case it would be sufficient if I could use the db map to specify this behavior, and one could still override this by just doing (j/insert! (assoc db :identifiers some-fn) table record). I realize that db is a Connectable and not always a map, but since its forced to a map under the hood anyways why not force it outside too. 2) Transaction Management? I dont quite understand what the point of the :transaction? option is since you should be able to infer this information at runtime? Seems to basically duplicate what Connection.setAutoCommit already does? Apart from these issues the API looks a lot nicer. Regards, /thomas On Saturday, May 4, 2013 5:58:11 PM UTC+2, Sean Corfield wrote: Thanx for the detailed feedback. I'm not sure why that didn't show up in testing. Update made to create alpha3. I'll have it released to Maven shortly. On Sat, May 4, 2013 at 3:51 AM, r0man roman@burningswell.comjavascript: wrote: Hi Sean, I just tested java.jdbc 0.3.0-alpha2 against my code base and got the following excpetion when running my tests: Exception in thread main java.lang.IllegalArgumentException: Unable to resolve classname: Connection, I think the problem only happens when you use the get-connection function in a macro, and the java.sql.Connection class was not already imported. The problem could be fixed by adding the fully qualified type hint java.sql.Connection instead of just Connection to get-connection. Could you please change this? Thanks, Roman. On Saturday, May 4, 2013 2:32:37 AM UTC+2, Sean Corfield wrote: Another step toward the 0.3.0 release for Clojure's JDBC wrapper. A very minor update, mostly bug fixes and consistency issues. Based on feedback from some users, the new boolean transaction? argument in some of the new API functions will probably change in alpha3 although that's not fully decided yet. Watch this space. Release 0.3.0-alpha2 on 2013-05-03 Address JDBC-51 by declaring get-connection returns java.sql.Connection Add IResultSetReadColumn protocol extension point for custom read conversions JDBC-46 Add :multi? to execute! so it can be used for repeated operations JDBC-52 Reverted specialized handling of NULL values (reopens JDBC-40) Rename :as-arrays to :as-arrays? since it is boolean Add curried version of clojure.java.jdbc.sql/as-quoted-str Officially deprecate resultset-seq For more details about past releases: https://github.com/clojure/java.jdbc -- 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 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/groups/opt_out. -- 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 --- You received this message because you are subscribed to the Google Groups
Re: Problems Bootstrapping With Shoreleave-Remote
Oh that's great Paul. Thanks for the insight. It's going to help when I get deeper into this project. Cheers Tim On Mon, May 6, 2013 at 7:44 PM, Paul deGrandis paul.degran...@gmail.comwrote: Hi Tim, I'm just seeing this now. Someone reported a similar problem on the Shoreleave mailing list not too long ago. The problem is the handling of keywords in CLJS (as you found out). Internally, Shoreleave takes care of this for you if you use the macros and not the direct functions. Moving forward, I'd suggest you use the macros and everything should work as expected (namespacing and all) If you ever run into a problem with Shoreleave, take a look at shoreleave-baseline[1]. There's a branch called `kitchen-sink` that exercises all pieces of all the shoreleave modules. It serves as a great place to harvest idiomatic examples. [1] https://github.com/shoreleave/shoreleave-baseline Cheers, Paul On Monday, May 6, 2013 12:55:04 PM UTC-7, frye wrote: Ok, I got this working too. Turns out that *namespaced keywords* do not keep their namespaces as they are transferred from Clojurescript, over to Clojure-land. This was causing my named remote function, not to be seen. Anyways, hopefully this can help someone in future. Cheers Tim On Mon, May 6, 2013 at 1:59 PM, Timothy Washington twas...@gmail.comwrote: Ok, I got this sorted. *A)* I used :optimizations :simple , and the JS files are separated out *B)* There was a stale version of clojurescript referenced in my project.clj file. I just removed that, cleaned out gen'd files with `lein cljsbuild clean`, then iii) `lein cljsbuild (once|auto)`. Then my edgar.js loads as expected. HTH. *BUT*, now when my client tries to go to *http://localhost:8080/_ shoreleave*, it gets a 404, *Remote not found.* error. Now the marginali docs (see herehttp://shoreleave.github.io/shoreleave-remote-ring/) show that the function wrap-rpc, should be setting up that just remote. Is there any other magic I need to throw in? (ns edgar.handler (:gen-class) (:import [java.io File]) (:use [clojure.core.strint] [compojure.core] [ring.middleware.params] [ring.middleware.multipart-**params] [ring.adapter.jetty]) (:require [clojure.tools.logging :as log] [compojure.handler :as handler] [compojure.route :as route] [ring.util.response :as ring-response] [clojure.java.io :as io] [shoreleave.middleware.rpc :as rpc] )) (defn *remote-fn* [arg1 remaining] thing) (rpc/defremote ^{:remote-name :handler/heartbeat} *remote-fn*) (defroutes *app-routes* (GET / [] (ring-response/file-response include/index.html { :root public})) (route/files / { :root public}) (route/resources / { :root public}) (route/not-found Not Found)) (def app (- *app-routes* *rpc/wrap-rpc* handler/site wrap-params wrap-multipart-params )) (defn -main [] (let [port (Integer. (get (System/getenv) PORT 8080))] (run-jetty app {:port port :join? false}))) *handler.clj* Thanks Tim On Mon, May 6, 2013 at 12:14 PM, Timothy Washington twas...@gmail.comwrote: Hi there, I'm trying to use shoreleave-remotehttps://github.com/shoreleave/shoreleave-remote(and shoreleave-remote-ringhttps://github.com/shoreleave/shoreleave-remote-ring/) in my Clojurescript application, and am running into a few problems. *A)* With the i) Clojurescript and ii) HTML code below, in Chrome, main.js gives me the error Uncaught Error: Namespace edgar already declared.. I'm using lein-cljsbuild, and this happens whether compiled with :optimizations :whitespace or :advanced. (ns edgar (:require-macros [shoreleave.remotes.macros :as macros]) (:require [clojure.browser.repl :as repl] [shoreleave.remotes.http-rpc :as rpc])) (rpc/remote-callback :handler/heartbeat [heartbeat] #(js/alert %)) *edgar.cljs* html head meta charset='UTF-8' titleEdgar: At your command/title /head body div id='content' script src='javascript/main.js' type='text/javascript'/**script script src='javascript/edgar.js' type='text/javascript'/**script script type='text/javascript' goog.require(edgar) /script /div /body /html *index.html* (ns edgar.handler ...) (rpc/defremote ^{:remote-name :handler/heartbeat} remote-fn [arg1 remaining] fubar ) (defroutes app-routes (GET / [] (ring-response/file-response include/index.html { :root public})) ) (def app (- app-routes rpc/wrap-rpc wrap-params wrap-multipart-params
Separating Out .cljs Content
This is on a Clojurescript compilation note. I've noticed that if I have a * main.cljs* and *my-other.cljs*, parts of *my-other.cljs* will appear in * main.cljs*. Is there a way to avoid this? Using *lein-cljsbuild*, any of the :optimization flags, gives the same result (in terms of adding all to * main.cljs*). I'd like main.cljs to just be a bootstrap file, and separately include my other files. Then at production time, I can choose flip a switch to have all the files compiled down to one compressed main.cljs. Can I do this? Thanks Tim -- -- 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: Separating Out .cljs Content
I believe the ClojureScript compiler simply looks for all .cljs files on the specified compile path. I think maybe you could put your files in different directories so they don't all get concatenated together. You can one build specify one path, and another build specify both paths. Perhaps other people have better solutions? On Tue, May 7, 2013 at 11:26 AM, Timothy Washington twash...@gmail.comwrote: This is on a Clojurescript compilation note. I've noticed that if I have a *main.cljs* and *my-other.cljs*, parts of *my-other.cljs* will appear in * main.cljs*. Is there a way to avoid this? Using *lein-cljsbuild*, any of the :optimization flags, gives the same result (in terms of adding all to *main.cljs*). I'd like main.cljs to just be a bootstrap file, and separately include my other files. Then at production time, I can choose flip a switch to have all the files compiled down to one compressed main.cljs. Can I do this? Thanks Tim -- -- 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. -- -- 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.
Accessing JSON Array data in Clojure
Hello everyone. Hopefully this is an easy question to answer. Our company is using a dashboard application that uses Clojure called Brainiac (https://github.com/cmonty/brainiac). It accesses weather data from Dark Sky. Dark Sky has upgraded their API and now the weather data is in arrays, which it wasn't previously. I can't get the data from inside the JSON arrays from Clojure. Specifically, I looking to get the data from the currently array taken from this Dark Sky data: {latitude:41.85,longitude:-87.65,timezone:America/Chicago,offset:-5,*currently:{time:1367940558,summary:Partly Cloudy,icon:partly-cloudy-day,precipIntensity:0,temperature:61.2,dewPoint:42.12,windSpeed:6.67,windBearing:14,cloudCover:0.31,humidity:0.49,pressure:1017.73,visibility:10,ozone:365.8}*,minutely:{summary:Partly cloudy for the hour.,icon:partly-cloudy-day,data:[{time:1367940540,precipIntensity:0} The Clojure code I am attempting to access the data is as follows, with the *bold* where I'm assuming I'm missing it: (ns brainiac.plugins.dark-sky (:require [brainiac.plugin :as brainiac] [clojure.contrib.json :as json :only (read-json)] [clojure.java.io :as io :only (reader)] [clojure.contrib.string :as string])) *(defn format-forecast [forecast] { :currently (:summary (:currently forecast)) :current-summary (:summary (:currently forecast)) :hour-summary (:timezone forecast) })* (defn transform [stream] (let [json (json/read-json (io/reader stream))] (assoc {} :name dark-sky :title Right now, outside... :data (format-forecast json (defn url [api-key lat lon] (format https://api.forecast.io/forecast/%s/%s,%s; api-key lat lon)) (defn configure [{:keys [api-key lat lon program-name]}] (brainiac/simple-http-plugin {:url (url api-key lat lon)} transform program-name)) Thanks for any help on this. Just starting in Clojure. -- -- 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: Separating Out .cljs Content
I haven't used clojurescript in a while, but if I recall correctly, the only way to not compile everything into a single file is to leave out the :optimization flag completely. If this is the case this should probably be considered a bug. I might be wrong though. Jonathan On Tue, May 7, 2013 at 5:49 PM, David Nolen dnolen.li...@gmail.com wrote: I believe the ClojureScript compiler simply looks for all .cljs files on the specified compile path. I think maybe you could put your files in different directories so they don't all get concatenated together. You can one build specify one path, and another build specify both paths. Perhaps other people have better solutions? On Tue, May 7, 2013 at 11:26 AM, Timothy Washington twash...@gmail.comwrote: This is on a Clojurescript compilation note. I've noticed that if I have a *main.cljs* and *my-other.cljs*, parts of *my-other.cljs* will appear in *main.cljs*. Is there a way to avoid this? Using *lein-cljsbuild*, any of the :optimization flags, gives the same result (in terms of adding all to *main.cljs*). I'd like main.cljs to just be a bootstrap file, and separately include my other files. Then at production time, I can choose flip a switch to have all the files compiled down to one compressed main.cljs. Can I do this? Thanks Tim -- -- 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. -- -- 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. -- -- 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: Accessing JSON Array data in Clojure
2013/5/7 Hawkeye02 bryan.d.hender...@gmail.com I can't get the data from inside the JSON arrays from Clojure. Specifically, I looking to get the data from the currently array taken from this Dark Sky data: Sorry but your JSON document example does not have arrays. Do you mean nested objects (maps)? Parsed JSON documents are returned as Clojure maps. In your example, the issue seems to be that keys in the map you have a strings but you are trying to access them as keywords. clojure.core/get-in is what I'd use instead [3]. And please don't use clojure.contrib.* stuff. Monolithic contrib has been deprecated a couple of years ago and is no longer maintained. Use Cheshire [1] or data.json (I don't recommend this one) [2]. Finally, take a look at http://clojure-doc.org if you need a free beginner documentation resource. 1. http://github.com/dakrone/cheshire 2. http://github.com/clojure/data.json 3. http://clojuredocs.org/clojure_core/clojure.core/get-in -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- 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: Separating Out .cljs Content
This is why I suggested organizing the project around directories and specifying different groups of them with different lein-cljsbuild groups. On Tue, May 7, 2013 at 12:24 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: I haven't used clojurescript in a while, but if I recall correctly, the only way to not compile everything into a single file is to leave out the :optimization flag completely. If this is the case this should probably be considered a bug. I might be wrong though. Jonathan On Tue, May 7, 2013 at 5:49 PM, David Nolen dnolen.li...@gmail.comwrote: I believe the ClojureScript compiler simply looks for all .cljs files on the specified compile path. I think maybe you could put your files in different directories so they don't all get concatenated together. You can one build specify one path, and another build specify both paths. Perhaps other people have better solutions? On Tue, May 7, 2013 at 11:26 AM, Timothy Washington twash...@gmail.comwrote: This is on a Clojurescript compilation note. I've noticed that if I have a *main.cljs* and *my-other.cljs*, parts of *my-other.cljs* will appear in *main.cljs*. Is there a way to avoid this? Using *lein-cljsbuild*, any of the :optimization flags, gives the same result (in terms of adding all to *main.cljs*). I'd like main.cljs to just be a bootstrap file, and separately include my other files. Then at production time, I can choose flip a switch to have all the files compiled down to one compressed main.cljs. Can I do this? Thanks Tim -- -- 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. -- -- 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. -- -- 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. -- -- 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: [ANN] java.jdbc 0.3.0-alpha2
On Tue, May 7, 2013 at 8:08 AM, Thomas Heller th.hel...@gmail.com wrote: 1) Why the keyword args to most functions? Because they're optional for most people. entities/identifiers in particular. My SQL Tables have columns like created_at, created_by, since SQL doesnt like - as separators, I still want to use - in Clojure so on insert I do (j/insert! db table {:created-by 1, :name test} :entities #(str/replace % #- _)) Or: (dsl/entities #(str/replace % #- _) (j/insert! db table {:created-by 1, :name test})) (and I'd make that a named function and wrap any blocks of DB code in dsl/entities). All is fine until I want to use the return value of insert (aka the inserted record + the generated id) which then equals Hmm, insert! should return either a sequence of just generated keys or a sequence of row change counts. Not sure how you're getting the translated column names back - can you show your exact code? In my case it would be sufficient if I could use the db map to specify this behavior, and one could still override this by just doing (j/insert! (assoc db :identifiers some-fn) table record). I realize that db is a Connectable and not always a map, but since its forced to a map under the hood anyways why not force it outside too. And specifically the db object does not take part in the SQL generation which is why this cannot work (I discussed this at length in another thread). 2) Transaction Management? I dont quite understand what the point of the :transaction? option is since you should be able to infer this information at runtime? Seems to basically duplicate what Connection.setAutoCommit already does? You would never need :transaction? unless you had some very specific, strange edge case so you can just ignore it. The implementation uses it and there have been some specific edge cases people have requested for specific DBs where they've needed to control transactions at that level. -- 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 --- 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: Separating Out .cljs Content
From the sample.project.clj: ; Determines whether the temporary JavaScript files will be left in place between ; automatic builds. Leaving them in place speeds up compilation because things can ; be built incrementally. This probably shouldn't be disabled except for troubleshooting. ; Defaults to true. :incremental true So it seems like you don't have to worry about it. :) cljsbuild does it automatically. Jonathan On Tue, May 7, 2013 at 6:32 PM, David Nolen dnolen.li...@gmail.com wrote: This is why I suggested organizing the project around directories and specifying different groups of them with different lein-cljsbuild groups. On Tue, May 7, 2013 at 12:24 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: I haven't used clojurescript in a while, but if I recall correctly, the only way to not compile everything into a single file is to leave out the :optimization flag completely. If this is the case this should probably be considered a bug. I might be wrong though. Jonathan On Tue, May 7, 2013 at 5:49 PM, David Nolen dnolen.li...@gmail.comwrote: I believe the ClojureScript compiler simply looks for all .cljs files on the specified compile path. I think maybe you could put your files in different directories so they don't all get concatenated together. You can one build specify one path, and another build specify both paths. Perhaps other people have better solutions? On Tue, May 7, 2013 at 11:26 AM, Timothy Washington twash...@gmail.comwrote: This is on a Clojurescript compilation note. I've noticed that if I have a *main.cljs* and *my-other.cljs*, parts of *my-other.cljs* will appear in *main.cljs*. Is there a way to avoid this? Using * lein-cljsbuild*, any of the :optimization flags, gives the same result (in terms of adding all to *main.cljs*). I'd like main.cljs to just be a bootstrap file, and separately include my other files. Then at production time, I can choose flip a switch to have all the files compiled down to one compressed main.cljs. Can I do this? Thanks Tim -- -- 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. -- -- 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. -- -- 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. -- -- 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. -- -- You received this message because you are subscribed to the
Re: Separating Out .cljs Content
In my project.clj file (fig.1), cljsbuild config just points to the parent source-path. Now, I plan to have *file1.cljs* in a different directory than *file2.cljs*. But what I'm finding in this case, is that compiled *file1js*is getting it's calls glommed into *main.js*. So for example in fig.1 2, edgar.js and the bottom of main.js are exactly the same. So I can't really include both of them in the same HTML page. I'm hoping there's a way to leave out the bottom of main.js. Removing the :optimizations flag doesn't do it. And having different directories, again, will separate user files, but not the cljs compiler generated main.js. :cljsbuild { :builds [{ :incremental true *:source-path public/templ/cljs* :compiler { *:output-to public/javascript/main.js * :output-dir public/javascript/ :optimizations :whitespace :pretty-print true}}]} *fig.1 - project.clj* ... }(); goog.provide(edgar); goog.require(cljs.core); goog.require(shoreleave.remotes.http_rpc); goog.require(clojure.browser.repl); shoreleave.remotes.http_rpc.remote_callback.call(null, \ufdd0'heartbeat, cljs.core.PersistentVector.fromArray([heartbeat], true), function(p1__2853_SHARP_) { return alert(p1__2853_SHARP_) }); *fig.2 - main.js* goog.provide('edgar'); goog.require('cljs.core'); goog.require('shoreleave.remotes.http_rpc'); goog.require('clojure.browser.repl'); shoreleave.remotes.http_rpc.remote_callback.call(null,\uFDD0'heartbeat,cljs.core.PersistentVector.fromArray([heartbeat], true),(function (p1__2853_SHARP_){ return alert(p1__2853_SHARP_); })); *fig.3 - edgar.js * Hmm Tim On Tue, May 7, 2013 at 12:32 PM, David Nolen dnolen.li...@gmail.com wrote: This is why I suggested organizing the project around directories and specifying different groups of them with different lein-cljsbuild groups. On Tue, May 7, 2013 at 12:24 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: I haven't used clojurescript in a while, but if I recall correctly, the only way to not compile everything into a single file is to leave out the :optimization flag completely. If this is the case this should probably be considered a bug. I might be wrong though. Jonathan On Tue, May 7, 2013 at 5:49 PM, David Nolen dnolen.li...@gmail.comwrote: I believe the ClojureScript compiler simply looks for all .cljs files on the specified compile path. I think maybe you could put your files in different directories so they don't all get concatenated together. You can one build specify one path, and another build specify both paths. Perhaps other people have better solutions? -- -- 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: Separating Out .cljs Content
Hey Jonathan, Saw that flag, and it's useful. But what I want to do is separate my main.js from all my other.js files. I've a more detailed description abouve. Maybe I just can't do this, but I thought I'd ask around. Tim On Tue, May 7, 2013 at 4:03 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: From the sample.project.clj: ; Determines whether the temporary JavaScript files will be left in place between ; automatic builds. Leaving them in place speeds up compilation because things can ; be built incrementally. This probably shouldn't be disabled except for troubleshooting. ; Defaults to true. :incremental true So it seems like you don't have to worry about it. :) cljsbuild does it automatically. Jonathan -- -- 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: I tripped out
yes, thank you, that is what I was referring to + the :or and :as like: (defn somefn [req1 req2 ;required params { :keys [a b c d e] ;optional params :or {a 1 ;optional params with preset default values other than the nil default ; b takes nil if not specified on call c 3 ; c is 3 when not specified on call d 0 ; d is 0 --//-- ; e takes nil if not specified on call } :as mapOfParamsSpecifiedOnCall }] (println req1 req2 mapOfParamsSpecifiedOnCall a b c d e) ) ;= (somefn 9 10 :b 2 :d 4) ;9 10 {:b 2, :d 4} 1 2 3 4 nil ;nil this may be good for most people, but not for me. I've tried implementing something for me but I have it only half way done (and I haven't looked at in in a few months) it's here [1] but u won't like how it looks xD meanwhile I realized what OP was saying with destructuring the arg vector. [1] https://github.com/DeMLinkS/demlinks/blob/7064df0491ea2b565f6edf18708a599af8b37a33/src/util/funxions.clj On Tue, May 7, 2013 at 9:58 AM, Pierre-Yves Ritschard p...@spootnik.orgwrote: atkaaz, you can do this: (fn [ {:keys [arg1 arg2 arg3]}] ...) On Mon, May 6, 2013 at 10:03 PM, AtKaaZ atk...@gmail.com wrote: I agree, I'm not sure what he means xD If you ask me, I'd rather have each arg be identified by a keyword instead of by order like: (somefn :arg1 somestr :arg3 100 :arg2 (+ 1 2)) or all those in a map I'll probably still do that for me, so that any function will take params like this. There's probably a way this can be done but it's not good enough for me, was it with :keys and :as map ? On Sun, May 5, 2013 at 10:52 PM, Alex Fowler alex.murat...@gmail.comwrote: Tell us more about it. On Sunday, May 5, 2013 11:54:32 AM UTC+4, JvJ wrote: Is anyone else tripped out when they realize that when you write args for a function you're basically just destructuring an arg vector? It trips me out. -- -- 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. -- -- 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. -- -- 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. -- -- 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: Separating Out .cljs Content
I tried it, and I think removing the :optimizations flag will do what you want. The problem is that cljsbuild sets it to :whitespace by default, so even if you remove it from your build it's still there. To circumvent this, I opened lein-cljsbuild-0.3.0.jar in ~/.m2/repository/lein-cljsbuild/lein-cljsbuild/0.3.0/ In the jar, in the file leiningen/cljsbuild/config.clj I changed the function (defn- default-compiler-options [target-path] {:output-to (in-target-path target-path main.js) :optimizations :whitespace :warnings true :externs [] :libs [] :pretty-print true}) to (defn- default-compiler-options [target-path] {:output-to (in-target-path target-path main.js) :warnings true :externs [] :libs [] :pretty-print true}) (just removing the :optimizations) and put it back in the jar. Which had the effect which I think you want, If I understand you correctly. I hope these instructions are clear enough. :) Jonathan On Tue, May 7, 2013 at 10:06 PM, Timothy Washington twash...@gmail.comwrote: Hey Jonathan, Saw that flag, and it's useful. But what I want to do is separate my main.js from all my other.js files. I've a more detailed description abouve. Maybe I just can't do this, but I thought I'd ask around. Tim On Tue, May 7, 2013 at 4:03 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: From the sample.project.clj: ; Determines whether the temporary JavaScript files will be left in place between ; automatic builds. Leaving them in place speeds up compilation because things can ; be built incrementally. This probably shouldn't be disabled except for troubleshooting. ; Defaults to true. :incremental true So it seems like you don't have to worry about it. :) cljsbuild does it automatically. Jonathan -- -- 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. -- -- 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: Separating Out .cljs Content
*DON'T DO IT* I just realised, if the :optimizations missing triggers this behaviour, it should be possible to set it to nil, and it was! So try ':optimizations nil' in your build. Jonathan On Tue, May 7, 2013 at 10:20 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: I tried it, and I think removing the :optimizations flag will do what you want. The problem is that cljsbuild sets it to :whitespace by default, so even if you remove it from your build it's still there. To circumvent this, I opened lein-cljsbuild-0.3.0.jar in ~/.m2/repository/lein-cljsbuild/lein-cljsbuild/0.3.0/ In the jar, in the file leiningen/cljsbuild/config.clj I changed the function (defn- default-compiler-options [target-path] {:output-to (in-target-path target-path main.js) :optimizations :whitespace :warnings true :externs [] :libs [] :pretty-print true}) to (defn- default-compiler-options [target-path] {:output-to (in-target-path target-path main.js) :warnings true :externs [] :libs [] :pretty-print true}) (just removing the :optimizations) and put it back in the jar. Which had the effect which I think you want, If I understand you correctly. I hope these instructions are clear enough. :) Jonathan On Tue, May 7, 2013 at 10:06 PM, Timothy Washington twash...@gmail.comwrote: Hey Jonathan, Saw that flag, and it's useful. But what I want to do is separate my main.js from all my other.js files. I've a more detailed description abouve. Maybe I just can't do this, but I thought I'd ask around. Tim On Tue, May 7, 2013 at 4:03 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: From the sample.project.clj: ; Determines whether the temporary JavaScript files will be left in place between ; automatic builds. Leaving them in place speeds up compilation because things can ; be built incrementally. This probably shouldn't be disabled except for troubleshooting. ; Defaults to true. :incremental true So it seems like you don't have to worry about it. :) cljsbuild does it automatically. Jonathan -- -- 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. -- -- 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: Separating Out .cljs Content
That's an interesting tweak. Indeed, I no longer have any of my contents in main.js. But I also get a JS error in my browser. goog.provide('edgar'); Uncaught ReferenceError: goog is not defined goog.require('cljs.core'); goog.require('shoreleave.remotes.http_rpc'); goog.require('clojure.browser.repl'); shoreleave.remotes.http_rpc.remote_callback.call(null,\uFDD0'heartbeat, cljs.core.PersistentVector.fromArray([heartbeat], true),(function ( p1__2853_SHARP_){ return alert(p1__2853_SHARP_); })); *my-file.js* Same thing happens in main.js goog.addDependency(base.js, ['goog'], []); Uncaught ReferenceError: goog is not defined goog.addDependency(../cljs/core.js, ['cljs.core'], ['goog.string', 'goog.array', 'goog.object', 'goog.string.format', 'goog.string.StringBuffer']); goog.addDependency(../clojure/browser/event.js, ['clojure.browser.event'], ['cljs.core', 'goog.events.EventType', 'goog.events.EventTarget', 'goog.events']); ... goog.addDependency(../shoreleave/remotes/http_rpc.js, [ 'shoreleave.remotes.http_rpc'], ['cljs.core', 'shoreleave.remotes.xhr', 'cljs.reader']); goog.addDependency(../edgar.js, ['edgar'], ['cljs.core', 'clojure.browser.repl', 'shoreleave.remotes.http_rpc']); *main.js * Hmm Tim On Tue, May 7, 2013 at 4:37 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: *DON'T DO IT* I just realised, if the :optimizations missing triggers this behaviour, it should be possible to set it to nil, and it was! So try ':optimizations nil' in your build. Jonathan On Tue, May 7, 2013 at 10:20 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: I tried it, and I think removing the :optimizations flag will do what you want. The problem is that cljsbuild sets it to :whitespace by default, so even if you remove it from your build it's still there. To circumvent this, I opened lein-cljsbuild-0.3.0.jar in ~/.m2/repository/lein-cljsbuild/lein-cljsbuild/0.3.0/ In the jar, in the file leiningen/cljsbuild/config.clj I changed the function (defn- default-compiler-options [target-path] {:output-to (in-target-path target-path main.js) :optimizations :whitespace :warnings true :externs [] :libs [] :pretty-print true}) to (defn- default-compiler-options [target-path] {:output-to (in-target-path target-path main.js) :warnings true :externs [] :libs [] :pretty-print true}) (just removing the :optimizations) and put it back in the jar. Which had the effect which I think you want, If I understand you correctly. I hope these instructions are clear enough. :) Jonathan On Tue, May 7, 2013 at 10:06 PM, Timothy Washington twash...@gmail.comwrote: Hey Jonathan, Saw that flag, and it's useful. But what I want to do is separate my main.js from all my other.js files. I've a more detailed description abouve. Maybe I just can't do this, but I thought I'd ask around. Tim On Tue, May 7, 2013 at 4:03 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: From the sample.project.clj: ; Determines whether the temporary JavaScript files will be left in place between ; automatic builds. Leaving them in place speeds up compilation because things can ; be built incrementally. This probably shouldn't be disabled except for troubleshooting. ; Defaults to true. :incremental true So it seems like you don't have to worry about it. :) cljsbuild does it automatically. Jonathan -- -- 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: Accessing JSON Array data in Clojure
Michael, Thank you for the response and references. I will try your suggestions and get back to you. My terminology isn't the best, thanks for deciphering. On Tuesday, May 7, 2013 11:27:01 AM UTC-5, Michael Klishin wrote: 2013/5/7 Hawkeye02 bryan.d@gmail.com javascript: I can't get the data from inside the JSON arrays from Clojure. Specifically, I looking to get the data from the currently array taken from this Dark Sky data: Sorry but your JSON document example does not have arrays. Do you mean nested objects (maps)? Parsed JSON documents are returned as Clojure maps. In your example, the issue seems to be that keys in the map you have a strings but you are trying to access them as keywords. clojure.core/get-in is what I'd use instead [3]. And please don't use clojure.contrib.* stuff. Monolithic contrib has been deprecated a couple of years ago and is no longer maintained. Use Cheshire [1] or data.json (I don't recommend this one) [2]. Finally, take a look at http://clojure-doc.org if you need a free beginner documentation resource. 1. http://github.com/dakrone/cheshire 2. http://github.com/clojure/data.json 3. http://clojuredocs.org/clojure_core/clojure.core/get-in -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- 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: Separating Out .cljs Content
You have to import the google closure library when compiling without optimisation. Given your build, probably something like this: script type=text/javascript src=public/javascript/goog/base.js/script Just make sure the base.js file is actually there. Jonathan On Tue, May 7, 2013 at 10:54 PM, Timothy Washington twash...@gmail.comwrote: That's an interesting tweak. Indeed, I no longer have any of my contents in main.js. But I also get a JS error in my browser. goog.provide('edgar'); Uncaught ReferenceError: goog is not defined goog.require('cljs.core'); goog.require('shoreleave.remotes.http_rpc'); goog.require('clojure.browser.repl'); shoreleave.remotes.http_rpc.remote_callback.call(null,\uFDD0'heartbeat, cljs.core.PersistentVector.fromArray([heartbeat], true),(function ( p1__2853_SHARP_){ return alert(p1__2853_SHARP_); })); *my-file.js* Same thing happens in main.js goog.addDependency(base.js, ['goog'], []); Uncaught ReferenceError: goog is not defined goog.addDependency(../cljs/core.js, ['cljs.core'], ['goog.string', 'goog.array', 'goog.object', 'goog.string.format', 'goog.string.StringBuffer']); goog.addDependency(../clojure/browser/event.js, ['clojure.browser.event' ], ['cljs.core', 'goog.events.EventType', 'goog.events.EventTarget', 'goog.events']); ... goog.addDependency(../shoreleave/remotes/http_rpc.js, [ 'shoreleave.remotes.http_rpc'], ['cljs.core', 'shoreleave.remotes.xhr', 'cljs.reader']); goog.addDependency(../edgar.js, ['edgar'], ['cljs.core', 'clojure.browser.repl', 'shoreleave.remotes.http_rpc']); *main.js * Hmm Tim On Tue, May 7, 2013 at 4:37 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: *DON'T DO IT* I just realised, if the :optimizations missing triggers this behaviour, it should be possible to set it to nil, and it was! So try ':optimizations nil' in your build. Jonathan On Tue, May 7, 2013 at 10:20 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: I tried it, and I think removing the :optimizations flag will do what you want. The problem is that cljsbuild sets it to :whitespace by default, so even if you remove it from your build it's still there. To circumvent this, I opened lein-cljsbuild-0.3.0.jar in ~/.m2/repository/lein-cljsbuild/lein-cljsbuild/0.3.0/ In the jar, in the file leiningen/cljsbuild/config.clj I changed the function (defn- default-compiler-options [target-path] {:output-to (in-target-path target-path main.js) :optimizations :whitespace :warnings true :externs [] :libs [] :pretty-print true}) to (defn- default-compiler-options [target-path] {:output-to (in-target-path target-path main.js) :warnings true :externs [] :libs [] :pretty-print true}) (just removing the :optimizations) and put it back in the jar. Which had the effect which I think you want, If I understand you correctly. I hope these instructions are clear enough. :) Jonathan On Tue, May 7, 2013 at 10:06 PM, Timothy Washington twash...@gmail.comwrote: Hey Jonathan, Saw that flag, and it's useful. But what I want to do is separate my main.js from all my other.js files. I've a more detailed description abouve. Maybe I just can't do this, but I thought I'd ask around. Tim On Tue, May 7, 2013 at 4:03 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: From the sample.project.clj: ; Determines whether the temporary JavaScript files will be left in place between ; automatic builds. Leaving them in place speeds up compilation because things can ; be built incrementally. This probably shouldn't be disabled except for troubleshooting. ; Defaults to true. :incremental true So it seems like you don't have to worry about it. :) cljsbuild does it automatically. Jonathan -- -- 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. -- -- 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
Parallel code execution in ClojureScript?
Hi: In Javascript language, and while the language is inherently functional, Javascript's *implementation* until now, does not support parallel code execution against available CPU cores, unlike Erlang for example or Clojure on JVM, so I am thinking that the actor pattern in Clojure when targetting JavaScript does not run in parallel natively. Am I right? -Ghassan. -- -- 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: Separating Out .cljs Content
That fixed one of the dependency problems. But now there are a bunch of other dependency errors. AndI'm not sure if I have to independently include all the library generated .js files. It looks like you have no choice but to glom your .js code into main.js. Hmmm. 1. Uncaught ReferenceError: goog is not defined http_rpc.js:1http://localhost:8080/javascript/shoreleave/remotes/http_rpc.js 1. Uncaught ReferenceError: shoreleave is not defined edgar.js:1http://localhost:8080/javascript/edgar.js Tim On Tue, May 7, 2013 at 5:26 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: You have to import the google closure library when compiling without optimisation. Given your build, probably something like this: script type=text/javascript src=public/javascript/goog/base.js/script Just make sure the base.js file is actually there. Jonathan -- -- 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: Accessing JSON Array data in Clojure
You might want to check out Clojure Data Analysis Handbook by Eric Rochester. There is an example using org.clojure/data.json and Incanter to read JSON format into an Incanter dataset. You might find other recipes in the book useful as well: http://www.packtpub.com/clojure-data-analysis-cookbook/book I'm going through it (slowly) and learning a lot. It's not a beginner's book. Full blast functional programming for sure. Regards, Greg -- -- 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: Import java classes in clojure
Did you try the downloads link here? http://openrules.com/jsr331/ On May 6, 2013 12:10 AM, Caocoa p.de.bois...@gmail.com wrote: Well, so I just tried the following commands: user= (ns mx.clojure.contemporary.pitch-centricity-and-symmetry #_= (:import [jm.music.data #_= Score #_= Part #_= Phrase #_= Note]) #_= (:import [jm.music.tools #_= Mod]) #_= (:import [jm JMC]) #_= (:import [jm.util Write])) jm.util.Write mx.clojure.contemporary.pitch-centricity-and-symmetry= It seems to work, right? :) Have I imported jMusic in a clean way? But I've still a problem with javax :-( On Monday, May 6, 2013 12:04:39 AM UTC+2, Caocoa wrote: Hi all! I'm a new Clojure user. I'm trying to import some java classes in order to use them with overtone, but I fail :/ Would you help me? Thanks a lot in advance for your answer. Here is the bug: user= (:import [javax.constraints #_= Problem #_= ProblemFactory #_= Var #_= Solver #_= Objective #_= VarSet]) CompilerException java.lang.RuntimeException: java.lang.**ClassNotFoundException: javax.constraints, compiling:(NO_SOURCE_PATH:1) user= (:import [jm.music.data #_= Score #_= Part #_= Phrase #_= Note]) CompilerException java.lang.RuntimeException: java.lang.**ClassNotFoundException: jm.music.data, compiling:(NO_SOURCE_PATH:1) As a newbie, I have several questions: - I've found jMusic here: http://sourceforge.net/** projects/jmusic/?source=dlphttp://sourceforge.net/projects/jmusic/?source=dlp. I hope it's the latest version. I've copied it in /usr/lib/jvm/java-7-openjdk/**jre/lib/ext but I still can't invoke any jm.music.data classes. How could I include it int the classpath. I thought that folder was already included. - How can I download and properly install javax.constraints? I don't even know where I can find that package. Some data about my system: - uname -a gives me back: Linux C40C04 3.8.11-1-ARCH #1 SMP PREEMPT Wed May 1 20:18:57 CEST 2013 x86_64 GNU/Linux - When I look for jMusic or javax in package database with my package manager (I use yaourt), I don't find anything. - Here is what java packages I've already installed: $ yaourt -Qs java extra/apache-ant 1.9.0-1 A java-based build tool extra/ca-certificates-java 20121112+nmu2-1 Common CA certificates (JKS keystore) extra/eclipse 4.2.2-1 An IDE for Java and other languages extra/gjs 1.36.1-1 Javascript Bindings for GNOME local/hsqldb-java 1:1.8.0.10-2 HSQLDB Java libraries extra/java-activation-gnu 1.1.1-1 JavaBeans Activation Framework (JAF), framework for declaring what beans operate on what MIME type data local/java-commons-email 1.2-1 Library for sending e-mail from Java. extra/java-gnumail 1.1.2-1 GNU implementation of the JavaMail API specification, version 1.3 extra/jdk7-openjdk 7.u21_2.3.9-1 Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - SDK extra/jre7-openjdk 7.u21_2.3.9-1 Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - Full Java runtime environment - needed for executing Java GUI and Webstart programs extra/jre7-openjdk-headless 7.u21_2.3.9-1 Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - Minimal Java runtime - needed for executing non GUI Java programs community/netbeans 7.3-1 IDE for Java, HTML5, PHP, Groovy, C and C++$ yaourt -Qs java extra/apache-ant 1.9.0-1 A java-based build tool extra/ca-certificates-java 20121112+nmu2-1 Common CA certificates (JKS keystore) extra/eclipse 4.2.2-1 An IDE for Java and other languages extra/gjs 1.36.1-1 Javascript Bindings for GNOME local/hsqldb-java 1:1.8.0.10-2 HSQLDB Java libraries extra/java-activation-gnu 1.1.1-1 JavaBeans Activation Framework (JAF), framework for declaring what beans operate on what MIME type data local/java-commons-email 1.2-1 Library for sending e-mail from Java. extra/java-gnumail 1.1.2-1 GNU implementation of the JavaMail API specification, version 1.3 extra/jdk7-openjdk 7.u21_2.3.9-1 Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - SDK extra/jre7-openjdk 7.u21_2.3.9-1 Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - Full Java runtime environment - needed for executing Java GUI and Webstart programs extra/jre7-openjdk-headless 7.u21_2.3.9-1 Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - Minimal Java runtime - needed for executing non GUI Java programs
Re: Parallel code execution in ClojureScript?
It can probably be done with HTML 5 Workers in browsers that support it, On Tuesday, May 7, 2013, Ghassan Ayesh wrote: Hi: In Javascript language, and while the language is inherently functional, Javascript's *implementation* until now, does not support parallel code execution against available CPU cores, unlike Erlang for example or Clojure on JVM, so I am thinking that the actor pattern in Clojure when targetting JavaScript does not run in parallel natively. Am I right? -Ghassan. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.comjavascript:_e({}, 'cvml', '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 javascript:_e({}, 'cvml', 'clojure%2bunsubscr...@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 javascript:_e({}, 'cvml', 'clojure%2bunsubscr...@googlegroups.com');. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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.