2013-09-28
| 00:05 | chord | https://gist.github.com/anonymous/b362df96de01ee91dbad |
| 00:05 | chord | why the hell cant it find GLCanvas |
| 00:07 | chord | i've been trying to get an opengl window up for 2 DAYS |
| 00:07 | chord | WHY DOESN'T THIS WORK |
| 00:13 | chord | NM FIXED IT |
| 00:15 | chenjf | chord: are you sure javax.media.opengl.GLCanvas is in your classpath? |
| 00:15 | chord | fixed the problem |
| 00:16 | chord | jogl.jar is bullshit have to use jogl-all.jar |
| 00:16 | chenjf | glad you fixed it |
| 00:16 | callen | games are hard, lets go shopping. |
| 00:16 | chord | callen I know you keep talking in an attempt to get me to give up |
| 00:17 | chord | not going to work |
| 00:17 | callen | chord: shopping is fun. |
| 00:17 | cgag | if i have a seq of pairs like this: [[:a b] [:a c] [:a :d]], and i want to get {:a [:b :c :d]} |
| 00:17 | cgag | is there some built in i can use or do i need to do somtehing like this: (reduce (fn [m [k v]] |
| 00:17 | cgag | (assoc m k (conj (m k []) v))) {} ...) |
| 00:24 | chord | guys i think callen is having a heart attack |
| 00:24 | chord | he stopped responding |
| 00:25 | cgag | rip |
| 00:28 | chord | cgag: you going to help with starcraft clone? |
| 00:28 | cgag | is that's what's going on |
| 00:28 | chord | just say yes |
| 00:28 | cgag | that sounds fun, idk if i have time though |
| 00:30 | cgag | have you considered going shopping instead |
| 00:32 | callen | chord: I'm pretty sure you should go shopping. |
| 00:34 | chord | cgag work on game ok |
| 00:37 | chord | NEW PROBLEM |
| 00:37 | chord | .m2/repository/org/jogamp/gluegen/gluegen-rt/2.0.2/gluegen-rt-2.0.2-natives-linux-i586.jar (No such file or directory) |
| 00:37 | chord | why is it not looking for gluegen-rt-2.0.2.jar instead |
| 00:37 | chord | where the hell did the natives-linux-i586 shit come from |
| 00:41 | arrdem | callen: and how goes the cup... |
| 00:41 | cgag | chord how do you plan on doing graphics and stuff |
| 00:41 | chord | jogl |
| 00:41 | chord | arrdem: i need your help dude |
| 00:41 | cgag | is there some existing clojure game stuff |
| 00:41 | chord | arrdem: please help |
| 00:41 | chord | cgag: not that I know of |
| 00:42 | arrdem | chord: don't get me started "helping" you again. I'm being productive right now. |
| 00:42 | chord | arrdem: productive doing what project best friend |
| 00:42 | callen | arrdem: well :) |
| 00:43 | callen | arrdem: we're making good progress, solving problems with large amounts of violence and fear. |
| 00:45 | arrdem | callen: ah good. shock and awe ftw. I'm buissy ddosing all the things with my crawlers. |
| 00:46 | holo1 | chord: "where the hell did the natives-linux-i586 shit come from" -> lein deps :tree |
| 00:47 | chord | lein deps :tree [clojure-complete "0.2.3" :exclusions [[org.clojure/clojure]]] [org.clojure/clojure "1.5.1"] [org.clojure/tools.nrepl "0.2.3" :exclusions [[org.clojure/clojure]]] [org.jogamp.gluegen/gluegen-rt "2.0.2"] [org.jogamp.jogl/jogl-all "2.0.2"] |
| 00:49 | holo1 | chord, you should really give up about swearing, unless you're someone really important that too many people worship |
| 00:49 | chord | holo1: I'm a spoiled child I can't stop the behavior |
| 00:51 | holo1 | chord, anyways, you're the one to lose about that spoiled theme, because you're likely to not get much help here. your call |
| 00:56 | chord | holo1: so I go shopping now? |
| 01:10 | chord | ok I learned i'm suppose to use gluegen-rt-main not gluegen-rt |
| 01:20 | chord | channel dead |
| 01:20 | tbaldridge | trolls have a way of doing that |
| 01:20 | arrdem | clojure-cup isn't helping either.. |
| 01:21 | chord | arrdem: whats stopping people from making their project before clojure-cup actually started |
| 01:22 | arrdem | chord: there's this thing called honor. you may have heard of it. |
| 01:25 | chord | arrdem: you trust the other people in clojure-cup? |
| 01:32 | chord | I got a window up FINALLY |
| 01:35 | muhoo | recurring PSA: /ignore works, and /ignore -replies ALL works in many clients too |
| 01:37 | callen | arrdem: honor and that competition beginning slapping together code in the first hour is a lot fun |
| 01:37 | callen | lot of fun* |
| 01:48 | chord | callen do you have a demo of your project |
| 01:49 | chord | yet |
| 01:49 | `cbp | chord: so sc clone will be ready by end of clojure cup then? |
| 01:49 | chord | `cbp: I didn't sign up for clojure cup so no |
| 01:51 | chord | `cbp: what are you working on |
| 01:52 | `cbp | i have like 4-5 projects where im like 10% in hah |
| 01:53 | `cbp | ill prolly try to get this weekend a working 0.1.0 of the rethinkdb driver i was supposed to finish like half a year ago or something |
| 01:54 | chord | `cbp: forget rethinkdb go make a driver for voltdb |
| 01:57 | chord | `cbp: what do you think about voltdb? |
| 01:57 | `cbp | chord: never heard of it before |
| 01:58 | chord | `cbp: http://www.youtube.com/watch?v=uhDM4fcI2aI |
| 02:00 | `cbp | :-o |
| 02:02 | chord | `cbp: what does that mean |
| 02:03 | `cbp | ill watch it tomorrow, too tired right now |
| 02:29 | chord | Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: No matching method found: gluPerspective for class javax.media.opengl.glu.GLU |
| 02:29 | chord | how do I debug this |
| 02:30 | Apage43 | doctor |
| 02:31 | Apage43 | it hurts when i try to call .gluPerspective on this object |
| 02:32 | chord | Apage43: you're not helping, I can see that the class has the method in eclipse |
| 02:33 | Apage43 | argument count or types are probably wrong |
| 02:33 | chord | Apage43, thats what I was thinking so how do I find out how its being called |
| 02:33 | Apage43 | the stack trace ought to tell you that |
| 02:34 | Apage43 | ah.. but the AWT thing doesn't give you that |
| 02:34 | Apage43 | *but* your code probably isn't calling gluPerspective in very many places |
| 02:34 | Apage43 | grep. |
| 02:34 | chord | (.gluPerspective glu 50.0 (float (/ w h)) 1.0 1000.0) |
| 02:34 | chord | does that look good |
| 02:35 | Apage43 | i have no idea what type that method is supposed to be |
| 02:35 | chord | wtf you're an opengl newb? |
| 02:36 | Apage43 | well gluPerspective was deprecated quite a while back, and is part of GLU, not OpenGL proper |
| 02:38 | chord | not switching to opengl proper yet |
| 02:40 | callen | technomancy: https://twitter.com/athos0220/status/383807244061536257 |
| 02:40 | Apage43 | what if you wrap all those args in (double) |
| 02:42 | chord | Apage43: wtf that worked, what kind of defaults was clojure using |
| 02:43 | Apage43 | the method has a version that takes four doubles, and a version that takes four floats. the call was ambiguous (and floats are problematic too) |
| 02:43 | amalloy | it was using doubles, except where you specifically asked it yo use a float |
| 02:45 | ggherdov | hello. Is there a web framework for clojure, like django for python or rails for ruby? |
| 02:45 | Apage43 | your garlic is now truncated to 24-bits |
| 02:46 | arrdem | Apage43: aw..... what happened to the sign bit? |
| 02:46 | arrdem | ggherdov: sort of. we have Luminous. |
| 02:46 | ggherdov | arrdem: thanks, looking it up. |
| 02:46 | arrdem | ggherdov: http://www.luminusweb.net/ |
| 02:46 | arrdem | ggherdov: I spelled it wrong :/ |
| 02:47 | ggherdov | arrdem: thanks for the link |
| 02:48 | chord | so I got a window up that fills it red |
| 02:48 | chord | now what do I do to finish my game |
| 02:49 | Apage43 | you'll need to figure out blue and green windows, then you lay those side by side at 1/3 pixel width, and fill a screen with them |
| 02:50 | arrdem | (Float. "NaN") |
| 02:51 | chord | Ok guys I made an opengl window I PROVED I CAN DO IT, now you guys are all going to flock to help me with starcraft clone like you all promised remember |
| 02:52 | Apage43 | "No, in javascript isNaN doesn't check that something isn't a number, it checks if its Not a Number. You should use typeof, but you still need isNaN if you might see Not a Number, because typeof Not a Number is number." |
| 02:53 | Apage43 | this was pretty confusing when I said it out loud to someone |
| 02:53 | rplaca | sure, NaN is a number |
| 02:53 | rplaca | at least in the sense that it has type "number" |
| 02:53 | Apage43 | but the data was being tripped through JSON, which meant there wouldn't be any NaNs |
| 02:54 | rplaca | because it's the result of an arithmmetic operation on numbers |
| 02:54 | ggherdov | arrdem: a quick web search brought up the name "compojure". What is that? a DSL for web development? |
| 02:55 | arrdem | ggherdov: Compojure is a routing based request server system. |
| 02:56 | ggherdov | arrdem: ok thanks |
| 03:01 | n_b | Anyone that can provide direction on the best way to reuse haml templates in a ring app? |
| 03:03 | n_b | Or should I just bite the bullet and port them to laser? |
| 03:11 | muhoo | watman |
| 03:11 | muhoo | ggherdov: also pedestal.io |
| 03:12 | ggherdov | muhoo: checking ! |
| 03:12 | muhoo | still think lein should disallow project names like clj-* or *-clj |
| 03:13 | muhoo | enforced creativity |
| 03:22 | amalloy | muhoo: well, it already disallows *jure |
| 03:22 | amalloy | see "LEIN_IRONIC_JURE" |
| 03:23 | chord | so when I jam my clojure code into github am I suppose to do git init inside the src directory or in the directory containing src |
| 03:23 | TEttinger | juure |
| 03:24 | TEttinger | cleaudzhoor |
| 03:28 | TEttinger | clodžure |
| 03:38 | Sgeo | Something's off with the slides here http://www.infoq.com/presentations/racket |
| 03:38 | Sgeo | I get the sense I'm looking at the slides at the wrong times |
| 03:46 | chord | you guys mad that I succeeded in setting this up: github.com/chord-rts/rts |
| 03:46 | chord | www.github.com/chord-rts/rts |
| 03:48 | callen | chord: don't think anybody cares mate. :) |
| 03:48 | chord | callen: you lie |
| 03:49 | callen | muhoo: I agree. |
| 03:50 | callen | muhoo: better nomenclature through fascism! |
| 03:50 | callen | (inc muhoo) |
| 03:50 | lazybot | ⇒ 2 |
| 03:50 | chord | callen: i demand you contribute to the project |
| 03:51 | chord | callen: I did first commit |
| 03:52 | indigo | 'Night Clojure peeps |
| 03:52 | chord | no |
| 03:52 | chord | you help me indigo |
| 03:52 | chord | on my project |
| 03:53 | nightfly | you sure know how to build a team |
| 03:53 | chord | nightfly you gonna join? |
| 03:53 | nightfly | I have no time |
| 03:53 | chord | what are you spending your time on nightfly |
| 03:54 | nightfly | work, school, and own looong backlog of projects |
| 03:54 | chord | nightfly which projects |
| 03:57 | chord | why do you all abandon me and the starcraft clone project |
| 04:04 | chord | what will it take for you guys to help my project |
| 04:18 | georgek | what could be the problem if in response to 'lein ring server' I get java.io.IOException: The system cannot find the path specified -- this is following the modern-cljs tutorials |
| 04:19 | georgek | my project.clj and all the other files look like the tutorials |
| 04:59 | chord | starcraft clone |
| 04:59 | chord | you help me now |
| 05:00 | callen | georgek: are you competing in Clojure Cup? |
| 05:01 | chord | callen are you going to help me with my game after clojure cup |
| 05:18 | jonasen | does anyone else get "Wrong number of args (3) passed to: reader-types$indexing-push-back-reader" with the newest clojurescript release? |
| 05:28 | sm0ke | hey i am trying to split a string on , and each one on :..i cant figure it out ##(map (doto s/trim (partial s/split #":")) (s/split " a:b, c:d , e:f " #"\s*,\s*")) |
| 05:28 | lazybot | java.lang.RuntimeException: No such namespace: s |
| 05:28 | sm0ke | sorry |
| 05:29 | sm0ke | ,(map (doto clojure.string/trim (partial clojure.string/split #":")) (clojure.string/split " a:b, c:d , e:f " #"\s*,\s*")) |
| 05:29 | clojurebot | ("a:b" "c:d" "e:f") |
| 05:29 | ro_st | split first by , then by : ? |
| 05:29 | sm0ke | ro_st: yes |
| 05:30 | sm0ke | so i want something like ((a,b) (c,d) (e,f)) |
| 05:31 | sm0ke | although i can do a map again...but wanted something concise |
| 05:31 | ro_st | ,(->> (clojure.string/split "a:1,b:2,c:3" #",") (map #(clojure.string/split % #":")) |
| 05:31 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 05:34 | sm0ke | ro_st: oh yea there is also a trim there |
| 05:34 | ro_st | on which? the stuff to be : split? |
| 05:35 | sm0ke | no after split by , i trime each string first then split on : |
| 05:36 | ro_st | https://www.refheap.com/19101 |
| 05:38 | ro_st | sm0ke: comp partial and juxt are your friends :-) |
| 05:38 | ro_st | many times you can avoid anon fns completely by using them |
| 05:39 | chord | sm0ke help me with my project |
| 05:40 | chord | sm0ke you help me with my project: github.com/chord-rts/rts |
| 05:40 | chord | www.github.com/chord-rts/rts |
| 05:41 | ro_st | sm0ke: here's a quick demo of juxt and comp togehter https://www.refheap.com/19101 |
| 05:57 | chord | ro_st help me with my game |
| 06:01 | piranha | how do I make js object in cljs without using clj->js? |
| 06:01 | piranha | I recall something like (js-obj "a" "b") |
| 06:19 | z3phyr | Almost every library in clojure requires JVM... |
| 06:24 | hiteki | z3phyr: ... or CLR ? |
| 06:27 | z3phyr | incanter |
| 06:27 | z3phyr | datomic |
| 06:28 | z3phyr | leiningen |
| 06:28 | z3phyr | ring |
| 06:29 | z3phyr | even they named it clojars.... |
| 06:32 | z3phyr | hmm... |
| 06:33 | z3phyr | Clojure core mainline has no official support for the CLR too |
| 06:33 | z3phyr | ClojureCLR should become 'another language' |
| 06:34 | z3phyr | much like joxa |
| 06:35 | hiteki | ok |
| 06:35 | z3phyr | joxa feels like a dead project too..... |
| 06:38 | Pupnik_ | its also not the only lisp for erlangvm |
| 06:52 | sm0ke | what wrong with this ## map( #([(first %) (second %)]) (["a" "b"])) |
| 06:52 | sm0ke | ,map( #([(first %) (second %)]) (["a" "b"])) |
| 06:52 | clojurebot | #<core$map clojure.core$map@1661ab8> |
| 06:53 | sm0ke | oh crap wait |
| 06:53 | sm0ke | yes actually on repl i get ArityException Wrong number of args (0) passed to: PersistentVector |
| 06:55 | sm0ke | ,(map #([(first %) (second %)]) '(["a" "b"]));i actually meant |
| 06:55 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentVector> |
| 06:57 | sm0ke | i actually want to cast second arguemnt to an int |
| 06:59 | pyrtsa | sm0ke: The #(...) special form requires a function to be called as first argument. |
| 06:59 | pyrtsa | Either use #(vector a b) or (fn [...] [a b]). |
| 06:59 | sm0ke | ok i found a ugly hack ##(map #(identity [(first %) (Integer. (second %))]) [["a" "1"]]) |
| 06:59 | lazybot | ⇒ (["a" 1]) |
| 07:00 | sm0ke | that is ugly right? |
| 07:00 | sm0ke | ,(map #(vector (first %) (Integer. (second %))) [["a" "1"]]); as pyrtsa said |
| 07:00 | clojurebot | (["a" 1]) |
| 07:01 | sm0ke | this feels much better i guess |
| 07:01 | pyrtsa | Or (juxt first #(Integer. (second %))) |
| 07:01 | sm0ke | ,(doc juxt) |
| 07:01 | clojurebot | "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]" |
| 07:02 | pyrtsa | I think I'd go with something like: (fn [[k v]] [k (Integer. v)]) |
| 07:03 | sm0ke | pyrtsa: yea i think after learning clojure i am getting obsessed with anonymous fns |
| 07:03 | sm0ke | i should try something more readabble |
| 07:03 | pyrtsa | sm0ke: The destructuring in my latest snippet makes it more readable IMO |
| 07:04 | sm0ke | pyrtsa: yea thanks thats much better |
| 07:05 | pyrtsa | Yw. |
| 07:08 | sm0ke | ok so i am now trying to make it handle null cases ##(map #(vector (first %) ((fnil Integer. "1") (second %))) [["a" "1"] ["b"]]) |
| 07:08 | lazybot | java.lang.ClassNotFoundException: Integer. |
| 07:08 | Glenjamin | is the idea to take a map of key->string-number and get a list of [key number] ? |
| 07:12 | pyrtsa | ,(map (fn [[& [k v]]] [k (some-> v (Integer.))]) [["a" "1"] ["b"]]) |
| 07:12 | clojurebot | (["a" 1] ["b" nil]) |
| 07:25 | sm0ke | i think i got disconnected |
| 07:25 | sm0ke | ,((fnil Integer. "1") "2") |
| 07:25 | clojurebot | #<CompilerException java.lang.ClassNotFoundException: Integer., compiling:(NO_SOURCE_PATH:0:0)> |
| 07:26 | sm0ke | isnt Integer . a function?isnt Integer. a function in clojure? |
| 07:27 | pyrtsa | sm0ke: "Integer." isn't a function but a special form (together with the arguments) that requires to be wrapped inside an s-expression. |
| 07:27 | pyrtsa | #(Integer. %) is a function. |
| 07:27 | pyrtsa | And (some-> argument (Integer.)) does the same as ((fnil #(Integer.)) argument) |
| 07:28 | pyrtsa | Oh, sorry, meant to add the % placeholder after "Integer." in the latter of course. |
| 07:29 | sm0ke | ,((fnil #(Integer. %) "1") nil) |
| 07:29 | clojurebot | 1 |
| 07:30 | pyrtsa | ,(some-> nil (Integer.)) |
| 07:30 | clojurebot | nil |
| 07:30 | pyrtsa | ,(some-> "123" (Integer.)) |
| 07:30 | sm0ke | ,((some-> "1" #(Integer. %)) nil) |
| 07:30 | clojurebot | 123 |
| 07:30 | clojurebot | #<NumberFormatException java.lang.NumberFormatException: null> |
| 07:30 | sm0ke | hmm i dont understand some-> still |
| 07:31 | pyrtsa | sm0ke: `some->` is a macro that does equally crazy things to the forms in it as do `->` and `->>` and `some->>`. |
| 07:32 | noncom|2 | hi, I'm trying to construct the vector of arguments for a proxied class elsewhere and then just pass it to (proxy) like (proxy [MyClass] prepared-args-vector ...) but it does not work.. how can I do that? |
| 07:32 | pyrtsa | They don't work together with #(...) or (fn [...] ...) because they change their form. |
| 07:32 | pyrtsa | sm0ke: Just see my example above. You don't need the #(...) wrapping aroung `Integer.` there. |
| 07:32 | sm0ke | thanks pyrtsa ..i will have a look at those macros you mentioned |
| 07:34 | igstan | I'm getting started with cljs and I can't get a browser-connected repl to work. does anyone see anything wrong with these? https://gist.github.com/igstan/3d2c2160a9672cdd42d8 |
| 08:04 | sm0ke | ok so i have a list like [[1 2] [3 4]] on which i want to apply a function inside try catch form and reutnr the first suceesful result |
| 08:05 | bz_g | Hi there |
| 08:05 | bz_g | (Disclaimer: I'm into the clojurecup, lurking here for help!) |
| 08:06 | sm0ke | the problem is clojure gives me "can recur only from tail position" |
| 08:06 | sm0ke | why that limitation..specially when jvm cant optimize tail recurions |
| 08:06 | sm0ke | so my (recur) from is inside the catch form |
| 08:08 | bz_g | I'm now wrestling with friend's authentication, trying to let users login through github *or* a normal account. |
| 08:08 | pyrtsa | sm0ke: loop / recur are for tail-recursive recursion. If you wan't non-tail-recursive, just call the function recursively. |
| 08:09 | TEttinger | (remove nil? (map #(try (apply / %) (catch Exception _ nil)) [[1 2 0] [3 4]])) |
| 08:09 | sm0ke | pyrtsa: omg i think i am losing brain cells |
| 08:09 | sm0ke | thanks lets me try that |
| 08:09 | pyrtsa | Certainly you can achieve your goal without recursion too, e.g. using reduce. |
| 08:10 | bz_g | I managed to use friend for github auth, or for classical auth, but if I define two workflows, it will go through both of them until one succeeds... |
| 08:10 | pyrtsa | ...and reduced. |
| 08:10 | sm0ke | pyrtsa: how does recuce helps here? isnt it for combining a seq into some value |
| 08:10 | sm0ke | reduce* |
| 08:11 | TEttinger | sm0ke: does it need need to be a recursive thing? |
| 08:11 | TEttinger | (first (remove nil? (map #(try (apply / %) (catch Exception _ nil)) [[1 2 0] [0 0 1] [3 4] [1 2]]))) seems to work |
| 08:11 | TEttinger | not in a bot because they block off catch |
| 08:11 | sm0ke | TEttinger: no it doesnt...its just that i dont know anything better |
| 08:11 | sm0ke | :D |
| 08:11 | sm0ke | TEttinger: OMG! |
| 08:11 | TEttinger | for me that returns 3/4 , seems right? |
| 08:11 | sm0ke | but but does it short circuits? |
| 08:12 | pyrtsa | sm0ke: It does. |
| 08:12 | TEttinger | uh I think mine might not |
| 08:12 | TEttinger | since it does do a map |
| 08:12 | sm0ke | hmm let me get my detective lenses to understand |
| 08:12 | pyrtsa | (Although map may do up to 31 steps of extra work with chunked sequences, not that it matters much.) |
| 08:13 | pyrtsa | TEttinger: map is lazy. |
| 08:13 | TEttinger | yes, is remove? |
| 08:13 | pyrtsa | I think so. |
| 08:13 | pyrtsa | filter is. |
| 08:13 | TEttinger | ,(remove nil? (repeat nil)) |
| 08:13 | pyrtsa | And remove uses filter. |
| 08:13 | clojurebot | Execution Timed Out |
| 08:14 | pyrtsa | TEttinger: You're printing the result. |
| 08:14 | TEttinger | oh! |
| 08:14 | TEttinger | ,(first (remove nil? (repeat nil))) |
| 08:14 | pyrtsa | There's no first either. |
| 08:14 | clojurebot | Execution Timed Out |
| 08:14 | pyrtsa | ... in that sequence. .) |
| 08:14 | pyrtsa | :) |
| 08:14 | TEttinger | heh |
| 08:15 | sm0ke | TEttinger: how does it short circuits, could you please explain? |
| 08:15 | TEttinger | sm0ke, uh pyrtsa can explain better. it's a lazy seq |
| 08:15 | TEttinger | (inc pyrtsa) |
| 08:15 | lazybot | ⇒ 1 |
| 08:15 | hyPiRion | see |
| 08:16 | hyPiRion | ,(do (remove nil? (repeat nil)) :no-print) |
| 08:16 | clojurebot | :no-print |
| 08:16 | pyrtsa | sm0ke: Look up laziness in Clojure. :) |
| 08:17 | TEttinger | sm0ke, it's pretty important to do, too. I've been bit by lazy seqs where I didn't expect them before... |
| 08:17 | sm0ke | OK i know one thing for sure repeat is lazy.. |
| 08:17 | TEttinger | sm0ke, nope. only one kind of repeat is :) |
| 08:17 | TEttinger | ,(repeat 3 "whee") |
| 08:17 | clojurebot | ("whee" "whee" "whee") |
| 08:18 | TEttinger | actually I could be wrong |
| 08:18 | TEttinger | ,(class (repeat 3 "whee")) |
| 08:18 | clojurebot | clojure.lang.LazySeq |
| 08:18 | TEttinger | you are correct! |
| 08:18 | pyrtsa | TEttinger: And chunks: |
| 08:18 | pyrtsa | ,(let [a (atom nil)] [(first (filter #(< 1000 %) (map (fn [x] (reset! a x) x) (range)))) @a]) |
| 08:18 | clojurebot | [1001 1023] |
| 08:18 | pyrtsa | ,(let [a (atom nil)] [(first (filter #(< 31 %) (map (fn [x] (reset! a x) x) (range)))) @a]) |
| 08:18 | sm0ke | TEttinger: actually the repl realizes the lazyseq here |
| 08:18 | clojurebot | [32 63] |
| 08:18 | pyrtsa | ,(let [a (atom nil)] [(first (filter #(< 30 %) (map (fn [x] (reset! a x) x) (range)))) @a]) |
| 08:18 | clojurebot | [31 31] |
| 08:19 | TEttinger | interesting, pyrtsa |
| 08:20 | pyrtsa | So internally, map and filter use a granularity of 32, in the current version of Clojure. |
| 08:20 | sm0ke | TEttinger: it doesnt...##17:14 < lazybot> ⇒ 1 |
| 08:20 | pyrtsa | ...unless you give a chunked seq to them, with a different chunk size. |
| 08:20 | sm0ke | 17:15 < hyPiRion> see |
| 08:20 | sm0ke | 17:15 < hyPiRion> ,(do (remove nil? (repeat nil)) :no-print) |
| 08:20 | sm0ke | 17:15 < clojurebot> :no-print |
| 08:20 | sm0ke | omg sorry wrong paste |
| 08:20 | sm0ke | ,(first (remove nil? (map #(try (do (println %) (apply / %)) (catch Exception _ nil)) [[1 2 0] [0 0 1] [3 4] [1 2]]))) |
| 08:20 | clojurebot | sm0ke: Excuse me? |
| 08:21 | hyPiRion | heh |
| 08:21 | pyrtsa | (And chunked seq's are practically not documented at all.) |
| 08:21 | TEttinger | yeah it can't do catch |
| 08:21 | sm0ke | try that is prints everything |
| 08:21 | sm0ke | hyPiRion: sorry man didnt mean to wake you up |
| 08:21 | TEttinger | oh that's what you meant! |
| 08:21 | pyrtsa | sm0ke: Suggestion: use `lein repl` or Emacs or something for playing around with things like that. |
| 08:22 | sm0ke | pyrtsa: i am already on a repl |
| 08:22 | hyPiRion | sm0ke: no worries, I'm quite awake. It's 2 pm here |
| 08:22 | pyrtsa | Cool. :) |
| 08:23 | sm0ke | so can we have show circuting try catch on seq without recusrions? |
| 08:23 | pyrtsa | sm0ke: Pretty much everything is a recursion internally. But you can achieve it with reduce (and `(reduced result)`). |
| 08:24 | TEttinger | yeah sm0ke, it short circuits for me at 32 I think. it evals 32 or 31 or so, then stops and gets the first |
| 08:24 | pyrtsa | I mean, everything of map, filter etc. |
| 08:26 | sm0ke | TEttinger: But you snippet prints every element when i put a println form |
| 08:26 | sm0ke | inside the try form |
| 08:26 | pyrtsa | sm0ke: How long was your sequence then? More than 32 elements? |
| 08:28 | sm0ke | pyrtsa: yea its not long..but the action which i want to do on each item needs a socket operation so its pretty expensive |
| 08:28 | pyrtsa | sm0ke: Working on it... Wait a sec. |
| 08:28 | sm0ke | :D nice guys |
| 08:28 | sm0ke | i am like the 'Lauging clown' as coined by zeromq guide |
| 08:30 | sm0ke | i think we can have it if clojure had a (drop-until) or something like that |
| 08:30 | pyrtsa | drop-while, yes. It works. |
| 08:31 | sm0ke | give me give me |
| 08:31 | pyrtsa | Well... (first (drop-while pred xs)) should probably do the job. |
| 08:33 | sm0ke | this has to be weird ..even this prints everything (first (drop-while nil? (map #(try (do (println %) (apply / %)) (catch Exception _ nil)) [[1 2 0] [0 0 1] [3 4] [1 2]]))) |
| 08:33 | pyrtsa | The map is the problem here. |
| 08:33 | pyrtsa | It's chunked. |
| 08:35 | pyrtsa | This definition gives you a simple and totally lazy map: (defn map1 [f xs] (reductions (fn [_ x] (f x)) nil xs)) |
| 08:36 | pyrtsa | sm0ke: Try it in place of map in your above snippet. |
| 08:37 | sm0ke | pyrtsa: let me try |
| 08:38 | TEttinger | sm0ke ah, there's another. you can just call lazy-seq on your vector |
| 08:38 | sm0ke | pyrtsa: yea that works.. |
| 08:38 | TEttinger | and that will have a chunk of 1 |
| 08:38 | pyrtsa | TEttinger: That's a good one. |
| 08:38 | pyrtsa | The best advice actually. |
| 08:38 | TEttinger | thanks |
| 08:39 | pyrtsa | TEttinger: Oh, does it work like that, actually? The documentation looks like not. |
| 08:39 | sm0ke | TEttinger: nope doesntworks ..(first (drop-while nil? (map #(try (do (println %) (apply / %)) (catch Exception _ nil)) (lazy-seq [[1 2 0] [0 0 1] [3 4] [1 2]])))) |
| 08:39 | TEttinger | argh ran the wrong code |
| 08:39 | pyrtsa | TEttinger: lazy-seq is used when making the recursion step lazy. |
| 08:40 | sm0ke | so the issue here is that the seq we are working with is not lazy? |
| 08:41 | pyrtsa | sm0ke: It's not fully lazy. It's lazy with chunks of 32 elements. |
| 08:41 | sm0ke | pyrtsa: can we make it lazy with chunk of 1? :D |
| 08:42 | pyrtsa | sm0ke: I think that's something that's still missing in Clojure. |
| 08:42 | pyrtsa | :) |
| 08:42 | sm0ke | :( |
| 08:42 | pyrtsa | Patches welcome, I suppose. |
| 08:42 | TEttinger | I am pretty sure this can be done though |
| 08:42 | pyrtsa | IIRC, Fogus blogged about it like 3 years ago. But his blog is offline since a few weeks ago. |
| 08:42 | pyrtsa | TEttinger: Definitely. |
| 08:43 | sm0ke | pyrtsa: what is that map1 thing you gave? |
| 08:43 | pyrtsa | sm0ke: It's my best quick tip for you to get the job done. |
| 08:43 | pyrtsa | Effectively does the same as map but with a chunk size of 1. |
| 08:44 | pyrtsa | (And with one sequence as argument only, as you see.) |
| 08:44 | sm0ke | hmm it works but not very intutive for me |
| 08:48 | pyrtsa | sm0ke: I think it is if you understand reductions. |
| 08:48 | pyrtsa | But here's an alternative impl (map2): https://gist.github.com/pyrtsa/6741499 |
| 08:49 | pyrtsa | I need to go. Have a good one. -> |
| 08:50 | sm0ke | thanks pyrtsa |
| 08:51 | jonasen | technomancy: I guess this is ok while developing: https://github.com/technomancy/syme/blob/master/src/syme/web.clj#L21 |
| 08:52 | jonasen | technomancy: I'm thinking of doing the same thing.. |
| 08:54 | pyrtsa | Oh, one more thing... |
| 08:55 | pyrtsa | sm0ke: Of course you can change any sequence to lazy with this: (defn lazy [xs] (reductions (fn [_ x] x) nil xs)) |
| 08:56 | hyPiRion | No value of making a sequence lazy when it's already realized |
| 08:57 | igstan | how does js array access look like in cljs? |
| 08:57 | sm0ke | good one |
| 08:58 | sm0ke | i am goined to name is unchunked and copy it shamelessly @ pyrtsa |
| 08:58 | igstan | found out. it's (aget js-array index) |
| 09:04 | piranha | anybody using cljsbuild crossovers here? Can't get it to work :( |
| 09:26 | dissipate | wtf, who wrote the 4th solution to FizzBuzz in clojure here: http://rosettacode.org/wiki/FizzBuzz#Clojure ? that solution is cray |
| 09:30 | hashcat | hi , can anyone give me a reason why clojure rather than other lisp on jvm? |
| 09:31 | jowag | hashcat: immutability |
| 09:31 | jowag | hashcat: composable abstractions, opposed to inheritance |
| 09:31 | hyPiRion | dissipate: crazy? |
| 09:32 | dissipate | hyPiRion, yep. |
| 09:32 | jowag | ambrosebs: does core.typed recognize a "type kind" concept, or I should just use (marker) protocols for that? |
| 09:32 | hashcat | jowag: helpful, thanks. honestly, My first lisp is clojure |
| 09:32 | dissipate | hyPiRion, do you understand all of those solutions to FizzBuzz in Clojure? |
| 09:33 | ambrosebs | jowag: what do you mean? |
| 09:34 | hashcat | ambrosebs: kind can be recognized as type of type. |
| 09:34 | hyPiRion | dissipate: well, yes. But I think any person who has worked with Clojure for some time would |
| 09:34 | hyPiRion | Some of them aren't that idiomatic though |
| 09:36 | ambrosebs | I don't see how marker protocols are relevant, so I assumed jowag was talking of something else? |
| 09:36 | dissipate | hyPiRion, i don't understand why 'f' and 'b' have to be passed to 'str' in the 4th solution |
| 09:36 | ambrosebs | we have higher kinded/rank types in core.typed. |
| 09:37 | hyPiRion | dissipate: concatenating strings together |
| 09:37 | hyPiRion | ,(let [f "foo" b "bar"] (str f b)) |
| 09:37 | clojurebot | "foobar" |
| 09:37 | dissipate | hyPiRion, ah, i see. yeah, it's not too bad actually. i think i initially freaked out about the verbosity. |
| 09:38 | dissipate | hyPiRion, which ones aren't idiomatic? |
| 09:38 | jowag | ambrosebs: i meant type of types |
| 09:39 | dissipate | i like the 3rd solution |
| 09:39 | jowag | ambrosebs: e.g. I soemtimes want to accept symbol or a keyword. If I just use something like Named protocol, it is more of a duck typing |
| 09:40 | hyPiRion | dissipate: second one is on one line. third one starts with `(lazy-seq (map` (map is lazy) |
| 09:41 | dissipate | hyPiRion, so the third one needs to be fixed. the 5th one is idiomatic? |
| 09:41 | hyPiRion | dissipate: coulda replaced the whole if-let thing with an "or" if used correctly |
| 09:41 | hyPiRion | that's what I would do |
| 09:42 | hashcat | jowag: https://github.com/clojure/core.typed/wiki/User-Guide#higher-kinded-variables |
| 09:42 | dissipate | hyPiRion, edit the page and fix it up. :D |
| 09:42 | ambrosebs | I don't think jowag is talking about higher rank types. Named is just an interface. |
| 09:43 | ambrosebs | jowag: I think you mean you want a supertype, not a type of types. |
| 09:43 | jowag | ambrosebs: well yes, but it can be a poor man's solution if you to represent a set of types |
| 09:44 | jowag | ambrosebs: maybe, I'm not at home in type theory |
| 09:44 | ambrosebs | jowag: do you mean union types? |
| 09:44 | ambrosebs | (U Symbol Keyword) |
| 09:45 | jowag | well union is not extensible |
| 09:46 | hashcat | could someone help me with eclipse? when I type "(def" and expect a complement of "(defprotocol" |
| 09:46 | hashcat | it just show me "(defn". what did I miss? |
| 09:46 | hyPiRion | https://www.refheap.com/19104 probably |
| 09:48 | ambrosebs | jowag: what's wrong with Named? |
| 09:48 | IamDrowsy | hashcat: do you have a running repl instance? |
| 09:49 | hashcat | IamDrowsy: I don't know whether it already run or not |
| 09:51 | hashcat | I just create a project and expect complementation would work |
| 09:51 | jowag | ambrosebs: currently it serves the purpose, but it does not convey the message, if I wanted to accept an identifier and not any type implementing Named (e.g. namespace or string may implement Named protocol in the future) |
| 09:53 | IamDrowsy | so load the file in a repl (strg + alt + s) and try again |
| 09:53 | ambrosebs | jowag: I think I need to see some code. I don't know what you mean. |
| 09:53 | hashcat | IamDrowsy: strg? |
| 09:53 | IamDrowsy | ctrl :) sry |
| 09:55 | dissipate | hyPiRion, i see, thanks for the example. |
| 09:55 | hashcat | it still only show me defn |
| 09:55 | hashcat | and slow down |
| 10:00 | IamDrowsy | hm.. it works for me. do you have a window "REPL @ ...." open now? |
| 10:00 | IamDrowsy | if not try to start the repl via menu (Clojure -> Load file in Repl) |
| 10:01 | jowag | ambrosebs: it is not a practical problem, just me wrapping my head around all this type stuff and imagining what-if |
| 10:01 | jowag | ambrosebs: anyway thanks for help |
| 10:02 | jowag | and everybody please support http://www.indiegogo.com/projects/typed-clojure :) |
| 11:14 | hashcat | IamDrowsy : sorry, I was leaving |
| 11:22 | hashcat | still only defn |
| 11:45 | juliangindi | Does anyone have a "better" debugging tool? I just got a stack-trace that does not mention any source code files I created |
| 12:13 | nDuff | juliangindi: clj-stacktrace will make your stack traces cleaner / easier to work with |
| 12:13 | nDuff | juliangindi: ...and if you want something serious and don't mind overhead setting it up, there's ritz |
| 12:17 | seangrov` | nDuff: you recommend ritz? I still haven't used it, might be time to play with it a bit |
| 12:19 | juliangindi | nDuff: clj-stacktrace looks pretty good. I'm gonna give that a whirl. |
| 12:19 | nDuff | I don't use ritz habitually -- actually, if I need to trace something in execution, I'm just as likely to reach for Light Table (and set it back down after) -- but it's a good tool; just has a lot of moving parts that need to be set up just so to work. |
| 12:27 | john2x | how do I get the md5 hash of a string in clojure? |
| 12:30 | ivan | getting a NullPointerException after my JavaScript builds, am I doing something wrong? https://www.refheap.com/027b8ba6b2a2ee49daa784ef0/raw |
| 12:31 | jonasen | john2x: http://stackoverflow.com/a/415971/24946 |
| 12:31 | nDuff | john2x: ideally, use apache commons-codec's DigestUtils; the version in the Java standard library is pretty funky. |
| 12:31 | nDuff | john2x: (org.apache.commons.codec.digest.DigestUtils/md5 "string") |
| 12:32 | john2x | thanks! |
| 12:34 | Jarda | when using hickup.form, is there a way to easily pass classes for the elements created and/or error descriptions? |
| 12:35 | Glenjamin | Jarda: you can pass a map as the first argument, which will become the element's attributes |
| 12:51 | sm0ke | hello is it a good practice to have blocking parts of your code inside a go block? |
| 12:52 | sm0ke | i have an application where on part is a ring server..another is a database handler part |
| 12:52 | sm0ke | can i just put their main entry point inside seperate go blocks? |
| 12:53 | sm0ke | although i have read core.async author telling somewhere that go blocks should be used for cpu intensive tasks |
| 12:54 | sm0ke | but to be honest most applications rarely write things which are cpu intensive per se..but depend a lot on network io database io etc |
| 12:54 | sm0ke | considering that i think go blocks are useless than |
| 12:56 | sm0ke | otoh i can just spawn a thread but i would really like to make use of channels which are really nice imo |
| 12:56 | sm0ke | blah blah bleh.. |
| 12:57 | ivan | oh, I see, I managed to guess that my .cljs file needed an (ns ) |
| 12:58 | sm0ke | ivan: haha living dangerously..i never tried on without a (ns) |
| 12:59 | sm0ke | .cljs? whats that clojure script/ |
| 12:59 | sm0ke | is that really something worth trying in production? |
| 13:00 | ivan | yes |
| 13:00 | sm0ke | i always have a feeling that compiling to js is a bad idea |
| 13:01 | nDuff | javascript is an awful language. Why would you want to write in it directly? |
| 13:01 | sm0ke | nDuff: to save the pain of having to debug in js first than on cljs |
| 13:02 | nDuff | sm0ke: *shrug*. It's a matter, I suppose, of how heavily interop-dependent your code is. |
| 13:02 | sm0ke | nDuff: its not like when your js crashes ...you know where to look for in cljs? or is it? |
| 13:02 | nDuff | sm0ke: if 95% of your cljs all runs in native Clojure, you can have your unit tests happen before it ever touches a browser. |
| 13:03 | nDuff | sm0ke: ...and, well, you can have the other 5% unit tested in a browser, too, if you need to. |
| 13:03 | nDuff | look at the Pedestal dataflow model for an example of things done right. |
| 13:03 | seangrov` | sm0ke: There's also source maps, but cljs may be too young for you |
| 13:03 | nDuff | almost everything that matters is in code that's very easy to reproduce and prove behavior for. |
| 13:04 | nDuff | sm0ke: anyhow -- I've had CLJS in production for over a year, and it works for me. |
| 13:04 | sm0ke | nDuff: i really have a feeling(tm) that unut testing 95% of your cljs doesnt really tells you how it would behave in a browser.. |
| 13:04 | sm0ke | unit* |
| 13:04 | nDuff | sm0ke: that "feeling" would be wrong, if you keep it interop-free. |
| 13:04 | nDuff | sm0ke: which is why you do all the interop in the 5%. :) |
| 13:04 | sm0ke | hmm i really cant say much..i havent had a look at cljs |
| 13:05 | sm0ke | but i have seen fails like coffescript, cappuchino, gwt etc etc |
| 13:05 | sm0ke | :/ |
| 13:05 | nDuff | ...the debugging stack there is beautiful. |
| 13:05 | nDuff | Seriously. Thing of beauty. Love it. |
| 13:06 | sm0ke | nDuff: you are insane |
| 13:06 | nDuff | sm0ke: I think the difference between us is that you treat generated javascript as code to be debugged. That's a mistake. |
| 13:06 | sm0ke | its ugly as hell ... trying to write 20 lines of code which you can do in 1 line of js |
| 13:07 | nDuff | sm0ke: ...unless you dive into compiler-generated assembly for C, why would you dive into compiler-generated javascript? |
| 13:07 | nDuff | Oh. Well, yes, the java bits are ugly because they've Java. |
| 13:07 | nDuff | That's unavoidable. The *toolchain*, though, is beautiful. |
| 13:07 | sm0ke | nDuff: oh so you really belive that "Js is assenbly of browser"? |
| 13:07 | sm0ke | assembly* |
| 13:08 | nDuff | sm0ke: Exactly -- I do drink that kool-aid. |
| 13:09 | sm0ke | i really think js is too high level to be considered an assembly |
| 13:09 | hashcat | what's the best ide for clojure? |
| 13:10 | nDuff | sm0ke: it's an _awful_ high-level language. Better to just ignore what it does badly and focus on using the good parts -- which is to say, the really fast JIT compilation in modern browsers. |
| 13:10 | nDuff | hashcat: the general consensus is emacs. |
| 13:10 | nDuff | hashcat: you can see the survey for a breakdown of what people use. |
| 13:10 | nDuff | hashcat: http://cemerick.com/2012/08/06/results-of-the-2012-state-of-clojure-survey/ <- there hasn't been one for 2013. |
| 13:10 | hashcat | nDuff: can it be integrated with lein? |
| 13:10 | sm0ke | nDuff: agreed awful..but its too good for dom manipulation...couldnt have been better |
| 13:11 | hiteki | hashcat: yes it can |
| 13:11 | dnolen | jonasen: http://cljsfiddle.net, cool! |
| 13:11 | hashcat | but how? |
| 13:11 | hiteki | hashcat: as far as I remember there is even a lein emacs mode available on marmalade (elein) |
| 13:11 | sm0ke | wait a minute ..i was here asking about the concurrency shit..i am still not able to figure out in clojure |
| 13:12 | sm0ke | somehow whenever is ask about concurrency i never get a reply |
| 13:12 | nDuff | hashcat: watch some of the live-coding videos from the Overtone folks for an idea of just how good the integration is. |
| 13:12 | hyPiRion | eh what |
| 13:12 | hyPiRion | doesn't cl-format work with *err* ? |
| 13:12 | sm0ke | i use vim |
| 13:13 | sm0ke | and i hate enter meta alt control space |
| 13:13 | nDuff | hashcat: this video is years old, and the tools have gotten better since then, but see http://vimeo.com/22798433 |
| 13:13 | sm0ke | :D |
| 13:14 | nDuff | sm0ke: I use the right tool for the job. For 80% of the languages I work on that's vim, but for Clojure, it's Emacs. |
| 13:14 | sm0ke | nDuff: wow you can do that? you must be having evil in emacs than? |
| 13:15 | nDuff | sm0ke: nope. |
| 13:15 | nDuff | sm0ke: I've had finger-memory for multiple editors for decades now. |
| 13:15 | sm0ke | nDuff: you must be chuck norris than |
| 13:16 | hashcat | but why emacs drop 10%? |
| 13:16 | nDuff | Newcomers, I'm guessing. |
| 13:16 | sm0ke | comiler doesnt warn nDuff he warns the compiler |
| 13:17 | hashcat | ok, I give it a try |
| 13:17 | sm0ke | hey hashcat also try vim with fireplace plugin |
| 13:18 | hashcat | no. I tried intelliJ and eclipse. using gedit now |
| 13:19 | sm0ke | hashcat: haha good one |
| 13:19 | nDuff | hashcat: if you want a configuration that's pre-built, the fellow who put together that video is behind https://github.com/overtone/emacs-live |
| 13:19 | hashcat | intelliJ and eclipse are silly enough. |
| 13:19 | sm0ke | hey nDuff you got any apps with clojure in production? |
| 13:19 | nDuff | sm0ke: not public, but yes. |
| 13:20 | sm0ke | nDuff: just want some advice ... how do you handle concurrency..i mean you use threads..future..goroutines? |
| 13:21 | hashcat | nDuff:it looks great! |
| 13:22 | sm0ke | what the hell is that glow |
| 13:22 | nDuff | sm0ke: everything I have in production predates core.async. atoms, mostly; refs, occasionally; agents, fairly often. |
| 13:22 | scottj | sm0ke: the glow is fake |
| 13:23 | nDuff | sm0ke: If you want a good discussion of which concurrency primitives to use when, I strongly suggest reading Joy of Clojure |
| 13:23 | sm0ke | :D i knew it those emacs guys will do anything to seduce new people |
| 13:23 | sm0ke | nDuff: which chapter in particular? |
| 13:23 | sm0ke | nDuff: also i dont think it would be covering core.async? |
| 13:24 | sm0ke | as its fairly old book |
| 13:24 | nDuff | the upcoming second edition might touch on core.async |
| 13:24 | nDuff | (and said second edition _is_ available in early access) |
| 13:24 | nDuff | I don't have chapter titles/numbers memorized. |
| 13:25 | sm0ke | nDuff: ok ill have a look thanks |
| 13:27 | ivan | is there some way to control lein-cljsbuild's :jvm-opts? |
| 13:28 | mdeboard | Has there been a particular design pattern that's been settled around wrt channels? |
| 13:28 | mdeboard | or is it pretty much piles of functions |
| 13:40 | dnolen | pretty sweet - http://cljsfiddle.net/fiddle/swannodette.test-logic |
| 13:42 | dnolen | mdeboard: not sure what you mean |
| 13:45 | bbloom | dnolen: ambrosebs: RE: type providers - I explain how that gist dnolen pointed out differs from F#'s type providers https://news.ycombinator.com/item?id=6462374 |
| 13:46 | mdeboard | dnolen: Well, for example at work, we use a mediator pattern to declare how "subapps" within a single application communicate with each other. What signals subapps' controllers handle & emit, and so on. In this dumb little HTML/JS game I'm working on, I'mjust kind of making up a design pattern around channels, and was wondering if there's a better way. |
| 13:47 | mdeboard | right now I'm just piling up functions and calling them e.g. https://gist.github.com/6744265 |
| 13:47 | mdeboard | relevant bit at line 102 |
| 13:48 | mdeboard | initialize all the channels, then pass them to relevant consumers |
| 13:49 | dnolen | mdeboard: at first glance looks fine, however 75-90 those fns aren't different |
| 13:49 | mdeboard | yeah, I'm still trying to get my spaceship to fly around atm before I put in more abstractions |
| 13:50 | mdeboard | but I mean imagine a much larger program I guess, would it still just be directly initializing the channels and passing them to consumers? I do'nt know what I'm asking really. |
| 13:51 | dnolen | bbloom: nice |
| 13:52 | bbloom | in my best jesse pinkman voice: decomplected, bitch |
| 13:53 | dnolen | mdeboard: using core.async takes some getting used to - you'll figure out a nice pattern soon enough I suspect. But yes making channels and sending them to other fns w/ go blocks is not unusual. |
| 13:53 | mdeboard | Alrighty. I Just collapsed 75-90 down into (init-chan) |
| 14:06 | juliangindi | Hey every. I'm attempting to grab some data from a JSON api response but am having difficulties because the type is String. Are there any libraries that will make parsing this data easier? |
| 14:08 | gfredericks | juliangindi: you want to parse a json string? cheshire will do that with one function call |
| 14:09 | juliangindi | gfredericks: This looks super badass. Thanks! |
| 14:11 | gfredericks | juliangindi: if you're using clj-http to get the "api response", it will do it for you as well |
| 14:11 | gfredericks | with the :as :json option |
| 14:12 | mdeboard | juliangindi: Cheshire is amazing |
| 14:12 | mdeboard | Need it for clojurescript imo |
| 14:12 | mdeboard | though I guess `(.parse js/JSON s)` |
| 14:13 | juliangindi | Hmm. I'm running into this error: clojure.lang.PersistentArrayMap cannot be cast to java.lang.String |
| 14:13 | juliangindi | when using Cheshire |
| 14:14 | mdeboard | juliangindi: how are you using it |
| 14:14 | jonasen | dnolen: I tried to update to the latest clojurescript version but I couldn't make it work.. I got "Wrong number of args (3) passed to: reader-types$indexing-push-back-reader". I'll try again tomorrow.. |
| 14:14 | gfredericks | juliangindi: does (cheshire.core/parse-string "{}") work for you? |
| 14:15 | dnolen | jonasen: it depends on tools.reader 0.7.8, it's a declared dep |
| 14:15 | jonasen | maybe I pull in the wrong version via some other dependency.. |
| 14:16 | juliangindi | gfredericks: That does work for me |
| 14:16 | dnolen | jonasen: would love to get warnings in this :) |
| 14:17 | dnolen | jonasen: still it's amazing |
| 14:17 | dnolen | http://cljsfiddle.net/fiddle/swannodette.test-match |
| 14:17 | jonasen | yes.. there is still a WIP. |
| 14:18 | jonasen | but I'm really happy with the perf of the edit/compile/run cycle... it's faster than cljsbuild for me :) |
| 14:19 | juliangindi | gfredericks: Got it working =) |
| 14:21 | dnolen | jonasen: yes this is going to be a great tool, thanks much |
| 14:21 | mdeboard | jonasen, dnolen: This is kind of like dommy's `set-text!` isn't it? https://github.com/Prismatic/dommy/blob/master/src/dommy/core.cljs#L50 |
| 14:22 | dnolen | mdeboard: yeah I should probably use that, never used dommy before though |
| 14:22 | mdeboard | (not saying it's redundant, earnest question) |
| 14:22 | jonasen | dommy is available (but I haven't actually tried it :) |
| 14:23 | jonasen | I'm more used to domina |
| 14:23 | mdeboard | Their blog post on it boasts some pretty good performance gains, at least over jquery DOM manip |
| 14:23 | mdeboard | http://blog.getprismatic.com/blog/2013/4/29/faster-better-dom-manipulation-with-dommy-and-clojurescript |
| 14:23 | jonasen | mdeboard: yeah, I'm sure it's great |
| 14:24 | gfredericks | juliangindi: good |
| 14:35 | mdeboard | I've been relying on cljsbuild to inject cljs dep into my project because the last version of cljs I tried didn't play well with core.async. Is there a version I can put in my project.clj now |
| 14:36 | dnolen | mdeboard: latest core.async and CLJS work fine together |
| 14:37 | radix | heya, do most people who want to do asynchronous I/O in clojure just use jetty directly? |
| 14:39 | radix | async socket I/O in particular |
| 14:40 | juliangindi | I am attempting to get some data within a particularly ugly data structure. Could anyone tell me how I could make this cleaner? https://gist.github.com/Julian25/6744759 |
| 14:42 | radix | hum. got confused I think :) |
| 14:42 | mdeboard | dnolen: Is latest of each on maven? |
| 14:42 | dnolen | mdeboard: should be |
| 14:42 | mdeboard | 0.1.242.0-44b1e3-alpha for core.async and 0.0-1909 for cljs? Those are compat? |
| 14:43 | callen | dnolen: thanks for posting cljsfiddle, that's cool! |
| 14:44 | dnolen | callen: thank jonasen since he did all the actual work :) |
| 14:44 | callen | dnolen: I know, just glad to be aware of it. we might use it to fiddle around for our Clojure Cup project :) |
| 14:44 | callen | jonasen: thanks for making cljsfiddle :) |
| 14:44 | jonasen | callen: that would be awesome... hope it helps |
| 14:44 | mdeboard | juliangindi: Is this json you're talking about? |
| 14:44 | jonasen | callen: thanks |
| 14:45 | juliangindi | mdeboard: Yeah, I parsed the JSON string and now I'm just trying to get one piece of data from it |
| 14:46 | callen | jonasen: do you have a Twitter I can follow? |
| 14:46 | mdeboard | juliangindi: Yeah I mean it's basically like JSON in any other language, you have to walk the tree. I'd just use named attribute access for the easiest way. |
| 14:46 | jonasen | I do, but I don't use it much: https://twitter.com/jonasenlund |
| 14:47 | mdeboard | (:foo (:bar (:baz (:wut (:lol (parse-string :body)))))) |
| 14:47 | juliangindi | mdeboard: Yeah, I think I'll have to use a mixture of named attributes and numbered indexes |
| 14:47 | bbloom | (doc get-in) |
| 14:47 | clojurebot | "([m ks] [m ks not-found]); Returns the value in a nested associative structure, where ks is a sequence of keys. Returns nil if the key is not present, or the not-found value if supplied." |
| 14:47 | mdeboard | juliangindi: Or you could use clojure.zip |
| 14:47 | callen | jonasen: well just in case :) |
| 14:47 | mdeboard | bbloom: Nice |
| 14:47 | bbloom | (get-in whatever [:foo 5 :bar 2 3 4]) |
| 14:48 | mdeboard | Very nice |
| 14:48 | bbloom | just a tree of maps & vectors |
| 14:48 | callen | making update-in do the right thing with scalars that can get promoted to vectors is fun. |
| 14:48 | bbloom | using vectors as "paths" in a tree is good fun & quite useful |
| 14:49 | mdeboard | `(get-in {:foo [0 1 2 3 {:bar [4 5 [6 7 8 [9 10 11]]]}]}) |
| 14:49 | mdeboard | ? |
| 14:49 | bbloom | ,(get-in {:foo [:x :y] :bar [:z]} [:foo 1]) |
| 14:49 | clojurebot | :y |
| 14:50 | mdeboard | man tha'ts slick |
| 14:50 | bbloom | (update-in {:foo [:x :y] :bar [:z]} [:foo 1] inc) |
| 14:50 | mdeboard | people ar esmart |
| 14:50 | bbloom | er, i mean |
| 14:50 | bbloom | ,(update-in {:foo [5 10] :bar [15]} [:foo 1] + 2) |
| 14:50 | clojurebot | {:foo [5 12], :bar [15]} |
| 14:52 | bbloom | what's awesome about that is you can chain it ##(-> {:foo [1 2]} (update-in [:foo] conj 3) (update-in [:foo 1] + 10) (update-in [:foo] (partial mapv inc))) |
| 14:52 | lazybot | ⇒ {:foo [2 13 4]} |
| 14:52 | bbloom | let's you do imperitive-ish field-by-field updates w/o mutation & clean syntax |
| 14:54 | dobry-den | In ever emacs nrepl config I encounter, people either have nrepl exceptions left default (open up a buffer that you have to :q on any exception) or they turn off the notification entirely so all you get is a minibuffer error without even a line number. |
| 14:55 | dobry-den | Ideally exceptions would display in some temporary buffer that I dont need to painstakingly navigate to just to close. Is there a middleground? |
| 14:58 | dobry-den | (nrepl-popup-on-error nil) (nrepl-popup-stacktraces-in-repl t) (nrepl-popup-stacktraces nil) is what I have, but it just displays a one-liner in the minibuffer. |
| 15:05 | mdeboard | Is there something special I need to do to use (:use-macros) in my ns definition? I created a src/cljs/clj_typeshooter/macros.cljs file and updated my ns def to read https://gist.github.com/mattdeboard/6744997 but when I go to cljsbuild, it tells me it can't find "macros.clj" |
| 15:05 | mdeboard | How do I let cljsbuild know that it's a cljs file, not clj ? |
| 15:05 | mdeboard | Oh, it needs to be a clj :) |
| 15:15 | mdeboard | Anyone spot anything particularly wrong with this macro? https://gist.github.com/mattdeboard/bf1c291b96e048461c19 |
| 15:16 | dobry-den | ~update-ch? |
| 15:16 | clojurebot | Pardon? |
| 15:18 | mdeboard | That's just a channel that would be passed in to the function that invoked `go-handle!' |
| 15:18 | mdeboard | This is actually a macro for use with CLJS, for UI event handlers to update an "update channel" to redraw the canvas |
| 15:18 | dnolen | mdeboard: you need ~update-ch in order to insert whatever the user provided |
| 15:19 | mdeboard | Oh, I see |
| 15:19 | dobry-den | yeah that's what i meant |
| 15:20 | mdeboard | be that as it may, still getting the following: Caused by: clojure.lang.ExceptionInfo: Could not locate cljs/core/async__init.class or cljs/core/async.clj on classpath: at line 1 src/cljs/clj_typeshooter/macros.cljs |
| 15:20 | mdeboard | is it because I'm not requiring cljs.core.async? |
| 15:21 | mdeboard | That doesn't work either. I dunno why I ever bother with macros, they just turn into a huge timesink for me :P |
| 15:22 | dobry-den | mdeboard: dude, same. i was just about to ask if anyone could point me in the right direction for writing a macro that can dynamically set the ns: https://www.refheap.com/19116 |
| 15:24 | dobry-den | or maybe there's a better way to have a set of requires/imports/uses that you want consistent across a group of namespaces |
| 15:24 | Leonidas | can I say to leiningen to refer to an local git checkout somehow? |
| 15:25 | Leonidas | so I don't have to upload every change to clojars again and again. |
| 15:25 | dobry-den | Leonidas: i bet so, https://github.com/technomancy/leiningen/blob/master/sample.project.clj |
| 15:27 | mdeboard | Whoops, forgot to delete macros.cljs, that was throwing the error. |
| 15:27 | wink | Leonidas: not git checkout, but local .m2 is pretty easy. see http://stackoverflow.com/questions/8738664/dependencies-in-maven-local-repositories-with-leiningen or something |
| 15:27 | Leonidas | dobry-den: uhm, sorry for being dumb but I scanned it and couldn't find it… which option is that? |
| 15:28 | dobry-den | neither could i |
| 15:28 | Leonidas | ohhai wink :) |
| 15:28 | wink | ehlo :) |
| 15:30 | Leonidas | will try lein-localrepo |
| 15:30 | piranha | dnolen: hi, I'm having a really strange (as in: have no idea what's going on) error when using 1909, but everything compiles nicely when using 1877 |
| 15:30 | piranha | error is here: http://paste.in.ua/8774/ |
| 15:31 | dnolen | somehow you're not getting tools.reader 0.7.8 |
| 15:31 | piranha | hm ok |
| 15:31 | wink | Leonidas: or google roudn for local maven repo. been a while |
| 15:31 | clojurebot | Cool story bro. |
| 15:32 | piranha | oh it was in my project.clj, version 0.7.6... :\ |
| 15:32 | Leonidas | wink: yeah. but it is still kinda a bother compared to PYTHONPATH trickery, unfortunately. |
| 15:33 | piranha | dnolen: I thought removing tools.reader from deps in project.clj should've helped, is that right? Because it did not and I had to bump its version there... |
| 15:34 | dnolen | should just work |
| 15:34 | dnolen | piranha: you can confirm with lein deps-tree |
| 15:34 | piranha | ok! :) |
| 15:34 | piranha | thanks |
| 15:34 | dnolen | piranha: https://github.com/the-kenny/lein-deps-tree |
| 15:35 | dnolen | piranha: I just tried it on core.async itself and I saw 0.7.8 |
| 15:35 | piranha | heh ok :) |
| 15:36 | piranha | I also had a question about how do I write a macro properly... |
| 15:36 | piranha | I have one and when it executes cljs reports 'Use of undeclared Var ....' |
| 15:37 | piranha | it's quite simple, but I still don't understand what's wrong: https://github.com/piranha/pump/blob/master/src/pump/def_macros.clj#L16 |
| 15:37 | technomancy | Leonidas: you want checkout deps; check `lein help faq` |
| 15:38 | dnolen | piranha: what does it say is undeclared? |
| 15:39 | piranha | dnolen: something like that: WARNING: Use of undeclared Var warmagnet.components/Navbar at line 16 cljs/warmagnet/components.cljs |
| 15:39 | piranha | that's when I do (defr Navbar ...) in ns warmagnet.components |
| 15:40 | Leonidas | technomancy: okay, thanks, will try. |
| 15:42 | the-kenny | huh? The lein deps-tree plugin was just for 1.x if I remember correctly |
| 15:42 | the-kenny | It's functionality was merged to 2.0 as lein deps :tree |
| 15:42 | the-kenny | s/It's/Its/ |
| 15:45 | dnolen | piranha: when do you see this? during auto build? |
| 15:45 | piranha | dnolen: yes |
| 15:46 | dnolen | piranha: do you see this if you do a clean build |
| 15:46 | dnolen | ? |
| 15:46 | Leonidas | technomancy: works, thanks! |
| 15:48 | piranha | dnolen: yep |
| 15:49 | dnolen | piranha: huh, would need a minimal project that exhibits the issue to investigate further, I don't see anything obviously wrong w/ your macro at the moment |
| 15:50 | piranha | dnolen: ok! :) well if you have time, cloning github.com/piranha/pump and running cljsbuild there will show this problem, but I'll make smaller project if you want after clojure cup :) |
| 15:50 | mdeboard | omfg my handler macro works |
| 15:50 | mdeboard | what the hell |
| 15:50 | mdeboard | Something is wrong, I wrote a macro that works |
| 15:53 | mdeboard | literally cannot believe https://gist.github.com/mattdeboard/6745533 |
| 16:13 | mdeboard | dobry-den: I did it! https://github.com/mattdeboard/clj-typeshooter/blob/master/src/cljs/clj_typeshooter/macros.clj#L3 |
| 16:14 | tbaldrid_ | mdeboard: why send 1? why not the result of body? |
| 16:16 | mdeboard | because so far the functions for which I wrote this macro are just channel consumers. This is just for handling what would otherwise be callback logic in JS |
| 16:19 | mdeboard | tbaldrid_: Though you're right, I'd probably need another variant that puts the result of body into the channel |
| 16:19 | mdeboard | eventually |
| 16:19 | technomancy | judging from the clojurecup web site, I'm guessing a hidden rule is that you have to be listening to chiptune while working on it |
| 16:19 | technomancy | chiptunes |
| 16:21 | kasko | hi guys at the api docs appears this function that I need: pow multimethod algo.generic Return the pow of x and y.. |
| 16:21 | kasko | how can I call it? |
| 16:22 | indigo | Hah, one print copy of "How to Solve It" |
| 16:22 | indigo | Is that book really that good |
| 16:23 | hyPiRion | indigo: it's good if you can follow the mathematics in it |
| 16:23 | hyPiRion | it's not terribly difficult, but it's aimed for mathematicians |
| 16:25 | juliangindi | So, I'm trying to construct a rudimentary caching system in Clojure and cannot quite seem to figure out how to have a global variable that always contains an updated version of a hash-map. The idea is that I will check to see if a particular key exists in this hash-map and if it does, return that value. If not, ill set a new value for that key. Any ideas? |
| 16:25 | mdeboard | juliangindi: An atom is one way |
| 16:25 | dobry-den | juliangindi: use an atom? |
| 16:26 | mdeboard | juliangindi: (def my-cache (atom {:foo 1})) |
| 16:26 | dobry-den | seems like textbook atom semantics you described |
| 16:26 | juliangindi | alrighty, I have not used those before but I'll check them out |
| 16:26 | technomancy | juliangindi: can you just use a memoized function? |
| 16:26 | technomancy | (only works if you never have to expire anything) |
| 16:26 | Apage43 | or use https://github.com/clojure/core.memoize if you do need expiry |
| 16:27 | mdeboard | (swap! my-cache #(update-in % [:foo] inc)) |
| 16:27 | juliangindi | oh wow, I think memoize will be perfect |
| 16:27 | technomancy | memoize is basically just a way of wrapping an atom around a function like a cache; simpler but less flexible |
| 16:29 | Apage43 | https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L5739-L5753 |
| 16:30 | seangrov` | technomancy: Is the chiptunes comment because of the design or some videos? |
| 16:31 | technomancy | seangrov`: just the look of clojurecup.com |
| 16:32 | hyPiRion | Man, I'm going to take time off for clojurecup.com next year. |
| 16:32 | technomancy | I should do another post on music I like to code to |
| 16:32 | seangrov` | technomancy: Bummer, thought I cloud have found some good chiptunes to listen to |
| 16:33 | technomancy | listening to http://zabutom.se/album/zeta-force right now and it is great |
| 16:33 | juliangindi | Is there a way to "reset" a memoized function after a certain amount of time? |
| 16:33 | seangrov` | Thanks technomancy, will check it out |
| 16:33 | hyPiRion | juliangindi: no, not unless you do that yourself |
| 16:33 | technomancy | juliangindi: I submitted a patch for that, but it was rejected. core.memoize has it though |
| 16:34 | juliangindi | Oh, ok. I'll check ut core.memoize |
| 16:34 | technomancy | it's pretty easy to write a copy of regular memoize that puts the atom on the fn as metadata |
| 16:34 | technomancy | http://dev.clojure.org/jira/browse/CLJ-804 <- juliangindi |
| 16:35 | technomancy | huh I just noticed someone suggested "make a Guava-wrapping contrib" as a solution O_O |
| 16:36 | technomancy | juliangindi: actually it's not difficult |
| 16:36 | technomancy | (alter-var-root #'memoized-version (constantly pre-memoized-version)) <- resets |
| 16:36 | juliangindi | technomancy: You guys rock. I'll give that a shot |
| 16:36 | technomancy | good luck |
| 16:39 | hyPiRion | technomancy: that would remove memoization altogether again though. |
| 16:39 | technomancy | derp; that is true |
| 16:40 | hyPiRion | (comp memoize (constantly pre-memoized-version)) would work though |
| 16:40 | hyPiRion | (I guess) |
| 17:06 | dobry-den | What's the difference between calling (def x ...) a second time vs. using alter-var-root? |
| 17:14 | marcopolo2 | technomancy: This site is bringing back memories :) |
| 17:14 | konr | how can I remove the prefix from a keyword? Like :foo/bar -> :bar |
| 17:15 | indigo | dobry-den: It's possible to wrap an existing definition with alter-var-root |
| 17:16 | marcopolo2 | ,(name :foo/bar) |
| 17:16 | clojurebot | "bar" |
| 17:17 | dobry-den | indigo: yeah, to clarify, what's the difference between updating an existing def by just invoking def again vs using alter-var-root |
| 17:17 | dobry-den | i have some hacky code that just uses def again and just learned about alter-var-root |
| 17:18 | technomancy | using def at runtime is usually a hint that someone is trying to program imperatively; using alter-var-root signals to me that someone probably knows what he's doing but is being too clever for his own good. |
| 17:21 | callen | technomancy: says the author of robert.hooke |
| 17:21 | seangrov` | tbaldridge: Thanks for the deep-walking macro video, was fun to skim through |
| 17:21 | callen | enabler of all things AOP and awesome. |
| 17:21 | technomancy | callen: no, it's way too clever |
| 17:21 | technomancy | it should be considered a measure of last resort |
| 17:21 | callen | technomancy: I'm pretty close to doing a talk just about robert.hooke and Dire. |
| 17:22 | callen | technomancy: The Metaobject Protocol rises again! |
| 17:28 | marcopolo2 | are macros evaluated inner to outer? |
| 17:53 | cpetzold | does anyone know if there's a known issue with loops in go blocks in latest cljs? |
| 18:12 | callen | cpetzold: yep |
| 18:12 | callen | cpetzold: use a newer version |
| 18:12 | cpetzold | yeah, just updated core.async to latest and it's fine now, thanks callen |
| 18:14 | Glenjamin | that reminds me, i've had a note in my inbox for months to remind me to try and implement catch+ for Dire |
| 18:21 | mdeboard | Where can I find changelog for clojurescript? I upgraded to build 1909 and it is giving me grief |
| 18:22 | cgag | if i have a bunch of pairs like [:a :b] [:a :c] [:a d] and want to get a map: {:a [:b :c :d]}, is there a better way to do that than something like: (reduce (fn [m [k v]] (assoc m k (conj (m k []) v))) {} ...) |
| 18:23 | amalloy | (into {} pairs) |
| 18:23 | amalloy | oh |
| 18:23 | cgag | i feel like maybe there's some std lib thing i'm missing |
| 18:24 | amalloy | cgag: well, update-in/fnil are nicer than assoc/conj with a default value |
| 18:25 | amalloy | what you want is almost (group-by first), but you want to also call second on the vals; if you like, that function is in flatland/useful: (groupings first second pairs) |
| 18:29 | mdeboard | dnolen: Does `js/window' no longer "satisfy INamed" ? https://github.com/clojure/clojurescript/compare/r1853...r1909#L11L6214 |
| 18:31 | cgag | the update-in/fnil version isn't bad |
| 18:31 | cgag | i'll look at that groupings function |
| 18:32 | cgag | group-by was my first thought |
| 18:34 | Glenjamin | possibly turn the vectors into single element maps and then merge-with? |
| 18:35 | Glenjamin | unsure if that'll be any better |
| 18:35 | cgag | Glenjamin: that's what i did first, turned them into maps that looked like {:a [:b]} and used merge-with concat |
| 18:35 | cgag | but i thought reduce might be more clear |
| 18:36 | amalloy | cgag: yikes. merge-with into, not merge-with concat |
| 18:36 | cgag | neither is bad, i just thought something like groupings might already exist |
| 18:37 | amalloy | try your merge-with/concat version on (repeat 2000 {:a [:b]}) for a fun time |
| 18:37 | cgag | yeah good call |
| 18:39 | cgag | this was just a tiny exercise but i'll keep useful/groupings in mind for larger stuff |
| 18:39 | cgag | thanks |
| 19:10 | dobry-den | technomancy: i basically define (def conn (d/connect uri)) but need to replace conn with a fresh connection when i (recreate-and-seed-db) which returns the new conn. |
| 19:11 | dobry-den | so for now i just (def conn ...) again in (recreate-and-seed-db) fn which doesnt always seem to work. but that's the best ive got |
| 19:12 | dobry-den | because i'm in a perpetual idea-famine. |
| 19:12 | dobry-den | a drought of smart. |
| 19:14 | Glenjamin | sounds like you might be better off with an atom |
| 19:25 | radix | hmm. I just upgraded to clojure 1.5.1 from 1.3 and I can't use "doc" in my repl any more... did that get changed? |
| 19:28 | ToBeReplaced | radix: idk if anything changed, but (use 'clojure.repl) will get you there |
| 19:29 | radix | huh. ok. maybe it's just how "lein repl" starts it up |
| 19:29 | radix | ToBeReplaced: yeah that worked, thanks :) |
| 19:47 | chord | you guys going to help with starcraft project in clojure |
| 19:49 | chord | SOMEONE ANSWER ME |
| 19:49 | mgaare | :D |
| 19:50 | chord | mgaare help me with the project www.github.com/chord-rts/rts |
| 19:51 | radix | -_- |
| 19:51 | radix | huh, gloss looks pretty rad. |
| 19:52 | chord | what? |
| 19:52 | clojurebot | what is short for ,(doc ...) |
| 19:53 | seangrov` | clojurebot: botsnack |
| 19:53 | clojurebot | botsnack is forget botsnack |
| 19:56 | chord | you guys got clone the code and CONTRIBUTE NOW |
| 19:57 | chord | so you guys admit your girlfriend cheated on you |
| 19:58 | callen | he is seriously fixated on the unfaithful girlfriend thing. Sniffs of projection. |
| 19:58 | callen | seangrov`: Clojure Cup is going well. How are you? |
| 20:00 | chord | callen: CLONE MY CODE AND CONTRIBUTE |
| 20:04 | danielglauser | I'm sure folks are busy with the Clojure Cup bit if anyone isn't, I'm looking for good resources to get folks started with ClojureScript |
| 20:04 | danielglauser | I'm aware of the O'Reilly book, are there any blogs or other web pages that folks recommend? |
| 20:06 | chord | danielglauser: just use coffeescript instead |
| 20:07 | danielglauser | Right... |
| 20:07 | chord | javascript is imperative based you're trying to fight too much |
| 20:24 | dnolen | danielglauser: http://github.com/magomimmo/modern-cljs |
| 20:24 | dnolen | danielglauser: my blog covers bits of core.async w/ respect to CLJS http://swannodette.github.io/ |
| 20:25 | danielglauser | Thanks dnolen, that's exactly what I'm looking for! |
| 20:51 | mullr | I'm having some trouble getting source maps to work with clojurescript (1909). The .js.map file is built and appears to be referenced appropriately from the .js file, but chrome devtools aren't doing anything with it. Does anybody know a way to diagnose this problem? (some kind logs inside of chrome, perhaps) |
| 20:52 | mullr | The only thing in my setup that's maybe a little strange is that I'm using a file: URL, but afaict that's supposed to work. |
| 20:54 | seangrov` | mullr: I don't think file: URLs are supported |
| 20:54 | seangrov` | Are you sure they are? |
| 20:54 | mullr | well, I can't find any sign that they aren't |
| 20:54 | mullr | I'll try with a web server (which I should have already done of course) |
| 20:55 | seangrov` | It's probably a security issue - I could never get them to work properly with chrome |
| 20:55 | seangrov` | + source maps |
| 20:55 | seangrov` | mullr: Have you had them working before? If not, I recommend checking out dnolen's post on it - uses brepl, but a good way to confirm that it's working properly |
| 20:57 | mullr | seangrov`: I haven't actually seen them working, no. I've been referring to dnolen's post as well. Are things currently limited to only the brepl, or should I expect them to work with lein cljsbuild auto et. al. as well? |
| 20:58 | seangrov` | mullr: Kind of, but there's a lot of post-editing that needs to be integrated to make it all smoother |
| 21:00 | mullr | The file: url was it; running things through a web server gets me significantly farther. Thanks! |
| 21:01 | seangrov` | squidz has a gist/post somewhere with more instructions |
| 21:05 | squidz | Here was my post on it. I'm not sure if anything has changed, but between that and dnolen's post you should be able to get started http://beandipper.github.io/ |
| 21:06 | squidz | mullr: I also used a shell script together with leincljsbuilds :notify-command to copy the sourcemaps to an external server |
| 21:07 | mullr | Success! The heavy hammer of 'cd /; python -m SimpleHTTPServer' lets me work in place with the absolute paths in the .js.map file |
| 21:07 | squidz | that way, you can have it copy over the sourcemaps every time lein auto compiles |
| 21:07 | dobry-den | danielglauser: yeah, modern-cljs is awesome |
| 21:08 | seangrov` | squidz: I think that's probably best as a pr for lein-cljsbuild |
| 21:08 | seangrov` | Probably as a few extra keys |
| 21:09 | squidz | yeah I only did it that way because I needed to have my compiled clojurescript + sourcemaps on an apache+php server so doing it that way kind of automates it |
| 21:10 | seangrov` | Looking forward to having it ironed out a bit, and wouldn't mind using it myself at this point. Should probably look into extending lein-cljsbuild |
| 21:11 | callen | productivity today was lost because an API lifting something that should've stayed in a map to a keyword arg. Resist the urge folks. |
| 21:11 | squidz | yeah I also considered maybe contributing something, but I needed something fast so I scratched my own itch with a quick hack |
| 21:15 | ambrosebs | bbloom: thanks about the F# type providers clarification. I guessed it would be something like that. |
| 21:16 | chord | Haskell > F# |
| 21:17 | Bronsa | primitive support almost there for CinC :P |
| 21:17 | ambrosebs | Bronsa: awesome! |
| 21:24 | chord | you dumb |
| 21:24 | chord | I KNOW YOU'RE ALL DUMB DUMB DUMB DUMB DUMB DUMB DUMB |
| 21:41 | bbloom | ambrosebs: yeah, iirc type providers use .net's modules (which are the true compilation unit within assemblies, which are essentially DLLs and EXEs) in the compiler to pull of their trick |
| 21:42 | bbloom | ambrosebs: basically you segregate pre and post type provided code by files & the compiler recognizes files that provide types & then compiles them as a separate stage |
| 21:42 | bbloom | the type checker runs once per stage |
| 21:43 | bbloom | the more interesting aspect of them is how they integrate with the IDE :-) |
| 21:59 | technomancy | I guess I should have given him a warning |
| 21:59 | technomancy | whatever |
| 21:59 | Kelet | In Bash on Windows, my 'lein repl' does not properly work, up/down arrows and such give unicode symbols instead of doing what they should. |
| 21:59 | Kelet | Any ideas? |
| 21:59 | Kelet | (Using Git Bash) |
| 22:00 | Kelet | Works ok in cmd.exe though |
| 22:01 | indigo | Kelet: Hm let me try |
| 22:02 | indigo | Lol, it doesn't even find lein |
| 22:02 | Kelet | indigo: I had to download lein from the bin of the repo, and change 2.3.3-snapshot to 2.3.2 |
| 22:03 | Kelet | seeing as leiningen comes with lein.bat for windows and not the shell script |
| 22:03 | indigo | Why don't you try going LANG=C lein repl |
| 22:04 | indigo | What I usually do on Windows to avoid pain and suffering is run Linux VMs via Vagrant |
| 22:04 | Kelet | same problem |
| 22:04 | indigo | And then just SSH in |
| 22:05 | indigo | Weeelll... I'm out of ideas; just use cmd.exe and git bash in separate windows for now ;P |
| 22:05 | Kelet | lol |
| 22:05 | arubin | Kelet, Just a guess: http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started#Enhancing_the_Environment |
| 22:06 | arubin | This sounds like a common problem in UNIX-like OSes where readline is not installed or readline support was not added, but I do not know much about lein. |
| 22:07 | arubin | s/added/enabled/ |
| 22:08 | callen | technomancy: he has spent several weeks getting warned by the channel itself |
| 22:08 | indigo | Oh sweet |
| 22:08 | indigo | chord finally got kicked |
| 22:09 | Kelet | But all he wanted to do was create a Starcraft clone in Clojure.. |
| 22:09 | indigo | Kelet: He's been trolling #ruby, #python and #haskell before he hit us |
| 22:09 | indigo | They all have him on their banlists |
| 22:09 | Kelet | where does he go next? Maybe he will go irc.mozilla.org #rust :O |
| 22:09 | technomancy | I'll consider the kick a warning before he gets on the banlist I guess. |
| 22:10 | indigo | Kelet: Probably nodejs next ;P |
| 22:11 | indigo | I'm surprised at how tolerant this channel has been, actually |
| 22:11 | indigo | You guys rock :) |
| 22:12 | Kelet | Oh well, tomorrow I'm beginning on my first real Clojure code for a huge Clojure project I'm starting to satisfy my fantasy of creating an expansive worldbuilding algorithm |
| 22:12 | Kelet | Which is: using Markov chains to generate realistic names :O |
| 22:14 | Kelet | I did a good amount of the Clojure koans though, which were a great way to learn some things |
| 22:14 | arrdem | (inc technomancy) ; death to trollz |
| 22:14 | lazybot | ⇒ 77 |
| 22:14 | callen | (inc technomancy) |
| 22:14 | lazybot | ⇒ 78 |
| 22:14 | indigo | Kelet: Good luck :) |
| 22:15 | callen | arrdem: I'm pretty excited about what we have so far :) |
| 22:15 | arrdem | callen: congrats! I have the slowest Mongo table ever! |
| 22:15 | Kelet | Yep, I'm excited, although to be frank, I am still somewhat considering using Racket. Although I am familiar with some other JVM languages so I'll probably stick here. |
| 22:16 | Kelet | Either way it will be my first real dip into a Lisp |
| 22:16 | arrdem | brb my desktop filled itself with molasses and needs a clean. |
| 22:16 | callen | arrdem: we don't know what our query performance is going to be like. We're just kinda hoping and praying ES does the right thing. |
| 22:16 | arrdem | callen: I dumped the 2.45M #clojure messages into one Mongo table and it isn't exactly happy. Trying to send it into neo4j because reasons. |
| 22:17 | indigo | callen: What are you guys trying to do |
| 22:17 | callen | arrdem: what kind of queries against Mongo/Neo? |
| 22:17 | callen | arrdem: you probably *do not* want to use Neo4j. |
| 22:18 | callen | 2.45 million documents shouldn't be that big of a deal, ordinarily. |
| 22:18 | indigo | Kelet: IMO Racket is good as a PL research platform; Clojure is good for getting real work done |
| 22:18 | callen | however clownshoes MongoDB might be. |
| 22:18 | callen | indigo: We're Simonides. |
| 22:18 | callen | indigo: http://clojurecup.com/app.html?app=simonides |
| 22:19 | indigo | Oh, Clojure Cup :D |
| 22:21 | indigo | Instead we use a hacky EAV store ORM on top of MySQL |
| 22:21 | arrdem | callen: you were saying? |
| 22:21 | callen | arrdem: what sort of queries are you going to be doing? |
| 22:21 | callen | indigo: horrific. |
| 22:22 | arrdem | callen: neo4j is just about the right tool because we're trying to do graph edge counting queries for the most part |
| 22:22 | arrdem | callen: we could have mashed it into Mongo but why bother |
| 22:22 | callen | arrdem: okay, so it's an actual graph problem. |
| 22:23 | callen | arrdem: godspeed. |
| 22:23 | arrdem | callen: the issue is getting away from the bulk of the (largely junk) #clojure logs and getting the community graph we seel |
| 22:23 | arrdem | callen: my thanks, clearly we need it |
| 22:23 | indigo | callen: If Rich Hickey is God, the developers that I work with are satanists ;) |
| 22:24 | callen | arrdem: *shrugs* we haven't conquered our query patterns yet although a lot of good progress has been made. |
| 22:24 | arrdem | indigo: that belongs in a fortune file :D |
| 22:25 | indigo | arrdem: I'll submit to bash :P |
| 22:25 | arrdem | callen: haha if we can get the data to behave, everything else is trivial and awesome. if. |
| 22:25 | indigo | Hopefully my fellow developers aren't going to get too upset |
| 22:25 | callen | arrdem: there were multiple problem spots for our problem. A few are solved, one or two remain. |
| 22:26 | allenj12 | is there a way yo get fmap or do i have to use contrib? |
| 22:26 | allenj12 | to* |
| 22:26 | callen | allenj12: you really want fmap? |
| 22:26 | callen | allenj12: if so, look at fluokitten. |
| 22:27 | allenj12 | callen: hmm eitther that or a better way to search within a list of hash maps |
| 22:28 | callen | allenj12: ffs, you don't need fmap or fluokitten for that. |
| 22:28 | allenj12 | callen: lol sry a haskell friend sitting next to me suggested it |
| 22:33 | allenj12 | callen: is there a reverse of get-in im basically searching that structure to see if a something matches one of the values in the hash map |
| 22:33 | callen | allenj12: just filter the list of hash-maps. |
| 22:34 | callen | searching a structure? you said it was a list of hash-maps. |
| 22:34 | allenj12 | callen: sry thats what i ment |
| 22:34 | allenj12 | callen: list of hash maps |
| 22:34 | callen | filter the list of hash-maps. |
| 22:36 | chord | callen are you done with clojure cup yet? |
| 22:36 | arrdem | technomancy: ^ |
| 22:36 | callen | chord: nobody's going to make your thing for you. |
| 22:36 | callen | chord: stop asking. |
| 22:36 | allenj12 | so if im looking for ({ :board (2 3 4) :cost 2} {:board (5 4 6) :cost 7}) i can search for a matching board value directly by filtering directly? |
| 22:37 | callen | allenj12: you can't figure out how to do this with filter? |
| 22:37 | allenj12 | callen: i prolly can i just didnt think i could directly do it since i want something specifically in the hash map ill play around |
| 22:38 | chord | arrdem: have you looked at the project I started www.github.com/chord-rts/rts |
| 22:38 | callen | allenj12: just filter it. |
| 22:38 | callen | allenj12: do you know what filter does? |
| 22:38 | allenj12 | calen: yea returns a sew of just the elemnts that return true in a function |
| 22:39 | callen | allenj12: okay...so filter the list of hash maps using a function that checks what you want to check. |
| 22:39 | john2x | how do dynamically I create functions with their names coming from a list of strings, and their bodies are similar? |
| 22:39 | allenj12 | callen: kk sry if that was dumb |
| 22:40 | callen | allenj12: it's not about dumb/smart, it's about forcing you to just confront the problem. |
| 22:40 | callen | the smartest people are the best at dithering about and avoiding the problem. |
| 22:40 | allenj12 | callen: kk |
| 23:03 | yedi_ | how does pallet relate to things like ansible and puppet? I'm trying to figure out my deployment strategy for a clojure webapp on aws (i've never had to do this devops stuff before) |
| 23:06 | callen | yedi_: use Ansible. |
| 23:06 | callen | yedi_: unless you're in Clojure Cup, in which case, use Puppet or Pallet. |
| 23:07 | yedi_ | I was thinking ansible because apparently the learning curve is really gradual, but pallet seemed clojure based and i wanted to know if they were basically the same kind of software, or if pallet is something different |
| 23:07 | yedi_ | but I'm assuming they're the same, and pallet has a similar level of complexity to puppet? |
| 23:07 | nightfly | callen: is Ansible really mature enough to recommend over Puppet? |
| 23:08 | egghead | callen: why not ansible in clojure cup |
| 23:08 | egghead | oh lol |
| 23:08 | egghead | b/c all the time will be wated trying to deploy |
| 23:08 | egghead | s/wated/wasted |
| 23:09 | callen | I would prefer my competitors use Puppet or Pallet so they get slowed down. |
| 23:10 | bmabey | nightfly: for its age ansible is remarkably mature. The community isn't as large as puppets but it is very friendly and growing fast |
| 23:22 | arrdem | anyone care to reccomend an RPC library for Clojure? |
| 23:25 | tbaldridge | arrdem: somethings should not be done, much less discussed :-P |
| 23:25 | yedi_ | whose winning clojurecup |
| 23:25 | tbaldridge | yedi_: the guys writing in scala |
| 23:26 | arrdem | tbaldridge: -_- I have an embarasingly parallel problem that I need to throw more than one machine at... some things are nessecary evils. especially on the clojurecup deadline. |
| 23:26 | tbaldridge | eh, I suppose that's not the best time to go and roll your own RPC lib :-P |
| 23:26 | arrdem | you don't say.... |
| 23:27 | `cbp | hurrah! |
| 23:27 | arrdem | I don't even need a full blown RPC library... I just need a way for workers to get the next 100 inputs from a server :/ |
| 23:28 | tbaldridge | arrdem: I'd be tempted to just use HTTP to talk to a simple ring server, have a single end point, and a multimethod that dispatches off the type of the message |
| 23:28 | tbaldridge | have the other end talk to it via slurp |
| 23:28 | tbaldridge | and no, I'm not joking :-) |
| 23:28 | arrdem | yeah that's probably the easiest thing to do sadly. |
| 23:29 | juliangindi | If I had a memoized function that made an API call, would subsequent calls with the same arguments still call the API? |
| 23:30 | nightfly | no |
| 23:30 | nightfly | they'd just hit the cache |
| 23:31 | juliangindi | hm. The API console is still registering api calls |
| 23:32 | juliangindi | My code, if that helps. https://gist.github.com/Julian25/6748965 |
| 23:32 | technomancy | arrdem: send forms to eval over redis? |
| 23:33 | technomancy | arrdem: you can see my ~200loc worker system over rabbit (die-roboter) but if you don't need guaranteed delivery then redis is fine |
| 23:34 | tbaldridge | arrdem: + 1 for rabbit. shouldn't take long to get running |
| 23:34 | technomancy | eh |
| 23:34 | technomancy | amqp is a really complicated protocol |
| 23:35 | technomancy | IME the main thing it gets you over redis is that you can have jobs automatically go back on the queue if the worker that takes them dies before acking |
| 23:35 | technomancy | if you don't need that, you probably don't need amqp |
| 23:37 | chord | anyone want to help starcraft clone project |
| 23:38 | tbaldridge | technomancy: idk, I had rabbit up and running in about 1 hour. You don't have to know a thing about amqp to get the Rabbit Java API up and going. |
| 23:38 | arrdem | technomancy, tbaldridge: okay thanks I'll check rabbit out once I test forcing more threads on my one machine |
| 23:39 | chord | tbaldridge and arrdem you going to help with project www.github.com/chord-rts/rts |
| 23:40 | technomancy | tbaldridge: there's a pretty big pile of terminology you have to un-tangle to find the specific subset you need for a worker mechanism. maybe not a big deal, but maybe not something you want to spend time doing on a 48-hour deadline when the alternative is http://redis.io/commands#list |
| 23:40 | technomancy | depends on whether you can afford to lose data, really |
| 23:44 | m00nlight | Is there a way to store the hadoop result into hbase directly instead of output a text file? |
| 23:51 | chord | hadoop sucks shit |
| 23:54 | m00nlight | chord: ?? |
| 23:54 | lazybot | m00nlight: Definitely not. |
| 23:54 | m00nligh_ | chord: ?? |
| 23:54 | lazybot | m00nligh_: What are you, crazy? Of course not! |
| 23:54 | chord | m00nlight: why you using hadoop |
| 23:55 | m00nligh_ | to process log |
| 23:55 | m00nligh_ | lazybot: crazy? what do you mean? |
| 23:56 | arrdem | technomancy, tbaldridge: turns out forcing 512 worker threads on my dev machine totally worked without involving other nodes :D |
| 23:57 | chord | m00nligh_ help me work on starcraft clone written in clojure |
| 23:58 | m00nligh_ | chord: You're not kidding :)? |
| 23:59 | chord | m00nligh_ I just learned how to make an opengl window but everyone in this channel is being stingy about helping me with it: www.github.com/chord-rts/rts |
| 23:59 | nightfly | you need to do more on your own |