#clojure logs

2015-09-22

00:21rritochIf there any shortcut, short of looping, to convert a vector of vectors into double[][] , such as [[1 2] [2.1 0]], into-array doesn't accept dimensions so it doesn't seem suitable.
00:24rritochFor now I'll use doseq + into-array but it seems like there must be a faster way.
00:31rritochWell doseq won't work, there's no counter
02:43elvis4526Why I can't redef a function used in (partial) with (with-redefs) ?
06:40visofhi guys
06:40visofhttps://gist.github.com/aibrahim/f1f08c22f7b8b2a764eb
06:49neurostormhowto write a boolean? function?
06:51noncomneurostorm: what do you mean?
06:52neurostormlike string?
06:52noncomvisof: what do you mean there?
06:52noncomneurostorm: ah, you mean predicates
06:52neurostormfunction which tests if argument is a boolean...
06:53noncomboolean? and fn? or ifn? (depends on your particular need)
06:53noncomneurostorm: oh wait, they did not yet implement the boolean? predicate...
06:53noncomneurostorm: so it will be (or (true? x) (false? x))
06:53noncomyes. it looks stupid :D
06:53neurostormthx. got it :-)
06:54visofnoncom: you didn't get what i meant?
06:54noncomneurostorm: this one ticket i opened looong ago: http://dev.clojure.org/jira/browse/CLJ-1298
06:54noncomvisof: oh, wait, i read again
06:54visofnoncom: ok
06:56neurostormbtw, like the ticket.
06:59noncomvisof: hmmm read again, really, the text is hard to follow, sorry... as i see, you need to rearrange a vector according to some complex rule. i cannot clearly make out the details of algorithm from this text, but from the first glance i think that i would go with a loop-recur over original vector indices
07:00noncomthen you can freely peek into any other elements in the vector, relative to your current index
07:00noncomwith (nth coll idx)
07:00xeqiI
07:00noncomxeqi: You
07:01xeqiI'm still getting used to writing on my atreus and hit the wrong thing
07:02noncomxeqi: don't worry, that was cool :D
07:02noncomxeqi: what is atreus btw?
07:03xeqinoncom: http://atreus.technomancy.us/
07:04noncomxeqi: wow. how does it feel ?
07:07xeqiI like it so far.though getting my hands used to being held in a different position took some time. I've gotten used to it for most writing prose. not quite there for code yet
07:17xeqivisof: i'd end up doing a loop/recur with an accumulator where each pass would read more off the list based on your movement criteria. something like https://www.refheap.com/109836
07:20noncomxeqi: oh, you write prose! anything published or available for reading? :)
07:30irctcHi all.
07:31noncomirctc: hello
07:31irctcHi noncom. :)
07:32irctcI am new to Clojure and I just discovered this channel.
07:32noncomirctc: that's great! welcome!
07:33irctcThanks. :)
07:33irctcI really like the language. I want to create my first web application in Clojure.
07:34noncomirctc: so it will be clojure + clojuresctipt then i guess :)
07:34irctcYea, that's the plan. :)
07:34irctcAlthough I am still strugling to get a grasp of all the tools out there.
07:35noncomirctc: so, be sure to also manifest your presense in #clojurescript
07:35irctcI just did. :)
07:35noncomirctc: yeah, tools, libs, things... you can always ask here. usually there's somebody around, it's very likely you'll get some answer or advice
07:36irctcI've been learning Clojure for about a month and I finally feel ready to dive in to a real project. But I don't know how different Clojurescript really is.
07:36irctcIs it basically Clojure just compiled to JS?
07:36irctcThanks noncom. :)
07:37noncomirctc: well, yes.. but there are differences https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure
07:38irctcThanks. :)
07:39irctcI am planning on using Compojure. I see a lot of people in the community like it and it seems like a good choice for a newcomer like me.
07:39irctcAlong with Leiningen ofcourse. :)
07:40noncomirctc: yeah it is also kinda a standard - compojure is for http routing
07:40noncomand leiningen is the project management tool , you won't get far with any clojure app without it
07:40noncomthere's also boot, an interesting tool, but i had no chance to look at it yet
07:40irctcThat's what seems to be the theme of all the tutorials and books I've read. :)
07:41noncom^)
07:42noncomoops
07:42noncom:)
07:42irctcI like what I read about this tool called Hiccup. It seems like a cool and easy way to generate HTML.
07:43noncomyeah, i use it all the time now
07:43noncomand reagent
07:44irctcDo you use JDBC to connect to your databases or is there another more idiomatic way to do it in Clojure?
07:44irctcWhat is reagent?
07:44noncomi am also a noob in clojure web dev. i have always been more non-web dev. and i still am. but recently i decided to take a web project too
07:45noncomthere are clojure wrappers for jdbc, but if you use db like sql or mongo you can use like korma lib or monger lib or other similar
07:45noncomreagent is a wrapper for facebooks react
07:45noncommakes updating components on the page easier... but it all depends on your architecture
07:45noncomirctc: maybe you should read what's there under the Documentation section here: http://www.luminusweb.net/
07:45irctcI am thinking of just using a MySQL db as I am not very familiar with other DBMS out there.
07:46noncomirctc: if you plan to use mysql then try the korma lib
07:46rritochDoes anyone happen to know the ideal 'frames per second' for video? I made a small 3D rendering engine for clojure by all of my cores are near maxxed when it's running. I didn't do anything to slow the engine yet but I need to. The loop uses Thread/yeild but that doesn't do much.
07:47noncomrritoch: if you're talking about games, then there are 2 possible max fps
07:47noncom1) capped, usually to 60hz or 30hz or 25hz, 2) uncapped - that's as far as you can go
07:48noncombut the 3d engines that i was using never load CPU up to 100% even if they give 3000fps on a simple scene
07:48rritochnoncom: Thanks. Right now it's uncapped and I'm probably cooking my CPU when it's running.
07:48noncomrritoch: is your engine software?
07:48noncomor opengl?
07:48rritochnoncom: Just software/swing
07:48noncomrritoch: then yes, you can cook your CPU with it, you should limit the fps
07:49noncomrritoch: you could use adaptive limiting
07:49irctcThanks for the advice noncom. Korma seems cool. I'm gona go try out some of these tools you recommended. :)
07:49rritochnoncom: I may offload it to GPU eventually, but for now this is just for fun to re-familiarize myself with clojure.
07:49irctcTake care everyone and have a nice day. :)
07:49noncomirctc: yeah, the luminus website i referenced, can give you a very easy introduction. thanks, you too :)
07:50rritochnuncom: I'll try 60hz and see if that lowers my cores any.
07:50noncomrritoch: so, if i get you correctly, you do all this polygins, matrix, projections 3d stuff in software and reder polygons, right?
07:52rritochnoncom: Well, it's a simplifed engine, it just uses projections and bufferedimages for tripple-buffering. It does have a double[] to hold a z value eventually to manage overlaying.
07:53noncomrritoch: i see. just wanted to know what amount of computations you're assuming
07:53noncomtry adaptive capping, like when game logic (not rendering) takes more, you sleep less
07:59rritochOther than the cores being maxxed, i'm just happy to see that clojure handles it well. We'll see what happens when I start building more complex objects.
08:00noncomrritoch: yeah, an interesting experiment. i did not have enough guts to perform vertex transformations and all algebra in clojure, i used java for these parts
08:03rritochnoncom: Same here, I offloaded all of the heavy lifting to java. Clojure is providing the self-rendering objects and calling java side transformations.
08:05rritochI'm not particularly familiar with any clojure support for matrix operations so it was a quick solution. The Projections are all persistent so they play nice with clojure.
08:06noncomwell, there is a matrix lib which ppl say is very neat
08:06noncombut interesting insight into your experience, good to know :)
08:19rritochWow, that helped! Thanks noncom. I reduced it to 60hz and CPU usage is now ~ 15%
08:24noncomcool :)
08:31noncomrritoch: if you want your rendering remain at 60fps even when you add logic, you can calculate the length of required delay. like estimated is 1000/60, but with some logic you get real 58 fps, so you measure it and take 1000/58, and 1000/60 - (1000/60 - 1000/58) is your new delay
08:31noncomif i remember all the numbers right
08:34rritochnoncom: I'm using System/nanotime and precalculate the rendering time of 1/60 seconds in nanoseconds. If there's time remaining it sleeps for the remaining time (reduced to milliseconds) otherwise it just yields.
08:37noncomyeah, something like that :)
10:16dxlr8rhello, something really easy but strange. when I run lein uberjar, and then run the jar, the jar won't print to stdout with the "print" function, only with "println". even if I append "\n" to print it won't work
10:16dxlr8ryou have any clues to why?
10:18noncomdxlr8r: idk, maybe you need (.flush *out*)
10:18noncommaybe "\n" is not enough
10:18dxlr8rsometimes I don't want to use \n though.
10:19noncommy only guess is that println also does flush on *out* and maybe *err*
10:20noncomdxlr8r: also if you need advanced terminal output control, look at ncurses and lantern
10:20noncomah, btw, clojure has (flush) function
10:21dxlr8rdon't need advanced :)
10:21noncomwhich is precisely (.flush *out*)
10:21noncomdid flush work for you?
10:21dxlr8rok
10:21dxlr8rno
10:21noncom:(
10:21dxlr8r(do (flush) (print errors?))
10:21dxlr8rlike that?
10:21noncomno
10:21noncom,(do (print "heeey") (flush))
10:22clojurebotheeey
10:23dxlr8rthx noncom , seems to work :)
10:23akabanderDoes clojurebot behave more like a repl or more like a jar?
10:23noncomcool!
10:23noncomakabander: hmmm to me repl and jar are orthogonal concepts... :/
10:24noncomeven unrelated
10:24akabanderYeah, I'm probably conflating. Just wondering if (print "hey") on the repl might be misleading because the repl does a (flush)?
10:25akabanderSo does clojurebot also do a (flush) before returning?
10:25noncomakabander: yes, clojurebot seems to create a separate output channel for each interaction
10:25noncom,*ou*
10:25clojurebot#error {\n :cause "Unable to resolve symbol: *ou* in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: *ou* in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: *ou* in this co...
10:25noncom,*out*
10:25clojurebot#object[java.io.StringWriter 0x55f97cd8 ""]
10:25noncom,*out*
10:25clojurebot#object[java.io.StringWriter 0x627f8247 ""]
10:25noncom,*out*
10:25clojurebot#object[java.io.StringWriter 0x11c4c01a ""]
10:25noncom,*out*
10:25clojurebot#object[java.io.StringWriter 0x352378f3 ""]
10:25noncomsee, different, each time
10:25noncomso it utilizes it, flushes and releases
10:25akabanderAha. Enlightening. Thanks!
10:56sdegutisWhy this not work?
10:56sdegutis,(->> [:a 1 :b 2] (reduce into {}))
10:56clojurebot#error {\n :cause "Don't know how to create ISeq from: clojure.lang.Keyword"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "Don't know how to create ISeq from: clojure.lang.Keyword"\n :at [clojure.lang.RT seqFrom "RT.java" 535]}]\n :trace\n [[clojure.lang.RT seqFrom "RT.java" 535]\n [clojure.lang.RT seq "RT.java" 516]\n [clojure.core$seq__4116 invokeStatic "core.clj" 137]\n ...
10:57noncomsdegutis: coz:
10:57noncom,(into {} :a)
10:57clojurebot#error {\n :cause "Don't know how to create ISeq from: clojure.lang.Keyword"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "Don't know how to create ISeq from: clojure.lang.Keyword"\n :at [clojure.lang.RT seqFrom "RT.java" 535]}]\n :trace\n [[clojure.lang.RT seqFrom "RT.java" 535]\n [clojure.lang.RT seq "RT.java" 516]\n [clojure.core$seq__4116 invokeStatic "core.clj" 137]\n ...
10:57sdegutisoh
10:57sdegutisThanks noncom.
11:02jeremyheiler,(->> [[:a 1] [:b 2]] (reduce into {}))
11:02clojurebot#error {\n :cause "Don't know how to create ISeq from: clojure.lang.Keyword"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "Don't know how to create ISeq from: clojure.lang.Keyword"\n :at [clojure.lang.RT seqFrom "RT.java" 535]}]\n :trace\n [[clojure.lang.RT seqFrom "RT.java" 535]\n [clojure.lang.RT seq "RT.java" 516]\n [clojure.lang.ATransientMap conj "ATransientMap.java" 4...
11:02jeremyheiler,(doc into)
11:02clojurebot"([to from] [to xform from]); Returns a new coll consisting of to-coll with all of the items of from-coll conjoined. A transducer may be supplied."
11:03sdegutisI'm very confused. How do you turn [[:a 50] [:a 10] [:b 20]] into {:a [50 10], :b [20]} ?
11:03sdegutisOh wait, merge-with I think
11:04jeremyheiler,(->> [[[:a 1]] [[:b 2]]] (reduce into {}))
11:04clojurebot{:a 1, :b 2}
11:04sdegutis,(->> [[:a 50] [:a 10] [:b 20]] (map (partial hash-map)) (apply merge-with conj))
11:04clojurebot#error {\n :cause "No value supplied for key: [:a 50]"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "No value supplied for key: [:a 50]"\n :at [clojure.lang.PersistentHashMap create "PersistentHashMap.java" 77]}]\n :trace\n [[clojure.lang.PersistentHashMap create "PersistentHashMap.java" 77]\n [clojure.core$hash_map invokeStatic "core.clj" 374]\n [clojure.core$hash_map doIn...
11:04jeremyheiler,(into {} [[:a 50] [:a 10] [:b 20]])
11:04clojurebot{:a 10, :b 20}
11:05jeremyheileroh i see what you're doing
11:05jeremyheiler,(doc merge-width)
11:05clojurebotTitim gan éirí ort.
11:05jeremyheiler,(doc merge-with)
11:05clojurebot"([f & maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping(s) from the latter (left-to-right) will be combined with the mapping in the result by calling (f val-in-result val-in-latter)."
11:07sdegutisYeah I *almost* got it.
11:07sdegutisThis is the closest I have gotten, but it's still not right:
11:07sdegutis,(->> [[:a 50] [:a 10] [:a 30] [:b 20]] (map (partial apply hash-map)) (apply merge-with vector))
11:07clojurebot{:b 20, :a [[50 10] 30]}
11:08sdegutisMaybe I need some intermediate step that creates vectors out of all its vals? That would suck though.
11:08jeremyheiler(reduce (fn [m [k v]] (update-in m [k] #(if (vector? %) (conj % v) [v])) {} [[:a 50] [:a 10] [:a 30] [:b 20]])
11:08jeremyheiler,(reduce (fn [m [k v]] (update-in m [k] #(if (vector? %) (conj % v) [v])) {} [[:a 50] [:a 10] [:a 30] [:b 20]])
11:08clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
11:08jeremyheiler,(reduce (fn [m [k v]] (update-in m [k] #(if (vector? %) (conj % v) [v]))) {} [[:a 50] [:a 10] [:a 30] [:b 20]])
11:08clojurebot{:a [50 10 30], :b [20]}
11:09sdegutis,(->> [[:a 50] [:a 10] [:a 30] [:b 20]] (map (fn [[a b]] [a [b]])) (map (partial apply hash-map)) (apply merge-with concat))
11:09clojurebot{:b [20], :a (50 10 30)}
11:09jeremyheiler,(reduce (fn [m [k v]] (update-in m [k] #(if (nil? %) [v] (conj % v)))) {} [[:a 50] [:a 10] [:a 30] [:b 20]])
11:09clojurebot{:a [50 10 30], :b [20]}
11:09sdegutisThis one I just did works, but it requires a custom function which I almost always consider an inferior solution.
11:10sdegutisGranted, it does it for destructuring and embedding into a new vector, so it's not that bad.
11:10akabanderIs there an elegant way to get '( :a :a :c :c :c :b ) => { :a 2 :c 3 :b 1 } ?
11:10oddcullyisn't the last one just group-by?
11:11jeremyheiler,(doc group-by)
11:11clojurebot"([f coll]); Returns a map of the elements of coll keyed by the result of f on each element. The value at each key will be a vector of the corresponding elements, in the order they appeared in coll."
11:11sdegutisoddcully: which one?
11:11jeremyheiler(group-by identity [:a :a :c :c :c :b])
11:12jeremyheiler,(group-by identity [:a :a :c :c :c :b])
11:12clojurebot{:a [:a :a], :c [:c :c :c], :b [:b]}
11:12akabanderClose, I can do another pass to get what I want
11:12jeremyheiler,(group-by first [[:a 50] [:a 10] [:a 30] [:b 20]])
11:12clojurebot{:a [[:a 50] [:a 10] [:a 30]], :b [[:b 20]]}
11:14jeremyheiler,(reduce-kv (fn [m k v] (assoc m k (map second v))) (group-by first [[:a 50] [:a 10] [:a 30] [:b 20]])
11:14clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
11:15jeremyheiler,(reduce-kv (fn [m k v] (assoc m k (map second v))) (group-by first [[:a 50] [:a 10] [:a 30] [:b 20]]))
11:15clojurebot#error {\n :cause "Wrong number of args (2) passed to: core/reduce-kv"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (2) passed to: core/reduce-kv"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 36]\n [sandbox$eval254 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbo...
11:16schmirhow about frequencies?
11:17schmir,(doc frequencies)
11:17clojurebot"([coll]); Returns a map from distinct items in coll to the number of times they appear."
11:17jeremyheiler,(frequencies [:a :a :c :c :c :b])
11:17clojurebot{:a 2, :c 3, :b 1}
11:17jeremyheilerta da!
11:17jeremyheilernice call, schmir
11:17akabanderSheesh
11:17akabanderThat was easy! :^)
11:17akabanderThanks, schmir
11:18akabanderIt seemed like something that would have already been written...
11:19jeremyheiler,(reduce-kv #(assoc %1 %2 (map second %3)) {} (group-by first [[:a 50] [:a 10] [:a 30] [:b 20]]))
11:19clojurebot{:a (50 10 30), :b (20)}
11:19jeremyheilersdegutis: ^
11:19sdegutisNice, thanks.
11:21jeremyheilerstill has a custom function tho :-/ lol
11:21jeremyheileri think a map-kv would be nice in this case
11:22jeremyheilermaybe...
11:23jeremyheilerseparate map-keys and map-vals
11:24oddcullymany libs have those. e.g. plumbing
11:25jeremyheileryeah
11:25jeremyheilercool
12:12justin_smithjeremyheiler: ,(reduce (fn [m [k v]] (update-in m [k] #(if (nil? %) [v] (conj % v)))) {} [[:a 50] [:a 10] [:a 30] [:b 20]])
12:13justin_smitherr
12:13justin_smithjeremyheiler: ,(reduce (fn [m [k v]] (update-in m [k] (fnil conj []) v)) {} [[:a 50] [:a 10] [:a 30] [:b 20]])
12:14justin_smithjeremyheiler: I know you found group-by, but the fnil pattern is still sometimes applicable
12:14jeremyheilerah, i always forget about fnil!
12:14justin_smith,(reduce (fn [m [k v]] (update-in m [k] (fnil conj []) v)) {} [[:a 50] [:a 10] [:a 30] [:b 20]])
12:14clojurebot{:a [50 10 30], :b [20]}
12:19amalloy,(apply merge-with into {} (for [[k v] [[:a 50] [:a 10] [:a 30] [:b 20]]] [k [v]]))
12:19clojurebot#error {\n :cause "clojure.lang.Keyword cannot be cast to java.util.Map$Entry"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.Keyword cannot be cast to java.util.Map$Entry"\n :at [clojure.core$key invokeStatic "core.clj" 1499]}]\n :trace\n [[clojure.core$key invokeStatic "core.clj" 1499]\n [clojure.core$merge_with$merge_entry__4637 invoke "core.clj" 2932]\n [clojure.l...
12:19amalloy,(apply merge-with into {} (for [[k v] [[:a 50] [:a 10] [:a 30] [:b 20]]] {k [v]}))
12:19clojurebot{:a [50 10 30], :b [20]}
12:20jeremyheilerheh, nice
12:20justin_smithfor a given task, justin_smith will find a way to solve it with reduce, and amalloy will find a way to solve it with for
12:20amalloysounds about right
12:21amalloyi think if you took away every clojure function but into and for, i'd still be content
12:22sobelyou only need fold anyway
12:23justin_smithsobel: AKA reduce
12:27hiredmanyou'll pry clojure.set from my cold dead rsi mangled stumps
12:28amalloyi use clojure.set pretty rarely. what gems am i missing?
12:28hiredmanclojure.set/index
12:30hiredmanthe doc string is a little too terse
12:31amalloymost of the docstrings in clojure.set are not very approachable because they use rel and xrel without ever defining them
12:31hiredmanclojure.set has the makings of a nice in memory relational database that you query using for
12:33hiredmanhttps://github.com/sonian/Greenmail/blob/master/src/clj/greenmail/db.clj uses clojure.set/index to index facts and provides a core.logic relation to query them (not even terse doc strings)
12:35sobeljustin_smith: basically, yeah
12:36sobelhuh, i rolled my own JOIN and WHERE functions for a very limited purpose. sounds like i might have benefitted from clojure.set
12:36sobelvec of map became my PMDB
12:37sobel(poor man's database)
13:25sjlI'm trying to figure out how nrepl's session middleware works. Right now I'm attempting to puzzle out how sessions get created/deleted/expired.
13:25Empperisniff, I wonder if Cursive has stopped supporting community edition of idea
13:25Empperithat would be sad if so
13:26sjlWhat I've found so far seems to be: if you don't include a "session" in the request map, one gets created for you but NOT saved into the main "map" of sessions, and so "expires" when that request finishes
13:26sjl(and it gets GC'ed)
13:26sjlAlternatively you can send a "clone" op, which will clone the current (temporary, autoadded) session and will register that into the sessions map
13:27sjlso that it won't get GC'ed
13:27sjland that will stick around forever, or until you send a "close" op
13:27sjlis that roughly correct, or am I missing something fundamental?
13:27amalloyEmpperi: that would surprise me
13:30Empperijust downloaded it by hand since it wouldn't work via idea plugin management
13:30Empperiand tried to install it from there
13:30Empperi"Plugin 'Cursive' is incompatible with this installation"
13:30Empperi:(
13:31Empperisad
13:31noncomEmpperi: jet brains have changed their licensing policies
13:31noncommaybe it has something to do with cursive
13:31Empperimaybe
13:31EmpperiI do have ultimate edition on my work laptop
13:31noncomthis company can go nuts, really... too much jet for their brains..
13:32Empperibut would like to use cursive on my home desktop too where I have only community edition
13:32Empperioh well, guess I won't be programming at home today then
13:33xeqisjl: sounds right, though clone can take an id to clone an existing one as well
13:33Empperithey are trying to tell me to use la clojure
13:33sjlwhere "existing" means "registered" right?
13:33Empperiwhich has even got an update, omg
13:33noncomEmpperi: blog.jetbrains.com/blog/2015/09/03/introducing-jetbrains-toolbox/
13:34Empperinoncom: yeah I was that
13:34Empperiwasn't really happy about that
13:34sjle.g. if I just send a bare {eval (something}} op, it will have a "session" but there's really no way to access that session
13:34sjlif I want a session I can do anything with, I need to clone first
13:34noncomEmpperi: well, there's always eclipse + ccw, emacs, vim... :)
13:34Empperiused eclipse+ccw combo quite enough
13:35Emppericcw is actually pretty nice but eclipse - ain't going back
13:35sjlxeqi: concrete example: I do {"op" "eval" "code" "(+ 1 2) (Thread/sleep 10000) (+ 2 3)"}
13:35noncomEmpperi: i'm on it right now. yes, eclipse sometimes gives pain.
13:35sjlI get back a response for the first form, which contains a session id
13:35Empperiafter one has tasted idea you won't want to go to back to eclipse
13:35Empperireally
13:35snowell+1
13:35sjlbut I can't actually do anythingwith that ID because it's not registered
13:36noncomcursive was not straight too - too many problems with key shortcuts, problems with project dependency, strange behavior sometimes... too much...
13:36Empperi89€ for the first two years for the idea ultimate edition
13:36snowellEclipse should be considered torture
13:36noncomyeah, idea might seem cool but not always so. eclipse just works.
13:36Empperithat's not THAT bad but considering I manage to do programming at home maybe two times in a year currently with baby girl in house...
13:37noncomEmpperi: i had to program at nights when everyones sleeping to satisfy my addiction
13:37EmpperiI need to sleep at nights to be able to function at work
13:37sjlxeqi: yeah ok I just tested it and that is indeed the case. makes sense (kinda)
13:37Empperiand I can write clojure at work full time so no biggie
13:40hiredmanthat is just really weird to me
13:42Balveda-3What would the Clojure equiv for Number n = Integer.parseInt(field) be?
13:42Balveda-3Alternatively, a coercion to Number
13:42luma,(Integer/parseInt "123")
13:42clojurebot123
13:42Emppericlojure does not implement it's own parseInt
13:43hiredmanto say, such and such editor isn't working so I won't be programming today
13:43akabanderIDEA is the first IDE I've liked using. Except for maybe TurboPascal back in the Borland days....
13:43justin_smithBalveda-3: we don't have typed variables, so you can just use (def foo (Integer/parseInt field)) and you might need the ^Number hint at the place of usage for interop
13:43Empperihiredman: well, I have about 1h time to do any programming this evening
13:43Empperiso I launch idea, it doesn't work
13:43Empperispend 30 mins finding out why
13:43Balveda-3And how would the hint work in use?
13:43Balveda-3(^Number foo)?
13:43justin_smith(.bar ^Number foo)
13:43Empperinow I have 30 minutes left to install some other IDE or similar and learn to use it to do the programming
13:43hiredmanEmpperi: sure, and far be it from me say you have to or should be working
13:43Empperioops, ran out of time
13:44justin_smithBalveda-3: hints only make sense in the context of a method or function call
13:44Empperihiredman: I'm at home
13:44hiredmanEmpperi: sure
13:44Empperiand I do have a full time job and I do have a work laptop right there with intellij ultimate edition...
13:44hiredmansure
13:44Empperiso not really getting your point here :)
13:44justin_smithBalveda-3: (^Number foo) would attempt to call foo, which should throw an error if foo is really a number
13:45justin_smith,^Number 1
13:45clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Metadata can only be applied to IMetas>
13:45justin_smithoops!
13:45amalloyEmpperi: hiredman's point is you can write clojure with a dumb text editor and a repl
13:46Empperisure I can
13:46Empperiyou can write any language with a dumb text editor
13:46amalloyjustin_smith: prediction: some object somewhere will implement IFn and extend Number
13:46Balveda-3(^Number 1)
13:46Balveda-3,(^Number 1)
13:46clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Metadata can only be applied to IMetas>
13:46Empperiit's completely different thing if I want to do that
13:46hiredmanwhich, I am not say you should, I just would never think to say "my editor isn't working, so no code today"
13:47dxlr8rwhen we are at the topic of editors, LightTable ain't bad :)
13:47hiredmanand that is all I am saying, we have a different stance
13:47Empperiyeah, been meaning to learn lighttable for a long time
13:47dxlr8rcomming from ccw and emacs
13:48Empperiso guess now is the time
13:48EmpperiI backed it back during the kickstarter
13:48dxlr8rnice
13:48hiredman(no moral judgement about stances implied or expressed)
13:48snowellI used Light Table for quite a while. It was pretty good. I prefer cursive now
13:48Balveda-3,(.Number "1")
13:48clojurebot#error {\n :cause "No matching field found: Number for class java.lang.String"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "No matching field found: Number for class java.lang.String"\n :at [clojure.lang.Reflector getInstanceField "Reflector.java" 271]}]\n :trace\n [[clojure.lang.Reflector getInstanceField "Reflector.java" 271]\n [clojure.lang.Reflector invokeNoArgInstanceM...
13:48Balveda-3,(.Number (Integer/parseInt "1"))
13:48clojurebot#error {\n :cause "No matching field found: Number for class java.lang.Integer"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "No matching field found: Number for class java.lang.Integer"\n :at [clojure.lang.Reflector getInstanceField "Reflector.java" 271]}]\n :trace\n [[clojure.lang.Reflector getInstanceField "Reflector.java" 271]\n [clojure.lang.Reflector invokeNoArgInstanc...
13:48dxlr8rI used some time setting it up. and installing plugins. nice paredit support
13:48Balveda-3better read those docs
13:50dxlr8rthe "best" editor is emacs though, most features, best paredit support etc. but I can't stand the editor
13:50justin_smithBalveda-3: an Integer is always a Number
13:51Balveda-3Yeah, the problem itself is weird
13:51Balveda-3I'm calling a query and giving it arguments, but apparently it's a little too specific in what it requires
13:51justin_smithBalveda-3: you might need to explicitly tell a jvm method that an arg is Number
13:51hiredmanI've never used a proper debugger(printlns everywhere), so I never felt the lack of one, but I know in the early days lots of people using clojure keenly felt the lack of one that integrated well with their editor of choice
13:51justin_smithBalveda-3: otherwise, clojure doesn't care
13:51snowellWait, there's a better method than printlns? :D
13:52Balveda-3{:id1 a :id2 b :num c}
13:52hiredmanand that difference seemed hard to bridge, they always said "no, seriously how do you do anything without a debugger?" and I said "I dunno, I just do, what is so great about debuggers?"
13:52justin_smithsnowell: I find that putting some data inside a mutable container mid execution, and then playing with the data directly in the repl is often superior to a either a println or a debugger
13:53Balveda-3a and b are ints, the postgre columns in the db are an int and a serial respectively
13:53justin_smithBalveda-3: {:id1 a :id2 ^Number b :num c} perhaps?
13:54justin_smithbut if it is of type serial, clojure.java.jdbc should accept a long...
13:55dxlr8rI usually just split my functions up so I don't need debuggers. so that each one is simple and can be tested from repl with testdata and I see errors quick then
13:55hiredmanand it seems like there is something sort of similar to that divide around more advanced ide functionality, and I wonder what the underlying difference between those two stances is, and how it arises
13:56justin_smithyou can do everything with a repl + ed, after that it's all about conveniences, and you don't miss any of them if you haven't tried them
14:01akabanderThis seems relevant to an article in the latest LispCast, "The Pain We've Forgotten"
14:01Balveda-3Ok, I got the problem. It was something else entirely
14:01Balveda-3Thanks justin_smith
15:26akkadOH: "you use clojure at uber?" "yeap" "Is your uber ever a jar?" "ahh uberjar cute"
15:29domokatoi've noticed that doing a keyword lookup in a record is slower than just referencing the field (i.e. (:key record) vs (.key record))
15:30domokatosurely this can be optimized at compile time. are there any plans for this?
15:32domokatohm, actually, I'm not sure if it could be optimized since it requires the type hint to be faster (i.e. (.key ^Type record))
15:33opqdonutindeed
15:58Empperidid end up writing my hobby piece of code in LightTable instead of Cursive (the problem I had earlier)
15:58Empperifelt like I was handicapped lol
15:58Empperiwas constantly wishing I had my ordinary repl
16:00Empperithe whole instarepl is nice for learning clojure but kinda useless for anything serious
16:10rvsvDoes anyone know what a "java.io.UnixFileSystem" error means? I'm trying to use send-message from the postal library to send an email.
16:10rvsvIt worked just fine last week, but I upgraded my jvm from 1.6 to 1.8 in the meantime.
16:17Empperi1.6 -> 1.7 brought NIO
16:17Empperiit changed how I/O is done in java, of course there's still the old APIs etc but lot of stuff changed
16:19Empperijava.io.UnixFileSystem is a package private class in the java.io package
16:19Empperiwould you mind giving the full error?
16:19rvsvSure, just a minute while I get a pastebin.
16:24Empperiwaiting :)
16:24Empperineed to go to bed soon, it's 23:24 here and got an early wake up tomorrow morning
16:30rvsvSorry, I'm seeing some other interesting stuff in the error log. I think I'll try to unravel this myself a bit so I don't embarass myself too badly. Have a good night, and thanks for being willing to help!
16:31Empperinp :)
16:31Empperinight
16:31justin_smithrvsv: when you create an instance of FileSystem, the jvm creates an instance of UnixFilesystem (if you are on a *nix box)
16:31justin_smithrvsv: of course there's a good chance you aren't yourself directly using any FileSystem objects
16:36rvsvjustin_smith: ok, the thing I noticed is that I'm getting a similar error on a windows box
16:36rvsvI was expecting a java process builder error (I don't have sendmail installed), but instead I got the java.io error
16:36rvsvAnd I didn't recently upgrade the jvm there.
16:36lpaste_sds pasted “sds” at http://lpaste.net/141496
16:37rvsvhmm, I'm just thinking out loud. I'll see what I can see.
16:37lpaste_sds revised “sds”: “No title” at http://lpaste.net/141496
17:06elvis4526Is there a way to use (with-redefs) against a function I use in (partial) ?
17:06jeremyheilerelvis4526: try it out?
17:07justin_smithelvis4526: no, because partial does not resolve the var when called (unless you provide partial with the var instead of the function (in which case yes, but it's clumsy))
17:07hiredmanpartial is a function, its arguments are evaluated before the function is invoked
17:07hiredmanif the argument is a name, the name is resolved to a value in the environment then the value is passed to the function as an argument
17:07hiredmanwith-redefs temporarily rebinds a name to another value
17:09justin_smith,(do (def 42+ (partial + 42)) (with-redefs [+ -] (42+ 42)))
17:09clojurebot#<NumberFormatException java.lang.NumberFormatException: Invalid number: 42+>
17:09justin_smithergh
17:09justin_smith,(do (def +42 (partial + 42)) (with-redefs [+ -] (+42 42)))
17:09clojurebot#error {\n :cause "First argument to def must be a Symbol"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: First argument to def must be a Symbol, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6891]}\n {:type java.lang.RuntimeException\n :message "First argument to def must be a Symbol"\n :at [cloju...
17:10justin_smith(do (def plus42 (partial + 42)) (with-redefs [+ -] (plus42 42)))
17:10justin_smith,(do (def plus42 (partial + 42)) (with-redefs [+ -] (plus42 42)))
17:10clojurebot84
17:11justin_smith,(do (def plus42 (partial #'+ 42)) (with-redefs [+ -] (plus42 42)))
17:11clojurebot0
17:11justin_smithelvis4526: note the difference between those two calls ^
17:11hiredmangiven this program (def a (atom 0)) (def x (+ @a 5)) x where do you have to change the value that the atom in refers to in order for x to be a different value?
17:11elvis4526Yeah I get it, thanks
17:11hiredmanin a
17:18irctcHi everyone. :)
17:19irctcI have a question about compojure. I am new to Clojure web development and I want to create a web app in compojure.
17:20sritchieirctc: ask away!
17:21irctcWhen I create a new project with Leiningen: lein new my-project I would get a file in the src directory called core.clj, but when I create it using compojure I don't get that.
17:21justin_smithirctc: core is just a convention
17:21irctcI get handler.clj. Is that my new default file to which all app requests will be coming from now on?
17:21justin_smithwith compojure, iirc handler will be the primary ns
17:21justin_smiththe handler will be tasked with handling all incoming http requests
17:22irctcOh, ok, so my primary ns is the handler now.
17:22justin_smithif your primary task is handling http requests, yes :)
17:22irctcAnd then from the handler I would direct those requests to other namespaces with corresponding functions?
17:22justin_smithirctc: you would define routes, and each route can call whichever function(s) it sees apropriate
17:23justin_smithirctc: usually it makes sense to break up the routes into categories of similar tasks, and put each group of related tasks in their own ns
17:23irctcWell, yes it is, since it is a web application I need a way to handle http requests. I am completely new to Clojure, started learning it a month ago and I just created my first compojure project.
17:24irctcThat's what I figured justin_smith.
17:24justin_smithirctc: the handler handles requests, with compojure you use defroutes to create a handler, and each route can call whatever function you like
17:24justin_smithI hope that's clear enough
17:24irctcCool, thanks. :)
17:24irctcIt is. :)
17:27irctcIs jetty the standard for a web server for Clojure development or can you use something else like Apache?
17:27jeremyheilerjetty is a common choice
17:28justin_smithirctc: that's modular, you can decide later, the code will be the same
17:28justin_smithjeremyheiler: for dev time maybe
17:28irctcWell once I compile all my code to java it won't really matter what server it runs on but I never used Jetty before and was just wondering if this is the standard for Clojure development.
17:29justin_smiththe point of ring is that you can switch out ring server implementations at any time, it is common to use embedded jetty during dev then deploy to a container, or use embedded aleph or http-kit in prod
17:29justin_smithirctc: lein-ring will make you use jetty automatically, unless you force it to do something else
17:30justin_smithif you are using websockets that will likely rule out jetty I think, otherwise it's convenient
17:39irctcThank you very much for your help justin_smith. :)
17:42irctcBtw, is there a better editor for Clojure than Eclipse/Counterclokwise?
17:43taliosIntelliJ + Cursive
17:43aaelonyWhat's the best way to convert a [ [ [] [] [] ] [ [] [] [] ] ] to [ [] [] [] [] [] [] ] ? Using flatten is overkill (e.g. [] ). Is it some combination of mapv, merge-with, and conj?
17:44justin_smithaaelony: (vect (apply concat v))
17:44aaelonybless you justin_smith
17:44justin_smith,(vec (apply concat [ [ [] [] [] ] [ [] [] [] ] ]))
17:44clojurebot[[] [] [] [] [] ...]
17:44justin_smithclojurebot: seriously? that's like all but one of the elements, and ... is longer than [] is to print out!
17:44clojurebot'Sea, mhuise.
17:45justin_smithhaha
17:45aaelonyhaha
17:45aaelonysuper
17:45justin_smithaaelony: I just thought of another way too
17:45aaelonycool
17:45justin_smith,(apply into [ [ [] [] [] ] [ [] [] [] ] ])
17:45clojurebot[[] [] [] [] [] ...]
17:45aaelonyI almost did that
17:45justin_smithif it's uniform that will work
17:46aaelonyI started with a mapv though so nixed the into.
17:46aaelonymaybe (apply mapv ... )
17:46aaelonynope...
17:47WorldsEndlessunc
17:48aaelonythanks again justin_smith
17:49amalloyjustin_smith: uniform here meaning "exactly two elements"?
17:52irctcThanks for the help everyone. :) Take care and have a nice day! :)
17:53justin_smithamalloy: oh right, reduce into it is
17:54BronsaI hate that into doesn't work for multiple collections
17:54justin_smith,(reduce into [[[]] [[]] [[]] [[]]])
17:54clojurebot[[] [] [] []]
17:54justin_smithbut reduce into does!
17:54Bronsaand now thanks to transducers it never will
17:54Bronsaeven worse
17:54Bronsa,(into [] [] [])
17:55clojurebot#error {\n :cause "Key must be integer"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "Key must be integer"\n :at [clojure.lang.APersistentVector invoke "APersistentVector.java" 298]}]\n :trace\n [[clojure.lang.APersistentVector invoke "APersistentVector.java" 298]\n [clojure.core$transduce invokeStatic "core.clj" 6575]\n [clojure.core$into invokeStatic "core.clj" 6591]\n [...
17:55Bronsathe error message is awful :(
17:55justin_smithyes, that is a terrible message
17:56Bronsai wish transducers werent direct functions but reified some protocol, that way all those weird messages could at least be $thing cannot be cast to ITransducer
17:58amalloyBronsa: but then you'd need to call a function to compose them! isn't it amazing that you can write ((map f) (filter even?))?!! imagine how dreary it would be to write (t-comp (map f) (filter even?))!
17:58justin_smithaaelony: anyway, hopefully you caught the thing about using reduce into instead of apply into
17:58aaelonyyes, very cool
18:02Bronsaamalloy: ah you might have an actual point there, composing transducers via `comp` wouldn't work anymore
18:02BronsaI'd be totally fine with that though.
18:02amalloywell, yes, i was attempting to take that stance as absurdly as i could
18:02amalloythere's no reason they should compose with comp instead of with some transducer-specific operator
18:03Bronsaagreed
18:06Bronsaand you could even "fix" the backwards aspect of composing them IUC (yeah I know it's not a bug to fix but I still feel it's unnatural & just a leaky implementation detail)
18:18m1dnight_Does anyone know how I can use the insert statement from honeysql?
18:19m1dnight_I cant get it to work. I know the queries work manually and reading works.
18:19m1dnight_This is how I feed it to jdbc:
18:19m1dnight_(jdbc/db-do-commands (read-db-config) (-> (insert-into :karma) (values [{:nick "bar" :karma 100}]) sql/format)))
18:19m1dnight_Reading from the db works, so the config is correct..
18:24aaelonym1dnight_: I'm likely alone in this, but if it's easier to issue the insert statement via jdbc, that's what I'd do...
18:24m1dnight_Well, I had it working with java-jdbc.sql before but I figured I would use one of the projects that are explicitly supported like HoneySQL.
18:24m1dnight_But the docs are unclear on how to do it.
18:25m1dnight_So Im going back to java-jdbc.sql then I guess
18:38cflemingEmpperi noncom: Cursive will always support the community edition of IntelliJ. That error normally means that you have the wrong Cursive version for the IntelliJ version (i.e. trying to install a Cursive that supports IntelliJ 14.1 in the v15 EAP or something).
18:46hlolliIs there any tutorial online on how to use tags for someone that is unfamiliar with tags in the first place? Or more percise, how to use tags to destructure function arguments?
18:47hiredmanthat isn't a thing
18:47hiredmanI am assuming by tags you mean type tags, which have nothing to do with destructuring
18:48hlolliok I am hoping to find a way to sequence trough [& rest] argument input and align the functions in correct order depending which function is tagged to which thing.
18:56neoncontrailshlolli: what you're describing sounds like a design pattern called dispatching on type
18:56neoncontrailsAre you familiar with the pattern?
18:58mungojellyis there any way to just have it detect everything, i want to just dump in the parts i want to connect and then if there's a function that returns an int and another function that takes an int then those would connect because duh.
19:01mungojellyhow about if there's just a big pile of input data and instead of waiting to be asked, as soon as you write a function it just starts going around the input trying to find yummy things to process and spitting its results back out for other functions to try.
19:03hlollisorry, went away for a sec.
19:04mungojellyis there a frame that will let me run a task and get like status reports on how it's doing.
19:04hlollidispatching on type... sounds something I will google.
19:07trissI'd really like to have `defn` associate messages with `:pre` and `:post` conditions just like we can with assert.
19:08trissIs it worth raising a ticket on the JIRA thing or is something thats been discussed before?
19:08mungojellyoh so defn has pre/post conditions? yay good news
19:09trissmungojelly: yep. lovely feature.
19:09trissI just think they could provide better error messages.
19:09mungojellyit's a map? {:pre ...?
19:09trissYup. :pre and post are just list of predicates over your arguments.
19:10trissif they all pass the fn can run.
19:10trissif they don't you get an assertion error
19:11puredangertriss: there is a ticket for this
19:12trissI'd love it if you could say stuff like: `{:pre [{(map? m) "m must be a map"} {(sausagey-enough? z) "Z is not sausagey enough. Have you added all sausages?"}]}
19:12trissah puredanger... i couldn't find it
19:13trisscould you point me in the right direction?
19:13mungojellywait what i have to say [{(?
19:14trissno sorry mungojelly this is all going on in a dreamworld/the future
19:14trissyou just do {:pre [(map? m) (number? n)]}
19:15puredangerSorry on my phone
19:15mungojellyok well maybe that's enough )}]}) already :p
19:16mungojellyok yay now i got it to work thanks
19:17mungojellydefn seems to do a zillion things i should just read it and see what all it does
19:18mungojellywhat documentation can you put into your functions? there's a doc string, error messages, assert messages
19:27justin_smithtype hints, comments
19:29mungojellyare there any of those tricky things where you read out particular formats of comments into documentation
19:29justin_smithnot built in, but there are tools that do something like that
19:31mungojellyhere are the ways i know of so far to poke a function (1) give it input, (2) ask for its doc string, oh and (3) dig around through its other metadata, anything else?
19:33rhg135Functions don't usually have metadata ##(meta +)
19:33justin_smith,(meta +)
19:33clojurebotnil
19:33rhg135,(meta #'+)
19:33clojurebot{:added "1.2", :ns #object[clojure.lang.Namespace 0x2ab76179 "clojure.core"], :name +, :file "clojure/core.clj", :inline-arities #object[clojure.core$_GT_1_QMARK_ 0x18b4c088 "clojure.core$_GT_1_QMARK_@18b4c088"], ...}
19:33rhg135But vars do
19:34mungojellythat's funny, you can get a function to do absolutely anything, but you have to come in through that one door
19:34rhg135Yup
19:35rhg135It's all .invoke()
19:35mungojellyyou can be like "argument that breaks into the other part of the function" and you're in, but you have to start by getting through there. it doesn't seem quite entirely fair somehow, i wonder if there's a better way.
19:35justin_smithmungojelly: this is because it keeps things straightforward
19:36justin_smithmungojelly: imagine if for example you could look at the insides of a function and change things, if the function calls you
19:36justin_smithor if functions could modify their arguments
19:37justin_smithmungojelly: what we do is reduce the number of moving parts so that understanding new code is tractible
19:37mungojellyoh sure of course always
19:39rhg135,(meta (with-meta + {:awesome-key true}))
19:39clojurebot{:awesome-key true}
19:40rhg135They CAN have metadata, but it creates a shim
19:50mungojellyi guess we call wrapping functions in another function to give them another interface "monads" and don't do it much
19:52mungojellythe monad interfaces i've tried are all clunky, it's a simple idea and then somehow something goes wrong in the execution. why do you have to manually lift things, why not have a wrapper that lifts-if-unlifted and do it to everything. i just want to use things and mostly not know or care if they know all the interfaces i'm using them in.
19:58mungojellyyou could have functions that know how to answer questions about their interface, like you say to them {:implements? :interface-i-want} or whatever, and if the function responds with an error or nonsense or says no then wrap it
20:12mungojellyare there no ways yet to publish a single paragraph of clojure that'll be interesting and useful to people, do you have to publish a whole independent project with its own dependencies and everything before anyone will listen to anything you say
20:12mungojellyisn't there anything that accepts plugins in clojure so you can write a simple part for it
20:15pbxmungojelly, what's your use case? i.e. what programming task are you finding frustrating and what specifically are you wishing for as a remedy?
20:16pbxfrom the words "before anyone will listen to anything you say" i take it this is some kind of cultural fit problem
20:16mungojellypbx: well, i find it frustrating that everything is wrapped in a zillion levels of wrapping always even though it's possible for a paragraph to be meaningful and useful, so what i'm wishing for is for someone to say "oh sure, this project over here would love some contributions"
20:17pbxmungojelly, i'm sure there are lots of projects that would like contributions. a pull request doesn't have to be an indpendent project. i really don't understand what you're getting at. elaborate on "zillion"
20:19mungojellysure well i can try to find places where i can randomly change things, but there's very little opportunity provided for participation in anything, no one's asking for any particular help making anything
20:20mungojellyok like my project i'm working on the working title is tile-toybox and it just gives you simple 2d tiles, one thing i'm going to ask for help with is making tile sets, i'm going to include some tile sets to play with, but then you could make another set based on those examples
20:27mungojellyi'd like if we made a bot together that makes bizarre cut-up blog posts, everyone could contribute a few random functions from strings to strings and then we'd hook them all up into a fun spaghetti and give it a blog
20:28mungojellythen you could just say a function that turns every "banjo" into "armadillo" and hook it up to the thing that gives a string of musical instruments so now it says "cello armadillo violin piano"
20:29mungojellythe appropriate response to a function that turns banjos into armadillos shouldn't be that nobody ever does such a thing functions are for Business Logic, it should be to direct someone to a fun project where their contribution will be appreciated
20:36mungojelly,((fn [str] (clojure.string/replace str #"banjo" "armadillo")) "cello banjo violin piano")
20:36clojurebot"cello armadillo violin piano"
20:36mungojellythere i wrote it. but it has no home. :(
20:41pbxmungojelly, if the fun project you are dreaming of doesn't exist, nobody is stopping you. like i said, there are plenty of open source projects that would welcome contributions.
20:42pbxyou can even do both at once. make your own fun spaghetti blog project, and find something else to contribute to
20:42mungojellypbx: ok well you don't know of or need any particular easy contributions? obviously everyone's happy if i go dig through docs and implement some transport protocol somewhere or something. but i'm still learning and i just want to have fun and say simple things.
20:43mungojellyshould i worry about what kind of project i make with leiningen or just say lein new. i don't understand this junk it makes you. :/
20:44justin_smithmungojelly: the options allow optional library specific templates
20:45mungojellyare those composable? like if you have multiple libraries they can't work together to make you a template for combining them can they?
20:45justin_smithnot really, I would try making a project from each template and then combining them by hand - you'll quickly find out if it's doable or not
20:46mungojellyit feels like complexity to have a program spitting out a bunch of files for me. i feel odd if i want to write a few lines to have a bunch of folders spit out for me and then go into one of them and put my couple of lines and seal it back up. why didn't i just say those few lines and another line that implies the rest of the shit.
20:47justin_smithmungojelly: nothing stops you from making a file yourself, putting some crap in it, running "java -jar clojure.jar" to start a repl, and using load-file to load the file contents
20:47justin_smithit's just that that doesn't scale well
20:47justin_smithso lein tries to make you do the "right thing" from the start
20:47mungojellyi don't need to know what target/classes/state/META-INF/maven.. maven this is stuff to tell maven what to do, tahnk god someone's abstracitng over maven for me anyway
20:49mungojelly./resources is just a suggestion for good structure right, like, if you have other assorted resources put them here?
20:49justin_smithright - anything in the resources will by default be included with your code if you make a jar
20:50justin_smithand that way you can distribute miscellaneous files you need with your code
20:50justin_smithtarget/ is for cached stuff - it is always safe to entirely delete that directory, all it does is hold partial results for multi step builds and speed up startup
20:51mungojellydoes it treat test/ differently, is that not included in production builds or something?
20:51justin_smithit's not included in a jar if you make a jar - but is used when you run "lein test"
21:08mungojellyok well i feel now like i understand what lein new makes for me, but y'all really should look at it with fresh eyes every once in a while and see that there's no simple way here to make and share anything
21:10mungojellyon TIOBE clojure is the they-don't-bother-to-count-anymoreth on the list of most popular languages, 51-100 somewhere. number 24 is scratch. scratch is clearly and significantly worse than clojure in i'd say every single respect except one: scratch has a "publish" button which causes the thing you made to be shared.
21:10justin_smithmungojelly: lein do jar, clojars
21:11justin_smithmungojelly: it's true that clojure's not easy, but the tooling is actually pretty decent once you get over the first few weird aspects
21:11justin_smitherr, s/clojars/deploy clojars/
21:11mungojellyi do fully intend to learn how to do that, but i didn't at any point put any effort at all into learning how to share scratch projects, it just simply has a large "publish" button
21:14mungojellyif the instructions for saving a word or pdf document were "it's easy, just say to a terminal "word/adobe save make awesome thing deploy!" and then it'll give you what you need" then there would be very few word or pdf documents in the entire world and they would all be about geeky things
21:18justin_smithmungojelly: I refuse to use a language that has the UI paradigm of a word processor, and if clojure adopted that I would stop using clojure
22:12rritochIf java class files change is there some way to get clojure to start using the new class files, possibly automaticallly, without restarting?
22:14mavbozorritoch, you mean like vinyasa's reimport https://github.com/zcaudate/vinyasa#reimport ?
22:17rritochmavbozo: Thanks. That is basically what I'm looking for. While not automatic it looks like it'll get the job done. I'll need to read up on that project.
22:21rritochI was thining of using JRebel, but it's probably useless in clojure due to the interning of classes.
22:22rritochthining = thinking
22:25rritochWould it possible to use JNotify with it to automate updates?
22:25rritochit = vinyasa
22:28rritochWell this reimport :all looks like it does most of the work, but calling it on every namespace could be problematic.
22:30kavkazzippers saved my life
22:30kavkazor project you could say
22:43kavkazwhat's up amalloy
22:47rritochmavbozo: Thanks, looks like vinyasa does a lot more than just reimporting.
23:03aconz2I'm a soon to be college grad looking for opportunities w/ clojure; would love to chat
23:15TEttingeraconz2: there are probably many!
23:16TEttingerpad your github with sweet and savory contributions to existing open source projects!
23:20aconz2TEttinger: why haven't recruiters just mined github yet?? I will try and do so over the next month
23:20TEttingeroh they do
23:20aconz2slightly difficult since most of my current work is in Python/C++ land
23:20TEttingerI think many people here have gotten unsolicited emails from github miners
23:20justin_smithI assume that's where the unsolicited job offers from google in my inbox came from
23:21justin_smithwell, not straight up job offers, but inqueries or whatever
23:22TEttingerfor me it's ironic since I think nothing I have done on github is commercially relevant. 466 day streak though.
23:22aconz2hah who knew! I think the whole repo-as-a-CV is nice - - but the lack of a shiny github doesn't imply a bad/incompetent dev
23:23justin_smithnor does a skimpy resume, but if you have a good resume or a good github account, both are going to get you better results
23:24TEttingeryep. it's often a factor in consideration if the company hiring values open source, that or at least some open source contribution (don't need a github account to have a contribution to the linux kernel in the past, for instance)
23:28aconz2hard to know what to make public -- random one-off toys/experiemnts? -- and I'm not always using the most bleeding-edge in-need-of-help libs. or I'm naiive
23:29rritochaconz2: The market for clojure developers is very small. When it comes to clojure you usually need to make your own market. Either by developing your own apps under some kind of business model, or applying to non-clojure jobs and convincing your employer that you NEED clojure to develop efficiently since platform X doesn't provide macros or a REPL.
23:29rritochaconz2: Employers need to be told what to think *evilgrin*
23:31TEttingeryou can totally be hired as a java dev in some shops and convert them to using clojure bit-by-bit
23:31TEttingerassuming they give leeway on certain things
23:31aconz2rritoch: which is a con in some respects, but a plus in filtering the market as well. hard to predict what company/role gives that leeway
23:32TEttingerhttps://github.com/rschmitt/collider is a good example of java that is halfway to clojure
23:32rritochaconz2: It isn't a con, a con artist doesn't believe in what he's selling, a good bussiness person does.
23:32TEttingerpro and con
23:32aconz2pro and con
23:32aconz2words are hard
23:34rritochaconz2: It is really a fact that development in clojure is more efficient, insanely so if your using macros. In one specific example I was able to reduce a specific type of project from 16 hours to 3 hours just by using clojure.
23:38aconz2oh I'm already convinced its a good system for certain domains; that's why I'm here :)
23:38rritochaconz2: While I have a lot of "pet" projects, one project I'm toying with is making code generators for clojure, comparable to how clojurescript works, so I can just automate my work in any other language from clojure.
23:38arrubinrritoch: You implemented it in Clojure and another language and compared?
23:40rritocharrubin: I've been asked to do these projects in various languages, most average about 16 hours, in clojure I was able to get it down to 3 hours average.
23:50rritochI also work with common-lisp and have an open-source implementation @ https://github.com/rritoch/jrelisp , it is good for highly mutable algorithms, but fails miserably at multi-threading, since they both run on the JVM they can be used together as long as you don't leak other threads from clojure into it (Since it's multithreading support is garbage).
23:51rritochDeveloping common-lisp vs clojure is incomparable, it takes 2X as long to do in common-lisp, and in many cases common-lisp just can't get the job done.
23:51rritochI'd like to further bridge the two, but lack of funding has put an end to my common-lisp development.
23:57arrubinrritoch: How much of that is due to Clojure having the JVM to fall back on?
23:58TEttingercommon lisp has the JVM too using armed bear common lisp
23:58TEttingerso the advantage I assume is due to immutable/persistent data structures and the easier reasoning about state they entail
23:58rritocharrubin: As I stated, the common-lisp implementation runs on JVM.
23:59arrubinrritoch: Sure, but does it have the same level of interop?
23:59arrubinI am not trying to be difficult. I have no vested interest in CL.
23:59arrubinJust curious why your claims might be true.