#clojure logs

2013-08-03

00:05futiledoes this not already exist?
00:05futile(defmacro do-in-background [& body] (doto (Thread. (fn [] ~@body)) (.start)))
00:05callenI know Clojure is a Lisp, but the way it's made immutable-by-default semantics palatable to my Common Lisp infected brain is quite impressive.
00:05callenAnd in the process, is still even more concise, clean, and readable.
00:06futilecallen: i looked at CL a few years ago. didnt seem any more special than ruby/python/etc, just had more parens (but only slightly more)
00:06callenfutile: it's considerably more powerful than rb or py, being a proper lisp. It's just less 'nice'.
00:06callenClojure leapfrogs all of them in that dimension.
00:06futileheh
00:07futilesrsly though, is there no do-in-background built in?
00:07callenpy and ruby are babyfood compared to Common Lisp.
00:07callenfutile: what do you mean?
00:07futile(defmacro do-in-background [& body] (doto (Thread. (fn [] ~@body)) (.start)))
00:07callenfutile: you're not supposed to do that dude.
00:07futilewhy?
00:07callenfutile: that's what futures are for.
00:07clojurebotfutile: because you can't handle the truth!
00:07callenseriously, just use futures and promises.
00:07futilecallen: i just want it to happen in the background
00:07callena future will do that for you.
00:07callenjust use futures.
00:07callenthey're going to be faster in the common-case anyway.
00:07futilebut they mean semantically different things
00:08futilefutures imply you get the value back at some point, right?
00:08callenwhat you're proposing is not idiomatic code and there's a reason it hasn't been baked into an idiom. Futures are better.
00:08futilebut here i dont care about values.
00:08futileah
00:08futileare futures built into clojure?
00:08callen...yes
00:08callenyou shouldn't be chucking side effects around willy nilly either, but even leaving that alone, use a damn future.
00:09callenI'm not sure how you missed futures and promises, they're one of my favorite Clojure features.
00:09callenI use them to make Scala people jealous all the time (they integrate much more cleanly)
00:09futilegoogling now
00:09soulman__why?
00:09clojurebotwhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
00:10soulman__;-)
00:10callenstop saying why without targeting somebody and providing context, clojurebot will make manifest how silly your communication is otherwise.
00:10futilebtw callen this is what im working on: https://github.com/sdegutis/dotfiles/blob/master/projs/zephyros/src/zephyros/core.clj
00:10callenI hate saying, "why what?"
00:10soulman__callen: that was just a test
00:11futilecallen: oh neat, so my (do-in-background ...) can literally be swapped out with (future ...)
00:11futileyay
00:12callensoulman__: you can /query the bot
00:12futilewow futures are cool
00:12futilei think thats going to help simplify my api a LOT
00:13futileso simple too
00:13futilei think the trick to being a good programmer is just knowing all the tricks there are so that when a problem arises that is best solved with one you already have it up your sleeve
00:13callenfutile: your ears should perk up whenever your code gets ugly. Usually means you're fucking up.
00:13futilei think thats all it takes.
00:14callenthat's hardly sufficient, but it's a good thing to keep in mind.
00:14futileno, i think thats all it is.
00:16futilecallen: i almost wonder if futures could help me get rid of my map-of-concurrent-blocking-queues
00:17futilei really hate that design because it means having to take the queue out of the map when im done with it.
00:27soulman__if i use binding to bind *out* to a FileWriter, will that be closed automatically?
00:29callenfutile: probably.
00:29futilecallen: no, i cant imagine how.
00:32technomancyfutile: FWIW I agree with your inclination to cringe a bit at using futures without caring about their value
00:32technomancythat said, I would still use futures
00:32futiletechnomancy: yeah i settled on using them and just saying 'meh its built in'
00:33technomancyI would cringe harder at using agents for that
00:34callentechnomancy: I was half trying to get him to stop side-effecting
00:35callentechnomancy: I assumed there was an x-y type thing going on and that getting him to stop side effecting by dint of using futures would lead to other things getting cleaned up.
00:35callentl;dr I am manipulative
00:35futilecallen: this is inherently side-effecty
00:35futileim scripting my window manager in clojure
00:35callenit really doesn't have to be.
00:35futilethe tcp conversation is side-effecty
00:36futilei think ive made it pretty idiomatic clojure so far
00:36amalloyxmonad to the rescue??
00:36lazybotamalloy: Definitely not.
00:36amalloyoh well
00:36futileamalloy: this is for mac
00:52futiletechnomancy: is it possible to make `lein run` not print the last thing -main returned?
00:55amalloyi'm pretty sure it would be impossible for lein run to have the behavior you're asking to change
00:56amalloywell, i guess that's not true
00:56amalloybut still, i don't think it actually does that
00:57futileoh
00:57futileok
00:59futileis it a feature of Java that i dont see any exceptions that happen on background threads (in futures)?
01:00amalloy$google java uncaught exception handler
01:00lazybot[Thread.UncaughtExceptionHandler - Oracle Software Downloads] http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.UncaughtExceptionHandler.html
01:01futilethanks amalloy
01:13futilewelp, looks like setting the uncaught-exception-handler doesnt help, it never gets called (or at least it never prints to stdout)
01:20ThatOneGuywelp
01:30futile,(last (repeat 3))
01:30clojurebotExecution Timed Out
01:33futiledoes (repeatedly) cache its stuff?
01:33futilei mean, its return values
01:33ThatOneGuyuhhh
01:34ThatOneGuyyes, I think it memoized.
01:34futilei wonder if thatll impact this negatively
01:34futile(repeatedly #(.take queue))
01:34ThatOneGuy,(doc repeatedly)
01:34clojurebot"([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"
01:35futileif i do (first f) (first f) on that, i wonder if the second one will return the cached version of the fn, or re-call it
01:35ThatOneGuycached
01:36futiledang
01:36ThatOneGuytest it.
01:37ThatOneGuy,(do (first (repeatedly #(str "lawl its " (System/currentTimeMillis)))) (first (repeatedly #(str "lawl its " (System/currentTimeMillis)))))
01:37clojurebot"lawl its 1375507290121"
01:38futileum thats a bad test
01:38ThatOneGuy,(do (first (repeatedly #(prn "lawl its " (System/currentTimeMillis)))) (first (repeatedly #(prn "lawl its " (System/currentTimeMillis)))))
01:38clojurebot"lawl its " 1375507316635\n"lawl its " 1375507316637\n
01:38futile,(let [f (repeatedly #(println "foo"))] (first f) (first f))
01:38clojurebotfoo\n
01:38futiledang
01:38futile,(let [f (repeatedly #(println "foo"))] (first f) (second f))
01:38clojurebotfoo\nfoo\n
01:38ThatOneGuythats a worse test
01:38futilenuh uh
01:38futilemines better
01:39ThatOneGuyyou won't know when something is cached or not because it returns the same thing every time
01:39futilei want it to call (f) each time
01:39futileok, that works.
01:39futileyay thanks
01:40ThatOneGuyI think there are better ways to do what you wan't
01:40ThatOneGuywant*
01:40ThatOneGuylawl
01:40ThatOneGuylike (defn next-in-queue [] (.take queue)) that way it nots generating a seq and possibly memoizing it
01:41futilethanks
01:46ThatOneGuyor if you want to define the queue once. (def next-in-my-favourite-queue (queue-taker queue)) (defn queue-taker [queue] (fn [] (.take queue)))
01:46ThatOneGuythe power of CLOSURES! :P in clojure
02:16futileis there a better way to keywordize map-keys than manually with into {}?
02:18futilemeh itll work
02:18futileits short
02:25Bronsafutile: clojure.walk/keywordize-keys ?
02:25futileyeah that
02:25futilethanks Bronsa
02:27futileis there a less dumb way to do this?
02:27futile(take msg-size (repeatedly #(.read socket)))
02:31futileuh oh
02:31futilethese bytes im getting... they're utf8
02:32futilebut im doing this: (apply str (map char bytes))
02:32futilei think thats why its messing up maybe.
02:36futilehow do you convert an array of utf8-encoded bytes into a utf8 string?
02:49clj_newb_2345when designing an editor; should line numbers / column numbers be 0 or 1-indexed? I thought it should be 0; but then I checked vim, which appears to be 1-indexed
02:49clj_newb_2345is there any reason for this to be 1-indexed
02:49clj_newb_2345(relation to clojure is that I'm writing my editor in Clojure)
02:49clj_newb_2345by "editor" I really mean HTML canvas for displaying code
02:49clj_newb_2345taht is slightly editable
02:53futileclj_newb_2345: i would do 1
02:54clj_newb_2345because it's right or beacuse everyone is used ot it?
02:54futileclj_newb_2345: both
02:54futileclj_newb_2345: also have you looked at nightcode? https://github.com/oakes/Nightcode
02:55clj_newb_2345futile: nah, just finished learning hiccup (after ditching enlive) and garden
02:55futilek
02:56clj_newb_2345will look into this after I finish existing project
02:56futileclj_newb_2345: its a text editor/ide written in clojure
02:56clj_newb_2345updated 4 hours ago too, rather active :-)
02:56futile:)
03:22r0bglees0nis talking to Java a pro or a con when you want clojure to run on multiple runtimes? (.NET, Java), or is JVM so dominant that it doesn't matter?
03:24clj_newb_2345is htere a more idiomatic way to write "(map (fn [x] (gensym)) (range 100))" ?
03:24clj_newb_2345where "100" is really meant to be an arbitray integer n
03:24clj_newb_2345it seems kind of stupid to do (fn [x] (gensym)) which makes me think there aught to be a better solution
03:25Bronsa,(take 3 (repeatedly gensym))
03:25clojurebot(G__31 G__32 G__33)
03:26Bronsa,(map (constantly gensym) (range 3))
03:26clojurebot(#<core$gensym clojure.core$gensym@5f65a8> #<core$gensym clojure.core$gensym@5f65a8> #<core$gensym clojure.core$gensym@5f65a8>)
03:26Bronsaderp.
03:26Bronsago with the first one.
03:33poppingtonicHi, after running lein deps on a new project, how do I make sure nrepl recognizes the downloaded packages without restarting?
03:39amalloyBronsa: (repeatedly 100 gensym)
03:39futilewhoa
03:39futilei just resized my window via clojure
03:50Bronsaamalloy: right, I always forget the second arity of repeat/repeatedly
03:57futilewoooo https://github.com/sdegutis/zephyros/blob/tcp/libs/zephyros-clj/src/zephyros/api.clj
03:57TEttingerBronsa, even without it you could do (take 100 (repeatedly gensym))
04:21morrifeldmanHello, I'm trying to use clojure.java.jdbc.ddl but when I require it as (require 'clojure.java.jdbc.ddl) I get a FileNotFoundException
04:22clj_newb_2345amalloy: nice; thanks, I thought there was something simpler
04:47clojurenewbhey guys, I'm trying to map a simple tree data structure into a hickory tree structure of nested ul nodes, can anyone point to similar examples ? I'm struggling conceptually
05:03BlackBlockmember:clojurenewb - if you want to do it yourself, recurse through the tree conjing [:li] to an initial [:ul] for each child, check if that child has children & if so recurse with the current [:li] to conj to
05:04BlackBlock…or you could use C2 unify
05:05clojurenewbBlackBlock: C2 unify ? is that a library which handles generic cases like this ?
05:05BlackBlockc2 is a library, unify is a function in it
05:05clojurenewbI'll have a look, thanks
07:00app_80hi all, i am trying to set up a clojure development environment on my android tablet. i have emacs working with clojure-mode and nrepl - but i cant start a repl because i dont have lein on my tablet.. and i dont seem to be able to connect to a repl running on a linux box either.. does anyone know of a version of lein that will run on android?
07:02TEttingerpmde, good question
07:03TEttingercan android even run jar files?
07:03pmdei'm not sure
07:03pmdethere is a clojure repl for android
07:03pmdeso i can write code and run it
07:03pmdein that repl..
07:09clj_newb_2345gah, is there a way to get clojure's split-line to not ignore trailing newlines?
07:09clj_newb_2345(clojure-splitlines "a\n\n\n\n") returns ["a"]
07:09clj_newb_2345whereas I'd preter ["a" "" "" "" ""]
07:14pmdeoh the repl on my linux box is only listening to 127.0.0.1 :(
07:20morrifeldmanseancorfield: I'm trying out the new API and I really like it. I'm confused on the difference between db-do-commands and execute!. When should I prefer one or the other?
07:22scapeapp_80 I'm not sure anyone has tried that before
07:25IamDrowsypmde: ssh tunneling is your friend
07:28scapeTEttinger: I was able to include my uberjar in android, it ran great actually
07:28TEttingerwow good stuff
07:28scapeyou need a static entry point in to the app from java
07:29scapegen-class static method
07:29scapei quickly wrote a post about it: http://blog.juncoapps.com/2013/07/31/running-libgdx-as-a-clojure-game-in-android/
07:29scapemay give some ideas for your app
07:32TEttinger`mail clj_newb_2345 (clojure.string/split "a\n\n\n\n" #"(?=\n)")
07:32TEttinger&mail clj_newb_2345 (clojure.string/split "a\n\n\n\n" #"(?=\n)")
07:32lazybotjava.lang.RuntimeException: Unable to resolve symbol: mail in this context
07:33TEttingerI thought sending mail was a feature of lazybot
07:37BronsaTEttingeri think it's $mail
07:37BronsaTEttinger *
07:53pmdeIamDrowsy: good idea.
07:54pmdei found there is a fix merged to master to allow you to specify the listen address at startup, but it is not in the latest release (2.2.0)
07:54pmdeit allows - lein repl :start :host 0.0.0.0 :port 9999 for example
07:55scapemaybe nrepl used directly in the project?
08:38dbeCan I do something like (def agent (agent 0)) (send agent <set value to the return value of (f))? I'm thinking if I can use agents like Golangs "go func()".
08:41dbeFound 'future', nevermind.
09:13squidzdnolen: saw your two new core.async posts. Really cool that your posting up cool stuff that you find. Thanks for your work
09:16dbesquidz, link?
09:18gavriI'd like what clojure.core/max-key does, but I'd like it to return multiple keys if more than one key corresponds to the maximum value. is there a function that does that?
09:18squidzhttp://swannodette.github.io/ here are his articles. The last three ones are recent and 'CSP is Responsive Design' is more in-depth
09:19dbesquidz, thanks.
09:19edbond,(doc max-key)
09:19clojurebot"([k x] [k x y] [k x y & more]); Returns the x for which (k x), a number, is greatest."
09:49jtoyi noticed there is no library for working with berkelydb , that is weird
09:49jtoyare there any other key value databases that are jstu a single file alike sqlite for clojure to use?
10:11scapehow would i call this in clojure? .glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); assuming the buffer bits are ints
10:11scapei dont understand how to pipe them together
10:31Okasuscape: (.glClear obj (bit-or gl-foo gl-bar))
10:52jonasendnolen: http://dev.clojure.org/jira/browse/CLJS-567
11:10gavriI load-file this file https://raw.github.com/gavri/show-of-hands/wip/extensions/show-of-hands-lib.clj in this one https://raw.github.com/gavri/show-of-hands/wip/src/show_of_hands/core.clj
11:11gavribut I'm unable to access the loaded files functions in core.clj
11:11gavriis this a namespace problem?
11:19technomancyjtoy: sure; you can use derby or that other one I forget the name of if you want sql. there are java libs for berkeleydb though; search for sleepycat.
11:20IamDrowsygavri: try swapping the load-file and the ns form... i would think it loads the file and will then swap to the core ns (so not loaded there)
11:21gavrinow I get a ClassNotFoundException for "show-of-hands.core"
11:21gavriIamDrowsy: ^^
11:23shdwprinceI forgot function from clojure.core, it have 2 behaviors depending on which collection (vector or list) passed to it argument. Someone?
11:23IamDrowsygavri: mh i don't know.. and i can't try it now.. sry
11:24gavriIamDrowsy: no problem. thanks
11:24technomancygavri: using load-file is kind of an advanced topic; stick with require when starting out
11:26gavrinone of the require examples involve loading files. they seem to be loading some kind of modules http://clojuredocs.org/clojure_core/1.2.0/clojure.core/require
11:26gavrido modules map one to one to files?
11:29technomancygavri: except in weird cases, namespaces map directly to files, yeah
11:31TimMcgavri: In Clojure you work with namespaces, not files. The files representing them are laid out according to Clojure + JVM conventions.
11:38gavrirequire seems to be taking in a vector of symbols as parameters
11:38gavriall I have is a file path
11:38gavriand the symbols are dot-separated
11:38gavrilike package names
11:39gavriat this point, I'm just looking for the equivalent of C's #include
11:44gavriI've added the contents of the second file in the first for now. I'll get around to learning about file and module inclusions later. thanks everyone
11:50TimMcgavri: I came in to this conversation late, so... what's your reason for wanting to do this in a non-standard way?
11:51gavriTimMc: I'm learning clojure and didn't want to get bogged down in understanding modules/packages, so I just included the util functions in the mail file
11:51gavrithere's no reason really
11:51gavriI didn't want to get blocked because I don't know how to include files :D
11:51TimMcYou'll probably have less trouble if you learn it now -- there's not much to learn.
11:51gavriin the *main file, I mean
11:54TimMcsrc/show_of_hands/core.clj should have (ns show-of-hands.core (:require show-of-hands.lib :refer :all)) at the top.
11:54TimMcAnd then you can have src/show_of_hands/lib.clj with (ns show-of-hands.lib) at the top.
11:55gavriTimMc: thanks a lot. also, I was just reading this http://stackoverflow.com/a/2459611
11:55TimMc:refer :all is *generally* frowned upon, because it makes it harder to tell where functions are coming from by name, but it might be appropriate here.
11:56TimMcAlternatively, in place of ":refer :all" you could have ":as lib" and then write lib/max-value instead of max-value in the main file.
11:56TimMcor ":refer [max-value max-keys-based-on-value]" if you want to be explicit but not have a prefix.
11:58llasramgavri: Unrelated, you may also wish to examine `max-key`
11:58llasram&(doc max-key)
11:58lazybot⇒ "([k x] [k x y] [k x y & more]); Returns the x for which (k x), a number, is greatest."
11:58gavrithanks, TimMc
12:00TimMcgavri: My first recommendation is probably the best for getting started, but you'll want to avoid it as your program (and experience) grows.
12:00gavrillasram: max-key only returns a single result when there are multiple matches. I'd like all the matches to be returned. for example, in {:a 1 :b 2 :c 2}, I'd like to get back [:b :c] instead of just :b or :c
12:01gavriTimMc: got it. I'll do it the first way for now
12:05MadFunkanyone have any experience with clang or otherwise working with cljs+angular?
12:07squidzMadFunk: I started making an application with clojurescript and angular, but the so far I left the angular bits in javascript and otherwise used clojurescript
12:08MadFunkso you had them do their own thing without being aware of eachother
12:10squidzyeah so far
12:10squidzBut I was planning on trying to move out as much as javascript as possible into clojurescript
12:10squidzI haven't used clan for example, but that looks interesting
12:11MadFunkyeah, it seems pretty awesome. but there's.. no real reference on it i can find, so i'm a bit wary of using it.
12:12squidzI think I would start keeping them seperate, but when you see a good situation where you could move some stuff out into clojurescript may be a strategy
12:13MadFunki am still very new to clojure/cljs, so that's probably the best approach
12:14squidzany javascript that isnt angular/otherlib dependent would be good candidates. Which is usually logic of some sort
12:15MadFunkaye.
12:16MadFunki get the sense for any stuff that would be pure js, it's usually better to write that in cljs instead
12:18futileis there a lein plugin that lets you run a single clojure file, which would be a mixture of a project.clj and the rest of the stuff you need?
12:18futileer, a mixture of project.clj and the src file
12:18futile(sorry for the insane wording)
12:21samratfutile: lein exec
12:22futilewooo thanks samrat!
12:22futilecan you specify a filepath somewhere on your system to be a dependency?
12:22futilelike, if i want to load "foobar" lib, but its not in maven/clojars, its really just at "/my/libs/foobar"
12:23samratfutile: there is a library for that too, by the lein exec's author I think
12:23futileyay!
12:23futileyou're making my day
12:27technomancyfutile: add-classpath
12:27technomancyis one way
12:27technomancynot sure why you wouldn't just make an uberjar though
12:27technomancyit's a lot simpler
12:27MadFunksquidz: thanks for the feedback btw
12:28futiletechnomancy: trying to simplify this: https://github.com/sdegutis/zephyros/blob/tcp/Docs/Clojure.md
12:28futiletechnomancy: to make it more like this: https://github.com/sdegutis/zephyros/blob/tcp/Docs/Ruby.md
12:28futilein terms of setup
12:28technomancyfutile: yeah you definitely want an uberjar
12:29futilethanks :)
12:29technomancyno one's gonna want to install lein if they don't care about clojure
12:29futiletechnomancy: if they're using the clojure api to my app, i bet they've already got clojure installed
12:36technomancylein-exec is a bit silly; you can do the same thing with lein run -m
12:41technomancylast I checked anyway
12:53futiletechnomancy: the goal is to allow the user to have a single file (like a ruby or python script) which they can run somehow on its own, instead of a whole dir tree
12:53futiletechnomancy: i think lein exec provides that, at least given the 4 seconds i spent skimming the page
13:12TimMcWell, depending on the user's setup, an uberjar is just that.
13:13TimMcI think you can prepend a shell script to the uberjar file to make it executable from the command line as well.
13:24futilehow would you debug figuring out why `lein doc` hangs?
13:25onrhttp://nightcode.info/
13:25futileonr: exciting isnt it?
13:26onryup
13:55shdwprinceI'm have IllegalAgrumentException: No implementation of method method1 of protocol protocol1 found for class record1, if protocol inside ns1, and record1 with this protocol1 inside another ns2. If I put protocol1 and record1 inside one ns, everything works. What I'm doing wrong?
14:00squidzshdwprince: you probably need to have a paste if you want help
14:02shdwprincesquidz, I though it's a typical error becose I miss something in docs, but now I see it's not
14:06kbidarkasquidz, I face something similar as above issue, need help please , here is the link http://pastebin.com/P37uXAXq
14:11kbidarkaCan I get some help/suggestions on this error I face, http://pastebin.com/P37uXAXq
14:12jtoyif i know the exact item in list, waht is the simple way to get the next item in the list and loop around if its at the end?
14:12jtoyI can use any structure to hold the list
14:12jtoyso if i have 1 and the list is [ 1 2 3] and i want 2, if i have 3, i want 1
14:13futiletechnomancy: easier, see? https://github.com/sdegutis/zephyros/blob/tcp/Docs/Clojure.md
14:15kbidarkaok, this is the error that I get, IllegalArgumentException No implementation of method: :create of protocol: #'katello.ui/CRUD found for class: katello.Environment clojure.core/-cache-protocol-fn (core_deftype.clj:541)
14:16jtoyor is there a simple way to do [1 2 3] [2 3 1] just take first element and add it to the last?
14:18futilehow do you block the main thread so background threads can work, without killing the cpu (which (while true) does)
14:20jtoyi guess i coudl do this:
14:20jtoy&(let [l [ 1 2 3] f (first l) ] (concat (next l)[f] ) )
14:20lazybot⇒ (2 3 1)
14:21shdwprince&(conj (vec (rest [1 2 3])) (first [1 2 3]))
14:21lazybot⇒ [2 3 1]
14:22jtoy&(concat (vec (rest [1 2 3])) (first [1 2 3]))
14:22lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
14:26jtoyhow do I add arguments to a method call, I thought this should word? (apply (+ 1) [2])
14:27TimMcjtoy: apply isn't a macro, so that's (apply 1 [2])
14:27shdwprince&(apply (partial + 1) [2])
14:27lazybot⇒ 3
14:27TimMcWhat you want is (apply + 1 [2])
14:28shdwprincehumm
14:28TimMcOr that. :-)
14:28jtoyI see,I want partial in this case as I am passing in a function with some args but that needs more args later
14:56futileonly one bug left!
14:57bhaumanfutile: I say that an average of ten times a day.
14:57futilehas to do with utf-8 and either InputStreamReader or BufferedReader :(
14:57futilebhauman: *knonk bug
14:57futile*known
14:57futilelol
14:57bhauman:)
14:58TimMcfutile: 1. You can block by trying to dereference a promise (or several) that a background thread will deliver; 2. you can .start the background threads and then call .join on them to block on their completion.
14:58TimMcThere are other methods, but those come to mind.
14:58futileand thanks to samrat, the clojure API is way simpler: https://github.com/sdegutis/zephyros/blob/tcp/Docs/Clojure.md
14:58futileTimMc: ah yes, good idea, thanks. @fut it is then.
14:58futile*shall be
15:02TimMc.start/.join is more obvious to a reader, unless you're actually receiving data from those promises
15:05futileTimMc: good point
15:08futileso, my server is rightfully sending 35 bytes of utf-8 data, but BufferedReader (which was initialized with an InputStreamReader which was initialized with the string "UTF-8" as the second arg) only gets 30 .read() calls
15:08futilewhat could possibly be causing this?
15:15arthurmacielhello
15:16arthurmacielI'm very new to clojure and reading about its data-structures I could not figure out the difference between keywords and symbols. Could anyone explain me please?
15:19wkellyarthurmaciel: symbols can eval to anything; keywords eval to themselves and have fast equality tests
15:20arthurmacielwkelly: could you please give me an example? 'anything' and 'themselves' are quite abstract to me.
15:22wkellyarthurmaciel: in the expression (let [x 1] x)
15:22arthurmacielx is a symbol, right?
15:22wkellyx is a symbol, and it evaluates to the value of 1
15:22arthurmacielok
15:22wkellykeywords are kind of a special case of symbols
15:23arthurmacieland is there any example on how to use them? I suppose they'd never be used on the above example, right?
15:23wkellythey will never evaluate to anything other than themselves, so they're typically used as keys in maps or
15:23TimMcfutile: Are you sending only ASCII characters, or are there also multi-byte characters?
15:24arthurmacielwkelly: and could I use symbols as keys in maps too? (sorry about the ignorance)
15:27wkellyarthurmaciel: you could, but it would not be idiomatic
15:27wkelly (let [my-map {:keyword1 "value1" 'symbol2 "value2"}] ('symbol2 my-map))
15:27wkellythat will return "value2"
15:28wkellyyou'd want to use a keyword there for the fast equality check
15:28wkellywhich is also why you'd use a keyword rather than a string, for example
15:30futileTimMc: its utf-8
15:30futileits crashing on a string with non-ascii utf-8 chars
15:30futileTimMc: i figured out why
15:30futilei was wrapping my InputStream in an InputStreamReader
15:31futilewhich meant i could no longer rely on the length the server gave me.
15:31TimMc*nod*
15:31futileso getting rid of it *should* solve that
15:31futilebut, it means i cant use BufferedReader
15:31futilewhich means i have to roll my own (readline)
15:32TimMcSounds like a solved problem.
15:32futileTimMc: no comprendo
15:32TimMcAs in, someone has probably solved this already.
15:32futileok thought thats what you meant
15:36jtoyif i have a function that takes 2 arguments, shouldnt I be able to do (partial ( my_method arg1) arg2) and that is the same as (my_method arg1 arg2)? when i try to do this it thinks i only send 1 argument, im not sure what im oing wrong
15:37jonasenjtoy: try ((partial my_fn arg1) arg2)
15:37TimMcjtoy: (partial (+ 1)) means "evaluate + with the argument 1, then give the result to partial"
15:38jtoyjonasen: i am doing it similar, liek this? (let [method_plus_first (myfn arg1)] ((partial method_plus_first) arg2))
15:38jtoy(myfn arg1) will always be called together in variable, so im not sure how to do this
15:38shdwprince(partial method arg1) is something about (fn [arg2] (method *value-of-arg1* arg2)), I'm wrong
15:38shdwprince?
15:39jtoy ((partial mthd_plus_arg) arg2)
15:39TimMcshdwprince: Close, but the resulting function can take any number of arguments.
15:39TimMc$def partial
15:39shdwprinceTimMc, shure
15:40jonasenjtoy: partial returns a new function. So you need something like (let [methd_plus_first (partial myfn arg1)] (method_plus_first arg2))
15:40jtoyjonasen: isnt that th sam as ( (partial myfn arg1) arg2) ) though?
15:40jonasenyes
15:41jtoyso that should work? hmm, ill test more, i think i am doing taht currently though
15:42shdwprince&( (partial + 1 2) )
15:42lazybot⇒ 3
15:45shdwprince&(str (char 9829) " lazybot")
15:45lazybot⇒ "♥ lazybot"
15:45arthurmacielwkelly: thanks!
15:45arthurmaciel&(1)
15:45lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn
15:45arthurmaciel&1
15:45lazybot⇒ 1
15:45arthurmacielO.o
15:45shdwprince&1
15:45lazybot⇒ 1
15:52vmarcinkohi, im reading clojure
15:52vmarcinkojoy of clojure in fact, and have one question, nothing important...
15:53vmarcinkoits stated there that to check if collection should be processed further, its idiomatic to use (when (seq coll) ...), and not (when-not (empty? coll) ...)
15:54vmarcinkowhy is that idiomatic, because second way seems more intiutive to me?
15:55LauJensenAny kind of inspection I do with nrepl-inspect just shows an empty buffer. Are there some common reasons for this?
15:56futileahhh
15:56futileso close
16:00clj_newb_2345so I'm playing with parsec
16:01clj_newb_2345and I want a way to integrate better error reporting, besides line number / column number
16:01clj_newb_2345i.e. a way to encode a "stack" of the parsec combinators I'm currently embedded in
16:03futilehow do you cast an int to a byte?
16:03futile,(byte 226)
16:03clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Value out of range for byte: 226>
16:12gfredericksfutile: you've got to worry about signed vs unsigned here
16:12gfredericks,Byte/MAX_VALUE
16:12clojurebot127
16:12futilethx
16:26gfrederickswhen running the main clojure tests (`mvn test`), does something somewhere rebind #'clojure.test/report?
16:27gfredericksvmarcinko: I have no idea. That's one of my top 3 least favorite idioms.
16:27clj_newb_2345_can someone point me at a simple example of a defrecord implementing clojure.lang.IFn ? I've been playing with "invoke" and "applyTo", but keep on getting weird errors
16:31bamford_People, newbie question: I am trying to implement the webscraper seen in the famous "Video Tour of Go" http://research.swtch.com/gotour in Clojure. What I find difficult is the final revision where it times out after 1 sec. I'm trying the java ExecutorCompletionService but I can't find a way to implement the timeout.
16:32si14how would you accept a single HTTP request as a part of a function?
16:32bamford_I take results from the ExecutorCompletionService as they come with (.. ecs take get) but how can I implement the 1 sec timeout with this?
16:32si14I mean as a part of other workflow, blocking until the request is made
16:33bamford_si14: Oh, I simply use (slurp (.openStream (URL. urlstr)))
16:34bamford_and then wrap this in a functiopn
16:34si14bamford_: no, the other way around. I need to *receive* a single HTTP request from uther
16:35si14as a part of contrived OAuth workflow I open a browser with URL pointing at localhost, and then I need to get an HTTP request with access token in it's GET..
16:35bamford_si14: oh I think we're talking about two different things, I was talking about my own question, sry
16:35si14don't think that this deserves a full-blown Netty or something like this, I think
16:44dark_elementHow do I tell clojurescript compiler to exclude minifying functions from external libs?
16:46futileyay fixed it
16:53gfredericksokay CLJ-866 has a test now
16:53gfredericksdark_element: you use a somethings file
16:53gfredericksexterns
16:54dark_elementgfredericks ok checking
16:55gfredericksit's a gclosure feature
16:55gfrederickscljsbuild supports it
16:59dark_elementgfredericks, cljsbuild config looks like this https://www.refheap.com/17182
16:59dark_elementgfredericks it's still not working for me. Does it have something to do with Three.js being minified ?
17:05tieTYT2i'm trying ot refactor some OO code into some functional code. It's a game and I've got a homing missile attack. This is pretty straight forward in OO because the attack simply has a reference to the target and every tick it recalculates its direction. But how can I do this functionally? I'm thinking the attack data needs a reference to the target. Some kind of key that uniquely identifies
17:05tieTYT2the target. Is that a good way to design it?
17:08noonianis the target a model in a database? or just an object in memory?
17:08tieTYT2an object in memory
17:09isaacbwwhat's the paste site that people like here?
17:10noonianto do it functionally, you would want your game loop to do something like, (let [new-obj (missile-attack old-obj)] (recur new-obj)), basically instead of updating a reference, you replace it with a new one in the next execution of the loop/function
17:10tieTYT2ok but how do I find the old/new object?
17:11tieTYT2isaacbw: I think it's refheap.com
17:11tieTYT2refheap.something
17:11isaacbwtieTYT2: cool, thanks
17:12isaacbwso I wrote this (correct, spoiler alert) solution to project euler #7, which is to find the 10001th prime number, and I'm wondering if anyone would be willing to take a look and maybe give some advice for making it more idiomatic: https://www.refheap.com/17183
17:13isaacbw*st
17:13nooniani'm not sure how your game is implemented, but if you have an object like (let [my-ob {:hit-points 20}
17:13noonian(just have your missile-attack fn take its target as an argument, and return a new game-object with the effects applied to it
17:14isaacbwor as a bonus, maybe someone could show me how to turn it into a lazy sequence? I haven't wrapped my head around lazy sequences yet
17:14tieTYT2yeah but what I don't understand is how do I find the target each tick? I think I need an identifier that is stored in the missile data
17:15shdwprincetieTYT2, you'll need to pass every data that should be changed every tick into a function, that loops recursively
17:15dark_elementgfredericks, ohh my bad. the externs needs to be inside compiler map.
17:15noonianyeah, it depends on how the game loop is happening, ideally you could pass an updated list of game objects to each iteration of the loop
17:15shdwprincefunction takes current objects, updates it, and call itself with new values
17:16chrisrossianother dumb noob question--how do i get a binary OutputSream that can write to stdout. I'm trying to output binary data.
17:17tieTYT2I think i'm asking a more specific question than you guys are answering. Imagine you've got 500 bad guys. How do I figure out between ticks that it was the 5th bad guy that the missile was headed towards?
17:17isaacbwcheck the missile's path against each bad guy
17:17isaacbwand you can do some space culling if you want
17:19chrisrossinm. java.
17:19noonianyou need some sort of physics code to detect when a collision happens, that would probably call a function like (handle-collision object missile), which would maybe dispatch on the type of the second argument and eventually call (missile-attack on the object) or some such, then you would have to search the list of game objects and replace the one that was equal to the old object with the new one or something similar
17:20shdwprincechrisrossi, yeah, java, try it's channel
17:26isaacbwany style recommendations for my post?
17:26isaacbw*paste
17:28tieTYT2I said headed towards, not hit
17:29isaacbwtieTYT2: do you understand the math to find whether the path intersects a bad guy?
17:29tieTYT2tick1: you were headed towards (3,4). Next tick the bad guy changed directions so he's at (4,5). How do I figure out the missile should now be headed towards (4,5)?
17:30tieTYT2in OO, it's simple. You just give the Missile object a reference to the target. Done
17:30isaacbware you asking conceptually or are you asking how to implement it, because the latter would amount to someone programming your game for you
17:30tieTYT2nm
17:31tieTYT2i'll use an identifier
17:43dark_elementcan i pass compiler flags to cljsbuild ?
17:44gfredericksthat would surprise me a little bit
17:45gfredericksI expect it wants you to put all options in the project.clj and then just specify which build you want
17:47dark_elementgfredericks I am using three.js which uses ES5 way of defining getters and setters. This breaks externs and closure asks to use laguage_in compiler flag
17:52gfredericksdark_element: I think you've surpassed my knowledge on the subject, sorry
17:52dark_elementgfredericks no problemo.
17:52gfredericksat worst you could hop into the cljsbuild code and see where it gets flags from; maybe a pull request if necessary
17:53dark_elementgfredericks cool
18:00jtoyi have a fix for my problem from earlier, but it seems crappy, I was trying to do this earlier: (let [methd_plus_arg1 (partial myfn arg1)] (method_plus_arg1 arg2))
18:01jtoyI just do: (let [method_plus_arg1 [myfn arg1]] (eval (concat method_plus_arg1 [arg2])) ) ; and this works
18:01jtoyis there a better way? it seems bad that i am using eval
18:04jtoyor is it ok the way I am calling this?
18:08clj_newb_2345alright, who here is using nightcode?
18:16clj_newb_2345alright
18:17clj_newb_2345https://gist.github.com/anonymous/c0874137348fac3c3e70
18:17clj_newb_2345how do I make that work?
18:17clj_newb_2345why can't make my record pretend it's a function?
18:18turbopapehi there...
18:18turbopapeaside with eclipse + CCW,
18:18turbopapeI am giving LightTable a try...
18:18turbopapeBut I can't fine no licensing,
18:18turbopapewill it be open source ? free? commercial ?
18:19turbopapethank you for enlightening my path :)
18:21clj_newb_2345it's javascript
18:21clj_newb_2345you can always read the code
18:22clj_newb_2345well, cljs compiled ot js
18:23clj_newb_2345okay, so I just read https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java
18:23clj_newb_2345and figured out wtf I was doing wrong
18:23clj_newb_2345apparently "&" does not work very well when dealing with java interop
18:24luxbockI was trying to look through clojure-mode.el to find out how it replaces `fn' into a pretty f-sign, but couldn't figure out where that actually happens
18:25luxbockany clue how it's done?
18:28hiredmanit isn't in clojure-mode
18:29hiredmanif you are using prelude or emacs live or whatever they tend to do things like that
18:29luxbockah yeah appears to be a part of the starter-kit that I'm using
18:45isaacbwanyone know why I might be getting a SocketException in lein repl when I try to run fireplace (foreplay) commands from vim?
18:45isaacbwSocketException: socket closed
18:48soulmanhi
19:36soulmantried to use a record from another namespace, who's namespace contained a - (as in my-namespace)
19:37soulmanthe class cannot be imported, supposedly because the resulting package name is invalid in Java.
19:37soulmanam I right there?
19:57mattmosssoulman: Check folder name corresponding to the namespace. Folder name should use underscores where the namespace has dashes.
20:10soulmanmattross: better to leave the hyphen out in that case
20:12soulmanmattross: it looks a bit strange, if you use the namespace with a hyphen and a line below the same namespace is used as package with an underscore.
20:16noto2soulman, some of clojure's package stuff isn't documented that well. I asked here a long time ago about how to access inner classes or enums declared in java code (like what Swing uses a lot); it's OuterClass$InnerEnum btw
20:17soulman_TEttinger, yes, i found that out too
20:17TEttinger#clojure is responsible for eliminating more of my coding headaches than any other channel
20:18soulman_:-)
20:19soulman_I'm quite new to this channel, but clojure eliminates most of my coding headaches with introducing some new headaches ;-)
20:20soulman_as how to handle complex entity graphs with immutable data structures
20:21RaynesGithub is down. Hide yo wife hide yo kids
20:22soulman_I really like zippers for example, but I have not used them on complex graphs
20:23callenRaynes: jesus, again?
20:24callenRaynes: it was down like a week ago.
20:24Raynescallen: Jesus probably didn't do it this time.
20:26squidzI heard they\re getting ddos'd
20:26callenit's not like they'd ever pay blackmailers, so why bother?
20:27RaynesI hate that so much.
20:27RaynesYou don't "i heard" something on the internet, man.
20:28RaynesYou very clearly read it somewhere you can link somebody to, or a friend in Github told you, but you don't just hear it through the grapevine on the street 5 minutes after it happened.
20:29squidzokay I 'read' it
20:30RaynesWhere did you read it squidz. :P
20:30RaynesTake me to your leader.
20:30callenprobably on twatter.
20:30squidzI read it on reddit
20:31RaynesOh dear
20:31RaynesMust be true.
20:32callenI think reddit might actually be a worse source than twatter.
20:32soulman_github's back again
20:32squidzhttps://status.github.com/messages
20:44callenRaynes: it's always the same hacker news thread when github goes down.
20:45Raynescallen: OMG github went down for 5 minutes so what are the alternatives!?!?!?!
20:45callenRaynes: EVERYBODY BAIL TO ATLASSIAN'S SHITTY PRODUCT ASAP
20:47squidzbit bucket
20:50clj_newb_2345what is the easiest way to grab the stack frame at a particular line of code?
20:51clj_newb_2345i.e. when a certain line of code is hit, I want to dump the entire stack frame
20:56chrisrossiweird, even when writing to System.out, which is a stream, not a writer, something's doing character translation somewhere and corrupting my binary data.
20:58callenclj_newb_2345: https://github.com/mmcgrana/clj-stacktrace
20:58callenclj_newb_2345: you have access to Google right?
20:58callenyou're not in a place like China?
21:00holohi
21:05holoI'm trying to make `lein cljsbuild test` work, but I got `ReferenceError: Can't find variable: goog`. I followed the advanced example in lein-cljsbuild. error output: https://www.refheap.com/17189 . any idea of any cause?
21:12timvisherholo: are you loading up your clojurescript build output in resources/private/html/unit-test.html?
21:13timvisheris there anything like ns-unmap for clojurescript? more specifically, is there anyway to undefine a test in cemerick's cljs.test?
21:14timvisheri keep loading my file in and the tests keep getting added to the registry.
21:14cemericktimvisher: clojurescript.test has its own runtime namespaces (since cljs doesn't have them)
21:14cemerickIf the test vars in question have the same names, then reloading the file should *replace* prior tests, not be additive.
21:15timvishercemerick: i'll have another go at it
21:15cemericktimvisher: You can blow away / modify the "namespaces" directly if you want to: https://github.com/cemerick/clojurescript.test/blob/master/src/cemerick/cljs/test.cljs#L22
21:15timvisheri'm executing the tests via C-x C-e on (t/test-ns) if that makes any difference
21:16holotimvisher, yes: <script src="../js/unit-test.js" type="text/javascript"></script>
21:16timvisheri just ran the tests and got 36 tests
21:17timvisherand reloaded the file and got 44
21:17timvisherwith no source changes
21:17timvisherdoes that sound like an issue i should file?
21:17timvisherreloaded again got 52
21:18timvishercemerick: ^^
21:18timvisherholo: are you requiring all the goog stuff you're using in the ns?
21:18cemerickack
21:18cemericktimvisher: yeah, that's a bug
21:19timvisherholo: i'm pretty darn new to this (2nd day clojurescripting) so i may be completely asking the wrong questions. :)
21:19cemericktimvisher: register-test! is conj-ing into a set though, so that's really odd
21:19timvishercemerick: ok. what would be helpful to include in the report?
21:20timvishercemerick: [com.cemerick/clojurescript.test "0.0.4"]
21:20holotimvisher, I made a typo in unit-tests.js in <script>, and it made a different output error, so I guess the build output file was being loaded.. timvisher, I think those goog requires are under the covers. I didn't demand them directly
21:20timvishercemerick: https://gist.github.com/timvisher/6148606
21:20timvisherwhoops. :)
21:21cemericktimvisher: Just a description will do, at least for now
21:21timvisherinteresting. i've had a couple goog issues where i had to get explicit in my own ns about using it before it worked. but like i said, i'm green as can be.
21:21cemericktimvisher: or, a link to that gist :-)
21:21holotimvisher, can you show me such require?
21:21timvishercemerick: cool cool. is there anything obviously wrong with the ns?
21:22timvisherholo: https://gist.github.com/timvisher/6148612
21:23holotimvisher, i didn't try to require them, since the example in cljsbuild doesn't do it too, and my own version doesn't add more dependencies
21:23timvisheri've had a couple of phantom things going on though that wouldn't stay still so I have no idea how much of what i did was necessary. i was going for the snake slash ninja approach with hissing, know what i mean?
21:23holotimvisher, thanks. ok, doesn't hurt to try. thanks!
21:24axle_512cemerick: Hey, have time for a cemerick/friend question?
21:24cemerickaxle_512: depends :-)
21:24axle_512cemerick: I've got a webapp using the interactive form workflow w/ bcrypt.
21:24axle_512cemerick: I'm trying to log the last login time in a table
21:25axle_512cemerick: I only want to log that time in my user table if the user successfully authenticates
21:25axle_512cemerick: Is there a best practice to do that? Would I add another workflow function?
21:27cemerickaxle_512: seems like a reasonable thing to do in your credential fn, or in something you compose around your credential fn
21:28timvishercemerick: I was able to get them all to simmer down using https://gist.github.com/timvisher/6148606#file-reference_test-clj-L36
21:28timvisherthanks for the tip.
21:29timvisherfwiw: the registered-tests all print `#<[object Object]>`. Not sure if they match for equality or not.
21:30axle_512cemerick: doh, I see it now
21:30axle_512cemerick: I can write a cred function that invokes your creds/bcrypt-credential-fn internally, etc
21:31axle_512cemerick: thanks for your time, friend :-)
21:32cemerickyup :-)
21:33timvishercemerick: issue filed :) https://github.com/cemerick/clojurescript.test/issues/13
21:33timvisheryou are a gentleman and a scholar!
21:34akurilinDoes anybody know where clojure.contrib.seq-utils ended up? Is it still in the 1.2 contribs?
21:35holotimvisher. I had a hunch, and replaced optimization :none -> :whitespace, and guess what, it's working! ( ゚ Д゚)
21:35akurilinDoesn't look like it made it into modular contribs: http://dev.clojure.org/display/doc/Clojure+Contrib+Libraries
21:36timvisherholo FTW!
21:38callenholo: derferk.
21:39holocallen, you beat google. what does it mean?
21:40soulman_cemerick, I suppose you know a bit about class loading? :-)
21:41soulman_I try to change the classpath of a console process
21:41holocallen, i got it. no need to explain :)
21:42soulman_got the following classloader hierarchy HIERARCHY (#<URLClassLoader java.net.URLClassLoader@5427ee05> #<AppClassLoader sun.misc.Launcher$AppClassLoader@47415dbf> #<ExtClassLoader sun.misc.Launcher$ExtClassLoader@1471cb25>)
21:43soulman_and this URL in the URLClassLoader CL URLS (#<URL file:/home/soulman/devel/workspaces/gitWS/CljLibrary/build/unittest/classes/>)
21:44soulman_but when I try to run the tests I get an error
21:44soulman_Exception in thread "main" java.io.FileNotFoundException: Could not locate org/soulspace/clj/test/string__init.class or org/soulspace/clj/test/string.clj on classpath
21:44soulman_any idea?
21:48soulman_the string__init.class is there, btw
21:50she_bansheeseriouslly clojure
21:50she_bansheewhow
21:56callenshe_banshee: who what?
21:56callensoulman_: obviously it's not.
21:57she_bansheei was marveling at the sheer genious of the room name
21:58she_bansheewho else are you talking to, i dont see anyone
21:59callengenius of the room name?
21:59she_bansheeyah
21:59technomancyyou mean the channel? AOL has rooms.
21:59soulman_ls build/unittest/classes/org/soulspace/clj/test/string__init.class
21:59lazybotdev etc home media selinux src
21:59soulman_build/unittest/classes/org/soulspace/clj/test/string__init.class
21:59she_bansheeaw two geniuses in the room tonight
21:59callenshe_banshee: you're aware that Clojure is a programming language and that this is Freenode IRC right?
22:00she_bansheenope
22:00she_bansheeim not thgat smart
22:00onrlol
22:00she_bansheethat*
22:00callenshe_banshee: there's about 400-500 people in here generally.
22:00she_bansheeall geniuses im sure
22:00she_bansheewith big dongs
22:01callenshe_banshee: you should /nick she_troll
22:01callenmore truthful labeling.
22:01she_bansheebrb
22:09she_bansheecat got your tounge genius big willy?
22:11brainproxytrolling the #clojure channel on a Saturday night.. for fun?
22:12brainproxyi mean I could understand it on a Monday or Tuesday night, but Saturday?
22:13onrit's monday in some countries
22:14brainproxygood point
22:15jack_rabbitbut seriously, why #clojure?
22:16onreasy to troll, obviously
22:19seancorfieldonr: is it really Monday somewhere? surely only Sunday...?
22:20seancorfieldI know it's Sunday in Australia right now (always confuses me chatting to my friends downunder since they're all off partying when I'm working Friday and they're all working again while I'm still partying on Sunday :) )
22:21onrseancorfield: hehe
22:21she_bansheeits sunday where im at
22:21chrisrossionly if earth has spin 1/2
22:24seancorfieldSunday in Bosnia/Herzegovina?
22:25onryes
22:25onrin all Europe
22:26seancorfieldI can't remember what TZ that is... It's about 2am in London I think?
22:26seancorfieldI should just go look at the world clock site I suppose...
22:26seancorfield3am?
22:27seancorfieldYeah, 3am in London, 4am in Sarajevo... wow, thought it was further East than that...
22:30callenseancorfield: do Clojurians still use the wrappers for the XML configured logging or have people switched to Timbre?
22:33seancorfieldcallen: which wrappers?
22:33seancorfieldI use tools.logging (and log4j - but that's because our host app was already using log4j)
22:35callenseancorfield: I usually use Timbre and I'm considering doing so for a library. Is it worth my time to offer anything other than the usual timbre stuff or should I break out log4j specfically?
22:35seancorfieldAfter all the socket.io comments on the mailing list, I should probably report back on using netty-socketio wrapped in Clojure... although we haven't really exercised it at scale yet...
22:36seancorfieldI'm not familiar with Timbre, sorry.
22:36callenseancorfield: you should probably exercise it to see what breaks.
22:36callenseancorfield: I've been using http-kit for websocket support, why netty-socketio?
22:38soulman_gotcha ClassLoader!
22:38soulman_;-)
22:39onrseancorfield: you're gonna opensource clojure socketio?
22:39axle_512man, bitbucket and sourceforge both down. github had outage earlier tonight. DOS attacks galore going on
22:39seancorfieldcallen: we need full Socket.IO on the front end - multiple transports etc
22:39soulman_callen, I missed setting the new Classloader as context classloader for the current thread
22:39callenseancorfield: It's just weird to me to hear of non-Node.js users using SocketIO
22:40seancorfieldhttp-kit is fine for bare WebSocket stuff but that isn't enough for us
22:40callensoulman_: why are you fucking with the classloader?
22:40callenseancorfield: you just use a flash shim for backwards compat to WS://
22:40seancorfieldnetty-socketio supports WS, Flash and xhr long polling out of the box
22:41callenso does http-kit.
22:41soulman_because when running from console, the classloader is not a DynamicClassloader here but an AppClassLoader
22:41callenalthough the flash shim just turns into WS://
22:41soulman_Java 7 on Ubuntu
22:41seancorfieldhmm, that wasn't clear from the docs callen... looked like it wouldn't support what we needed...
22:41seancorfieldanyways, we have the netty-socketio solution in production now :)
22:42callenseancorfield: my only real problem with http-kit is the lack of thread affinity, but I'm the only person the world that cares about that.
22:42seancorfieldwe just don't have it enabled on any live sites yet
22:42soulman_and I don't konw the complete classpath at start time
22:42callenseancorfield: beyond that, it's a wonderful stack.
22:42callenmore people should use http-kit.
22:42callenI'm trying to get yogthos to flip Luminus over to it from Jetty.
22:42seancorfielddepending on what we see with netty-socketio, we may go back and re-evaluate http-kit but most of our stack is on tomcat right now
22:43seancorfieldremember we mostly use clojure as the model of an existing (large) web app - this new piece is the first clojure end-to-end server component for us
22:44callenyeah I remember your stack being weird.
22:44seancorfieldif i was building this system from scratch today, i'd approach it very differently than how the existing team had started building it in 2009!
22:44callenseancorfield: I was asking about libraries because I'm writing a tracing library for clojure.
22:45seancorfieldas it is we're slowly picking apart the monolithic web app and trying to turn it into a series of collaborating processes in clojure...
22:45callenseancorfield: eventually I'd like to build it out towards something like zipkin with pluggable repeaters like Kafka, but for now...I just want tracing.
22:45seancorfieldbut it will take years given that we have 4M live users on the current app and we need to maintain that while we also take it apart :)
22:45callenseancorfield: SOA has the nice property of allowing you to evaluate and swap components out interchangeably without having to have one big migration
22:46seancorfieldyeah, we have to decouple each internal component to move that way
22:47seancorfieldAs we decouple things so only the truly real-time stuff is in the main web app, we'll have a much nicer architecture and a much faster (and much more scalable) system!
22:47callenseancorfield: sounds like a solid direction to head in :)
22:48callenseancorfield: I'm currently working at a 100% Python shop. I've been agitating to get us away from Mercurial and Python-all-the-time.
22:55seancorfieldI was looking to bring Python in to solve our painful ant/shell build script problems!
22:55seancorfieldBut now I think I might just go whole hog on Clojure for that too...
22:57callenRaynes: I'm going to start calling you randomly.
22:58callenseancorfield: I don't have a good story for scripting in Clojure yet. I still use Python, bash, and make for that.
23:07supersymnetty-socketio... didn't know there was one, was about to try some http-kit websockets support later this week
23:13callensupersym: (pssst use http-kit)
23:14onrlol
23:14callenonr: lel
23:14onrwhat's valuable about socket.io/sockjs is client-side code
23:15callenpeople shouldn't be coding against an API not really made to be crossplatform.
23:15onrcallen: btw, just found out your nickname is callEn
23:15callenthey abandoned non-Node.js users a long time ago.
23:15onrsock.js's API is almost identical to websockets
23:16callenonr: my nickname is what?
23:16onrcallen: i wrote to someone named callAn, wondering why you aren't replying :(
23:17callenonr: tab completion.
23:17callenonr: what did you need?
23:17onrcallen: just wanted to talk about girls and stuff :P
23:20callenonr: no but seriously, what?
23:22seancorfieldcallen: well then i consider it my duty to advocate non-Node.js back ends for Socket.IO! :)
23:22callenseancorfield: my point is that it's like being a Mono user.
23:23callenseancorfield: the upstream overlords are just going to abuse you at will because they don't care about you.
23:23seancorfieldI've just been having a conversation about F# so that's very timely :)
23:23callenF# is nifty, but I left the .NET world for a reason.
23:23callenMost uninspired people I've ever worked with.
23:24seancorfieldI've never been in the .NET world but I like F# and I think Type Providers are neat.
23:25seancorfieldMaybe the F# folks could be persuaded to target the JVM? :)
23:25callenor we could just use a nice Lisp with good concurrency tooling on the JVM.
23:26seancorfieldThe type inference is nice... and clojure.typed isn't quite "there" yet! :p
23:26seancorfieldBut Type Providers on the JVM that we could use from Clojure would certainly be interesting...
23:27callenI'm starting to wonder if I use atoms a lot because they're available, or if I've just left a lot of really unstable software in my wake before I started using Clojure.
23:28seancorfieldThis netty-socketio-based app is the first one where I've used atoms much. Previously I only used them for infrequently refreshed caches.
23:28seancorfieldTime to go feed the kids. Back later.
23:28seancorfieldAnd that's the four-legged variety.
23:28callenseancorfield: cheers.
23:28callenwell I'm using atoms because I want my damn library to be thread-safe.
23:29callenI'm not really super-duper interested in using mutexes...so...