#clojure logs

2013-12-12

00:08brainproxydnolen: nice
00:09nonubywhats the latest solution to the leak in clojure web apps in servlet container (i.e. immutant/jboss), is it safe to use 1.6.0alpha2 if I not in my layers doing any thread local rebinding?
00:09dnolenupdated gist, https://gist.github.com/swannodette/7915826, boilerplate around pure eliminated, and demonstrates how path information is communicated down the tree
00:35bitemyapparrdem: mumble!
01:00wei__started using logback to direct clojure.tools.logging messages to a file, but my "spy" messages disappeared. where does clojure.tools.logging/spy output to?
01:34hiredmanwei__: I would check your log level setting in logback, spy may use the trace log level
01:34wei__hiredman: good call
01:42sj__anyone experience parsing xml documents using data.xml?
01:43sj__i am relatively new to clojure ańd got stuck a littlebit
01:44wei__(inc hiredman)
01:44hyPiRionlazybot is dead
01:44hyPiRionlong live lazybot
01:44wei__:(
01:48Jardasj__: it depends on what you need. I've used data.zip combined with data.xml to parse, works great!
01:49Jardasj__: check this answer (not the accepted but underneath) http://stackoverflow.com/a/9595315/270945
01:52sj__Jarda: hmm, thanks missed xml-zip, that looks good
01:56SegFaultAXhyPiRion: Aww, why's that?
01:57hyPiRionSegFaultAX: ask Raynes
01:57hyPiRionhe's responsible for that thing
01:58arrdemRaynes: BOT DOWN
01:58SegFaultAXYay!
01:59hyPiRion(inc hiredman)
01:59lazybot⇒ 30
01:59hyPiRionthere we go
02:22arrdem(inc Raynes) ;; best bot hearder
02:22lazybot⇒ 39
02:26ddellacostabitemyapp, noprompt: I called you out here, but if you don't want me to list your name/link to you let me know: http://davedellacosta.com/cljs-dom-survey
02:27nopromptddellacosta: don't mention my name. anywhere. ever. j/k :P
02:27nopromptddellacosta: hey, hey, i like the new digs!
02:28nopromptddellacosta: nice work!
02:28ddellacostanoprompt: haha...well, you never know if people, people can be picky.
02:28ddellacostanoprompt: thanks!!
02:28ddellacostanoprompt: your feedback definitely helped. :-)
02:28nopromptddellacosta: it looks sharp! clean and easy to read.
02:28ddellacostanoprompt: excellent! Just what I was going for.
02:29nopromptughh, i just spent a full hour trying to track down a bug through a maze of speghetti oo javascript.
02:29ddellacostanoprompt: ;-(
02:29ddellacostathat sucks.
02:29ddellacostanoprompt: and, did you track it down?
02:30nopromptddellacosta: yeah. i can't imagine what this guy was thinking.
02:30ddellacostanoprompt: yeah, I know how that is...had many a moment like that myself.
02:30ddellacostaand unfortunately, probably provoked many a moment like that in the past as well.
02:30nopromptliterally. ObjA to ObjB to ObjC to ObjC's parent (ObjB)
02:30ddellacostawhat
02:31ddellacostayikes.
02:31noprompti've never liked OO code that mucks with this.parent
02:31nopromptcoupled with events and mutable state it's way to fragile.
02:32ddellacostanoprompt: if you are mucking with this.parent, doesn't it indicate that that shouldn't be inheriting from the parent in the first place? Not that I'm much good as an OO architect. Have never been able to feel grounded writing OO code.
02:32nopromptthe funny part was the bug occured when i deleted a single line of code entirely somwhere else in the codebase.
02:32ddellacostaahahaha...*sob*
02:33nopromptddellacosta: basically in this case the child class is listening for events on the parent class and then doing something.
02:33ddellacostahmm.
02:33wei__trying to figure out how to deserialize a json to a map which originally had keyword values. anyone have a scheme to distinguish string values and keyword values in json?
02:34ddellacostawei__: so, the JSON originally was a map once upon a time? do you have any flexibility in terms of converting to EDN vs. JSON?
02:34nopromptddellacosta: my sentiment exactly. it seems to me if one were going to architect a system like that the parent should be responsible for sending messages to it's children.
02:35ddellacostanoprompt: yeah, I mean, I don't know the details so I can't comment, but that seems natural to me...
02:35nopromptddellacosta: a little context; i'm rewriting a large messy js front end in cljs. :)
02:35gwswei__: https://github.com/clojure/data.json has a way for you to specify a :key-fn keyword that may be what you want?
02:35ddellacostanoprompt: well, at least you have something nice to look forward to. :-)
02:36nopromptddellacosta: i showed the other devs today the work i'd been doing the past couple weeks and they looked so happy. (these are the backend guys)
02:36ddellacostanoprompt: excellent. Is it Clojure on the back-end too?
02:36nopromptddellacosta: sadly no. it's python. :(
02:36ddellacostanoprompt: well, could be worse...haha. ;-)
02:37nopromptddellacosta: that's certainly true. it's cool though cause they've set the api in the development branch to send me edn. :)
02:37ddellacostanoprompt: oh, that's super cool--sounds like they are pretty receptive to Clojure then.
02:39nopromptddellacosta: not entirely, but they certainly agree with me raw javascript can be a rat's nest.
02:39ddellacostagotcha.
02:39ddellacostanoprompt: well, the indoctrination has to start somewhere.
02:40nopromptddellacosta: it's funny though cause i've been able to take control over almost all of the front-end story simply with leiningen and clojurescript.
02:40ddellacostanoprompt: are you the only/main front-end dev?
02:40nopromptddellacosta: lein-npm can fetch bower dependencies now >:)
02:41nopromptddellacosta: sadly, yes. and the front-end is the most complex part of it. :|
02:41ddellacostanoprompt: woah, that is cool...embarassingly, I've never heard of lein-npm until this moment... ;-p
02:41ddellacostaoh, it's bodil's work, cool
02:42nopromptddellacosta: it's pretty sweet but she hasn't pushed the new code to clojars so the README is lying a bit.
02:42ddellacostanoprompt: ah, okay
02:42nopromptddellacosta: i just created my own version of it [noprompt/lein-npm "0.1.1"]
02:43ddellacostanoprompt: weeel then maybe I'll sneak a look at yours then
02:43nopromptddellacosta: all i did was clone the repo as it is now, bump the version, and push to clojars.
02:44ddellacostaalright, I really gotta do some more work...be back. Thanks again noprompt !
02:45nopromptddellacosta: you bet!
03:10bitemyappnoprompt: yeah, I hate it too.
03:11nopromptbitemyapp: dude, i just summed it up with that last tweet.
03:11nopromptbitemyapp: in context, that's twitter gold.
03:11noprompthaha
03:11nopromptlol "Don't call your parents. They'll call you."
03:11bitemyappnoprompt: nice.
03:11noprompthahahhaha
03:12nopromptbitemyapp: no shit it's true. if i don't call my mom and dad after a week, they call me. really.
03:13bitemyappnoprompt: my parents call me once every month or two.
03:13nopromptbitemyapp: dude, i just spent hour trying to figure out this rediculous bug.
03:13bitemyappnoprompt: super related?
03:14bitemyappI was talking to a coworker today about how super and class-based views make Django code impossible to understand or modify.
03:14bitemyapphe was as angry as myself about it :(
03:14nopromptbitemyapp: i'll recap. ObjA -> ObjB -> ObjC -> this.parent.on(event, f, this)
03:14noprompti'm using the -> here to represent flow.
03:15nopromptbitemyapp: that's actually kind of funny because one of the django guys i work with was expressing the *exact* same pain.
03:18rurumatewhoa, cascalog is really high level stuff
03:18bitemyapprurumate: yep, it's awesome.
03:19nopromptbitemyapp: this idea of putting state (when you need it) behind a pub/sub on the client side is turning out to be a really clean way to manage app state.
03:19rurumatebitemyapp: but how to pass parameters/data to jobs, what I would normally do via JobConf?
03:21nopromptbitemyapp: it's like having a small evented document database.
03:21seriously_randomhow do I tell if difference in sorted sequence between each adjacent element is 1? e.g. [1 2 3] and not [1 2 4]
03:22bitemyapprurumate: data would be on HDFS, no?
03:23bitemyappnoprompt: hrm.
03:23bitemyappseriously_random: fold/reduce + reduced
03:23hyPiRion,(every? #(= 1 (- %2 %)) (partition 2 1 [1 2 3])) ; seriously_random
03:23clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval27/fn--28>
03:23bitemyapphyPiRion: god dammit
03:23noprompt:|
03:23nopromptlol
03:23noprompt:)
03:23bitemyappI knew a solution with partition was coming.
03:24logic_proghttp://digitalocean.com/pricing <-- how is digital ocean managing to offer services cheaper than aws?
03:24logic_proganyoe hosted clojure apps on digital ocean?
03:24bitemyapplogic_prog: AWS is massively over-priced.
03:24noprompt,(partition 2 1 [1 2 3])
03:24clojurebot((1 2) (2 3))
03:24hyPiRion,(every? (fn [[a b]] (= 1 (- b a)) (partition 2 1 [1 2 3])) ; <- working ?
03:24clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
03:24bitemyapplogic_prog: I do.
03:24hyPiRiongahd
03:24arrdem,(as-> [1 2 3] s (map (fn [x y] (<= y (inc x))) s (rest s)) (reduce and s))
03:24clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/and, compiling:(NO_SOURCE_PATH:0:0)>
03:24nopromptah that's what it was.
03:24arrdemFUUUUUU
03:24hyPiRion,(every? (fn [[a b]] (= 1 (- b a))) (partition 2 1 [1 2 3]))
03:24logic_progbitemyapp: do you have a blog post / documentation / something I can read?
03:24clojurebottrue
03:24bitemyapparrdem: NO SOUP FOR YOU
03:24Apage43(reduce (fn [p i] (if (= 1 (- i p)) i (reduced :nope))) [1 2 3 4 5 6])
03:24hyPiRionthere we go.
03:24Apage43,(reduce (fn [p i] (if (= 1 (- i p)) i (reduced :nope))) [1 2 3 4 5 6])
03:24clojurebot6
03:24Apage43,(reduce (fn [p i] (if (= 1 (- i p)) i (reduced :nope))) [1 2 3 4 5 6 8])
03:24clojurebot:nope
03:25arrdemgoddamnit Apage43
03:25bitemyapplogic_prog: bitemyapp.com + gitub.com/bitemyapp/ - nothing specific to DigitalOcean, they're just a VPS provider.
03:25Apage43<3
03:25bitemyappApage43 has defeated you all.
03:25noprompt,(map #(apply -) (partition 2 1 [1 2 3]))
03:25clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval204/fn--205>
03:25arrdem(inc Apage43)
03:25lazybot⇒ 10
03:25bitemyapp(inc arrdem)
03:25lazybot⇒ 12
03:25nopromptoh read the question wrong
03:26bitemyapp ,(map (partial apply -) (partition 2 1 [1 2 3]))
03:26clojurebot(-1 -1)
03:26bitemyappnoprompt: yours could be a stepping-stone.
03:27AWizzArd,(let [x [1 2 3 4 5 7]] (clojure.set/difference (set (range 1 (inc (last x)))) (set x)))
03:27hyPiRion,(every? #(= % 1) (map #(apply - %) (partition 2 1 (rseq [1 2 3]))))
03:27clojurebot#<CompilerException java.lang.ClassNotFoundException: clojure.set, compiling:(NO_SOURCE_PATH:0:0)>
03:27clojurebottrue
03:27hyPiRionbut then we're moving into obscure territory
03:27AWizzArd^^
03:29AWizzArdMaybe a version with reducers...
03:29Apage43s/reduce/fold ^^
03:29nopromptbitemyapp: i picked up a bit of a buzz somehow after finding that bug.
03:30noprompthonestly, beer, i don't know how it happened.
03:30Apage43actually no, can't just fold that
03:30Apage43bleh =P
03:30rurumate'(pr-str {"1" 2 "2" 2})
03:30rurumate,(pr-str {"1" 2 "2" 2})
03:30clojurebot"{\"1\" 2, \"2\" 2}"
03:31rurumatehow to prevent pr-str from printing commas? it's bloating my files..
03:31seriously_randomhyPiRion, how about I check the difference between min and max value of [1 2 3] and see that frequencies max value is 1?
03:31Apage43maybe use https://github.com/clojure/data.fressian if you need something compact
03:32hyPiRionseriously_random: that's also a possibility
03:32Apage43I like frequencies as an anagram checker
03:33Apage43,(let [anagram? (fn [a b] (= (frequencies a) (frequencies b)))] (map anagram? ["fred" "meat" "what"] ["derp" "team" "thaw"]))
03:33clojurebot(false true true)
03:34noprompt,(clojure.string/replace (pr-str {"1" 2 "2" 2}) #"," " ")
03:34clojurebot"{\"1\" 2 \"2\" 2}"
03:34noprompt:P
03:35nopromptrurumate: ^^
03:39gws,(let [c [1 2 3 4]] (every? #(= 1 %) (map #(- %2 %) c (drop 1 c))))
03:39clojurebottrue
03:41hyPiRionI'm sometimes a bit angry that every? isn't variadic
03:44Apage43hyPiRion: would it concat its args?
03:44hyPiRionApage43: no, just work like map
03:44Apage43ah
03:44hyPiRione.g. (map + [1 2 3] [1 2 3]) => (2 4 6), (every? = [1 2 3] [1 2 3]) => true
03:46bitemyapparrdem: http://www.youtube.com/watch?v=45lB-fyB87Y
03:53ucbg'day all
03:57bitemyappucb: hi!
03:58ucbbitemyapp: !!
04:02atyzAnyone know how I can add a key to a map that will match based on a regex?
04:04arrdembitemyapp: so one thing I was pondering during my spindown ritual...
04:04arrdembitemyapp: your "duel" system needs to prevent ties
04:04arrdembitemyapp: it shouldn't be possible for two players to contest the state indefinitely.
04:06arrdembitemyapp: one solution is to have ressonance in the environment state, which feeds upon itself and becomes chaotic/unstable (but still deterministic) after some finite N ticks
04:06bitemyapparrdem: mana/willpower?
04:07bitemyapparrdem: you can cast spells that affect more state, but drain your ability to cast spells faster, forcing you balance slow/steady vs. burst play?
04:07bitemyappyou to*
04:07arrdemsure... but I'm saying that it should be impossible for two players both playing rationally along a slow and steady course to perfectly contest forever.
04:08bitemyapparrdem: the only way to accomplish that would be to time their mana running out at exact intervals
04:09bitemyapparrdem: ordinarily they'd cast spells of varying cost and create gaps for the other person to attack or manipulate state uncontested.
04:11arrdembitemyapp: right. what I'm proposing is that the state slowly becomes nonsteady. if A and B make moves a, ^a then the state is unchanged in the trivial model. but if the state devolves of it's own occord and introduces some neutral imballancing factor then it becomes impossible (or at least bloody hard) for humans to come up with a, ^a
04:12arrdembitemyapp: think of the battle field as an echo chamber that retains some energy slowly becomming resonant in conflict with both players
04:13bitemyapparrdem: I like it. It could be like a travelling wave
04:13bitemyapparrdem: adding "energy" to the wave, almost like a motorcycle losing control, makes it more violent.
04:13bitemyapparrdem: could lead to some exciting duels where they sustain a fight until it completely explodes in one of their faces.
04:13bitemyapparrdem: you are really good at this :D
04:14arrdembitemyapp: EXACTLY. this harmonic will eventually backfire on and crush someone while staying deterministic.
04:14seriously_randomhow do I write: (let [x] be (this) on_condition (condition) else let [x] be (other))
04:15arrdem(let [x (if (condition) this other)] .. )
04:43rurumateis there a standard way to pretty-print the :out field from a clojure.java.shell/sh call?
04:45rurumateit looks like this: (clojure.java.shell/sh "ls") -> "etc\nlog\nproject.clj\nproject.clj~\nsrc\ntarget\n
04:50hyPiRionjust call println
04:56divyansrwhat does #^ symbol mean in argument list of function ?
04:59ucbbitemyapp: oh! forgot to give you and update on trafficmigrationlols
04:59ucbbitemyapp: turns out that all the shittyness was due to graphite
05:00rurumatehyPiRion: thanks, that's exactly what I was looking for
05:06daGrevisdoes lein run automatically gets all dependencies specified in project.clj?
05:07divyansrwhat does #^ symbol means ?
05:14scottjdivyansr: old syntax for ^
05:15divyansrThanks ! In fact I was looking for compojure old commits and puzzled by #^ :)
05:21makkalothi, i'm trying to write a macro in clojurescript : http://pastebin.com/Rd2Z5jE7 when i call it i see every time it returns nil to my called function , any ideas ?
05:26makkalotnevermind i figure it out :P
05:26clojurebotIt's greek to me.
05:27rurumatewhat's observable-fn?
05:27makkalotrurumate, it is my custom fn
05:28rurumatemakkalot: where is it defined?
05:28makkalotin .cljs file in same ns
05:28makkalotrurumate, macro is in clj
05:30makkalotbtw, is there a way to run clsjbuild test without compiling
05:30rurumatemakkalot: oh, I see. macro doesn't care what it is, it just returns the symbol
05:31rurumatemakkalot: I think munged-symbol cannot be private
05:31rurumatemacros can only use public functions
05:31makkalotrurumate, actually it is ok
05:31makkalotrurumate, works now, just had to change result of mungle to be str
05:32makkalotbecause that variable was not exsitng
05:32rurumatecool
06:15FragDoctorHi
06:16ucbsay I want to include lib1 "0.0.1" and lib2 "0.0.1", how can I avoid repeating the "0.0.1" and instead provide a named constant?
06:16ucbI tried (def ver "0.0.1") before defproject but that didn't work :(
06:24clgvucb: you can try to use ~ver inside the project map. but it might not work for the dependency vectory
06:24clgv*s
06:24ucbah, gotcha
06:33seriously_randomhow does "predicate" function know about a-map, which isn't in its parameters?
06:33seriously_randomoops, http://pastebin.com/PQn35sEf
06:41ucbseriously_random: key->predicate returns a function. This function is called by filter with each map. That's how a-map gets bound to each map.
06:47pcnGood morning
06:57dav_gen-class continues to baffle me. I have this very simple class which I'm able to instantiate, but cannot call any methods.. any ideas?
06:57dav_source is here: https://github.com/obadz/xlloop-clojure/blob/master/src/xlloop_clojure/funs.clj
06:58dav_(.myTest (xlloop.funs.)) => IllegalArgumentException No matching field found: myTest for class xlloop.funs clojure.lang.Reflector.getInstanceField (Reflector.java:271)
07:02pcnI'd like to have an async service that writes all output to a single file. Does anyone have any examples of something like this?
07:03ohpauleezpcn: You want an HTTP service, that writes all of its responses to a file (like a journal)?
07:04pcnNot http - the proto is simpler, but yes, something like that.
07:04pcnI want to read line-separated input, splitup the input, and write batches of some number - say 50 or 100 per line - to the output
07:04pcns/number/quantity of inputs/
07:06pcnThe input is straightoforward, and I'm passing it arund via go blocks. The part that I'm trying to understand is how to end up writing synchronously to an output file in batches. Order of the messages doesn't matter.
07:06ohpauleezahh, you just need some sort of a script - the functions you'll need are `slurp`, `split`, `spit` with :append true
07:06ohpauleezYou don't want to do socket or file reads in go blocks
07:06ohpauleezyou should really do those in thread blocks
07:07ohpauleezI was just optimizing a blog post the other day (adam bard's) that made some small mistakes
07:08ohpauleezYou read from the file synchronously though, and that's what is feeding "the machine"
07:08ohpauleezso you'll end up being limited by that single part of your process
07:09dav_Does anyone have a minute to help me with my (above) gen-class problem ? :)
07:10ohpauleezdav: let me hit the scrollback, hang on
07:10pcnHow efficient is spit? I expect to write a few hundred thousand lines, and I don't want the documented open, write, close behavior per-line
07:10davohpauleez: thanks
07:11ohpauleezpcn: I'm not sure, but personally, I only use spit and slurp for quick jobs. More often than not I need to use clojure.java.io readers and writers (for more control)
07:11clgvpcn: the you probably should open a fileoutput stream in a with-open
07:12clgvpcn: you'll find useful functions in clojure.java.io
07:13ohpauleezdav: You should try using the :methods arg in your :gen-class
07:14ohpauleezsomething like (:gen-class :name xlloop.funs :methods [ … ])
07:15ohpauleezand you can also set the method to be static there is you want (if you need that sort of thing)
07:17davohpauleez: worked with :methods, thanks.,
07:17ohpauleeznp! Happy to helo
07:17ohpauleezhelp
07:18davohpauleez: any idea why this guy (https://kotka.de/blog/2010/02/gen-class_how_it_works_and_how_to_use_it.html) is able to do it without :methods?
07:18pcnohpauleez: so I can pass the message around go blocks, then at the end put it on an async channel, and have a thread the manages file writing (and rotating out files and linking bits to where I want them) !< from that channel, outside of a go block. Does that sound like it's obeying the appropraite rules?
07:18ohpauleezYou need to add the :prefex piece if you want to do that
07:19ohpauleezthe default might be `-`, but I wouldn't count on it always being there
07:19davohpauleez: I see. thx.
07:20davohpauleez: actually :prefix doesn't seem to work either.
07:20davohpauleez: https://github.com/obadz/xlloop-clojure/blob/master/src/xlloop_clojure/funs.clj <= this doesn't work.
07:21ohpauleezpcn: Yeah, there are no hard and fast rules, but if you're dealing with something that has the potential to block (like certain kinds of IO), you should put the step directly response for the IO in a `thread` instead of a `go` block
07:22ohpauleezso you don't end up using up one of the threads from the go-block thread pool
07:22davohpauleez: I think I get it. :methods is required anytime I'm creating new methods that aren't already in a superclass..
07:22davohpauleez: I think?
07:23ohpauleezI can't confirm that… I have only used gen-class once or twice in my entire Clojure career :)
07:24ohpauleezahh yes, the blog post seems to make a point about "custom methods"
07:25davohpauleez: thanks. mystery solved. lots of mystery surrounding gen-class :(
07:26ohpauleezyes, it's a bit of a black art :)
07:32ohpauleezpcn: I will cook up an example a little later this morning if you're still around
07:36pcnThanks, I may idle
07:36pcnbut I'll check my scrollback
08:32seriously_randomcheck if HashSet one contains all the keywords in HashSet two?
08:33ohpauleezseriously_random: Take a look at clojure.set
08:33ohpauleezthere are some subset functions
08:34ohpauleezand intersections (you can use the set of keys of both)
08:35ohpauleezyou can also use .containsAll and .entrySet and a length check
08:36ohpauleezor (= (keys hs-one) (keys hs-two)) if you need the keys to be the same - really depends on what you're trying to express
08:36clgvseriously_random: since these are sets just compare if they are equal
08:37ohpauleez(for example, you don't need the length check in most cases)
08:37amalloyohpauleez: it's a set, not a map
08:37clgv,(= #{:a :b :c} #{:c :b :a})
08:37clojurebottrue
08:37clgv,(= #{:a :b :c} #{:c :b :a :d})
08:37clojurebotfalse
08:38ohpauleezahh I missed that - yeah subset?, equality, or intersection - depending on the use case
08:38mdrogalisFive Word Tech Horror has to be my favorite hashtag on Twitter ever.
08:40jkj_hmmh. clojure bot pardons me in query
08:40jkj_ ,(:a #{:a :b :c})
08:40clojurebot:a
08:40jkj_ ,(#{:a :b :c} :a)
08:40clojurebot:a
08:41jkj_ ,(#{:a :b :c} #{:a :b :d})
08:42clojurebotnil
08:44sw1nnhi, anyone know much about deploying with leiningen to s3? I have it working, but lein deploy causes *many* WARNING: Error Response messages to be logged to console (307 temporary redirects by the look of things).
08:46seriously_randomfilter returns keywords, but they are not in a hashset, e.g. (:one, :two), how can I make it a set?
08:47opqdonut,(doc set)
08:47clojurebot"([coll]); Returns a set of the distinct elements of coll."
08:47gfredericksdoes clojure-mode allow easily adding new keywords to the list of things that get indented macro-style?
08:49amalloygfredericks: M-x customize-variable RET clojure-defun-indent
08:49Bronsadnolen: you there?
09:00sw1nnjust discovered the #leiningen channel, apologies for the noise.
09:01mdrogalissw1nn: No worries. More than happy to help here if we know the answer.
09:03sw1nnmdrogalis: seems to me that 307 shouldn't be a warning, but I'm wondering if I've done something unusual in the set up that's causing this.
09:04mdrogalissw1nn: Can I see your project file?
09:05gfredericksamalloy: coolthx
09:07dnolenBronsa: hello
09:08sw1nnmdrogalis: https://gist.github.com/7928437
09:08Bronsadnolen: hi, I was testing out t.analyzer.jvm and found out a typo in core.match https://github.com/clojure/core.match/blob/master/src/main/clojure/clojure/core/match.clj#L1363
09:08Bronsadnolen: you have one too many nil in that call
09:09dnolenBronsa: yep, thanks
09:09Bronsadnolen: also, https://github.com/clojure/core.logic/blob/master/src/main/clojure/clojure/core/logic.clj#L73 you actually use pair in other namespaces, it only works now because you (declare pair) later in the source
09:10dnolenBronsa: which other namespaces?
09:11Bronsadnolen: https://github.com/clojure/core.logic/blob/master/src/main/clojure/clojure/core/logic/fd.clj#L40
09:12mdrogalissw1nn: Hmm, I don't see anything out of the ordinary.
09:13dnolenBronsa: thanks, made a ticket for that one.
09:13sw1nnmdrogalis: I just created the S3 bucket, wondering if maybe it's not replicated fully yet and that's why I'm seeing the redirects. Will try again tomorrow. thks.
09:15pcnI want to have an single thread that writes data to a file. Every second, i want to rotate that file out, open a new file, and resume writes, but to the new file, etc.
09:15pcnIt doesn't seem like this is easy to support using with-open.
09:16pcnand spit seems to do an open, write, close which puts a lot of stress on the filesystem
09:16mdrogalissw1nn: Mmmkay.
09:16pcnIs it OK to manage files with, say, a ref to the current open file, and in a while loop change the ref when the second boundary has been crossed?
09:20ohcibiit is okay to call def inside a function, right? otherwise (defn) could not be implemented? or is this something only the core should do?
09:20Bronsaohcibi: defn is a macro, not a function
09:21ohcibiBronsa: ah.. so if I want to create my own def (e.g. for a dsl) the idiomatic way is to write macros for it?
09:23Bronsaohcibi: yeah
09:43ohcibiBronsa: is defmacro also a macro?
09:44Bronsayes
10:05`cbpb
10:14ngwhi *, I'm trying to use carica in one of my projects (https://github.com/sonian/carica) but apparently the repo is not present on clojars or any place so lein deps fails
10:15ngwhow do I solve this?
10:16nDuffngw: it's there on clojars
10:16nDuffngw: which version are you trying to pull?
10:16nDuffngw: https://clojars.org/sonian/carica
10:17joegalloah, it looks like 1.0.4 was tagged but not pushed out
10:18joegalloto clojars
10:18ngwnDuff weird: [sonian/carica "1.0.4"]
10:18ngwha!
10:18joegalloleathekd: ^
10:20jcromartieI'm finding myself using Compojure's destructuring exceedingly rarely because I have functions that operate on the session and other things in the request
10:20jcromartieand it's just getting rather cluttered in the route destructuring
10:28Pupeno_wDoing (defn foo [& [bar baz]] ...) it's using pattern matching/destructuring to essentially define a function that receives between 0 and 2 attributes (more are just ignored), right?
10:28coventryPupeno_w: Yes.
10:30Pupeno_wNeat.
10:38wei__trying to compare two maps across processes. could I compute an object hash or something of that sort?
10:41`cbpwhy not = ?
10:43leathekdjoegallo: ngw: Sorry, yeah. The last update changed the readme but I failed to deploy it. Let me do that now.
10:47joegallofor shame, leathekd!
10:47joegallo:)
10:48emaphis`ouch.
10:52CookedGryphondoes anyone know of a good ascii art graph renderer? vijual does exactly what I want but is ancient and doesn't work any more, plus it relies on swing which I can't use - I only want the ascii art bits
10:53CookedGryphonor am I going to have to bring vijal up to date
10:57tolstoyCookedGryphon: Maybe http://ditaa.sourceforge.net has something useful?
10:58CookedGryphonah, overtone has a fork of vijual which seems to work
10:58CookedGryphonbut isn't well advertised or documented
10:59CookedGryphontolstoy: that's cool, but not quite what I want I don't think
10:59CookedGryphonI want to feed in [:a :b] [:b :c] [:a :d] and get a directed graph visualization in ascii art
11:00tolstoyI didn't think so. ;) Ditaa is more like OmniGraffle. ;)
11:00leathekdngw: All set. 1.0.4 is now on Clojars.
11:00clgvCookedGryphon: if you drop the ASCII requirement you can use rhizome
11:02CookedGryphonclgv: that's nice, but I don't have swing
11:02coventryCookedGryphon: Sounds like an interesting application. What's it for?
11:02CookedGryphonotherwise I would probably have tried that first
11:03CookedGryphonI have a complex publish/subscribe model for my android app which coordinates lots of ui/system events and want to visualize it to help newcomers understand
11:03CookedGryphonbut being on android all the graphviz stuff won't work
11:03CookedGryphonso it would be nice to just have it in the repl
11:04clgvCookedGryphon: pure java graph layouting then?
11:04CookedGryphonyep, with textual output
11:05clgvno android UI?
11:05CookedGryphonclgv: could do, but don't really want to do it on the device, it's a dev tool
11:05CookedGryphonso want to bring it up in the repl really
11:06clgvoh ok
11:17coventryWow, sounds really cool.
11:17CookedGryphonyeah, i'm quite pleased with how it's coming along actually
11:17CookedGryphonloads of complex interactions that just melt into simple parts with core async and this model
11:18CookedGryphonso far anyway :P
11:57jtoycan a library know what the path of that java was started from? so if im at /home/jtoy and i do lein repl and include a library, can the library kow the path /home/jtoy and if so, how can Iget it?
11:59TimMcThat's the current working directory, yeah?
11:59jtoyTimMc: yes, but im not sure if the jvm hides it or if jars know
12:00justin_smithjtoy: (System/getenv "PWD")
12:01justin_smithit's the same way any process tracks the working directory, and you can change your working directory by mutating it with setenv
12:01jtoygrea,t thanks
12:01justin_smiththough java tools don't care about PWD they care about the classpath
12:01justin_smithbut you can use PWD in creating File objects etc.
12:03jtoyjustin_smith: I just wantto set the log directory for my app
12:03hiredman /win 27
12:03jtoythats a lot of windows
12:03hiredmanyep
12:10jtoyis there a simple way I can catch all exceptions in a program so hat I can log them?
12:11justin_smith(defn -main [] (try ... (catch Throwable t ...)))
12:11justin_smiththat is a bit excessive though
12:11justin_smiththere are throwables that you should not try to handle
12:11mdrogalisjtoy: You need to make a decision about what level of abstraction you're going to deal with errors and what you're doing to do about it.
12:11mdrogalisOne big net is a recipe for a bad program.
12:12jtoyI just want to log them, canI just rethrow them?
12:12justin_smithtrue, I take my silly suggestion back
12:12stuartsierrajtoy: Thread/setDefaultUncaughtExceptionHandler will catch exceptions on threads that have no other try/catch in place.
12:12mdrogalisYeah, of course. But to do that you need to catch them.
12:12mdrogalisstuartsierra: Huh, I never knew that was a thing.
12:12jtoystuartsierra: great, thanks!
12:12stuartsierraNote that this doesn't apply to exceptions thrown in Futures, which get stored until you deref the future.
12:14stuartsierraAlso note that ExecutorService.submit returns a Future, so any exception in one of those tasks will be stored in the Future.
12:15apgwozhello.
12:15apgwozwoah. this room has grown a ton since i last visited.
12:19mcblumpersonascii
12:27justin_smithto elaborate what stuartsierra said, I think agents behave similarly (though agents may even be a subcategory of future for all I know)
12:30TimMcAh, so I should deref all my futures... in another future... that can log the errors...
12:31justin_smith"We are all interested in the future, for that is where you and I are going to spend the rest of our lives."
12:32justin_smiththat classic quote seems quite apropos here
12:32hiredmanTimMc: at that point you may be better off just not making any errors
12:33technomancy"Of all the dimensions I could spend my life being inexorably forced to travel forward through, I guess time isn't the worst."
12:33hyPiRionwould be worse if it were the x-axis of the world
12:35teslanickIt wouldn't be so bad if we could travel through time at will. If we were moving through time *and* the X-axis, well, that would be bad.
12:35hyPiRionoh yeah, you're right
12:36justin_smithI would settle for immutibility
12:36justin_smithso much better than immortality imho
12:37teslanickIsn't the "many worlds" hypothesis of time effectively immutability?
12:37technomancyconsciousness is an agent
12:38technomancywhich is too bad; it'd be really nice to have access to dosync
12:38danneuDoes anyone use a minimal Backbone.js-like abstraction with ClojureScript?
12:38teslanickThat would have made college so much easier: stop the world and do homework.
12:38hyPiRiontoday I learned AI can't use dosync
12:41apgwozdoes anyone have experience integrating clojure into a heavily guiced java code base?
12:42apgwozi'm interested in hearing horror / success stories
12:45dnolenk thinking about React life cycle hooks for om via reify - https://github.com/swannodette/om/issues/1
12:47justin_smithapgwoz: I haven't done so, but it should suffice to implement the right interfaces on a clojure defrecord or deftype. But hold out for someone who actually has tried it, I am just speculating.
12:47hiredmanapgwoz: the search team where I work was fiddling with writing elasticsearch plugins (which I guess rely on guice for deps?) in clojure, there were issues at one time with being able to annotate constructors created by clojure with the correct annotations
12:47S3thc0nIf I have no else to execute, but also only one expression (no do necessary) as then, should 'if' or 'when' be preferred?
12:48justin_smithS3thc0n: when for side effects
12:48justin_smithor for values
12:48S3thc0nWhy is that?
12:48justin_smith(or (get-value thing) default-value)
12:48justin_smith(when in-outer-space (use-jetpack)
12:48justin_smith)
12:48hiredmanapgwoz: that got fixed, and then after that I think they've been able to, but I haven't been directly involved so I am not sure what the extent of their success was
12:49justin_smithS3thc0n: either works, but or is more clearly about values, when is more clearly about what side effects to create
12:50S3thc0njustin_smith: You meant if instead of or?
12:50justin_smithno
12:50justin_smithif if you have two branches
12:50justin_smithor if you have one and care about values
12:50justin_smithwhen if you have one branch and care about side effects
12:51justin_smith,(or nil true (println :huh))
12:51clojurebottrue
12:51apgwozhiredman: thanks!
12:52S3thc0nI see.
12:52S3thc0njustin_smith: Thank you.
12:52justin_smithS3thc0n: np - though of course with or you end up inverting the first condition compared to when
12:53justin_smith'and' works similarly
12:53justin_smith,(and true :OK)
12:53clojurebot:OK
12:54apgwozjustin_smith: yeah. I'm still investigating, but I think as long as I use an injector with modules that I'm not providing, it should be OK.
12:54apgwozjustin_smith: but we'll see. :)
12:54S3thc0nInteresting. That is a bit I will have to remember
12:57S3thc0nBut I did not quite get why I should use or instead of when?
12:58justin_smithfor the same reason you wouldn't use if
12:58justin_smith,(if true :yeah)
12:58clojurebot:yeah
12:58justin_smithit works, but may not be as clear
12:59justin_smithsimilarly, when works for a single branch, but may not be as clear if all you care about is the value
12:59justin_smith'and' works also, but is not as clear if you care about side effects
13:00justin_smith(I should have suggested 'and' in the first place, I thought of or because that is how most of my single branch conditionals work - providing a default if nothing is specified)
13:00S3thc0nI see. So if I don't even have anything to do I'll just use or.
13:00justin_smithyeah, or for values, when for side effects
13:01S3thc0nok.
13:01S3thc0nThanks a lot!
13:19S3thc0nIn the 4clojure problems, 'conj' is used very often, even though the order of the items matters. Is that bad style, or is it acceptable to let the next one looking at your code figure out what conj will do?
13:21bbloomS3thc0n: conj doesn't have anything to do with order. conj is just a polymorphic add-to-collection operator
13:22bbloom,(conj #{2 4 6} 1 2 3 4 5 6 7 8)
13:22clojurebot#{1 2 3 4 5 ...}
13:22TimMcUsually when you're using conj, you know what kind of collection you're adding onto.
13:22S3thc0nbbloom: That is why I am asking. In 4clojure, the order of the resulting collection matters when it is used.
13:23llasramAnd if the function needs a particular type for the algorithm to be correct, that's no different than requiring you pass in that collection type vs a database connection or whatever
13:23bbloomS3thc0n: only if it's a sequential data structure
13:23bbloom,(map sequential? [#{1 2} [1 2] {1 2}])
13:23clojurebot(false true false)
13:24bbloombitemyapp: i can't hold a grudge. you're re-followed :-P
13:25pyrtsaNaming problem: I keep wanting to use a helper function that converts any non-nil value x into [x] and nil into [], i.e. #(if (nil? %) [] [%]). In Haskell, I'd use maybeToList, but what's a suitable name for it in Clojure?
13:26bbloompyrtsa: i think i've seen that called seqify or vecify
13:26bbloomoh no, nevermind.
13:26bbloomthat's like 5 -> [5] and [5] -> [5] is vecify
13:27jtoycan I put a breakpoin in clojure code so that when I run the function from the repl, it will stop there and I can continue running the commands by hand to test ?
13:27bbloompyrtsa: don't you just want into [] ?
13:27bbloom,(into [] nil)
13:27clojurebot[]
13:27bbloom,(into [] 5)
13:27clojurebot#<ExceptionInfo clojure.lang.ExceptionInfo: Don't know how to create ISeq from: java.lang.Long {:instance 5}>
13:27pyrtsaNo I don't. :)
13:27bbloomer nevermind
13:27bbloomonce again, i should think before i type anything
13:27bbloomignore me :-P
13:27pyrtsa:)
13:28S3thc0nbbloom: Usually they are sequentials. WHat bothers me that it is expected for the reader to consider the data type.
13:28S3thc0n,(= '(3 4 5) (conj '(3 4) 5) (conj [3 4] 5))
13:28clojurebotfalse
13:29S3thc0nI fully understand if you use it for a map or so, but 4clojure definitely uses it on sequences in cases where order matters.
13:29hyPiRionpyrtsa: I'd just call it maybe-vector and get on with life :p
13:29bbloomS3thc0n: 4clojure has intentionally contrived problems to illustrate things
13:29S3thc0nOf course one will know it, but there's nothing wrong with making it more explicit?
13:29hyPiRionconsidering ##(vector 5) gives you a similar function
13:29lazybot⇒ [5]
13:30S3thc0nbbloom: It is all over the place, nto only when teaching conj / cons
13:30bbloomS3thc0n: i'm still not understanding the problem...
13:30bbloomS3thc0n: conj means "add to collection"
13:31jtoythis is a pretty cool breakpoint: https://coderwall.com/p/xayyvq
13:31pyrtsahyPiRion: Maybe. :)
13:32S3thc0nYes. There's nothing wrong with conj itself. But I wanted to know if it isn't bad style to rely on conj to append to a particular end of a sequence and let the reader figure out which one it is.
13:34bbloomS3thc0n: i don't think it's bad style
13:35bbloomit's usually pretty clear if the thing being conj-ed on to needs to be of a particular type or if the function works generically on any composite
13:35alewWell you should only be relying on an order in a vector I would think
13:37coventrySuper-correct style would probably be only to use conj if you don't care about where it puts the addition to the collection. But it's pretty minor.
13:37S3thc0nSo it is preferred to explicitly convert the given sequence to the datastructure and then use conj implicitly instead of just takig the given and then adding to the correct position?
13:37S3thc0nCaus then you will always have to know the type, which is kidn of inconvenient.
13:38mdrogalisHe has a good point.
13:38mdrogalisThis wouldn't make any sense if you didn't know it was prepending.
13:38alewWhat does it mean to be in a specific position in a map or set for example
13:38mdrogalis,(reduce conj (list) (range 1 5))
13:38clojurebot(4 3 2 1)
13:40S3thc0nalew: Nothing, but I'm talking about sequences.
13:41alewconj acts on collections not sequences no?
13:41S3thc0nalew: Aren't sequences collections?
13:41hyPiRion,(conj (seq (range 10)) -1)
13:41clojurebot(-1 0 1 2 3 ...)
13:42alewyou can access any collection as a sequence
13:43justin_smithS3thc0n: I use conj on the data if the same function creates or coerces the data
13:43alewa sequence is a view at a collection, but not a collection itself I believe
13:43alewlists implement sequences pretty directly though
13:44amalloyalew: of course a sequence is a collection
13:44justin_smithalew: that is true
13:44amalloyit holds elements, you can add elements to it, what else is there?
13:44alewa seq is just an interface against some collection, is it really a collection itself?
13:44justin_smithlinked-list style first/rest is kind of the lowest common denominator api for collections - if it is ordered pretty much anything can provide you that style
13:44amalloy&(coll? (range 1))
13:44lazybot⇒ true
13:44amalloy&(coll? (seq [1 2 3]))
13:44lazybot⇒ true
13:45amalloyyou cannot provide any seq that is not a coll
13:45justin_smith,(seq "hello")
13:45clojurebot(\h \e \l \l \o)
13:46alewI'm guessing a seq created from range is a list underneath
13:46justin_smith,(coll? "hello")
13:46clojurebotfalse
13:46justin_smithdunno if that is what you meant
13:46amalloyalew: you are guessing some crazy things
13:47amalloyit's a sequence constructed of cons cells, which is rather like a list, but all it promises to be is a seq
13:47amalloyif you can provide some x such that (seq? x) is true and (coll? x) is false i shall be very excited
13:48amalloy(since that is definitionally impossible - every seq is a collection)
13:48S3thc0nI would argue that everything implementing an interface kind of has to be that thing in some sense.
13:48justin_smithS3thc0n: the instance? predicate agrees with you
13:49amalloyyeah, it's basically impossible to disagree with S3thc0n's assertion
13:51alewYeah
13:51S3thc0nSo I would propose to use cons and a function that appends on the end when order matters, instead of just relying on data types. It doesn't cost anyhting and only makes it clearer.
13:52alewDoes clojure actually use cons cells underneath btw?
13:52amalloysometimes
13:52justin_smithS3thc0n: well the point of conj is it is guaranteed to be the cheapest way to add to a collection, time/space wise
13:53S3thc0nExactly. But order is not guaranteed. It might change depending on implementation (although that is not sure).
13:53amalloyjustin_smith: i have an entertaining edge case for you
13:53alewIn that respect, it doesn't really make sense to use conj as a way to ensure order from arbitrary collection input
13:53justin_smithamalloy: cool, do tell!
13:54amalloy&(let [x (lazy-seq (do (Thread/sleep 5000) [1]))] (time (first (conj x 0))))
13:54lazybot⇒ "Elapsed time: 5017.044583 msecs" 0
13:54amalloy&(let [x (lazy-seq (do (Thread/sleep 5000) [1]))] (time (first (cons 0 x))))
13:54lazybot⇒ "Elapsed time: 11.118449 msecs" 0
13:54alewThat's funny
13:55justin_smithlike a magic trick
13:55justin_smithbut that is indeed why we have laziness, neato
13:55amalloywell, the trick is that LazySeq's conj implementation forces the first element of the sequence
13:55amalloywhereas cons just builds a Cons
13:56alewis it only the first element?
13:56hyPiRionunless it is chunked
13:56amalloywell, it calls seq
13:56S3thc0nI think i will look at coljure.core and see how conj is used there.
13:57justin_smithS3thc0n: good call, reading code is often the right answer :)
13:57amalloyand you can build collections which do arbitrary amounts of work to implement seq, so "only the first element" isn't really a provable thing
13:57TimMcBeware, clojure.core is full of dirty tricks and bootstrapping.
13:57TimMcIt's a good read, but there's some very unidiomatic stuff. :-)
13:58justin_smithS3thc0n: if using emacs, M-x rgrep is a cool way to investigate usages throughout a codebase
13:58TimMc(Usually because it is still building the things Clojure idioms rely on.)
13:58amalloyeg, (conj (lazy-seq (vec (range 1e7))) -1) only forces the first element of the underlying seq, but building that seq can't happen until you make a 10M element vector
13:58alewit's probably bad practice anyway to rely on lazy seq evaluation for side effects
13:59seangrovebbloom: I think you'll like this - we're building in a bit of functionality to show emails in the browser
13:59seangroveLuckily, we don't have to worry about it looking good/formatting it at all, nor attachments, etc.
14:02TimMcFor now. Just wait.
14:03TimMcIn 6 months you'll be working on a full MTA.
14:03bbloomseangrove: remind me who "we" is again?
14:03coventryEvery mail reader expands until it can be used as a general-purpose programming language.
14:04seangrovebbloom: Zenbox, but working on a new product
14:04jcromartieI'm about to just (def ^:dynamic *db*) here, is that so wrong?
14:04bbloomseangrove: oh right, the gmail plugin in cljs :-)
14:05seangroveTimMc: It's an idea I flirt with form time to time for a side project eventually - an open source extensible email client in cljs
14:06justin_smithcoventry: lol, I was just looking for the original quote
14:06justin_smithjcromartie: depends, should threads see the db binding, and are they launched inside the lexical context of the binding?
14:07TimMccoventry: Claws Mail is definitely working on that, although it relies on being able to shell out for the most advanced predicates and actions.
14:07seangrovejcromartie: I'm not a big fan of it, but if it's just something quick-n-dirty, it's not the end of the world
14:08S3thc0n_As much as I have seen (not too much) the function description explicitly states that it is conjoined (no order guarantee) or it is used on a sequence which was created very near to the use.
14:08coventryTimMc: Sounds like a glorious yak shaving vehicle.
14:09alew(class (range 1))
14:09alew,(class (range 1))
14:09seangrovejcromartie: Also, I believe bitemyapp said something like "I'd burn my house down before doing dynamic db bindings again"
14:09clojurebotclojure.lang.LazySeq
14:09seangroveCould have been for something else though
14:10jcromartieseangrove: I'm leaning towards "just pass an arg"
14:10jcromartieit's really not that bad, once you get used to it, and it's the very definition of SIMPLE
14:10jcromartiebut I have my doubts
14:10jcromartiethat's the story of my Clojure experience, nothing but self doubt :(
14:10seangrovejcromartie: Yeah, I think that's a good approach
14:11justin_smithjcromartie: that sting is just your pride fucking with you, you're learning, that's positive
14:12jcromartiehm, that's an interesting way of looking at it, actually!
14:12justin_smithit is my philosophy of learning
14:13alewWhat's the difference between a LazySeq and a ChunkedCons?
14:13jcromartiealew: this sounds like a start to a good troll :)
14:14alewI'm wondering because
14:14alew,(class (seq (range 1)))
14:14clojurebotclojure.lang.ChunkedCons
14:14alew,(class (sequence (range 1)))
14:14clojurebotclojure.lang.LazySeq
14:15justin_smithalew: chunking is a performance optimization, it realizes some number of results beyond what is needed for the current call
14:15alewIs it still a LazySeq though?
14:16coventryalew: http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/
14:16justin_smith,(instance? clojure.lang.ChunkedCons (seq (range 1)))
14:16clojurebottrue
14:16justin_smith,(instance? clojure.lang.LazySeq (seq (range 1)))
14:16clojurebotfalse
14:17coventryIf you're looking at clojure.core.clj, jvm/clojure/lang/ChunkedCons.java are only a short hop away.
14:18coventry*and friends are only a short hop away
14:25alewspeaking of friend
14:25alewhas anyone had a good experience with the friend authentication library?
14:26jonasenBronsa: Is tools.analyzer.jvm better to infer java types than Compiler.java (i.e. less type hints are needed)?
14:30Bronsajonasen: yes
14:31jonasenBronsa: Is there an easy way to see which types Compiler.java can't find? (I'm thinking some kind of :infer-type-hints "linter")
14:32Bronsajonasen: not that I can think of right now
14:32jonasenBronsa: ok
14:33Bronsajonasen: btw will probably release a 0.0.1-alpha1 version of t.a & t.a.j later this week so that eastwood can depend on a non-SNAPSHOT version
14:33algalI got to a good place with friend but it took longer to get there than I'd have liked.
14:37alewalgal: Do you think it's because of documentation or just the inherent complexity of the interface?
14:38alewconventry: Thanks for the link btw
14:38algalalew: Documentation is definitely a problem. I am not sure what I think of the interface.
14:38S3thc0n_I have now seen a whole lot of examples where people just rely on conj to do the right thing...
14:39algalalew: The main docs now are the README, which needs editing.
14:40S3thc0nBut in core it is made sure that it is always the same. So there should be no real issues as long as noone fiddles around with core. But it still is semantically incorrect and complicates thing unnecessary
14:40algalalew: it presents too many concepts for basic use cases.
14:41algalalew: I started with friend, ditched it for http-basic-authentication, then went back to friend.
14:41alewalgal: Yeah, I think he just wrote everything he had on mind without really thinking of the minimal surface area to cover
14:42algalalew: yes. friend would be 3x as useful if someone spent 3 hours editing the README.
14:42justin_smithwell there is that thing they call pull requests on github
14:42algaljustin_smith: I know! It's on my todo list.
14:43alewI still need to get a working conceptual model of friend before I'm confident in making docs for it :P
14:43algalalew: I bet that whole model could fit in one well-considered diagram.
14:44alewProbably, it seems well designed
14:44justin_smithalew: three awesome ways to figure out how to use an underdocumented library: write unit tests that pass given the current implementation, write comments that accurately describe the non-trivial parts of how the functions interact (given the facts you know from the tests), write a readme that the author considers accurate
14:45justin_smiththe nice thing is these can be stepping stones to help others in the future
14:46bitemyappBronsa: I didn't know eastwood used ta/taj
14:46bitemyappBronsa: neat.
14:47algalalew: one complicating factor is that authentication + routing + ring is a bit non-obvious, imho.
14:48algalalew: at least, I first stumbled into the error of wrapping routing handlers in auth. others do as well.
14:49Bronsabitemyapp: it was mostly an Andy Fingerhut effort to port it, it helped me a lot finding & fixing bugs
14:50Bronsabitemyapp: now t.a and t.a.j have been succesfully run in all contrib libraries but core.typed/jvm.tools.analyzer because of namespace collisions and data.fressian/test.generative beacause of http://dev.clojure.org/jira/browse/TANAL-24
14:51justin_smithalgal: alew I am trying to figure out friend myself, so I can integrate it into caribou with my plugin API (said api is still in development)
14:51technomancybbloom: congrats on breaking 10M =D
14:52algaljustin_smith: caribou looks very impressive, btw!
14:52justin_smiththanks, I am only one of the devs, and not the primary one
14:52justin_smithbut I trust that the parts that you like best are the ones I am responsible for :)
14:53justin_smiththe parts you don't like are all patchwork's fault
14:59bbloomtechnomancy: w00t! thanks
14:59bbloomtechnomancy: it's really unbelievable
15:01bbloomtechnomancy: http://www.youtube.com/watch?v=R6dnBA8BSR8&amp;feature=youtu.be :-)
15:02technomancyhaha wow
15:03biggbearbbloom: are you the kid teaching?
15:03bbloomthat's just the most recent cool thing to grace my inbox
15:03bbloomtechnomancy: there's so much news/press/excitement, it's just too cool
15:03bbloomlike absurdly excited little girls: http://www.youtube.com/watch?v=e_t3-3vPp-g
15:04bbloombiggbear: http://code.org
15:04algal"They used to call it magic. Today we call it information" :)
15:05seangrovebbloom: Looks like you need to work on loading times :)
15:06bbloomseangrove: lol i think she was just too excited & mis-tapped the safari icon :-P
15:07algalbbloom: has Papert's Mindstorms etc. influenced the instruction design? or not so much?
15:07hyPiRionhow do you even get that sort of domain? Crazy lucky.
15:08hyPiRionThat's what the only thing I wonder about. I have weird priorities.
15:08algalI've been visiting public elementary schools in SF and it's sad how unimaginative they are about use of computers.
15:08bbloomalgal: technomancy & others were discussing mindstorms in here a few days ago. i just wrote javascript/ruby/etc, leave the education design up to the professionals :-)
15:09`cbpyou can hack mindstorms with clojure? or is that not related?
15:10bbloombut i can say that the feedback has been exceptionally positive for the pacing & presentation of our tutorials in particular. some of our learning partners, especially those teaching javascript or freeform ones with out goals, have much lower success rates
15:10algal`cbp: Lego mindstorms != Papert mindstorms.
15:10bbloom`cbp: not lego
15:10technomancyit's definitely indirectly influenced by mindstorms
15:10technomancylogo -> scratch -> blockly -> code.org
15:10algalbbloom: Very cool.
15:10`cbpoh, I got excited for a bit
15:15algalbbloom: btw, I really liked your presentation on concatenative clojure. saw it online. very eye-opening.
15:15bbloomalgal: thanks! glad you liked it
15:19bitemyapp~APL
15:19clojurebotAPL is a comonad
15:19bitemyapp~concatenative is a comonad
15:19clojurebot'Sea, mhuise.
15:21algalbitemyapp: Has someone really configured "~" to call its argument a comonad?
15:21algal~algal
15:21clojurebotNo entiendo
15:23pjstadigalgal: "~" is just how you get clojurebot's attention
15:23danneuDoes anyone implement the ol *current-user* concept in a different way than to use a dynamic var?
15:23TimMcYou're a comonad.
15:23bbloombitemyapp: no, it really isn't stop that
15:24bbloombitemyapp: even if it was a comonad, it's not a useful thing to consider
15:24jcromartiesurvey: mustache (clostache etc.) vs hiccup?
15:24TimMcIs a comonad like a coburrito?
15:24jcromartieor a cronut?
15:24bitemyappTimMc: kinda.
15:24algalit's like a co writing desk.
15:24TimMcjcromartie: Hiccup is unsafe by default, so there's that.
15:25danneuhiccup for sure
15:25TimMc(Mustache HTML-encodes data unless you ask for an exception.)
15:26TimMcSomeone made a safe version of Hiccup, although I can't remember who.
15:26seangroveBig fan of hiccup
15:26coventryTimMc, algal: http://trevorjim.com/the-monadic-morass/
15:27teslanickGoogling turned up nothing -- why is hiccup unsafe?
15:27bitemyappcoventry: monads aren't a turing tarpit, lol.
15:27rovarhow can I get tests to work via fireplace?
15:27bitemyappcoventry: monads aren't some limited language researchy thing, they're used to build reusable software components.
15:27rovarI'm trying to work through the intro to fireplace and I'm stuck there..
15:27bitemyappa regrettable article written from ignorance.
15:28TimMcteslanick: If the data you're dumping into hiccup is "<blink>", hiccup will happily include that in your HTML.
15:28xeqiteslanick: you have to manually escape strings
15:28jcromartieI like the *idea* of mustache, and yeah I don't like the unsafe-by-default hiccup
15:28xeqiTimMc: https://github.com/ato/clojars-web/blob/master/src/clojars/web/safe_hiccup.clj is the additions we use in clojars to make escape by default
15:28TimMcI don't undersatnd why people keep writing HTML templating or generation libs that fuck this up.
15:29teslanickAh, the XSS problem.
15:29xeqithough it does escape more then it needs to, we just don't use those parts
15:29bitemyappTimMc: Selmer gets it right by default.
15:29TimMcI'm glad to hear that.
15:30TimMcSo does Enlive, and, I think, Laser.
15:30bitemyappHrm. I should ask Raynes.
15:30jcromartieI don't really like any of the Clojure mustache libs, and I have failed at several attempts at writing my own due to the insanity of parsing Mustache with the set-delimiter directive
15:30Raynesbitemyapp: https://www.youtube.com/watch?v=WkNGf_NPM78
15:30RaynesHi.
15:30bitemyappTimMc: Selmer is the only *fast* and nice to use templating library that gets it right :)
15:30bitemyappRaynes: hi!
15:30jcromartiemaybe I'll try selmer too :)
15:30jcromartieright now this app uses clostache AND hiccup
15:30bitemyappjcromartie: highly recommend it.
15:30RaynesSo what are you asking me about?
15:30RaynesEscaping?
15:31bitemyappRaynes: yeah, how does Laser do it?
15:31xeqiI thought everyone was using cljs+react now :p
15:31TimMcRaynes: Laser, does it fuck up escaping?
15:31danneuhiccup is a unique opportunity to do something you just can't/don't do in other languages/stacks.
15:31bitemyappdanneu: er, no.
15:31jcromartietrue
15:31RaynesLaser escapes strings by default. You can wrap strings in an Unescape type if you want them to not be escaped.
15:31bitemyappdanneu: that was already a thing in Common Lisp with CL-WHO
15:31danneuoh come on
15:31TimMcRaynes: Good, good.
15:31RaynesThat's what my hickory fork allows for.
15:31danneucaptain technical
15:31TimMcdanneu: Yes, and I like the general shape of Hiccup for some tasks, but this one flaw is pretty serious.
15:31bitemyappTimMc: so, sounds like Laser works on roughly the same basis as Selmer. Escape by default, mark for unescaped on a case-by-case basis.
15:32bitemyappdanneu: pardon me for being a grumpy old Lisper, just saying.
15:32alewjustin_msith: you mentioned caribou. I've been thinking of switching to it from composure and making use of the model stuff
15:32bitemyappcompojure*
15:32justin_smithalew: I won't try to convince you not to :)
15:33pcnDoes anyone know of libraries that make interacting with the filesystem easier? I'd like to have access to stat, link, unlink, and some other stuff.
15:33Raynesbitemyapp and I are secretly the same person.
15:33bitemyapppcn: fs
15:33danneupcn: Raynes has this fs lib.
15:33RaynesOur real name is Jason and we have multiple personality disorder, clearly.
15:33justin_smithalew: be sure to check out the docs, they are pretty extensive. If you have questions that are caribou specific we hang out on #caribou
15:33bitemyappRaynes: no we don't
15:33pcnthanks
15:34bitemyappRaynes: ssshhh don't tells thems
15:34Raynes<3
15:34danneuTimMc: is the issue that you have to opt-in to escaping user input instead of opting in to unescape it?
15:34TimMcExactly.
15:35Raynespcn: danneu is correct, I do has this fs lib. It may have things you want in there.
15:35arrdemRaynes: http://i.imgur.com/qYNFUyF.gif
15:35TimMcAnd users will always get this wrong in at least one location, and then Samy comes in the night and crashes your site.
15:35Raynespcn: There is also conch if you'd like to just shell out. That works too.
15:35RaynesI got whachu need, brah. Take your pick.
15:36bitemyapppcn: the entire Clojure community is actually just Raynes and technomancy. There are no other creators of libraries.
15:36TimMcAnd ztellman. I think ztellman is a separate person.
15:36jcromartieztellman is an AI
15:36bitemyappTimMc: yeah but he's in another dimension.
15:36jcromartiebut legally a person
15:37bitemyappjcromartie: glasses-wearing AI
15:37RaynesMy new profile pictures: http://fc00.deviantart.net/fs70/i/2011/288/7/6/deal_with_it___rainbow_style__by_j_brony-d4cwgad.png
15:37TimMcI don't think I even need to click on that.
15:37danneuTimMc: since there are solutions for it, it doesn't seem like it should have much clout in one's decision
15:37arrdemTimMc: the URL does say it all
15:37bitemyappRaynes: <3
15:38danneubesides, cowboy coders don't care
15:38ztellmanbitemyapp: you figure my designers would have gotten my eyes right, but alas
15:38TimMcdanneu: Unless I'm mistaken, xeqi didn't monkeypatch hiccup, it's an outright fork.
15:39TimMcThat means it's not even hiccup, it's a less-maintained thing that used to be hiccup.
15:40danneuit's just a redef of the html5 macro
15:41danneui do like that form-to redef though that bakes in the anti-forgery-token input
15:41danneu*yoink*
15:42TimMcAh, OK.
15:44danneuoh yeah, there's even hiccupy syntax for css https://github.com/noprompt/garden
15:44Raynesnoprompt is a bro.
15:44Raynes<3
15:45danneui used to think flask/sinatra/express were minimal. but now i use that weavejester/noprompt stack
15:48bitemyappRaynes: yes he is.
15:49bitemyappRaynes: a MENSCH as they say.
15:49mdrogalisRaynes: Someone saw that I added 'fs' to a project and asked about when I "added this raynes stuff in"
15:49mdrogalisYou're basically a library now.
15:50Rayneslol
15:50bitemyappbut a library with hopes and dreams.
15:51mdrogalisA library that throws a nio class cast exception on Java 6. Bad Raynes
15:52Raynesmdrogalis: Pretty sure that was fixed in a more recent version.
15:52RaynesBut the plan was to deprecate Java 6 support in the next major version.
15:52mdrogalisRaynes: Ah, it wasn't my problem, and I could care less about Java 6 support. So good.
15:53RaynesIt's just that the nio stuff is pretty nice. It's hard to ignore when Java releases are moving so fast these days :p
15:53mdrogalisYeah, no fault there for sure.
16:01sverihi, how can i refer from one leiningen project to another leiningen cljs-build?
16:04bitemyapptechnomancy: the answer to the shopping cart thing is that Amazon does a set union when they need to resolve a conflict
16:05bitemyappwhich explains that one time I had an item in my shopping cart I couldn't seem to delete.
16:05technomancybitemyapp: when in doubt, go with the answer that makes the company more $$$
16:06bitemyapptechnomancy: yeah I found it a cute, but sensible solution.
16:07dnolensveri: what do you mean?
16:09sveridnolen: i have to projects, both are clojurescript projects and i want to include one project into the other during development and build time, just like i would use one clojure lib in another clojure library
16:09sveri*two
16:10dnolensveri: oh, might be possible, but I don't know myself.
16:10sveridnolen: ok, thank you :-)
16:16OscarZif i have a recursive function, a kind of tree traversal thingy that may make two recursive calls to itself in some cases, is it possible make the two calls run in parallel if there are cores available?
16:17justin_smithOscarZ: sounds like reducers http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
16:19OscarZthanks
16:19justin_smithOscarZ: or you could express it as go blocks that send their results to a shared input channel
16:19technomancysveri: you mean :dependencies?
16:19OscarZmight be too advanced stuff for me at this point :)
16:19patchworkGetting intermittent errors about "too many arguments to def"
16:19patchworkI run it one time, no errors
16:20patchworknext, error
16:20patchworkWhat is that about?
16:21justin_smithsounds like an evil macro!
16:21justin_smithare you using defonce with a docstring?
16:22patchworkNot me!
16:23amalloypatchwork: using def with a docstring pre-1.3?
16:24gfredericksamalloy: that wouldn't be intermittent
16:25amalloygfredericks: intermittent is so vague. maybe he's running lein test, in a project which runs tests on all clojure version in a nondeterministic order
16:25patchworkamalloy: That is the error. So it seems it is intermittently pulling in pre 1.3, then on next boot post 1.3?
16:25patchworkamalloy: Typing > lein run each time
16:25justin_smithsounds like a job for lein pedantic / exclusions
16:25patchworkNo multiple versions
16:26patchworkSo: lein run — too many arguments to def
16:26patchworkNext: lein run — *boots fine*
16:26technomancyyeah definitely drop a pedantic in there
16:26gfredericks(if (zero? (rand-int 2)) (eval '(def foo bar baz bang bapiew)))
16:27justin_smithlol
16:27technomancybapiew? were you raised by wolves?
16:27technomancythe correct metasyntactic variable is "quux"
16:28justin_smithmy goto metasyntactic is ☃
16:29technomancykids these days
16:29TimMcquux quuux quuuux
16:29justin_smith😼
16:29gfredericksclojurebot: bapiew is wolfspeak for quux
16:29clojurebotRoger.
16:30TimMcThat's a nice little time bomb of surreality.
16:30gfredericksthat's a good summary of most of my interaction with clojurebot
16:30coventrypatchwork: I would try putting a clojure.tools.test/trace-var on (def) at the entry point of lein run. Don't know whether that works, though.
16:30technomancythat's clojurebot's whole purpose for existence
16:31gfredericks~that
16:31clojurebotthat is dumb
16:31gfredericks~this
16:31clojurebotthis is not a bug
16:31gfredericks~what
16:31clojurebotwhat is cells
16:31justin_smith~wat
16:31clojurebotIt's greek to me.
16:31technomancy~why
16:31clojurebottechnomancy: because you can't handle the truth!
16:31justin_smith~greek
16:31clojurebotExcuse me?
16:31gfredericks~technomancy
16:31clojurebottechnomancy is <jweiss> oh man this sucks, why didn't anyone warn me about protocols
16:32technomancy~how
16:32clojurebotwith style and grace
16:32gfredericks~wherefore
16:32clojurebotexcusez-moi
16:32justin_smith~when
16:32clojurebotI don't understand.
16:32technomancyhard to argue with that one
16:32pjstadig~suddenly
16:32clojurebotBOT FIGHT!!!!!111
16:32pjstadigbah
16:32gfredericks~lazybot
16:32clojurebotlazybot is echo ~lazybot
16:32gfredericks~sexpbot
16:32clojurebotsexpbot is not a clojurebot
16:32justin_smith~~
16:32clojurebotCool story bro.
16:32technomancy~when is for side effects
16:32clojurebotIn Ordnung
16:33pjstadigtechnomancy: haha!
16:33pjstadigkeep the dream alive, my friend
16:33sveritechnomancy: basically, yes, but i mean clojurescript dependencies
16:33technomancysveri: sure. what's the problem though?
16:34justin_smith~whither
16:34clojurebotIt's greek to me.
16:34technomancy~whence
16:34clojurebotExcuse me?
16:34sveritechnomancy: i wonder if its possible, and if, do i do it just like i add a clojure dependency
16:34technomancy~tias
16:34clojurebotTry it and see! You'll get results faster than asking someone in #clojure to evaluate it for you, and you'll get that warm, fuzzy feeling of self-reliance.
16:34pjstadig~dont
16:34clojurebotNo entiendo
16:35justin_smith~whither is let bindings or function args are best, then vars, finally dynamic vars
16:35clojurebotOk.
16:35justin_smith"to what place or state"
16:36technomancyclojurebot: whether tis better to suffer the slings and arrows of outrageous monads
16:36clojurebotTitim gan éirí ort.
16:36technomancyget it? arrows? eeeeeeh.
16:36sveritechnomancy: was that hint for me?
16:36justin_smithlol
16:36technomancysveri: right-o
16:37justin_smithGeneralized Abstract Nonsense is the best source of humor material
16:37sveri:D it took me a while to get it :D thank you, i try it
16:37technomancyoh no cartesian closed comic is offline D=
16:39gfredericksit is?
16:39jweisshah, technomancy's definition is from met complaining about protocols. something about reloading the definition of a protocol causing class mismatches :)
16:40jweiss*me
16:42justin_smithyup, that is what sucks about protocols
16:42justin_smithmacros have similar issues
16:42justin_smithredefining them does not redefine the things that already used them
16:43gfredericksmacro-driven development is a hard life
16:50bitemyappI would rather like it if Mac OS X would stop breaking my applications when I unlock my computer.
16:51justin_smiththat sounds really weird
16:55bitemyappjustin_smith: it's pretty weird.
16:55bitemyappI end up having to kill and restart a bunch of stuff.
16:57justin_smithwhat are the symptoms?
16:59bitemyappjustin_smith: they shove up to the top of the screen, taking all the horizontal width, and about 1/4 of the vertical span
16:59bitemyappthey are responsive in some sense, but the rendering of the window is frozen and I have to cmd-q and restart to make them work again
17:01justin_smithWhy can't anybody do displays right. I bet it has to do with the code for recognizing and using monitors as they are plugged in.
17:01jcromartieyeah I really don't get it. particularly on Linux
17:01jcromartiegraphics cards are scary beasts
17:02justin_smithjcromartie: now that I grok xrandr I would not enjoy having to use systems that do not provide that utility
17:02technomancyintel cards <3
17:02technomancyjust works
17:02justin_smitha single command line to use / ignore / rotate an external display, eminantly shell-scriptable
17:02justin_smithtechnomancy: how frequently do you use multiple monitors?
17:03technomancyevery day?
17:03technomancyI don't do rotation though
17:03jcromartieI'd love to use the output on my thinkpad, which has Nvidia/Intel setup
17:03jcromartieI have to run the Nvidia card to get output
17:03jcromartiebut I have to run Intel to get more than 40 minutes of battery life :|
17:06bitemyappjustin_smith: xrandr has been pretty good to me on my Thinkpad.
17:06bitemyapptechnomancy: so nix. How do I install/search packages?
17:06justin_smithtechnomancy: I don't do rotation either on a regular basis, I was using it as an example that more advanced functionality was also there in the command. One of these days I want to try the zoom/pan multi-monitor setup, where one monitor is the entire "display" scaled down, and the other is a zoomed in region following the mouse
17:06bitemyapptechnomancy: the documentation hasn't been kind to me.
17:08technomancybitemyapp: `nix-env -qa emacs`
17:08technomancy^ to search
17:08technomancy`nix-env -i emacs-24.3` <- to install
17:09bitemyapperror: getting information about `/Users/callen/.nix-defexpr': No such file or directory
17:09bitemyapptechnomancy: I tried figuring out what it wanted me to do to finish bootstrapping the env but it referenced files I couldn't find.
17:10bitemyappnix is written in C++? Brave.
17:10technomancybitemyapp: yeah there's some crazy NIH going on there
17:11technomancyI wish they had gone the https://www.gnu.org/software/guix/ route from the start
17:11technomancy(haven't tried guix yet; it looks more pleasant but probably a bit less polished)
17:14technomancyI really should try it
17:18bitemyapptechnomancy: I don't want to use Guile :(
17:19coventryFunny, I've just been playing with nix today too.
17:33pcnThis has go to to be well known. How am I getting "IOException Stream closed java.io.BufferedWriter.ensureOpen (BufferedWriter.java:98)" using with-open and a for loop to write data to th efile.
17:35stuartsierrapcn: `for` is lazy
17:36pcnAh, yeah, I just get that while works for that. Hmm..
17:37technomancybitemyapp: you'd prefer a weird one-off language?
17:45bitemyapptechnomancy: you know what I prefer *_*
17:46technomancybitemyapp: there's a disturbing amount of perl in nix =\
17:47technomancy#fivewordtechhorrors or whatever
17:48bitemyappnot surprised.
17:55pcnSo what's an idiomatic way to deliver a list to an open file, not using spit?
17:55pcnCan while bind?
17:57coventry>pcn: You can use (for [bindings :while (test)] body) for that.
17:59coventryOh, didn't see your first message. To send to a file, use doseq instead of for.
18:00pcnAh, I was going to ask about un-lazifying it. I'll try doseq.
18:11pcnSo https://gist.github.com/pcn/7937204
18:12carkanybody here having a bit of experience running a cljs repl on node-webkit ?
18:13carki got the repl working, but the document element being referenced is the iframe for the repl rpc, i have no clue on how to acccess the top-level repl
18:13carki mean top level document
18:15justin_smithcark: sounds like a xss security thing
18:15carkeverything is local
18:15carkbut yes, i think it's forbidden for an ifram to access anything else
18:16justin_smithyeah, just because this is all the same host, does not mean xss security measures can'
18:16justin_smitht affect it
18:16carkoh, node-webkit is loading it's data from file, so yes must be xss problem
18:16justin_smithdamn fat fingers hitting too many keys at once
18:17carkso i guess i should serve the files and access these via http at least for developement
18:17carkthat sounds right, thanks !
18:18justin_smithnp
18:21TimMcS11001001: Are you at the meetup?
18:22S11001001TimMc: I'll be leaving for it soon
18:22TimMcOK, I think the times on the meetup site are wrong.
18:23TimMcI got here at 6:00, but Eric's not here yet.
18:23TimMcIt seems to still be on, though.
18:23S110010016 isn't the right time :)
18:23TimMchrmph :-)
18:23S110010016:30's the meet/greet, 7's the "official" start
18:24S11001001here we go
18:39pcnTimMc: what town are you guys in?
18:42TimMcpcn: Cambridge/Boston, MA
18:42TimMc(By the way, the meetup was in fact supposed to start at 6:00 PM.)
18:44amalloygood news! if you're living on a sensible coast, it's not 6PM yet
18:48pcnSo you're still at work :)
18:51slpsys" "
18:58Raynesamalloy: I don't understand the east coast.
18:59RaynesI picture it as kind of a swamp. All of it.
18:59amalloypcn: happily unemployed!
18:59Raynes:p
19:00RaynesBut the beach is still there.
19:00pcnamalloy: can't find any problem with it if you're happy!
19:02TimMcRaynes: This is correct.
19:02amalloycheckmate, east coast
19:20bitemyappoh my god I just spent like 5 hours jumping between helping 4 different people
19:20bitemyappI want to curl up in a ball now.
19:21Rayness'okay buddy
19:22bitemyappRaynes: I like helping people but if I don't get some music and code in my life I will shrivel up and die.
19:22rovaris it possible to use a chan as a key in a map?
19:22bitemyapprovar: don't.
19:22rovarok
19:22bitemyapprovar: don't pretend channels are reified "things"
19:23bitemyapprovar: they might be in some cases, but often aren't.
19:23rovarrgr that
19:23bitemyappthe current state of reification is a value-oriented convenience but don't take it beyond that.
19:24bbloomrovar: it's perfectly possible
19:24bitemyapprovar: why'd you want to do that anyway? curious idea.
19:24rovarmaking a multi-user websocket server
19:24bitemyappI could see it making sense for a chan to be a value, but not a key.
19:24bbloomi also don't think it's as bad a plan as bitemyapp suggests
19:24amalloyreally? i'd expect channels to have identity equality
19:24bitemyappamalloy: they do
19:24bbloomamalloy: they do
19:24amalloyseems perfectly sensible to use them as keys in a map
19:24bbloomagreed
19:25bitemyapp s/faces/face/g
19:25bbloomespecially with (alts! (keys ..
19:25amalloyi think it's totally plausible that you're just running around the room scrunching everyone's faces
19:25rovarits either I use the channel to associate all of the rest of the metadata.. or I generate a unique string that represents that connection, and hand that back to the client
19:25technomancyamalloy: he didn't sp.ecify what he was helping 4 different people with
19:25rovarthe first approach is just much simpler, but not as fault tolerant.
19:26bitemyapptechnomancy: clojure and datomic
19:27bitemyappthe clompire spreads here.
19:30bitemyappemp-jure?
19:31technomancyplease set LEIN_IRONIC_CLO to continue
19:41bitemyappbbloom: I see you re-followed me on the twattles. What inspired that?
19:42bbloombitemyapp: i only really unfollowed you for a gag & then you showed up on my "interactoins" page, so i clicked the follow button :-P
19:43bitemyappbbloom: <3
19:44Raynesbitemyapp is good peoples.
19:44noprompt#1983
19:44Raynesnoprompt: Hi!
19:44nopromptRaynes: :-)
19:45nopromptbitemyapp: my internet tanked last night. there was comcast blackout. :(
19:45mysamdogBoth dommy and dommina do not appear to work for me
19:45mysamdogI mean, append! and stuff works, but listen! doesn't
19:46bitemyappnoprompt: is it back up?
19:46bitemyappRaynes: that is a lie.
19:46kendallbuchananI have a question about the robert-hooke library: I'm wondering if a particular use-case I have is taking it too far. Anyone used it before?
19:46nopromptbitemyapp: yeah, but i'm at work for the next hour or so atm.
19:47bitemyappRaynes: http://www.youtube.com/watch?v=omSeE9Ku9lM
19:47rovarso how might I force an evaluation of chan to put it in a map to test?
19:47bitemyappnoprompt: sure, just trying to schedule.
19:47rovar{ (chan
19:47Raynesbitemyapp: I think I just died https://www.youtube.com/watch?v=jlSF0dtDRD8
19:47rovarmeh
19:47rovar{ (chan) "channel 1" (chan) "channel 2" }
19:48rovarresults in a duplicate key: (chan)
19:48bitemyapprovar: only way to access that if you define it that way is (keys ...)
19:48bitemyappRaynes: listening to the cotton story, it's hilarious.
19:48nopromptbitemyapp: yah, i'm stoked. i'm super rusty and basically back at the n00b level but this'll be good.
19:48bbloom,{(gensym) 1 (gensym) 2}
19:48clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (gensym)>
19:48bitemyappnoprompt: it's fine.
19:48bbloomheh, well would you look at that?
19:48bbloomseems like a bug to me
19:49rovarbitemyapp, yea, I was just testing to see if it would work
19:49rovarthat approach obviously didn't :)
19:50arrdem<3 anamanaguchi
19:50nopromptlol
19:50nopromptarrdem: it's allabout virt.
19:51bitemyapprovar: let
19:51arrdemnoprompt: will investigate
19:51bbloomtechnomancy: http://cardenas.house.gov/media-center/press-releases/c-rdenas-416d65726963612043616e20436f646520
19:51arrdemonce I finish my anual AW YEAH TSO phase
19:52swarthysandbar or friend?
19:52bitemyappbbloom: good to see our congressmen are still figuring out ways to destroy the middle class >:D
19:52technomancybbloom: thought it was a uuid at first
19:52rovarthat worked..
19:52bitemyapprovar: good.
19:53bbloombitemyapp: that's the most cynical point of view, it's frankly idiotic
19:53bitemyappbbloom: you're assigning a value judgment that isn't there.
19:53bitemyappbbloom: commoditization of knowledge and labor is the natural order with a society organized the ways ours is. It's a good thing.
19:54bitemyappbbloom: however, due to forces unrelated to software, it contributes to the weakening of the middle class. Hopefully a smarter labor force will outweigh the negatives.
19:54nopromptarrdem: virt fx1, fx2, fx3 <3
19:54bbloomtechnomancy: i'm concerned that the act will fail b/c nobody will want to type in that hexadecimal string all the time :-P
19:55bitemyappbbloom: why would people type it in?
19:55bitemyappmanually, that is.
19:55bbloombitemyapp: your sense of humor is broken
19:56arrdembbloom: there is an open issue somewhere..
19:56bitemyappbbloom: well, I know that, but do you?
19:57Apage43whats with the trailing space tho
19:58noprompt:-(
19:58bbloomApage43: it's an intentional bug to teach children about the perils of append-only code bases such as our laws
19:58bbloomi hope.
19:59bbloomoh wow: https://pay.reddit.com/r/programming/comments/1sqnj7/416d65726963612043616e20436f646520/ce0b9vy
19:59technomancyI'll see your Japan Air and raise you a Meow: http://www.youtube.com/watch?v=vc3JWo2iiGc#t=167
19:59technomancyoops; http://www.youtube.com/watch?v=vc3JWo2iiGc
20:00coventryNo way a congressman wrote a reddit post that cool without assistance.
20:01Bronsabbloom: re: {(gensym) 1 (gensym) 2} -- that's throwing at read-time, I don't see a way to "fix" that
20:01bbloomBronsa: you could not count unquoted lists as duplicate keys
20:02Bronsabbloom: what about {[(gensym)] 1 [(gensym)] 2} then?
20:02amalloybbloom: but it's not a legal map. how would you work with it?
20:02amalloy(get m (first (keys m))) ;; what can this possible return?
20:02hiredmanarraymap used to not check duplicates so you could do things like that, but everyone complained
20:02Bronsaamalloy: it'd be legal at runtime, it's not at read-time
20:03bbloomjust goes to show how silly little things like a duplicate check can be hard :-P
20:03noprompti'm glad i don't follow politics.
20:03amalloyBronsa: i know, and the compiler has to work with it at read time
20:03BronsaI guess the compiler could use create instead of createWithChecking or whatever they're called
20:03bitemyappnoprompt: good idea.
20:03Bronsaamalloy: the compiler really doesn't care AFAIKT, it's only an artifact of the reader
20:05Apage43bbloom: oh. huh.
20:05hiredmananyway, I think enforcing valid datastructures at read and at runtime is for the best
20:07bitemyapphiredman: true Lispers shove everything to runtime and write a bunch of error handling code.
20:07coventryCould the reader transform map literals into hash-map calls?
20:08coventryI guess that would get messy for ^{} metadata annotations.
20:09arrdemaaaand we've reinvented reader macros..
20:10coventryNot at all.
20:10Bronsa,'`{1 1}
20:10clojurebot(clojure.core/apply clojure.core/hash-map (clojure.core/seq (clojure.core/concat (clojure.core/list 1) (clojure.core/list 1))))
20:13coventryYes, but that still fails on '`{G__# 1 G__# 2}. If the literal were transformed to (hash-map G__# 1 G__# 2), it would give sensible results, at least in this case, and duplicate keys would still fail at runtime.
20:14Bronsacoventry once you hit the reader, it's already too late.
20:14Bronsacoventry you'd have to use a parser as opposed to a reader if you wanted that to work
20:18mysamdogOkay, so I have this code:
20:18mysamdog(ns soar.site
20:18mysamdog (:require [domina :as dom]
20:18mysamdog [domina.events :as ev]))
20:18mysamdog(defn test []
20:18mysamdog(dom/append! (dom/by-id "content") "<p>Test Successful</p>"))
20:18mysamdog
20:18mysamdog(defn ^:export init []
20:18arrdemmysamdog: PASTE PASTE PASTE
20:18mysamdog (if (and js/document
20:18mysamdog (.-getElementById js/document))
20:18mysamdog (ev/listen! (dom/by-id "Home") :click test)))
20:18technomancy~gourds
20:18clojurebotSQUEEZE HIM!
20:19mysamdogsorry, probably should have put that on refheap
20:19swarthymysamdog: try http://refheap.com instead
20:19swarthybeat me
20:19mysamdogI figured it was short enough to just paste it, but then the formatting got screwed up
20:19arrdemunless it's a one-liner never paste
20:19mysamdogGood to know.
20:20arrdem*in channel
20:20mysamdogAnyway, So I'm trying to make that code append <p>Test Successful</p> to a div with id "content" when the button with id "Home" is clicked
20:21coventryBronsa: What breaks if you change the (RT/map (to-array the-map))) line in tools.reader/read-map to something like (list* 'hash-map the-map)? You'd need to extend read-meta to detect such a list and try to convert it to a map at that point.
20:21mysamdogThe part that appends the <p> works when I call it from the console, but not when the button is clicked.
20:22bitemyappnoprompt: so that I know when to head home, when are we hacking?
20:22mysamdogHere's my html: https://www.refheap.com/21703
20:22mysamdogI had the exact same problem when I used Dommy
20:22bitemyappmysamdog: Selmer user?
20:23nopromptbitemyapp: i'm gonna work for probably another 30mins here and then head back home. i should be down to hack by no later than 7pm.
20:23Bronsacoventry I understand what you're saying, but then what you're doing is no longer reading, it's parsing & transforming
20:23bitemyappnoprompt: okie-dokie. I'll give some thought as to how we pair digitally.
20:23coventryBronsa: and it's important to maintain that distinction for the sake of simplicity?
20:23mysamdogYeah, I use Selmer
20:24mysamdogOne sec, I'll put the code that generates the html on refheap
20:24bitemyappNOOOOOOOOOOOOOO
20:24bitemyapptechnomancy: why is floobits on MELPA?!
20:24bitemyappthose fucking madmen
20:24nopromptbitemyapp: i expect you'll be driving for the majority of the session. mostly i plan to ask questions. beside you don't wanna see me squirm w/o my evil-mode keybindings. :-)
20:24bitemyappdon't they know what they're asking me to doooooooooo
20:24bitemyappnoprompt: all the same.
20:25bitemyappI was thinking voice/skype + floobits or something.
20:25mysamdogOh wait. I uploaded that. I meant to give you the one that the browser sees, after selmer parses it
20:25mysamdogOne sec
20:25bitemyappnoprompt: if we use floobits you use your native environ.
20:25bitemyappand I use mine.
20:25nopromptwow
20:25bitemyappthat's uh, the point.
20:25coventryOooh. Floobits looks incredibly useful. Thanks.
20:25nopromptthat sounds pretty cool.
20:25bitemyappnoprompt: https://floobits.com/ technomancy reminded me it existed last night after dinner.
20:25Bronsacoventry AFAIK a lisp reader is just a special-case of a parser, whose special-ness is that it "outputs" the data it reads-in into its internal representation, if you take that away.. it's no longer a reader
20:25bitemyappgood timing on his part.
20:26mysamdoghttps://www.refheap.com/21704
20:26bitemyapptechnomancy: see, this MELPA installation, this is why I end up vendoring everything.
20:26arrdembitemyapp: vendoring?
20:27bitemyapparrdem: the reason I have 400,000 LOC in my .emacs.d
20:27bitemyapparrdem: I vendor 90% of the code I use.
20:27bitemyappbecause I have zero patience for things breaking.
20:28bitemyappfloobits-summon and floobits-join-workspace <--- cool.
20:28bitemyappnoprompt: so yah, get a floobits account.
20:28bitemyappthen we'll rock.
20:28coventryBronsa: OK. I'm curious about why you want a reader as opposed to a parser, though.
20:28technomancybitemyapp: node.js, man
20:29bitemyappnoprompt: free plan has zero private workspaces, but this works fine, it's open source work anyway.
20:29Bronsacoventry: I don't. It's the Lisp Way™ though.
20:29bitemyappThis is wicked if it ends up working
20:30arrdemnoprompt: do like.
20:30nopromptarrdem: such a killer song.
20:30coventryMaybe I'll submit a patch to LispReader.java, then.
20:30mysamdogSo, uh, any thoughts on what's wrong with my code?
20:30bitemyappwe live in the future!
20:30Bronsacoventry I doubt it'll ever make through
20:31bitemyappmysamdog: I see HTML, not code. What's breaking and what's the code?
20:31bitemyappmysamdog: include more context in your refheap, it helps people to help you faster.
20:31coventryBronsa: Because of the reader/parser distinction?
20:31arrdembitemyapp: pair editing over shared VTTY has been a thing for over a decade...
20:31bitemyapparrdem: floobits isn't VTTY
20:31bitemyapparrdem: did you look at it?
20:31technomancyyeah the whole point of floobits is just that you can pair with vim users
20:32bitemyapparrdem: each person works in their native environment.
20:32arrdembitemyapp: yes I saw how floobits works, and it's awesome. I'm just making the point that remote pair work isn't new.
20:32coventryCan you share a repl/interactive python buffer in floobits?
20:32technomancyemacs:emacs floobits doesn't make a lot of sense
20:32bitemyapparrdem: that's not the part that makes it the future, it's the cross-client part.
20:32bitemyapptechnomancy: what's the name of the emacs native one?
20:32technomancybitemyapp: rudel
20:32technomancywell
20:33technomancyit's not emacs-native
20:33mysamdogHere's the .cljs file: https://www.refheap.com/21705
20:33bitemyapptechnomancy: but it was made for emacs.
20:33technomancybitemyapp: but the only other implementation is gobby, which is a pretty lame editor
20:33technomancyno
20:33bitemyappoh, wow.
20:33mysamdogAnd I'll go get the last 500 lines of the .js file I get
20:33technomancygobby implemented the protocol first
20:33bitemyapptechnomancy: weird.
20:33Bronsahttps://floobits.com/code_roulette/ so sad.
20:34nopromptbitemyapp: so are we using this thing or not?
20:34mysamdogHere's the last 500 lines of my js: https://www.refheap.com/21706
20:34technomancyI'd rather be using rudel than floobits, but it's not supported by vim
20:35noprompttechnomancy: if it supports emacs that's good, i just use the evil-keybindings.
20:35technomancynoprompt: if you're willing to do that just use tmux =)
20:35technomancymuch easier to share shells/repls that way
20:36noprompttechnomancy: so am i to understand floobits won't be a good solution here?
20:36bitemyappnoprompt: if I can figure it out, yes.
20:37bitemyapptechnomancy: I don't use evil mode, he does.
20:37technomancyright, but you can toggle that with a single binding
20:37noprompttechnomancy: which i have w/ key-chord
20:38technomancydifferent strokes for different folks; use whatever works for you
20:38bitemyappI don't have a key combo for it. I could add one.
20:38bitemyapptechnomancy: I mostly just want to test floobits. We've discussed how I want to hammer out processes for remote working at my company.
20:38bitemyappvim and sublime text are popular with my coworkers.
20:38nopromptthe haskell mode indention has to be tweaked for evil-mode.
20:38bitemyappnoprompt: lol fuck that then
20:38bitemyappusing my editor. I like my smart ident.
20:39nopromptbitemyapp: nah all you have to do is turn it off.
20:39noprompt(setq evil-auto-indent nil)
20:39bitemyappI'll set it in my haskell-config JIC then
20:41nopromptbitemyapp: other than that i'm pretty happy w/ the basic rollout. i won't demand any of my other fancy stuff.
20:41noprompttechnomancy: btw, how do i get recentf files to show up when i use switch-buffer?
20:41noprompttechnomancy: i'm being lazy.
20:42technomancynoprompt: ido-use-virtual-buffers
20:42technomancyunfortunately uniquify doesn't work on the recentf buffers =(
20:43technomancybut pretty handy apart from that
20:43bitemyappRaynes: I'm telling people to use Tentacles so that they complain at you.
20:46bitemyappBronsa: https://floobits.com/active/
20:47bitemyappnoprompt: there's some code I need to push on my other computer, but this seems to at least exist.
20:48pcnIs there a time function that'l convert time into seconds + millis?
20:48technomancyjuxt!
20:49Bronsabitemyapp: hopped in :)
20:49technomancy,((juxt / mod) (System/currentTimeInMillis) 1000)
20:49clojurebot#<CompilerException java.lang.NoSuchFieldException: currentTimeInMillis, compiling:(NO_SOURCE_PATH:0:0)>
20:49technomancyyeah yeah whatever clojurebot
20:49llasram,((juxt quot mod) (System/currentTimeMillis) 1000)
20:49noprompttechnomancy: thanks!
20:49clojurebot[1386899366 255]
20:50llasramProbably `quot` too :-)
20:50technomancy~juxt
20:50clojurebotjuxt is a little hard to grok but it's the best thing ever
20:50llasram~quot
20:50clojurebotGabh mo leithscéal?
20:50pmapdo you guys think it's possible to do a real-time display of a changing 2d pixel array with seesaw?
20:50llasramgee, thanks clojurebot
20:51llasrampmap: Hard real-time, or just like 60 frames a second?
20:51pmapit wouldn't even have to be 60 frames per second
20:51llasramThen definitely
20:52pmapyou think you could do it with no java interop?
20:53llasramErr. I don't know. I saw you wrote "seesaw" but just then immediate thought "Java2D"
20:53pmapyeah
20:53pmapI know it's definitely possible with java
20:54pmapdo you think it'd be much effort doing that through java interop?
20:55pcnllasram: thanks I'll try that
20:57coventryHmm, not a ringing endorsement for rudel: http://stackoverflow.com/questions/2375473/emacs-collaborative-buffers-open-in-the-wrong-mode#comment12957400_2375473
20:57llasrampmap: I personally don't think direct interop is that big a deal. But also haven't used seeswa much, -- it might provide a better experience, depending on your problem
20:58llasramI wonder how hard it would be to some sort of cider-eclim integration, so you could get interop autocompletion for classes and methods via eclim
21:02nopromptbitemyapp: alright, i'm gonna bounce home here in a bit.
21:10coventryThere's no trick for destructuring a ::namespace-qualified kw out of a map like with :keys, is there?
21:10amalloycoventry: just the general map destructuring, no :keys shortcut
21:11coventryamalloy: Thanks.
21:17pmapllasram: I do it when it's necessary, but I'd always rather do things in pure clojure.
21:18coventrypmap: Clojure is on the JVM partly because java does some things well, and it's idiomatic to utilize it for those things.
21:19pmapwell I have to go walk for 10 minutes in the snow to get to my school's computer lab right now
21:19pmapI'll be back
21:19coventryEnjoy!
21:20pmappiping the X11 output from their 64 core hasn't been working for me
21:20pmapover ssh
21:20ivantry NX?
21:20pmapso I gotta use one of their sun machines
21:20pmapnever heard of nx
21:21pmapno time to try new things though
21:21pmaptomorrow's the last day of the semester :S
21:22pmapthough I'll want to try things like that once I'm back home 4 hours away
21:22pmapsee you all in a bit...
21:25pcnwhat exactly is ,(...) ? I can't find documentation on it
21:28rovari'm having a hard time serving a js file via ring/compojure
21:28jcromartiepcn: it's nothing… where do you see it?
21:28rovarI've set a handler : (resources "/js" {:root "js"})
21:28llasrampcn: It's just how you tell clojurebot bot to eval code
21:28llasram,:fun!
21:28clojurebot:fun!
21:28rovarthe file is compiled and present, but the server is returning a 404 upon request
21:29jcromartiepcn: oh, the comma :)
21:29rovar,(repeatedly 5 (rand-int))
21:29clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core/rand-int>
21:29rovar,(repeatedly 5 (rand-int 10))
21:29clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn>
21:29jcromartierovar: where is your JS file located in the filesystem?
21:29rovarjcromartie, target/resources/js/
21:30jcromartierovar: just put it in resources/js/
21:30rovarI'm just re-using an existing webchat example
21:30jcromartieand the URL should be /js/whatever.js
21:30rovarwhat are the rules for where ring looks for said files?
21:30jcromartiesince you're specifying a certain base URL and a base resource bath
21:30jcromartieit's loaded from the classpath
21:31rovarthe url is /js/whatever.js
21:31jcromartievia Java's resource loading
21:31rovarthere is an edn file in resources/
21:31rovara frodo config
21:31rovarI don't really want to go serving that, do I?
21:32jcromartieno, that's why compojure's `resources' defaults to serving the files in resources/public
21:32jcromartiebut you've overridden that with {:root "js"
21:32rovarso putting it in resources/js/ fixed it
21:32rovaris that a recent change?
21:33rovarI'm just curious as to why everything seems to compile to target/...
21:33jcromartieno
21:33jcromartiethat's where compiled output goes
21:33jcromartieand resources are inside the produced jar
21:34jcromartieyour source and resource paths all get copied into the final jar
21:34rovarright.. and there's a resources dir.. and a js dir in that.. why wouldn't compojure/ring look there for static files to serve?
21:34jcromartie...
21:34rovarinside of target/ i mean
21:34jcromartiewhen you run "lein run" or "lein ring server" it does not use the output in target/
21:35jcromartietarget/whatever.jar is just the output of "lein jar" or AOT compilation form "lein compile"
21:35jcromartiefrom*
21:35jcromartiehow are you running your app?
21:36rovarlein dev
21:36jcromartiethe short answer to "why" is: because target/ is not on the classpath
21:36jcromartiewhat's lein dev? sorry, never used it
21:38rovarit's just an alias for running a few things in order, pdo. cljsbuild auto, frodo
21:38rovar(as far as I understand lein)
21:39jcromartieOK
21:40jcromartieso I don't know about those specific plugins, but I don't think they run from any compiled output in target/
21:40jcromartiemaybe?
21:41jcromartiebut either way, for interactive purposes ("lein run", "lein repl", "lein ring server" etc.) the classpath includes ./resources/ ./src/ ./test/ etc.
21:41jcromartienot target/
21:41rovarjcromartie, good to know
21:42rovarok.. I have a question about channels and go blocks...
21:43rovarI have a go-loop.. and from within that loop I call a multimethod
21:43rovarand in that multimethod I call >!
21:43rovarand it asserts saying that >! is not used in (go ...) block
21:43rovarbut the function is being called from a function that is clearly in the go block..
21:44llasramrovar: You can only use >! etc *lexically* within a `go` block
21:44jcromartierovar: because it needs to literally be inside the go block
21:45rovarbut.. I.. err..
21:45jcromartiethe `go' macro actually recompiles all of the code inside of it into a crazy state machine :)
21:45jcromartieyeah
21:46rovarwow.. it would have been nice to know that before I made this beautiful multimethod for my wire protocol
21:46rovarI guess I could change it to pattern matching, but I will be wearing a sad face..
21:50rovarhow can I include a " in a string in clojure?
21:51dsrx\"
21:51bitemyappnoprompt: home now.
21:51dsrx, "hello \"world\""
21:51clojurebot"hello \"world\""
21:51nopromptbitemyapp: yeah just got here.
21:51dsrx,(println "hello \"world\"")
21:51clojurebothello "world"\n
21:51dsrx,(print "hello \"world\"")
21:51clojurebothello "world"
21:51dsrxthere we go.
21:52rovarany clever way to wrap a string in quotes?
21:52rovar,(str "\"" "blah" "\"")
21:52clojurebot"\"blah\""
21:53coventry,(str \" "blah" \")
21:53clojurebot"\"blah\""
21:53jcromartie(defn wrap-quotes [x] (apply str (take 3 (flatten (cycle ["\u0022" x])))))
21:53jcromartieyou wanted clever?
21:53rovar,(read "\"blah\"")
21:53clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.io.PushbackReader>
21:54rovarjcromartie, I deserved that.
21:54rovar,(read-string "\"blah\"")
21:54clojurebot"blah"
21:54rovar,(read-string "{:mykey \"blah\""})
21:54clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: }>
21:54dsrxjcromartie: not point-free style, not "clever" enough
21:54rovar,(read-string "{:mykey \"blah\"}")
21:54clojurebot{:mykey "blah"}
21:55coventryrovar: Is that the reason you want to do the wrapping?
21:55coventry,(pr-str {:mykey "blah})
21:55clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
21:56coventry,(pr-str {:mykey "blah"})
21:56clojurebot"{:mykey \"blah\"}"
21:56rovarcoventry, yes, I'm sending messages in from a browser and they're interpreted as strings, i want to read them in as edn
21:56bitemyappnoprompt: about to order food
22:00coventryrovar: pr-str may be what you want, then.
22:02gfredericksreiddraper: I just realized defspec is incompatible with clojure.test :each fixtures, isn't it?
22:04reiddrapergfredericks: I'm not familiar with that, but totally possible
22:06gfredericksreiddraper: I want to clear the database before each run of a test; now that I'm using defspec that's problematic
22:07seangrovecoventry: Would be curious to hear how rudel works out
22:08coventrySounds like technomancy has used it in anger.
22:08coventryIts marmalade package install is broken, so I have punted on it for now.
22:13seangroveI tried floobits out between a vim and emacs session, and it was ok-ish
22:13seangroveSeems like it's a pretty difficult problem to tackle well
22:22coventryYeah, it needs a shared shell/repl facility to really be useful, for starters.
22:22coventrybitemyapp, noprompt: are you guys going to use floobits?
22:24justin_smithI tried pair programming in google wave once
22:25justin_smitheven started worked on a multi-cursor mode for emacs that took in external commands (did not get far with that project)
22:32arrdemfloobits' python component bombs for me... filing bug report.
22:35bitemyappcoventry: hangouts first.
22:35bitemyappcoventry: I might install floobits while I'm eating.
22:35coventryMakes sense.
22:39ldkfwiw, pair programming really doesnt' require two cursors, just one shared one is ideal
22:39ldkTaking turns driving is where the benefits of pairing come from
22:40ldkYou can pair effectively with ssh + screen/tmux + any editor
22:41technomancyyeah, two cursors is actually a disadvantage for pairing
22:44rovar,(defn wrap-quotes #{ apply str (-> ["\u0022" %] cycle flatten (partial take 3) (partial apply str) })
22:44clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: }>
22:45rovar,(defn wrap-quotes #{ -> ["\u0022" %] cycle flatten (partial take 3) (partial apply str) })
22:45clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Parameter declaration #{["\"" %] (partial apply str) cycle -> (partial take 3) ...} should be a vector>
22:46rovar,(defn wrap-quotes #{ (-> ["\u0022" %] cycle flatten (partial take 3) str) })
22:46clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Parameter declaration #{(-> ["\"" %] cycle flatten (partial take 3) ...)} should be a vector>
22:47rovar,(def wrap-quotes #{ (-> ["\u0022" %] cycle flatten (partial take 3) str) })
22:47clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0)>
22:47rovar,(def wrap-quotes #{ (-> ["\u0022" %1] cycle flatten (partial take 3) str) })
22:47clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: %1 in this context, compiling:(NO_SOURCE_PATH:0:0)>
22:47coventryrovar: You want def, not defn.
22:47rovar,(defn wrap-quotes [x] #{ (-> ["\u0022" x] cycle flatten (partial take 3) str) })
22:47clojurebot#'sandbox/wrap-quotes
22:47arrdemcoventry: he got that
22:47rovar,(wrap-quotes "testing")
22:47clojurebot#{"clojure.core$partial$fn__4198@54d7ac"}
22:48rovarnot quite :P
22:48arrdemrovar: what are you doing with that set?
22:49arrdem,(defn wrap-quotes [x] (-> ["\u0022" x] cycle flatten (partial take 3) str set))
22:49clojurebot#'sandbox/wrap-quotes
22:49arrdem,(wrap-quotes "testing")
22:49clojurebot#{\@ \a \b \c \$ ...}
22:49rovarI just want to wrap a string in quotes
22:49rovarthe hard way
22:49arrdem,(defn wrap-quotes [x] (format "\"%s\"" x))
22:49clojurebot#'sandbox/wrap-quotes
22:50arrdem,(wrap-quotes "testing")
22:50clojurebot"\"testing\""
22:50rovarthis was actually in response to jcromartie's response where he was chided for not providing a point free solution
22:50rovarso I decided to take a whack at a point free solution
22:50arrdempoint-free?
22:51xpe,````````x
22:51clojurebot#<StackOverflowError java.lang.StackOverflowError>
22:51rovarbasically coding by not passing variables, only composing functions.
22:53arrdem,(def wrap-quotes (comp (partial interpose " ") (partial apply str) (partial format "\"%s\"")))
22:53clojurebot#'sandbox/wrap-quotes
22:54arrdem,(wrap-quotes "testing")
22:54clojurebot(\" " " \t " " \e ...)
22:58justin_smithyou can /msg him for that :)
22:59arrdemor I could just M-x jack-in on ~/scratch.clj :P
23:06rovaralc
23:06rovararg
23:06rovarI have a (match [] .. et up
23:06rovarset up
23:07rovarbut I keep getting "No matching clause ..."
23:07rovareven when I have the correct values
23:07rovarregardless, I have an :else clause that it also seems to be ignoring..
23:17rovaris there a better way to fetch the same key from a hash-map of hash-maps?
23:17arrdem,(doc get-in)
23:17clojurebot"([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."
23:17rovar(map :name (vals mymap))
23:18arrdemrovar: no that's fine
23:18arrdemrovar: (map (comp second :name) ..) alternatively...
23:22rovarI want all of the :name's though..
23:22rovarnot just the first one
23:22rovari swear there was a function for that..
23:22rovaroh well.
23:23justin_smitharrdem: I think that's backwards
23:23arrdem,(doc comp)
23:23clojurebot"([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc."
23:23arrdemjustin_smith: yerp.
23:23rovarI knew what he meant
23:24rovarso I still can't figure out this match thing
23:24rovarmaybe it's an old version
23:29rovaroh.. i had a paren mismatch, but the entire match case was still somehow syntactically correct..
23:29rovarerr..
23:29rovarjust not semantically..
23:30justin_smithclojure has lots of multi-arity fns that do that
23:33brand0I'm glad that guy's blackmail thread was deleted
23:34brand0if he's *for* underground markets, as he says, then why not leave it at "I hacked ___" here's the proof, don't use this market
23:34brand0why go after people sticking their necks out and running these markets?
23:34arrdembrand0: wrong channel?
23:34brand0big time
23:34brand0lol
23:34arrdembrand0: I mean nice to see you but that's #atx2600 or #aha :P
23:38rovaris there a way I could get around this go block restriction for channels?
23:38rovarI mean, I'd really like to clean up this code with functions..
23:39rovarI mean I guess I could eval a function string, but that seems harsh..
23:40justin_smithwait, you can't call functions inside go blocks? that's absurd
23:40justin_smithof course you can
23:40tbaldridgeyeah you can call functions inside of gos
23:40rovaryou can.. but not functions that call >! or <!
23:41rovarso I have, for instance, a function called broadcast which I call in the case of many different messages
23:41rovarwhich does what you might expect..
23:41tbaldridgerovar: use pub instead?
23:42tbaldridgeor perhaps mux, both are used to broadcast msgs
23:42rovarhmm
23:44rovari'm actually using the chord wrapper around http-kit websockets
23:44rovarso it presents the core.async api, but I am not sure if it provides the pub/sub yet..
23:45tbaldridgewell you can always use pipe + pub/sub
23:46rovarnot familiar...
23:46tbaldridgechord hands you a channel like thing right? A "output" channel.
23:47rovarboth input and output, yea
23:47rovarinside of its with-channel macro
23:47tbaldridgeSo on one end you should be able to take the chord channel and sub it into a pub.
23:48tbaldridgeOr on the other end create a pub that uses the chord channel as the input channel
23:48rovarI'm not seeing any docs for pubsub.. other than a gist..
23:48rovarI like the pubsub model, largely because I'll have several hierarchies of broadcast..
23:49tbaldridgehttp://clojure.github.io/core.async/#clojure.core.async/pub
23:51rovaralso must be called in a go block?
23:51tbaldridgenope
23:52tbaldridge<! >! alt! and alts! are the only things that have to be in go blocks
23:53rovarneat..
23:53rovartbaldridge, thanks for your help. Now the conundrum.. have to be at work in 8 hours, need sleep.. want to try..
23:53tbaldridgelol, I hear that
23:56bbloomtbaldridge: i haven't been paying attention, seems like there are some more channel utils worth studying :-)
23:56tbaldridgeyeah, we've added a ton of new stuff in the past 2 months or so
23:57bbloomit's fun to see how close they are to my asyncx implementations :-) but i only really did the < variants
23:57rovarare there examples anywhere? i'm having a hard time grokking the big picture of pubs and also the mult/tap bits
23:58tbaldridgethis might help, I have a few examples here: https://github.com/halgari/clojure-conj-2013-core.async-examples/blob/master/src/clojure_conj_talk/core.clj
23:59rovara..