#clojure logs

2013-11-28

00:00bbloomignoring readline support, debugging features, etc, a repl can do 3 IO things: read form, print text, and print values
00:00bbloomi'm only interested in print
00:00bbloom(println ...) is like emitting text
00:01bbloomin theory i could have (emit :content-type "plain/text" ...)
00:01bbloomor emit-jpg or whatever
00:01technomancyright
00:01justin_smithwhat about prn / print / display
00:01technomancyso nrepl handlers can already emit response maps of arbitrary contents
00:01bbloomsure
00:02bbloomanyway, i need this long weekend badly b/c my brain is fried, so i'm mostly just wasting both of our time here. sorry. in anycase, i'd propose for eval/print sort of things a two-function API:
00:03bbloom(f (g "image/jpeg" ...))
00:03bbloomwhere g wraps some thing in a magic type that middleware knows to render with that mimetype
00:03bbloomand f takes a pre-wrapped thing and emits it like printed text would be emitted
00:04bbloomanything more sophisticated than that won't give me the control i want to trust the thing & belongs out of the core of it :-P
00:04bbloomif that makes anysense
00:04technomancyaha; gotcha, to bridge the gap between eval land and the nrepl tooling which knows about the transport/communication
00:04technomancythat makes sense, but it's a totally different use case from what I've been considering so far
00:04technomancyI'll give it some thought
00:05bbloomit's acceptable for g-wrapped things to be printed special if returned from an eval
00:05bbloombut ONLY g-wrapped things... again from core
00:05bbloomif somebody wants to install some insane thing that does arbitrary fucking with their return values fine
00:05bbloombut not me :-P
00:06bbloomi want to opt-in to "ok fine, you can display THIS particular jpeg as a jpeg, instead of the standard toString"
00:06technomancythat would be analogous to an HTML-generating function attaching some kind of hinting to its response to tell the ring handler to add some kind of caching directive to the headers or something
00:06bbloomyeah, but i don't want that
00:06bbloomno metadata
00:06bbloomno fancy tricks w/ different data types
00:06bbloomjust a single quoting construct
00:07bbloom(deftype NReplContent [mime-type x])
00:07technomancyhiredman suggested sending tagged literals all the way back to the client, but we currently don't require clients to implement a reader, so that's a lot to ask
00:07bbloomthat's it
00:07bbloomer i guess
00:07technomancyyeah, makes sense
00:07bbloom(deftype Content [mime-type bytes])
00:07bbloomand you'll probably already need some system for mime-type => serialization-function
00:08bbloomi just want explicit representation
00:08bbloomat least absent some much more sophisticated system a la mathematica's "forms" that you'll never be able to build nor standardized
00:09bbloomdon't get cute & i'll love this feature :-P
00:09technomancyheh nice
00:09bbloomthanks for putting up with my incoherent rant that took a while to find it's point. i'm going to bed now.
00:09technomancywell I did get to meet tpope at the conj and he said he'd take a look
00:09technomancycheers
00:09justin_smithso we currently have print-dup and print-method that return strings with different rules for constructing them - what about a third method that returned an arbitrary tagged rich type? then we can use some extension of the same logic / rules that currently decide between print-dup and print-method
00:10justin_smiths/method/multi
00:11technomancyseems eminently reasonable
00:12technomancyI kinda feel like getting the client/server bits nailed down first since everything else rests on top of that
00:12technomancybut if you want to take a swing at it =)
00:12justin_smithhah
00:12justin_smithI'll consider it
00:12technomancystarting to think there's enough meat here for a clojurewest talk
00:13bitemyappoh man, I should go to clojurewest since I failed to go to the conj.
00:14technomancycome see me speak! (maybe)
00:14justin_smithI failed to come to the last c/w and it was in my own damn city
00:14justin_smithI have no excuse this year
00:15bitemyappjustin_smith: pretty sure c/w is in my city this year.
00:15bitemyapps'posed to be SF innit?
00:19justin_smithclojurewest.org still mentions the portland event
00:19justin_smithI really don't know
00:24arrdembitemyapp: gaming PC get
00:28technomancyjustin_smith: they said at the conj it would be SF =(
00:29justin_smithyou consider that sad news?
00:32RaynesPARSE ERROR
00:34jared314Raynes: that is quite an entrance. I'll have to use that some time
00:34akurilinHowdy. Have people heard much of Clojuratica in the past few years? Is the project dead?
00:34technomancyjustin_smith: well if it has to be in california, SF is fine
00:34technomancybut portland is the best place in the world for conferences
00:35justin_smithagreed, I like being able to walk to conferences
00:35justin_smithand sleep at home
00:35Raynestechnomancy: Are you a Portlandia fan?
00:35technomancyRaynes: I haven't seen the show
00:35Rayneso_o
00:35technomancyit's just ... a cool city
00:35justin_smiththey actually filmed one of the portlandia sketches in my office
00:35technomancyseattle's kid brother
00:35justin_smiththe one with "pitchfork kids"
00:36technomancyunrelated note: I heard BSD described as "the Canada of Linux" the other day and it was perfect; the best thing I heard all week.
00:37technomancyRaynes: I don't really watch anything but doctor who
00:37justin_smithhttp://www.youtube.com/watch?v=6eOnnIi6O5E
00:38justin_smitherr... that didn't show the part in my office actually
00:39bitemyapparrdem: WHOA
00:39bitemyapparrdem: up for some practice/2s?
00:40bitemyapparrdem: http://i.imgur.com/DWnJplv.gif
00:40arrdembitemyapp: already playing br0
00:40bitemyapparrdem: goddammit, catch you next game then.
00:44nopromptah, the Emacs spiral.
00:44justin_smithnoprompt: it is literally endless
00:44noprompttechnomancy: i uninstalled esk. the learning process begins.
00:44bitemyappnoprompt: esk?
00:45arrdememacs starter kit
00:45nopromptbitemyapp: emacs starter kit.
00:45bitemyappnoprompt: oh good.
00:46noprompti wanted to try out cider but i didn't know how to remove the old nrepl dependencies apparently because i was getting strange errors.
00:46nopromptso i decided to nuke everything in elpa.
00:47nopromptnow i need helpa. lolpa.
00:48nopromptone thing i miss is the switch-to-buffer behavior.
00:48technomancynoprompt: start here https://github.com/technomancy/better-defaults
00:48bitemyappI wouldn't advocate the use of cider specifically...
00:48technomancythis is like the bare minimum to keep you sane
00:48justin_smithyeah, that should get you back iswitchb, if that is what you miss
00:48nopromptbitemyapp: does it suck?
00:48arrdemit works...
00:48arrdembut isn't quite stable
00:49arrdemsupposeldy
00:49arrdemI have't had problems with it yet
00:49bitemyappnoprompt: it's unstable. use nrepl for now.
00:49justin_smithnoprompt: for switch to buffer behavior do you mean the completions visible with C-x b?
00:49bitemyappnoprompt: look at my dotfiles repo if you need ideas for what to add.
00:49justin_smiththat is iswitchb
00:49technomancyI finally upgraded to cider, but only so I could add features to it
00:49bitemyappjustin_smith: iswitchb is heavenly.
00:49bitemyappcan't live without it.
00:49noprompttechnomancy: bingo.
00:49technomancyjustin_smith: he's talking about ido
00:49justin_smithahh
00:49technomancywhich is a superset of iswitchb technically
00:49justin_smithwell ido is just iswitchb on find file
00:50justin_smithand a few other things
00:50justin_smithyeah
00:50justin_smithhe mentioned switching buffers, I was looking for the most conservative match :)
00:58nopromptone thing i'd really like is a smart tab and for emacs to not autobreak long lines for me.
00:58noprompt*two things
00:58justin_smithwhat is a smart tab?
00:59nopromptjustin_smith: one that autocompletes when it can or otherwise "insert fucking spaces."
00:59justin_smithalso, M-x toggle-truncate-lines
00:59justin_smithnoprompt: that is alt-tab by default
00:59justin_smithor m-/ for more heuristic guessing
00:59nopromptjustin_smith: that's not the answer. the answer i'm looking for is how to turn that shit off.
01:00justin_smithtoggle is what I said
01:00justin_smitha toggle
01:00nopromptjustin_smith: oh oh, wait no that's not what i was talking about. what you're talking about is fine.
01:01nopromptwhat i'm talking about is when i type a long line and hit enter, emacs tries to get all fancy and break the line at x number of characters etc.
01:01justin_smithyou mean it is actually making new lines, not just wrapping?
01:01nopromptfor docstrings and comments this is desirable.
01:01nopromptjustin_smith: yes, that.
01:01justin_smithnoprompt: I think that is part of paredit, it is called electric-return iirc
01:02nopromptjustin_smith: js2-mode and html-mode both do this and it drives me nuts.
01:03noprompttechnomancy: i hear ya.
01:04justin_smiththe problem is window managers all decided to steal the alt-tab combo
01:04nopromptfor all i know the solution could be (setq jiggle-pop-bibble nil) but i have no way of knowing what i'm looking for.
01:04justin_smithnoprompt: maybe it is auto-fill-mode you need to turn off
01:05justin_smithit is not a default, so it will be somewhere in your config explicitly
01:05justin_smithfill or electric will likely be somewhere in the name
01:05nopromptjustin_smith: thankyou. this is a good start.
01:06justin_smithsee if M-: (auto-fill-mode 0)
01:06justin_smithturns off the bad behavior
01:06justin_smithif so, put that in your .emacs, or delete the thing that turns auto fill on
01:07nopromptwell, i'll be.
01:09nopromptjustin_smith: you sir are today's winner.
01:09justin_smithwas it auto-fill?
01:09nopromptlooks like it was.
01:10justin_smithI had discounted the possibility at first, because I have only ever turned that on for plain text
01:10justin_smithI figured it was for paragraph formatting
01:14nopromptit's nice for comments. if i could turn that on soley for breaking long lines in comments that'd be a win.
01:14nopromptpersonally, i think it's kind of annoying when someone writes a 200 character long comment.
01:14justin_smithM-q fills the block your cursor is inside
01:14clojurebotOk.
01:14justin_smithdoes what you want inside comments
01:15technomancynoprompt: there's a way to turn it on in comments only iirc
01:15noprompttechnomancy: i'll google it.
01:15nopromptjustin_smith: fyi, i use evil-mode.
01:15justin_smithI don't mind having to occassionally hit m-q inside a commnt block, as luddite as that sounds
01:15justin_smithoh, so you don't get the normal shortcuts
01:16justin_smiththe command is called fill-paragraph
01:16nopromptjustin_smith: no. for example M-x is done with keychord as m+x
01:16noprompterr sorry ,+x
01:17justin_smithif you do M-x describe-function fill-paragraph it will tell you any keybinding you have for it
01:17justin_smithor +x or whatever
01:17nopromptah good deal
01:17justin_smithyeah, describe-function, apropos, describe-key
01:17justin_smithall your friends as a learner
01:18justin_smithoh, and apropos-documentation
01:18justin_smithapropos-variable is good too
01:19nopromptnice.
01:22nopromptjust realized i've been programming with Andale Mono for over a month.
01:23justin_smithat first I thought that was a disease
01:23justin_smitha relation of the regular mononucleosis
01:23justin_smithaka mono
01:24emaphisI thought it was a brand of cheese.
01:24majykOMG that's funny!
01:24justin_smithclearly it is a contageous variety of cheese, spread by kissing
01:24emaphisEwww!
01:25`cbpit means go monkey! in spanish
01:26justin_smithnot to be confused with andale arriba
01:27justin_smithwhich is a monospace programming typeface designed for usage by spanish speaking mice
01:27emaphislol
02:10d11wtqIs there any sort of convention in Clojure to group the defn-'s at the top or bottom of the namespace?
02:13andyfd11wtq: You mean specifically the defn's for functions that you want to be private? I have not seen any pattern there -- what I have usually seen is that defn-'s go wherever the author would put them if they were regular defn's.
02:14andyfd11wtq: Putting them all at the bottom would be inconvenient, since they could not be called by public functions in the namespace unless you declare'd them earlier.
02:15d11wtqandyf: yeah, for non-public defn-'s. Good point about the need to declare them!
02:15d11wtqIn other languages I'd tend to keep the "private" stuff in the least visible place, at the bottom of the file.
02:16andyfd11wtq: You can do that if you prefer, as long as you declare what is needed, e.g. at the top.
02:16hiredmanI would recommend against making anything private at all
02:16d11wtqandyf: yeah, thanks. I'll go with the flow and stick with convention!
02:17d11wtqhiredman: I generally agree with that, although sometimes it's just useful to guide people who are reading the code so they know what's intended to be used and what's likely to change.
02:20hiredmanprivate things have only ever been a thorn in my side, mocking me in an opensource project where I can see the source, see what I need, and I could just use it and it would be fine, but someone decided to make it private
02:21d11wtqcan't disagree with that :)
02:22bitemyappprivate vars should've never been added to the language.
02:22bitemyappthey lead to either #' or dependency vendoring.
02:22bitemyappSucks.
02:22arrdembitemyapp: I almost forgot, happy thanksgiving!
02:22arrdem(same goes for the rest of yall)
02:22bitemyapparrdem: Happy thanksgiving to you too!
02:23arrdem'night
02:23bitemyappg'night
02:23ddellacostawhat am I forgetting to do such that my new extern, defined in a file with other externs which are already working, isn't getting picked up? I've cleaned my clojurescript and re-compiled...confused.
02:23ddellacosta'night arrdem, happy thanksgiving!
02:23bitemyappddellacosta: I mean, it's not like all of us benefit from Thanksgiving beyond having a day off work.
02:23bitemyappI'm just going to drinking tea and coding tomorrow.
02:23bitemyappgoing to be*
02:24ddellacostabitemyapp: yeah, I'm not even taking a day off. Although can't blame my bosses, I'm sure they would have given it to me if I'd asked. I just don't have any reason to do so.
02:24bitemyappddellacosta: what's the biggest holiday of the year in Japan?
02:25ddellacostaanyone have any tips for getting externs picked up? I feel like I'm forgetting something obvious, since it is such a simple thing.
02:25ddellacostabitemyapp: hmm, probably either Obon or the New Year
02:25ddellacostabitemyapp: I guess New Year's day is probably the biggest one.
02:26bitemyappddellacosta: is it in your :provides vector?
02:27ddellacostabitemyapp: haha, what is that? I don't have that but other externs are definitely picked up.
02:28bitemyappoh, I thought maybe you had to re-expose it like you setup the namespaces for javascript modules.
02:28bitemyappI don't do much, if any, CLJS I'm afraid. Sorry!
02:28ddellacostabitemyapp: no worries! Thanks for giving it a shot. Anything is helpful at this point.
02:38rurumateis it correct that clojure cannot auto-determine order of compilation when using using a gen-classed class within in the same project?
02:38rurumatewhat I do is, I determine order of compilation manually using :aot in project.clj but that is tedious
02:39bitemyappthat is tedious.
02:39rurumateso I do :aot [ns.that.generates.javaclass ns.that.uses.generated.javaclass] in that order
02:41bitemyapprurumate: :aot :all dinna work?
02:41rurumateno
02:41bitemyappnuts.
02:41rurumatelemme try again though..
02:42bitemyapprurumate: yeah I think you just have to specify the AOT order. Sorry :(
02:43rurumatebitemyapp: yes it fails with :aot, pity
02:43rurumatewith :aot :all I mean
02:43bitemyappyou'll just have to be specific for now I guess.
02:43rurumateit seems like something the compiler might learn some day
02:44bitemyappwell you could hack it up, it'd just be a bad idea.
02:44rurumatealso auto-resolving circular dependencies between namespaces would be a nice feature
02:44bitemyappmaybe a pre-task that overrides/provides the AOT vector based on inference.
02:44bitemyappI don't think allowing circular dependencies is a good idea anyway.
02:44rurumatewhy not?
02:44bitemyappyou can and should break stuff like that out into a tree.
02:45bitemyapp / DAG
03:07ddellacostabitemyapp: the answer to my problem before was, btw, that I was not including the JavaScript I had written the extern for in my HTML. /facepalm
03:07bitemyappddellacosta: welp.
03:07bitemyappddellacosta: thanks for sharing the original problem.
03:08bitemyappddellacosta: I should celebrate thanksgiving by launching a wiki.
03:08ddellacostabitemyapp: there ya go. :-) You can set it up so Clojurebot will give it as the answer to any questions that have been asked before...
03:08ddellacostabitemyapp: seriously though, we do need some kind of FAQ for Clojure
03:08ddellacostaClojure/Script
03:19bitemyappkrisajenkins: US Fact: On my last visit, I *could not* buy a tuna sandwich. Kept getting chicken. In the end, I had to pronounce tuna with a silent 'ch'.
04:32eredhttps://news.ycombinator.com/item?id=6812499
04:32ereddid you guys see this on HN today?
04:34bitemyappered: of course, I was trolling Church on Twitter.
04:34eredhah, fair enough
04:35bitemyappered: I was correcting the mutable "placeness" description of core.async
04:39bitemyapptechnomancy: I found something really cool.
05:04d11wtqHow does one find things that used to be in contrib? I'm looking for where clojure.contrib.mock would live today.
05:05xeqi~contrib
05:05clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go
05:07d11wtqI've seen that page, but clojure.contrib.mock is nowhere to be seen.
05:08d11wtqI might actually want something else. I basically want to be able to say: if foo/some-func is invoked with args [x y z] then return 42.
05:08d11wtqFor stubbing out a network-calling function in tests.
05:08d11wtqWith midje.
05:11d11wtqI'll just go with robert.hooke and do it by hand for now.
05:11nopromptbitemyapp: check out this wank book http://www.math.mcgill.ca/triples/Barr-Wells-ctcs.pdf
05:12nopromptCategory Theory for Computer Scientists!
05:12nopromptmy only hope is that it doesn't suck as had as Logic and Discreet Matematics For Computer Scientists.
05:13nopromptwhich by the way, if you want to learn about logic or math, go get fucking logic or math book for god's sake.
05:14nopromptone for mathemeticians.
05:19robewaldhi, is there a function to compare a nested datastructure for submaps? The easy case for testing submaps is (= sub (select-keys super (keys sub))). But that doesn't work for nested maps.
05:19jballancd11wtq: does "provided" not work for you?
05:22d11wtqjballanc: I'm not sure what that is. Third day learning clojure :)
05:22nopromptrobewald: can you provide a bit more context?
05:23d11wtqjballanc: Oh, I just found it in the midje wiki.
05:23jballancyeah, the wiki is a good resource...take some time to digest it all :)
05:23nopromptd11wtq: welcome to clojure!
05:25d11wtqnoprompt: thanks. Liking it so far. Having done (guile) scheme and CLISP, Clojure is elegant.
05:25robewaldnoprompt: well. I have a vector of maps containg other vectors of maps. But in the "super" map there are more keys than I am interested in. So for testing I want to have a predicate that checks whether the stucture of the vectors is equal but ignores the keys of the various maps that are not present in the "sub" map. If that makes the problem clear at all... I could go recursively through all the vectors checking map? and go from
05:25robewaldthere. It is just a bunch of work that might be in a library.
05:27d11wtqReader macros would be nice, although the things I'd want to implement in Common Lisp are already implemented in Clojure anyway (e.g. decent regex syntax).
05:28nopromptrobewald: so you have something like [{? []} {? []}]?
05:28noprompt[{? [{?? }]} ..]
05:28bitemyapp(inc robert.hooke)
05:28lazybot⇒ 1
05:30robewaldI guess. What i want is (= [{:a "f"} {:b "b"}] [{:a "f" :c "c"} {:b "b"}]) => true
05:30robewaldwhere [{:a "f"} {:b "b"}] is the "sub"map
05:31robewaldand the whole thing recursively nested :)
05:31jballancrobewald: recursion is your friend, I think...something like:
05:31jballanc,(letfn [(comp-map [ma mb] (reduce (fn [a [k v]] (and a (if (and (map? v) (map? (mb k))) (comp-map v (mb k)) (= v (mb k))))) true ma))] (comp-map {:a {:b 2 :c 3}} {:a {:b 2 :c 3}}))
05:31clojurebottrue
05:32jballanc:)
05:32noprompt,(doc comp-map)
05:32clojurebotIt's greek to me.
05:33robewaldI know. I was wondering whether there is a library function for that. Because I think this stuff is really basic.
05:33nopromptoh whoops, letfn.
05:35jballanca bit easier to read: https://gist.github.com/jballanc/7690023
05:35robewald,(letfn [(comp-map [ma mb] (reduce (fn [a [k v]] (and a (if (and
05:35robewald (map? v) (map? (mb k))) (comp-map v (mb k)) (= v (mb k))))) true
05:35robewald ma))] (comp-map [{:b 2 :c 3} {:b 2}]))
05:35clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
05:35jballancrobewald: basic, but there are a million *small* variations on semantics that means it's probably just easier to implement yourself
05:36nopromptso basically you just want to know if there are some key-value pairs in the vector of maps that are equal?
05:37robewaldjballanc: I guess.
05:38jballancfor example, my solution only handles maps nested in maps
05:38jballancbut you said you want maps nested in vectors nested in maps...so you'll have to alter what I wrote
05:38robewaldnoprompt: yes, and the keys that are not in the "sub"map I don't care about.
05:38jballanc(an exercise left for the reader ;-) )
05:39robewaldjballanc: yes I know. And it is a bit of work because AFAIK you cannot just override the map comparison and everything else is as before. You have to handle all the cases again.
05:40nopromptrobewald: sounds like you could use sets then if i'm not misunderstanding the problem.
05:41jballancyup...depending on the number of cases you want to handle, you might consider using cond(p) and/or case
05:41noprompt,(set {:b "b" :c "f"})
05:41clojurebot#{[:b "b"] [:c "f"]}
05:41robewaldnoprompt: i cannot, because I care about the values associated with the keys being equal.
05:41robewaldoh
05:41nopromptrobewald: intersection
05:42robewaldright
05:42robewalddidn't think of it like that.
05:42robewaldthat might work
05:42robewaldthanks
05:42nopromptrobewald: defintely explore the clojure.set ns if you haven't already. it's certainly powerful.
05:43bitemyapphttp://clojurewiki.com/
05:43nopromptbitemyapp: nice work!
05:43robewaldI have, but I didn't consider the *entries* as sets, only the keys...
05:44bitemyappnoprompt: it's git based, if I add a git user for somebody, they can push changes from their text editor!
05:44Apage43hot diggity haskell
05:44bitemyappApage43: sssshhhhhh
05:45robewaldjballanc: I wonder whether there are easier ways in clojure to add these small variations.
05:45nopromptrobewald: the way i tend to think of hash-maps is a set of key-value pairs.
05:46Apage43i've used pandoc a good bit, its handy to know that's in there
05:47nopromptrobewald: that being said, one way to see which key value pairs are equal between two hash-maps would be to use `set` on each of the maps and perform an intersection.
05:48nopromptbitemyapp: that sounds pretty rad.
05:48robewaldnoprompt: not quite (clojure.set/union (set {:a "a" :b "b"}) (set {:a "b"}))
05:48robewald,(clojure.set/union (set {:a "a" :b "b"}) (set
05:48robewald {:a "b"}))
05:48clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
05:48robewaldI don't know how to use clojurebot
05:49robewald,(clojure.set/union (set {:a "a" :b "b"}) (set {:a "b"}))
05:49clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>
05:49robewaldanyway that evals to #{[:b "b"] [:a "a"] [:a "b"]}
05:49Apage43oh neat, same guy as pandoc
05:49robewaldwhich is not a hashmap
05:49nopromptrobewald: why are you using union?
05:51robewaldnoprompt: just to illustrate that you may create a set of map-entries that are not a map. That is why i don't think of hashmaps as a set of entries.
05:51robewaldBut your point is valid for this problem and I will try
05:52noprompt,(s/intersection (set {:a "b" :b "f"}) (set {:a "c" :b "f"}))
05:52clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: s, compiling:(NO_SOURCE_PATH:0:0)>
05:52noprompt(clojure.set/intersection (set {:a "b" :b "f"}) (set {:a "c" :b "f"}))
05:52noprompt,(clojure.set/intersection (set {:a "b" :b "f"}) (set {:a "c" :b "f"}))
05:52clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>
05:52noprompt:|
05:52nopromptwhatever anyway that should respond with: #{[:b "f"]}
05:53robewaldright
05:53robewaldactually I would need to test for subset?
05:54noprompt(reduce set/intersection (map set [{:a "b" :b "f"} {:a "c" :b "f"}]))
05:55bitemyappnoprompt: haha, pro.
05:55bitemyapp(inc noprompt)
05:55lazybot⇒ 1
05:55bitemyappI was wondering to myself if there wasn't a better way.
05:56bitemyappApage43: I actually got really lucky, only searched for Haskell-based wikis after I failed to get MediaWiki running.
05:56bitemyappApage43: uninstalled apache, php, mysql, and mediawiki, got gitit running in a jiffy. Turned out to be more of what I wanted anyway :)
05:57poppingtonichi
05:58nopromptpoppingtonic: hi
05:59poppingtonicnoprompt: does anyone here work with Weka? I'm wondering how to connect the library with my leiningen project.
05:59Apage43yeah it looks like a nice thing
05:59Apage43mediawiki is a bit of a pain, but just about any significantly large php thing is
05:59nopromptpoppingtonic: as if i'm the president of #clojure. flattering.
05:59poppingtonichihi
06:01nopromptpoppingtonic: in all seriousness, my guess is there probably are. ML, not SML, is popular topic in the clojure world or so it would seem.
06:02poppingtonicI guess I should just stick around until the hive wakes up, then :)
06:02bitemyappApage43: the way Apache and PHP are crammed up each others asses drives me nuts.
06:02bitemyappApage43: I'd rather just fire up a server bound to localhost and proxy the fucker with nginx.
06:02bitemyapppoppingtonic: I'm only awake because 1. I'm crazy 2. I'm getting a wiki rolling
06:02Apage43but but LAMP stack man
06:02Apage43so 2003
06:03Apage43i'm awake because someone decided it was poignant movie night
06:04nopromptpoppingtonic: americans will be busy with thanksgiving and black friday for the next two days; it's not certain what the #clojure channel will look like.
06:06nopromptyou know come to think of it, i don't recall seeing any portrayals of white men breaking bread with the former natives of this country the past few thanksgivings.
06:06poppingtonicnoprompt: ah, yeah. Food comas and everything. I'm happy for them, the turkey-eaters.
06:07bitemyappI'm not eating turkey :(
06:07nopromptbitemyapp: i'm up because i'm on a really fucked up sleep cycle.
06:07bitemyappnoprompt: me too!
06:07bitemyappI decided to make it constructive :)
06:08poppingtonicnoprompt, bitemyapp So am I. It's 14:10 and I just woke up, slept at 6AM.
06:08bitemyapp0311 in our realm.
06:09bitemyappyeah I'm satisfied, I'm going to start reading and prepping for sleep now.
06:09bitemyappnoprompt: write something in the wiki! :)
06:09nopromptgod i love 24hr time. thank you so much rational people.
06:09nopromptbitemyapp: i know, i'll post a George Carlin quote!
06:10nopromptj/k
06:10poppingtonicI'm pretty sure there's a movie in there somewhere, that someone's just afraid of making. Better call Tarantino!
06:11nopromptpoppingtonic: he's the last person to call.
06:11nopromptseriously if i had an actual list of people i would call in the event i needed to call someone from a list, his name would be at the bottom.
06:12poppingtonicthat bad, huh?
06:13noprompti'll call myley cyrus before i call tarantino.
06:13nopromptthen i'll put them on three way.
06:13nopromptand hang up.
06:14nopromptpoppingtonic: teach your machines that.
06:14sm0kenoprompt: leave mylry cyrus ALONE!!
06:14bitemyappsm0ke: sshhh with the pop culture plz
06:17nopromptbitemyapp: you know how i said i wrote that app that lets me browse ~/.m2?
06:17nopromptwell, i just realized there's probably some code in there i could pull out into a lein plugin if it doesn't already exist.
06:19nopromptlein describe (or something like that) - Display information about a project's dependencies.
06:19nopromptie. display dependency description's, git info etc.
06:19bitemyappnoprompt: hrm, not a bad idea.
06:19nopromptdoes something like that exist?
06:20nopromptcause all that meta is sitting in the pom.xml files generally.
06:21nopromptbitemyapp: how can i publish something to the wiki? (serious)
06:21bitemyappnoprompt: create an account yo
06:21bitemyappnoprompt: top right
06:22nopromptbitemyapp: if i get one spam email, you're done. :P
06:23yedido i need to wrap these while loops in go blocks? https://gist.github.com/yedi/c7f54429df6dc39bb5fc#file-gistfile1-txt-L6
06:23bitemyappAha, three users now :)
06:23nopromptbitemyapp: is the css open source?
06:23bitemyappyippee.
06:23yedii'm dealing with an issue where my channels are getting closed and im not sure why
06:23bitemyappnoprompt: uhm, it's an unmodified gitit install right now. there's a custom.css file that I haven't changed.
06:23bitemyappnoprompt: the only thing I've changed is swapping out the logo.png
06:24nopromptyedi: hmmm
06:28nopromptyedi: well one thing i think you can do is change [socket (<! (ws/connect ...)) ... to just [socket (ws/connect ...) ... and move the let above the first (go
06:28bitemyappthe wiki is now being backed up as well.
06:29nopromptit looks like you want to execute code in the go block whenever the connection arrives.
06:29nopromptso my assumption is that socket is bound to a channel right?
06:32nopromptyedi: i'm guess it's because of the (<! (ws/connect ...)) part.
06:33sm0kehey guys, is there anyway lein repl can detect my changes in a namespace and load entire file automatically?
06:34sm0kei would be running lein repl from a project
06:34nopromptyedi: maybe what you wanna do is (let [{:keys [in out]} (<! socket)] and use alt! on in/clicks
06:37yediill try it
06:38sm0keit would be better if it only reloads changed forms but anything will do
06:38sm0kedoes this happens automatically for emacs users using cider?
06:40nopromptyedi: i'm taking a shot in the dark here. :-) does the channel returned by ws/connect close! after it receives the connection?
06:40nopromptor rather once the connection event takes place?
06:41yedihttps://github.com/loganlinn/cljs-websockets-async/blob/master/src/cljs_websockets_async/core.cljs
06:42noprompti'm guessing it might and that {:in (chan) :out (chan)} are open. but if (<! socket) is closed the whole go block will park.
06:42nopromptyeah, it looks like they're closing that channel once the connection is established. https://github.com/loganlinn/cljs-websockets-async/blob/master/src/cljs_websockets_async/core.cljs#L22
06:43poppingtonic noprompt: what about one where you find out the latest version of a leiningen project? like `lein project latest`? Rather than searching clojars all the time...
06:43nopromptpoppingtonic: i think lein anchient does that.
06:43poppingtonicwhich is what I usually do
06:44nopromptpoppingtonic: but the meta data about dependencies can be useful.
06:44CookedGryphonand i made an emacs plugin which will automatically type out the dependency vector with the latest version in your buffer
06:44CookedGryphonand offers you the option of adding it to your running repl
06:44CookedGryphon(uses lein-ancient in the background)
06:44noprompti'm thinking of situations where someone is new to a code base and wants to know what dependecies are used for.
06:44poppingtonicCookedGryphon: nrepl.el or cider?
06:45nopromptthat way they can get an idea at a glance w/o having to google/search github.
06:45poppingtonicnoprompt: aren't they handled automatically when one runs lein deps?
06:45CookedGryphonI'm still nrepl, I've been meaning to update it to cider, but wasn't sure how many people were on it already
06:45CookedGryphoni'm using emacs live which is still on nrepl
06:45poppingtonicso am I...
06:45nopromptmost of the libs pulled down from clojars have a lot of that information sitting in the pom.xml file.
06:46poppingtonicCookedGryphon: strange choice, considering your language choice...
06:46CookedGryphonpoppingtonic: ?? what do you mean?
06:47yedinoprompt: why would the entire go block part just because socket is closed? the init fn only takes! from socket once
06:48nopromptpoppingtonic: here's what i'm saying. suppose i clone some project and there's a dependency on [jayq "x.x.x"]. when i run lein describe-dependencies i should see something like: jayq - A jQuery wrapper for ClojureScript. (https://github.com/ibdknox/jayq)
06:48poppingtonicClojure has maybe .2% of all programmers hooked, yet you're worried about cider not having that many users among clojurists. If I had to guess, it's probably just inertia.
06:49poppingtonicnoprompt: ok that's awesome. want!
06:49poppingtonicCookedGryphon: ^^
06:50CookedGryphonnoprompt: If that's stuff that's in the pom, you could probably extend lein-ancient to do that
06:50CookedGryphonwhich would work on maven and friends too
06:52noprompt_well erc decided to take a dump.
06:52noprompt_poppingtonic: did you get my description?
06:54poppingtonicnoprompt:yeah you were very clear. I think it does fill a need.
06:54cYmen_I just read this ( https://www.refheap.com/2464e1cf9678fe26ea275322e ) somewhere. Could somebody interpret what the author might be trying to say for me?
06:54nopromptpoppingtonic: the information would be pretty printed, etc.
06:55justin_smithpoppingtonic: emacs has poor dependency isolation, compiled elisp gets used in the compilation of another lib that depends on it, and you get weird bugs eventually with major lib changes that require rebuilding all your packages. So I am waiting until cider is 100% verified production ready, and then dumping all my clojure related packages and rebuilding with a cider stack. I am probably not the only one.
06:55nopromptis there something better than erc for emacs?
06:56justin_smithnoprompt: not in my experience. what extensions do you have turned on? my setup seems pretty stable
06:57nopromptjustin_smith: no extensions. but it seems to lock up and crash. could be something else.
06:57justin_smithI mean what erc extensions
06:57nopromptjustin_smith: none extensions.
06:57nopromptjustin_smith: just the default out of the box erc.
06:57justin_smithwhat about optional behaviors turned on?
06:57justin_smithoh, ok
06:59nopromptit's probably just bad luck.
06:59justin_smithwhat are the symptoms?
07:00bitemyappjustin_smith: hey, look: http://clojurewiki.com/
07:01justin_smithwho is hosting it?
07:01bitemyappjustin_smith: moi
07:01justin_smithcool
07:01bitemyappjustin_smith: finally got my fucking wiki.
07:02nopromptjustin_smith: i'm not sure. at first blush i might say evil-mode and accidentally prefixing an insert with 99 by mistake. however, the second time it locked up right after i ran erc and logged in. :(
07:02nopromptbitemyapp: this should be ported to that http://www.clojure-toolbox.com/
07:03bitemyappnoprompt: psh, on it: http://clojurewiki.com/Libraries
07:03nopromptbitemyapp: that'd be the idea. ;)
07:04nopromptbitemyapp: oh nice. did you write a script to parse/dump the markdown?
07:04bitemyappnoprompt: no, this is by hand yo.
07:04bitemyappnoprompt: http://clojurewiki.com/_activity diary of a madman
07:05nopromptbitemyapp: boo! you had a chance to use ruby + nokogiri and blew it.
07:05bitemyapplike I want to use Ruby.
07:06nopromptbitemyapp: true. doesn't enlive do something like that. let you query html and get data out of nodes?
07:07bitemyappyeh
07:07justin_smithenlive has saved my ass when clients want certain data included as a "feed" from another page, but we need to inject styling or truncate some content
07:08bitemyappnoprompt: I'm doing it by hand partly because I explicitly want to remove some content from clojure-toolbox.
07:08justin_smithanother page I do not control, that is
07:08bitemyappthere are some libraries that are abandoned/broken or just plain bad.
07:08nopromptbitemyapp: i'll remove CSSGen and Gaka for you. :P
07:09bitemyappjustin_smith: I'm not even sure what that would entail.
07:09justin_smithI kid because I love
07:10nopromptactually, i'm not trying to be a douce here but cssgen hasn't been touched in two years and one of Gaka's last commit messages is "Update to clojure 1.4.0"
07:10ben_mAnyone know why nREPL quits after I close Quil sketches?
07:11bitemyappsm0ke: already in the wiki now.
07:11CookedGryphon:on-close :dispose
07:11sm0kebitemyapp: what wiki?
07:11bitemyappnoprompt: k, I'll kill 'em.
07:11CookedGryphonben_m: the default behaviour on closing a jframe is system.exit
07:11justin_smithnoprompt: sometimes something is simple enough that it is just done, that doesn't make it stop being useful
07:11justin_smithnow if they have multiple unaddressed issues on their repo on the other hand
07:12sm0kei also found https://github.com/paraseba/lein-reload, but it doesnt seems to be working
07:12nopromptjustin_smith: this is certainly true.
07:12bitemyappjustin_smith: I'm willing to believe that, but people should just be directed to Garden.
07:12bitemyappif I want to emphasize a particular library, I'll put a "Recommended" next to it in future.
07:13nopromptjustin_smith: garden does have open issues, some of which are not really issues, other's like this one: https://github.com/noprompt/garden/issues/23 are pretty much a crap shoot.
07:13CookedGryphonben_m: at least that's a thing I remember being an issue, can't remember the exact details now I've said it
07:14nopromptthe issues on garden right now are mainly feature oriented.
07:14ben_mCookedGryphon, yeah that makes sense, it doesn't work though and on-close isn't an option if I (doc sketch)
07:14CookedGryphonben_m: and you're using defsketch and not putting it in something else?
07:14justin_smithwell garden hasn't seen a change in master in two years from what I see
07:15nopromptsay wut?
07:15justin_smitherr
07:15justin_smithwait, don't mind me
07:15justin_smithneed my coffee
07:15justin_smithI was looking at cssgen
07:15nopromptjustin_smith: the version was bumped 9 days ago. haha!
07:15ben_mCookedGryphon, I was using sketch instead of defsketch. Works now :D
07:15CookedGryphonben_m: oh, odd, were you making your own frame?
07:16nopromptlol
07:16CookedGryphonben_m: I would recommend finding out what was wrong and going back to sketch, defsketch is bad for many reasons
07:16nopromptjustin_smith: everyone has those moments. :)
07:16ben_mNo, just using sketch, I assumed it was just defsketch without giving it a name.
07:16justin_smithit would be cool if the list of libs mentioned the time since last activity on github
07:16CookedGryphonincluding things like opening windows when you're trying to package a jar or run tests!
07:16nopromptjustin_smith: i thought you just said that wasn't technically relevant.
07:17justin_smithnoprompt: I was devil's advocating
07:17justin_smithnot sure how I feel :)
07:17nopromptjustin_smith: oh, hoho, i see! :P
07:17justin_smithor maybe more thinking out loud
07:17justin_smithsocratic method to find the truth!
07:17CookedGryphonben_m: it's quite easy to stick the sketch in a swing window yourself, maybe using seesaw
07:17nopromptjustin_smith: although i dislike the metric, i tend to agree it can be useful at times.
07:17CookedGryphonben_m: then if you wanted to add other ui too...
07:18CookedGryphonben_m: ah, so the difference is, defsketch actually does defapplet under the hood
07:18ben_mWhich seems to be the same thing
07:18CookedGryphonin fact it seems to be an exact alias
07:18justin_smithnow a reddit style karma system for libs
07:18ben_mYeah.
07:18ben_mI'm currently investigating source too.
07:18justin_smithwhere each user could upvote / downvote a lib
07:18nopromptoh gawd.
07:19CookedGryphonben_m: the :target option might be interesting to you too
07:19CookedGryphon:frame :perm-frame or :none
07:19justin_smithbut then of course we would see "karma whore" libs, that include kitten pics and in jokes to get pushed to the top
07:19CookedGryphonI use none when embedding some graphics in another bigger ui
07:19ben_mI'm just calling functions from nrepl
07:20ben_mStill very much in the exploring phase
07:22sm0keaha finally found https://github.com/pyronicide/lein-autoreload
07:22nopromptbitemyapp: "there is no substitute for using criterium in benchmarking. Proper."
07:22rkzcan anyone spot the problem with my 'throttle' function here? http://cljsfiddle.net/fiddle/r4vi.cljsfiddle123
07:22rkzmaybe i'm misunderstanding core.async
07:22rkzi'm trying to throttle mouse events
07:23CookedGryphonrkz: why do you have a sliding buffer?
07:23CookedGryphonof 1...
07:23CookedGryphonisn't that just the same as not having a buffer?
07:23bitemyappnoprompt: yes.
07:24bitemyappnoprompt: nothing there is untrue.
07:24bitemyappnoprompt: I need to sleep, plz add things
07:24rkzCookedGryphon: I don't want it to block
07:24CookedGryphonit won't... that's the point of core.async
07:24rkzCookedGryphon: just throw away all events between 1st one and recieved while blocking for timeout
07:24rkzinside the go block it will
07:25rkzi dont want to recieve 1 mouse event every 5 seconds
07:25rkzi want to recieve 1 mouse event ignore all of them for 5 seconds and recieve the next one
07:29bitemyappI'm off to sleep 5realz now. Goodnight all.
07:29nopromptbitemyapp: night buddy.
07:30sm0keis robert.hooke available for every lein plugin?
07:32nopromptrkz: wait (>! to-throttle)?
07:33CookedGryphonrkz: you could share a timeout...
07:34rkznoprompt: bloking put onto a sliding-buffer channel of size 1, then blocking read from timeout channel of msesc
07:34rkz(>! to-throttle) shouldn't block and immediately wait on the timeout
07:34nopromptrkz: yeah but you're not putting anything on the channel.
07:35rkzi see
07:35rkzyeah
07:35rkzim just returning (chan) basically
07:35rkzwhoops
07:35yediwhat happens when you put! to a closed channel?
07:36nopromptyedi: http://clojure.github.io/core.async/#clojure.core.async/put!
07:36noprompt"Will throw if closed."
07:36yediis there a way to check if a channel is closed
07:37nopromptyedi: you know i was wondering the same thing the other day.
07:37drguildois anybody here using nrepl.el on windows?
07:38yedii guess i'll just have to wrap my puts in try/catches
07:38rkznoprompt: i think this fixes what you're pointing out http://cljsfiddle.net/fiddle/r4vi.cljsfiddle123
07:38nopromptrkz: fyi https://github.com/swannodette/swannodette.github.com/blob/master/code/blog/src/blog/utils/reactive.cljs#L239-L277
07:41ben_mCookedGryphon, if you're curious still, closing the sketch is actually fine, pressing Escape is what causes nREPL to close.
07:42ben_mI guess that might be some hardcoded part of processing or something like that.
07:42drguildoif not, what's the most popular clojure development environment on windows because i've found a problem with nrepl.el that's kind of a deal breaker
07:44nopromptdrguildo: doesn't counterclockwise work on windows?
07:45nopromptdrguildo: https://code.google.com/p/counterclockwise/
07:45drguildonoprompt, as far as i know. i really need a good development environment, especially for something like clojure with it's simple syntax and type system.
07:46drguildoerm, i don't mean it has a simple type system, just that with something like scala the type system helps you more by default
07:47nopromptdrguildo: most of the folks here use Emacs. but you might wanna look at counterclockwise. also i think SublimeText now has some good plugins to get a repl etc rolling. LightTable should also work.
07:49nopromptdrguildo: oh. i'm not sure about that. clojure's a dynamic language (aka unityped).
07:50nopromptdrguildo: how much help an IDE will be able to give you about the correctness of your program is really hard to say. there's core.typed for static type checking though but that's outside of the scope of what you're asking for i think.
07:52drguildowell i was thinking more along the lines of manipulating s-expressions
07:52drguildoi'm a beginner and my brain isn't good at parsing them yet
07:52drguildoso i need all the help i can get from my tools
07:53nopromptdrguildo: Emacs' paredit excels at that. i believe similar facilities are available for LightTable and SublimeText.
07:54drguildoi'm having trouble with emacs + nrepl.el, it seems windows cannot kill child processes automatically so each time i nrepl-quit i'm left with an orphaned jvm instance
07:54nopromptdrguildo: you might also want to look into something like rainbow-delimiters or rainbow-parentheses which will highlight matching delimiters using alternating colors depending on nesting.
07:54drguildolighttable has a problem with recursion causing it to bug out sometimes which makes it unresponsive. not the program itself but the magic instarepl stuff.
07:54nopromptdrguildo: you may want to try simply running lein repl somewhere and then connecting to it from emacs vs using something like nrepl-jack-in.
07:55drguildoso that's a no go as well
07:55nopromptdrguildo: yes, i've seen that happen.
07:55drguildohrmm yeah, maybe.
07:55nopromptdrguildo: typically that's how i do it. i seldom use nrepl-jack-in unless i'm being supremely lazy.
07:55drguildoi'm already using rainbow-delimiters, it's great.
07:56nopromptdrguildo: paredit-mode is probably the next thing you'll want to look in to.
07:57nopromptdrguildo: if you're fluent with paredit-mode and have you're nrepl working properly, you're pretty much set. everything else is icing on the cake. :)
07:58nopromptdrguildo: i hope that's helpful to you.
07:59nopromptdrguildo: i suppose if all else failed you could run a linux VM. :P
08:03justin_smithdrguildo: you can run (System/exit 0) in a repl to kill its vm
08:05drguildonoprompt, thanks
08:06nopromptdrguildo: sure thing.
08:06nopromptholy cow it's 0509.
08:06nopromptwell that's my cue to sleep.
08:06drguildoapparently windows has no way of automatically killing a parent processes children
08:07drguildowhich is what's causing the orphaned java.exe
08:07drguildothere must be a way around it though
08:08drguildosurely windows isn't that shit... right?
08:11justin_smithdrguildo: as long as your agents are shut down, System/exit will shut down the vm
08:12justin_smiththough I guess it would be annoying to have to remember to do that before exiting the editor
08:13justin_smith(and this is where as an emacs user with 32 gigs of ram I think "exit the editor, when does anyone ever do that?")
08:13drguildoi have the mentality where if there's a problem like this it really bugs me and i feel compelled to find a "proper" solution to it
08:13drguildoi have 16gb so memory isn't an issue either
08:14justin_smithif you want "proper" behavior, it is odd that you would use Windows
08:14justin_smithWindows has some great things, propriety isn't one of them
08:14rkzsurprised I havent heard of this before though, must be plenty of people using windows
08:14rkzdoing clojure
08:14drguildoi came to the conclusion a long time ago that there are no good operating systems, unix, linux and windows are all bad in their own special ways
08:14justin_smithI think a plurality are osx or linux users
08:15justin_smithwait, you've used a proper unix? I didn't think anyone used a licensed unix any more on a desktop
08:15drguildobut i don't want to argue about operating systems
08:16drguildoi've used freebsd and openbsd
08:16drguildoi used linux exclusively for years
08:16justin_smiththose aren't unix any more than linux is
08:16justin_smithnone are licensed as unix
08:17drguildowhy does being licensed matter?
08:17justin_smiththat's what makes something a unix
08:17drguildoif you say so
08:17justin_smithunix is a trademark
08:17justin_smithit's a certification
08:18justin_smithif you are going to differentiate unix vs. linux, bsd is not in the unix category
08:18drguildoif you say so
08:19justin_smithhttp://en.wikipedia.org/wiki/Unix#Branding
08:19justin_smith*bsd and linux are legally not allowed to use the unix name
08:19justin_smithit is a trademark and a certification
08:20drguildocool
08:24dsrxi think people tend to not differntiate *BSD and UNIX so much because the BSDs are direct descendents of AT&T UNIX
08:28justin_smithanyway, I should apologize, the whole unix pedantery is irrelevant here
08:28justin_smithas is my opinion of anything about windows being "proper"
08:29justin_smithI think the proper thing is if a program starts a jvm that you wouldn't use after its exit, it should safely shutdown said vm
08:30justin_smithdrguildo: are you seeing this phenomenon with emacs / nrepl on windows?
08:30drguildoyeah
08:32justin_smithif there is an nrepl.el command that shuts down all jacked-in repls, you could add that to kill-emacs-hook
08:32justin_smithany function added to kill-emacs-hook will get run if emacs is exited in a normal way
08:33drguildothe problem is nrepl.el spawns a java.exe process which has a java.exe child but when the parent is killed it doesn't kill the child
08:33drguildoeither explicitly or automatically (windows doesn't kill children when the parent is killed)
08:33drguildoi don't know why java.exe even has the child to begin with but i'd like to
08:33justin_smithOK, so what we need is a command that sends a message to each open repl owned by emacs, and tells it to exit
08:34justin_smithsounds like something that could be done in four or five lines of elisp, if it is not in nrepl already
08:35justin_smiththe tricky thing I guess is the owned by emacs vs. connected to and should stay running distinction
08:35drguildohttps://github.com/clojure-emacs/cider/issues/390
08:35justin_smithfor example I use emacs to host a repl inside a server - just because I quit emacs does not mean I want that server to shut down
08:35justin_smiths/host/connect-to
08:36justin_smithOK, that's helpful
08:36justin_smith(that link)
08:37justin_smithI think an elisp command that sends (System/exit 0) to be evaluated by a child repl would fix that issue
08:37justin_smithheh, and now I see you say the same thing there
08:38drguildo:-)
08:39drguildothe problem is ultimately with windows but the chances of getting that fixed are practically 0
08:39justin_smithright
08:39justin_smiththus my snark about propriety and windows :)
08:40drguildobut maybe there could be some kind of workaround implemented in emacs's delete-process
08:40drguildobut i don't know enough about windows system programming to have any ideas
08:40justin_smithbut the point of the jvm is to smooth over such things, so why not rely on the jvm (by telling it nicely to exit) rather than the os (by depending on shutdown behaviors specific to sane operating systems)
08:40drguildoi've looked around and there are no obvious/easy ways of find a processes children
08:40drguildotrue
08:41WWWest1hi all
08:41justin_smithI mean if everyone had a sane OS, we wouldn't need the jvm now would we
08:41drguildoit could also be seen as a problem in java.exe because it should really be killing it's child when it gets the signal to exit
08:41dsrxdoes the jvm run on templeos?
08:42justin_smithLOLOL
08:42WWWest1is there something special to do to get :advanced compilation working when targeting node?
08:42justin_smithdsrx: speaking of sane os's
08:42WWWest1my project compiles but dies with has no method 'zb' when I run it
08:42drguildotempleos has ascended beyond the need for virtual machines
08:43makkalothi, is someone using austin, ?
08:43WWWest1do the modules I use through node/require need to be declared as extern libs or something?
08:45justin_smithwoah, cleaning up browser windows I see that OSX paid for unix certification
08:46drguildois templeos a unix?
08:46francis_wolkeIt's rather annoying that all library sources are stored in .jar files, as this prevents me from r-grepping the libraries that I use - is there an solution to this I'm simply oblivious to? There __are__ solutions, ( http://stackoverflow.com/questions/1342894/find-a-class-somewhere-inside-dozens-of-jar-files ) but I'm asking anyway because it seems likely that someone has had this issue before and solved it.
08:47justin_smithfrancis_wolke: if you know which ones you want to search, jars are zip files
08:47clojurebotIt's greek to me.
08:47justin_smithyou can unzip them
08:49justin_smithyou could do something like: for i in $(lein classpath | grep jar); do mkdir $(basename $i .jar); cd $(basename $i .jar); unizp $i; done
08:49justin_smiththat is not complete, but close to what would do it
08:52francis_wolkejustin_smith: Adknowledged.
08:54justin_smithI just experimented with emacs archive mode - it lets you open and edit jars without extracting them, but does not allow search rgrep style
08:54justin_smithfrancis_wolke: agreed that this is an annoying issue btw
08:54francis_wolkejustin_smith: Yep. I walked down that path too.
08:54francis_wolkejustin_smith: Elisp hacking time I suppose. *sigh*
08:54justin_smithdefinitely an option :)
08:55justin_smithM-x jar-occur
08:55justin_smithwould be sweet
09:04CookedGryphonOr, get cloc 0.1.0 and do lein cloc
09:05CookedGryphonmy colleague wrote it, it scans all the jars on your classpath and source folder, running codox over them building documentation for every namespace sorted by library
09:05CookedGryphonand indexing them to be lucene searchable
09:05justin_smithCookedGryphon: if people use doc strings, that seems like it would work
09:05henryw374codeq could help here. u need a script to pull all src of all deps into a codeq instance - which i dont have btw. then query away
09:05CookedGryphonindeed, which they should. It searches on the function name too
09:06justin_smithCookedGryphon: I have coworkers who see doc strings as irrelevant decoration, so the only way to figure the namespace out is to read the whole god damned source file
09:07justin_smithgrumble grumble
09:07CookedGryphonjustin_smith: marginalia might be better for you then
09:07justin_smithyeah
09:07justin_smithor hs-mode in emacs
09:07justin_smithwhich comes out to the same thing if you don't have doc strings :)
09:08justin_smithnow I am dreaming of a variant of hs that hides everything but the doc string...
09:08justin_smiththat would be sweet
09:09CookedGryphonfocus-mode - you can only see the source of one thing at a time
09:09CookedGryphonif you find yourself needing to look at two, you haven't named/documented it sufficiently
09:09CookedGryphonfix that then continue
09:09justin_smiththat is how I use hideshow basically
09:10justin_smithcollapse all, expand one at a time
09:10justin_smithbut my main collaborator has an "abstract all the things" philosophy, such that his code is not readable that way
09:11justin_smithcommon conversation him: "why use flet, and not just put it in its own defn?" me: "why make a top level defn that will only be used in one place?"
09:12justin_smithI am more likely to repeat small things, he is more likely to have definition-spaghetti
09:13CookedGryphonit's not spaghetti if it does one well defined small thing and doesn't have tendrils
09:13justin_smithCookedGryphon: spaghetti as in you cannot figure out what this thing is doing without recursively following 5 or more definitions spread throughout the file
09:13justin_smitheach one is small
09:14CookedGryphonso that's badly named
09:14justin_smithand too abstract to have an intuitively meaningful name
09:14CookedGryphonyeah, you need to be able to name it
09:14justin_smithright, they are weird hard to name things he is abstracting out
09:15justin_smithhttps://github.com/caribou/caribou-core/blob/master/src/caribou/model.clj#L111
09:15justin_smithfor example
09:16justin_smithscreen after screen of weird little definitions
09:16CookedGryphoni don't even understand the docstring on the top level function there though :P
09:16CookedGryphonbut yeah i see your point
09:17CookedGryphonif you're having to do lots of funny little custom transformations like that... it makes me wonder whether the underlying data structure is actually to blame
09:17justin_smithand notice that splinter-order is only ever called once in the entire codebase!
09:17justin_smithwhy even make that a function :(
09:17CookedGryphon(disclaimer, that opinion is entirely based on these few lines)
09:18justin_smithit's more like he has a write-only brain for algorithms sometimes
09:18justin_smithdon't get me wrong, he is brilliant, and it is solely thanks to him that caribou does what it does so well - but working on his code can be maddening
09:18justin_smithOK, done griping about my best friend now :)
09:20justin_smithCookedGryphon: actually the data structures are pretty straightforward, though the impedence mismatch between sql and clojure maps can be a bit sticky sometimes
09:38justin_smithfor a while I used sets as a shorthand for testing for any of multiple equalities (set membership)
09:38justin_smith(defn is [& things] (let [preds (map #(fn [x] (= x %)) things)] (apply some-fn preds)))
09:38justin_smithcompared to the equivalent set used as a predicat, the average time is 1.48 microseconds
09:38justin_smithas opposed to 100 nanoseconds
09:39justin_smithwhich is how many orders of magnitude? wow
09:40justin_smitherr wait
09:41justin_smithI got the order of micro and nano mixed up
09:48xeqidnolen: does form-seq (really form-seq*) cause a rebinding everytime a value is realized from the resulting lazy-seq?
09:48xeqiI thought it did, but perhaps I missunderstand lazy-seq recursion w/ dynamic vars
09:55nonubycompojure depends on clojure 1.3.0 https://github.com/weavejester/compojure/blob/master/project.clj so what happens when i bring compojure into my new project that is according to my project.clj on 1.5.1?
09:57CookedGryphonnonuby: I *believe* it'll default to the latest version and assume back compatibility. Which in this case is a correct assumption, so you'll be fine
09:57justin_smithnonuby: it should still work, you may want to use an :exclusions clause in your dependencies so that you don't accidentally get the wrong clojure version
09:57justin_smithwith a recent library, I actually left out the clojure dependency, because I assume nobody using it would not be using clojure
09:58justin_smithI wonder if that is bad form
09:58CookedGryphonjustin_smith: if nothing else it documents which version you had in mind when you wrote it. I would say it was bad form
09:58CookedGryphonclojure is a funny one though, because it is really very stable and back compatible
09:58nonubyclj-http lists in dev dependencies rather than deps
10:00justin_smithCookedGryphon: the library is miniscule, it is really just a dependency injection of avout as a state coordinator into a caribou app (replacing an atom caribou used with an avout distributed atom)
10:01justin_smithmy reason for doing this is so often I have gotten a wrong clojure version (or wrong foo version) indirectly through some random lib
10:01CookedGryphontell you what we need... immutable libraries
10:02CookedGryphonand when you compile code, it closes over the versions of the libraries you use
10:02CookedGryphonthen instead of jars, have some git-like construct
10:02justin_smithnot really compatible with the clojure classloader
10:02CookedGryphonto give you immutable library versions
10:02dnolenxeqi: it does because it calls re-form, which will rebind
10:02dnolenxeqi: lazy sequences and binding do not compose
10:02dnolenxeqi: you always have to capture before you start
10:02justin_smithCookedGryphon: unless we had a new ns with every library version
10:02dnolens/re-form/read-form
10:03xeqidnolen: I meant on current master
10:03dnolenxeqi: the behavior is correct and master and incorrect in your patch
10:03dnolens/and/in
10:05CookedGryphonjustin_smith: not necessarily... the build/packaging tool could manage that
10:05dnolenxeqi: oops actually, master is wrong too :)
10:06dnolenxeqi: actually it's not ... *cljs-ns* and *alias-map* is correct because those might change during reading
10:06justin_smithCookedGryphon: so how is it handled when two versions of clojure are relied on?
10:06dnolenxeqi: I mean master is right for those
10:07dnolenxeqi: and data-readers is also right - because we need to bind that based on what it was when we started
10:07dnolenxeqi: so yeah master is correct here
10:07xeqidnolen: heh, I'm good with the changes proposed (as mentioned in my latest comment). Just was really curious about behaviour difference
10:08dnolenxeqi: so what was the dec thing in compiler.clj all about?
10:08dnolengotta run, bbiab
10:16ohcibihi, is there an equivalent for this: http://clojuredocs.org/clojure_core/clojure.core/vector for sequences? i found sequence but it just takes a coll as single argument and turns it into a seq..
10:16`cbpohcibi: no, you construct seqs "by hand"
10:17`cbpAssuming that's what you meant by sequences
10:17`cbpsequences are actually a superset that includes vectors, lists, seqs, etc
10:18ohcibi`cbp: yes but I need a function like vector that takes many arguments and creates a sequence from it to pass to map, so I wonder why there is no function like vector
10:18justin_smithseq does not create a sequence, it creates a "cursor" on a sequence
10:18justin_smiththe overhead is pretty low, it is a convenience so you can check the first / rest etc. and iterate on it
10:19justin_smithohcibi: map turns an argument into a sequence
10:19clgvo:O
10:19clgvo_O
10:19justin_smithohcibi: the input to map can be any collection that can be treated as a sequence
10:20ohcibijustin_smith: i need a function that takes many arguments and returns a sequence from them...
10:20ohcibilike vector does
10:20justin_smithvector is a sequential
10:20justin_smithsequence is not a type
10:20clgvohcibi: why not use vector?
10:20justin_smithit describes many types
10:20justin_smithyou could use vector, list, hell if you don't care about the order you could use set
10:21justin_smith*hash-set
10:22justin_smithor if you prefer you could use a java array or List
10:22justin_smithmap will iterate over any of them by using a seq
10:23TEttingera function that takes many arguments and creates a sequence from it to pass to map: ##((fn [& args] (map inc args)) 1 2 3 4 5)
10:23lazybot⇒ (2 3 4 5 6)
10:23justin_smiththat's another way to do it, sure :)
10:23ohcibiah... indeed I confused "sequence" with list
10:23TEttingerI just meant the many args thing
10:23justin_smith((fn [& args] args) 1 2 3 4 5)
10:23justin_smith,((fn [& args] args) 1 2 3 4 5)
10:23clojurebot(1 2 3 4 5)
10:24clgvohcibi: if the current answers dont suffice for you just provide concrete examples for the input and output
10:24ohcibiclgv: no no, its just that I confused sequence with list, so there was no way to give proper answers 8-)
10:24TEttingerI wonder...
10:25justin_smith,(class ((fn [& args] args) 1 2 3 4 5))
10:25clojurebotclojure.lang.ArraySeq
10:25justin_smith,(class (list 1 2 3 4 5))
10:25clojurebotclojure.lang.PersistentList
10:26justin_smith,(class (reduce conj () [1 2 3 4 5]))
10:26clojurebotclojure.lang.PersistentList
10:26TEttinger,(map first (java.util.TreeMap. (sorted-map :a 1 :b 2)))
10:26clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.util.TreeMap$Entry>
10:26xeqidnolen: (dec column) was meant to be a seperate patch. yet another instance of 0 vs 1 indexing difference between tools.reader and sourcemaps
10:26TEttingerso it can map over java types cool
10:27justin_smith,(map identity (java.util.TreeMap. (sorted-map :a 1 :b 2)))
10:27clojurebot(#<Entry :a=1> #<Entry :b=2>)
10:28justin_smith,(map identity "hello")
10:28clojurebot(\h \e \l \l \o)
10:28justin_smith:)
10:29justin_smiththough map on a string is usually a pretty bad idea
10:29justin_smithit totally works
10:29TEttingerit is totally not a bad idea if you need character manipulating
10:29TEttingerit just uh... shouldn't be needed...
10:30justin_smithdepends on if you care about memory usage / execution time
10:30justin_smithsticking string ops on strings makes a big difference
10:30TEttingerlazy seqs vs. strings though...?
10:31justin_smith(says the guy who made the mistake of ubiquitously using seq ops on strings in a webapp and felt the pain)
10:31TEttingerheh.
10:32justin_smitha sequence from a string, compared to a string, will likely use at least 4 times the space, not to mention the difference in search and alteration time
10:32justin_smith4 times the size is hazy and from memory.. let me see if I can get more accurate
10:35justin_smith,[Character/SIZE (count (.getBytes "a"))]
10:35clojurebot[16 1]
10:35TEttinger,[(count (.getBytes "a")) (count (.getBytes \a))]
10:35clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: getBytes for class java.lang.Character>
10:36justin_smithso a primitive character is 2 times the size
10:36justin_smith\a is not a collection
10:36justin_smithlooking for the size of the class
10:36TEttingeralso an array might be different?
10:36justin_smithwhich is different from char
10:36justin_smithyes, array vs. seq
10:36justin_smithbecause an array is unboxed
10:37justin_smithso if you used a char-array, that would be smaller than a seq of character objects by a significant margin
10:37justin_smithand both are larger than a string of equivalent contents
10:37justin_smithand then you have the optimized string ops, as compared to the ops on collections that are more general and have to be more cautious
10:42justin_smithTEttinger: comparison of seq vs. string ops http://sprunge.us/TTNK
10:42justin_smitha simple one, but informative
10:43TEttingerwoah!
10:44justin_smithyeah, the differnce is pretty big. Though to be fair, you would only construct that seq once and convert the seq back to string in actual practice, you would need a more realistic example for that
10:45TEttingerI do wonder if it would make sense to use java strings as a basis for specialized data. I'm almost certain my crappy game's map could be represented with unicode...
10:45justin_smithor you could use an array if it is a performance bottleneck
10:45justin_smithI guess with string you get the advantage it is still immutible
10:45TEttingerI am. but it uses a ton of memory now
10:46justin_smithan array of what type?
10:46TEttinger,(count (.getBytes "╬"))
10:46clojurebot3
10:47justin_smithalso, you could consider a sparse map
10:47`cbpI always used .toCharArray for codejam stuff :-)
10:47lnostdalSegFaultAX: from the chat yesterday (if you recall) this was the problem for me: https://github.com/clojure-emacs/cider/issues/408#issuecomment-29471701
10:47TEttingerI actually kinda did a sparse map in C# for some of this
10:47TEttingerthen later rewrote in clojure
10:48justin_smithTEttinger: for example I have been playing with quad trees for representing some rectangle packing stuff, and the advantage of only needing storage for occupied space is nice
10:48justin_smithalso makes iterating easier
10:49justin_smithI guess in 3d they ubiquitously use octrees
10:49justin_smithsame concept
10:49TEttingerI think now I'm using ^doubles arrays. not sure if that boxes or not?
10:50justin_smith^doubles should be unboxed
10:50justin_smithyou could use jvisualvm and compare the memory used by the object to the count to know for sure :)
10:50justin_smithjvisualvm is really helpful for investigating this stuff
10:50clgvTEttinger: the values in the ^doubles array are primitiv
10:50justin_smithalongside criterium
10:51clgvTEttinger: there is also `vector-of` for primitives
10:52TEttingerI have never been able to figure out visualvm
10:53`cbpyou can also compile to .class then decompile into java with something like jd-gui :)
10:53TEttingerthen probably it has something to do with either logic code (which uses large vectors for each creature), or more likely the rendering is poorly done
10:54justin_smiththe difference in storage space used between a sequence of char and a string is 3/2 + (housekeeping data of sequence)/8
10:54justin_smith3/2*length that is
10:54`cbpthat's the only sure way i know to check for boxing
10:54justin_smithalso, TIL each bool is 8 bytes in size minimum, even when optimized
10:55TEttinger8 BYTES?
10:55TEttingerfor 64-bit stuff?
10:55justin_smith"a normal object requires 8 bytes of "housekeeping" space;"
10:55clgv`cbp: Luyten is much better than jd-gui (and the jd-gui website is down, isnt it?)
10:55justin_smithunboxed 8 bits, sorry
10:55justin_smithoh, so my math above is way off
10:56justin_smith9/2*count + seq-stuff/8
10:56justin_smithfor sequence of char vs. string
10:56`cbpclgv: it seems up for me: http://jd.benow.ca/
10:56`cbpclgv: Ive never used luyten though
10:56clgvoh on a new URL?
10:57justin_smithTEttinger so the minimum size of a bool is 8 bits, 9 bytes if it is a standalone boxed bool
10:57justin_smithcrazy
10:57clgv`cbp: Luyten is a small frontend for procyon which had much ebtter results on the class files I got from clojure
10:58`cbpi'll check it out
10:58clgv`cbp: I upgraded it to use the latest version of procyon overhere: https://github.com/guv/Luyten/releases
10:58justin_smithTEttinger: which is a good argument for using bytes as bit-vectors
10:58clgv`cbp: the original developer seems not very reactive
10:59`cbp:P
10:59clgvoh jd-gui has no 0.3,6 release for linux?
10:59justin_smithclgv: so is that the decompiler you would recommend?
11:00clgvjustin_smith: you mean procyon via Luyten GUI?
11:00ea-newbie question here.. if I have a string, and a vector, how can I prepend the string into the vector?
11:00justin_smithI recently got the "clojure high performance programming" book and it recommended jd-gui
11:00justin_smithclgv: yeah
11:01`cbpthat book sounds interesting :)
11:01ea-right now im doing (into [mystring] myvector) and it's adding each character from the string into the vector as an element
11:01clgvjustin_smith: it managed to decompile class files where jd-gui/jd-core failed (showed only bytecode)
11:01ProfpatschI’m trying to configure ac-nrepl. It works for the REPL, is there a way to couple it into my clojure-mode buffer?
11:01arcatanjustin_smith: what's this book?
11:01ea- also tried (conj myvector mystring) and it still adds each character fmor the string into the vector
11:01justin_smith,(apply vector "your string" [1 2 3]) ; ea-:
11:01clojurebot["your string" 1 2 3]
11:02clgvjustin_smith: I think you should install both and on failure check if the other one manages decompilation of the class file
11:02arcatanah, found it
11:02justin_smithea-: if you don't mind the string being at the end instead, you can use conj, and that is much more efficient
11:02justin_smithclgv: cool, sounds like a plan
11:02justin_smith,(conj [1 2 3] "your string") ; ea-:
11:02clojurebot[1 2 3 "your string"]
11:03justin_smithea-: or use a list and conj, that will put it on the front
11:03justin_smith,(conj (list 1 2 3) "your string")
11:03clojurebot("your string" 1 2 3)
11:03ea-hmm.. still seem to be getting the same issue
11:03justin_smitharcatan: shantanu kumar, clojure high performance programming
11:04justin_smithit's good, though slim
11:04justin_smithnot much filler though
11:04ea-(csv/write-csv *out* (apply vector [url (re-seq re-expn line)]))
11:04justin_smithhttp://www.packtpub.com/clojure-high-performance-programming/book
11:04justin_smithea-: what issue
11:04ea-seems to add each character of the "url" into the vector instead of the whole string.
11:04justin_smithea-: the order of the args is wrong
11:05ea-basically just trying to prepend the vector returned by re-seq with the string "url"
11:05justin_smithyou are putting the vector into the string
11:05ea-oh, damn!
11:05ea-haha
11:05justin_smithea-: sorry, missed where you described that above
11:05justin_smith,[(into "hello" [:a :b :c]) (into [:a :b :c] "hello")]
11:05clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentCollection>
11:05justin_smitherr
11:06justin_smithea-: no, I was right the first time
11:06justin_smithuse conj
11:06justin_smithinto treats the string as a collection
11:06ea-ok let me try into
11:07justin_smith,(into [:a :b :c] ["hello"])
11:07clojurebot[:a :b :c "hello"]
11:07justin_smiththat is one way to do it
11:07justin_smithbut really you could just conj
11:07justin_smith,(conj [:a :b :c] "hello")
11:07clojurebot[:a :b :c "hello"]
11:07ea-i must be missing something reallty obvious
11:07ea- (csv/write-csv *out* (conj (re-seq re-expn line) url))
11:07ea-that still adds each character of the string URL inrto the vector
11:08justin_smithre-seq returns a lazyseq not a vector
11:09ea-hmm
11:09justin_smith,(conj (re-seq #"[^ ]+" "this is a test") "hello")
11:09clojurebot("hello" "this" "is" "a" "test")
11:09justin_smithwhat else are you doing to url - maybe something else is turning it into a seq before that
11:09gtrakdnolen: managed to make ISeq first/rest work with array-copy, inefficient, but works.
11:09justin_smithif so, (apply str url)
11:10justin_smith,(apply str [\a \b \c])
11:10clojurebot"abc"
11:10ea-https://gist.github.com/earle/0a5266fd0ebb4db5cc43
11:10Bronsaxeqi: any issue working with the source-logging reader?
11:11justin_smithea-: yeah, don't use apply vector
11:11ea-i have some futures that are grabbing some urls and tokenizing an access log. .trying to prepend the url to the csv returned frmo re-seq
11:11justin_smithea-: use conj
11:11ea-yeah im using conj, and its tokenizing the string into characters in the vector
11:12justin_smithea-: that gist is using apply vector
11:12`cbpcan you paste what you're actually using? :P
11:13ea-https://gist.github.com/earle/0a5266fd0ebb4db5cc43
11:13ea-sorry hadnt updated the gist ;)
11:13`cbpthe arguments to conj are in reverse order
11:14`cbpoh nevermind me
11:14justin_smith`cbp: I was gonna say :)
11:14ea-my first real clojure program.. figures i get the futures right, but cant figure out how to put a string into the vector ;)
11:15justin_smithea-: how sure are you that the code in that gist is running when you get a request?
11:15ea-its running, its writing everything to stdout
11:16justin_smithand it is definitely running that version and not an old definition?
11:16ea-yeagh
11:16`cbpI imagine write-csv takes a sequence of [column-names & rows] so i guess you're telling the csv that column-names is the url so it takes each char as a column
11:18`cbpor i may be completely wrong, ea- which library are you using
11:19ea-im using https://github.com/clojure/data.csv
11:19ea-if i take out the conj and url, and just write the csv, it works fine
11:20justin_smithea-: I just commented something you can try on that gist
11:20ea-trying to prepend the url into it is adding each character of the url instead of the string
11:20justin_smithto see what conj is returning
11:20justin_smithconj really does not work that way, something else is going on
11:21justin_smiththe doto form returns what conj would have returned, while also printing
11:22justin_smithwait, I fucked that up, one sec
11:23justin_smithea-: updated
11:24ea-ok..
11:25ea-yeah this makes sense.. i changed it to println, and it works:
11:25ea- (println (conj (re-seq re-expn line) url))
11:25justin_smitherr
11:25ea-(http://notebook.cowgar.com/access.log [1.202.218.8 - - [03/Jun/2012:13:51:44 -0400] "GET /robots.txt HTTP/1.0" 404 1.202.218.8 - - 03/Jun/2012:13:51:44 -0400 "GET /robots.txt HTTP/1.0" 404])
11:25justin_smithright, so conj is doing the right thing
11:25ea-not really
11:25ea-its not adding to the vector.. it returned a new sequence with the url then the vector in it
11:26justin_smithOH
11:26justin_smithshit
11:26justin_smithline is not a string, it is a collection?
11:26justin_smithwait, no
11:27ea-its the result of spit-lines
11:27ea-which should be a string right?
11:27AimHereIt's a collection of strings
11:27AimHereProbably a vector
11:27`cbpi dont see how it can work at all haha since write-csv needs a vector of vectors and youre passing it a seq of strings as far as i can tell
11:28ea-https://gist.github.com/earle/0a5266fd0ebb4db5cc43
11:28ea-is where im at.. im just using println right now
11:29`cbpcan you use prn insteand of println
11:29justin_smithwhat is re-expn
11:29justin_smithI think re-seq re-expn is not returning the data structure you expect
11:29justin_smithdoes it have any grouping in it?
11:30ea-updated the gist with the whole thing.. re-seq is returnignt he vector
11:31ea-this app is: 1) read urls for access logs from a file 2) grab urls 3) parse into csv prepending with the url of where it came frmo
11:31ea-and re-seq seems to be dong just fine.. i just cant figure out how to prepend the vector retruned by re-seq with the url
11:32justin_smithea-> when you have multiple groups like that, re-seq returns a nested structure
11:32justin_smith,(conj (re-seq #".*(s).*" "this is a test") "hello")
11:32clojurebot("hello" ["this is a test" "s"])
11:32justin_smiththat is your problem
11:32ea-re-seq is returning one vector not nested, its fine
11:32justin_smithyou need to massage the output of re-seq
11:32justin_smithno it is not
11:33ea-oh, yeah you're right
11:33ea-hmm
11:33justin_smith,(re-seq #".*(s).*" "this is a test")
11:33clojurebot(["this is a test" "s"])
11:33justin_smithnested structure
11:33justin_smithif you conj to that, the conjed thing will be in the outer group, but not the inner
11:33ea-ok i just need to change my regex then
11:33justin_smithso the problem is you did not know the data structure re-seq was returning
11:33justin_smithconj was behaving properly
11:33ea-yup, ok thanks.. so now i just need to fix hte regex
11:34ea-ok this makes me feel better i was really confused ;)
11:34justin_smithglad we sorted it out, I was confused for a moment too, and I should know better
11:35ea-yeah.. thanks.. happen to have a good regex for parsing an apache log?
11:35justin_smithI bet org.apache.something has a log file parser class you can use :)
11:39justin_smithhttp://stackoverflow.com/questions/6623974/parsing-log4j-layouts-from-log-files
11:40justin_smithif you know apache's patternlayout config, you can use that to generate your parser
11:40justin_smithbonus, if the config changes your parsing still works :)
11:57francis_wolkejustin_smith: https://gist.github.com/francis-/7694998
11:57justin_smithfrancis_wolke: so you went for the for loop method, nice
11:58justin_smithanother option could be decompressing to /tmp
11:59justin_smithbut then you would need to manipulate the search path or make a symlink I guess
11:59francis_wolkejustin_smith: Yup.
12:02justin_smiththe for loop on lein classpath method would have the "advantage" of unpacking all your recursive deps
12:03justin_smithbefore an rgrep
12:03justin_smithmaybe that should be a separate function, if it should even exist :)
12:03justin_smithcheck for project.clj, query for unpack all deps into a subdir before rgrep
12:07francis_wolkejustin_smith: In that case you have to deal with other people, submit a pull request - ect. ect. Personally, I don't feel like doing all that. 10 minutes is about my maximum amount of time I'm willing to invest. Please don't let my negativity prevent you from creating the solution though.
12:07justin_smithwhy? you can just write a function that calls rgrep
12:07justin_smithbut sure
12:24francis_wolkejustin_smith: I had to kill emacs, and don't have our previous conversation. Iirc you wanted to tie into lein. I'm not familiar with what lein offers in terms of running functions on startup. Also, if at all possible, I'd prefer to do things from emacs, that way if at some point in the future I'd like to change something, it's a M-. or two away.
12:24francis_wolkeEmacs has more staying power that either the JVM or clojure. I'd prefer to invest in it, and it's model rather than a particular build tool.
12:24justin_smithfrancis_wolke: I was just suggesting running lein classpath from the shell
12:25justin_smithI almost have the script working actually, I will share when done
12:26justin_smithhttp://sprunge.us/LAhN
12:26justin_smithrun it from the top level of the project
12:26justin_smithputs everything under alldeps
12:26justin_smithjust run it before doing the rgrep
12:27justin_smithI think the only non-standard command in there is basename
12:27justin_smithit could be replaced with anything that takes a file and generates a good directory name out of the full path
12:27justin_smithbut I recommend having basename if you ever use the shell
12:28francis_wolkejustin_smith: Cool. But what happens when you dynamically pull in a dep with pomogranate?
12:28justin_smiththen you can fix the script
12:28justin_smithor do your version of the rgrep from the location that has the lib's jar
12:28francis_wolkejustin_smith: Exactly
12:29justin_smiththe advantage here is you can semi-instantly have all jars declared in project.clj open for investigation and recursive search
12:30justin_smithand in one tidy place so you can remove them again
12:30justin_smith*all jars required via declarations in project.clj, including nested dependencies
12:39poppingtonichi
12:40poppingtonicis there anyone who can guide me on how to connect Weka to my leiningen project?
12:40justin_smithpoppingtonic: have you found the maven repo and required it in your project.clj?
12:41poppingtonicjustin_smith: yes.
12:41poppingtonicIs that all there is?
12:41justin_smithwell that is the first step
12:41justin_smithI would have explained how to do it if you had not done it yet
12:42justin_smithI'd say find a simple example / tutorial that gets close to what you want to try, and translate from java to clojure jvm interop
12:42poppingtonicjustin_smith: ah, cool. I've downloaded v3.7.10, and extracted it. Where do I put weka.jar?
12:42justin_smithwait
12:42justin_smithI said require it in your project.clj
12:43justin_smithlein will just find it and hand it to you
12:44hyPiRionpoppingtonic: could you provide us with the URL to the WEKA maven repo?
12:44justin_smithso you want something like [nz.ac.waikato.cms.weka/weka-stable "3.6.6"] in the project.clj dependencies vector
12:44justin_smithhyPiRion: I think it is this: http://mvnrepository.com/artifact/nz.ac.waikato.cms.weka/weka-stable/3.6.6
12:44poppingtonicyeah, sec
12:45hyPiRionjustin_smith: yeah, except he has 3.7.10
12:45ohcibiok, I learned that a vector is a sequence, but why does (seq? [1]) return false?
12:45poppingtonicotoh, justin_smith jsut gave it...
12:45poppingtonic*just
12:46justin_smithohcibi: it is sequential, but does not implement the ISeq protocol
12:46hyPiRionohcibi: a vector is seqable/sequential, not a seq itself. It just means it can be converted to a seq
12:46ohcibiah
12:46ohcibiso what I want is sequential?
12:47seangroveHrm, what's a good strategy for generating api-keys?
12:47seangroveIncremental integer ids?
12:47hyPiRionohcibi: I would guess so, yes
12:47justin_smith,(doc sequential?) ; ohcibi
12:47clojurebot"([coll]); Returns true if coll implements Sequential"
12:47hyPiRion,(sequential? [1])
12:47clojurebottrue
12:48CookedGryphonseangrove: java.util.UUID/randomUUID perhaps?
12:48hyPiRionseangrove: Wouldn't random UUIDs suffice?
12:48poppingtonici see...
12:48seangroveCookedGryphon hyPiRion: That was going to be my serious suggestion. So that's not a known bad-idea?
12:49CookedGryphonseangrove: not as far as I know, I've used it for just that purpose in a production system, less chance of screwing it up and getting a collision than incremental IDs
12:49justin_smithpoppingtonic: if the version they have on the standard maven is not recent/ good enough, there are ways to do a local install
12:49justin_smithpoppingtonic: but everything just works better if you rely on the archives that exist
12:50poppingtonicjustin_smith: `lein deps` didn't complain about unavailability or anything...
12:50justin_smithoh OK
12:51hyPiRionseangrove: it's incredibly unlikely to get a collision, so unless you process incredible amounts of data AND need to be 120% sure there aren't any collisions, it should be okay
12:51seangroveCookedGryphon: Heh, the incremental ids was not meant in any seriousness, of course :)
12:51justin_smithif you have the artifact, then you can import it in a repl and start experimenting
12:51seangrovehyPiRion: Cool cool.
12:51poppingtonicSo I'm just writing a quick repl form to test everything
12:51CookedGryphonseangrove: oh yeah, I was thinking user names, heh, yeah it would be monumentally bad as an api key :P
12:52hyPiRionafaik it's way more likely to get SHA collisions in your git repo
12:52hyPiRionum wait, I think I take that back.
12:52justin_smithpoppingtonic: yeah, I would suggest opening a repl, importing the class, and trying to follow a simple tutorial
12:52justin_smithturning their code into clojure w/ interop
12:53poppingtonicjustin_smith: Eric Rochester's data analysis cookbook should be useful for that...
13:35xeqiBronsa: only issue with hooking the source reader up was the one you helped with about cljs bootstrapping
13:35xeqiits unfortunate that metadata can't go on java objects / primitives though
13:36xeqitook me a moment to realize why reading "3" didn't give back any info
13:38Bronsaxeqi: yeah, that's unfortunate but there's nothing I can do about that
13:41xeqiits a minor inconvience atm, and a work around is possible. It might be a bit uglier for making sourcemaps have more detailed info, but agreed nothing can be done about it at the tools.reader level
13:43tangrammerHi folks!, any advise about refactor clojure (so far only i'm searching for rename vars) in emacs[-live]
13:44tangrammerI'm trying to use https://github.com/joodie/clojure-refactoring but no success
13:44justin_smithm-x query-replace-regexp
13:44justin_smithor just m-x query-replace
13:44justin_smithalso m-x rgrep
13:44justin_smithtangrammer: that only works with slime, it appears
13:44justin_smithslime is out of date
13:45arrdemooh yeah
13:45tangrammerjustin_smith: thanks Justin, i'm using nrepl
13:45upwardindexI'm using enfocus.core/html but it seems that it remove capital letters in my attribute names. Anyone has had the problem?
13:45scottjtangrammer: clojure-refactoring hasn't worked well, even with slime, since clojure 1.1 or maybe 1.2
13:46tangrammerscottj: i dont know the cause, but i was trying without success
13:47tangrammerscottj: thanks, i'll try justin_smith trick
13:47justin_smithtangrammer: I am sure query-replace-regexp and rgrep are a poor substitute for true refactor tooling, but I don't really know what one expects from that, never having felt a need for it myself
13:47justin_smithbeyond rgrepping for the names and adjusting with a query-replace-regexp
13:48tangrammerjustin_smith: me neither, but i'm trying to understand the bmaddy 4clojure problem solution
13:48tangrammer(fn [c]
13:48tangrammer (let [f (fn [[b & c :as a] [y & z :as x]]
13:48tangrammer (if (= a x)
13:48tangrammer false
13:48tangrammer (if (= b y)
13:48tangrammer (recur c z)
13:48tangrammer (or (= c x)
13:48tangrammer (= a z)
13:49tangrammer (= c z)))))
13:49tangrammer p (fn p [c]
13:49tangrammer (if (= (count c) 1)
13:49tangrammer (list c)
13:49tangrammer (for [h c
13:49tangrammer t (p (disj (set c) h))
13:49tangrammer :let [s (cons h t)]]
13:49tangrammer s)))]
13:49tangrammer (reduce #(or % %2)
13:49tangrammer (map (fn [i]
13:49tangrammer (every? true? (map (fn [[x y]]
13:49tangrammer (f (seq x) (seq y)))
13:49tangrammer (partition 2 1 i))))
13:49tangrammer (p c)))))
13:49tangrammersorry!
13:49tangrammeri didn't know how to paste that
13:49justin_smithrefheap in the future
13:49justin_smith~refheap
13:49clojurebotrefheap is http://gist.github.com/
13:49amalloytangrammer: refheap.com
13:49hyPiRionclojurebot: forget refheap
13:49clojurebotHuh?
13:50hyPiRionmeh
13:50justin_smithtangrammer: yeah, for something like that query-replace will help make it more readable
13:50amalloyhyPiRion: you'll never get that one to work
13:50tangrammerjustin_smith: the code golf!
13:50amalloyit's inferred via refheap is paste, paste is gist, gist is gist.github.com, or some similar madness
13:50hyPiRionoh, wonderful
13:51amalloyclojurebot: forget refheap |is| paste
13:51clojurebotI forgot that refheap is paste
13:51justin_smithtangrammer: m-x query-replace c <return> input-collection <return>
13:51justin_smithfor example
13:51amalloy~refheap
13:51clojurebotrefheap is gist.github.com
13:51amalloyugh
13:51`cbp:)
13:51justin_smith~gist
13:51clojurebotgist is http://gist.github.com/
13:52hyPiRionclojurebot: forget gist |is| http://gist.github.com/
13:52justin_smith~paste
13:52clojurebotI forgot that gist is http://gist.github.com/
13:52clojurebotpaste is not gist.github.com
13:52tangrammerjustin_smith: it seems perfect for that!
13:52hyPiRion~refheap
13:52clojurebothttps://www.refheap.com/
13:52hyPiRionoh hey
13:53amalloyhyPiRion: i don't know which of us fixed him; i was PMing while you were doing it for all to see. but it does look fixed
13:53justin_smithtangrammer: also if you have a region, or are narrowed, it will only try to operate within that constraint
13:53Rayneslol
13:53mimieuxblist
13:53hyPiRionamalloy: Well, we'll see how long it will last
13:53RaynesIt's because someone changed 'gist' to be refheap at some point.
13:53RaynesSomeone decided to seek revenge, clearly. :P
13:54justin_smith~paste
13:54clojurebotpaste is not gist.github.com
13:54hyPiRionclojurebot: gist is <reply>http://gist.github.com/
13:54clojurebotOk.
13:54hyPiRion~gist
13:54clojurebothttp://gist.github.com/
13:54hyPiRion~refheap
13:54clojurebothttps://www.refheap.com/
13:54hyPiRionokay, done spamming
13:54justin_smith~eatpaste
13:54clojurebotTitim gan éirí ort.
13:55justin_smithtangrammer: also paredit helps with refactoring clojure, because for example C-k kills to end of line, then keeps killing until the last fragment killed is balanced
13:56justin_smithso you can easily move blocks around
13:57wuschelHi folks.
13:58hyPiRionhi there
13:58tangrammerjustin_smith: yes, i'm a bit familiar with paraedit, i started to use it from the first time I used clojure on emacs because I was used to use eclipse IDE
13:58wuschelHow hard is the transition from scheme to clojure if one is absolutely not into Java? Does it make sense to get a take on clojure-lang, or should I wait a bit and see how alternatives (e.g. Julia-lang) might turn out?
13:59wuschelI am using LightTable right now - but the Java package, building, deploying system really scare me, even when I use leiningne.
13:59justin_smithwuschel: I find the dep management in clojure better than my scheme experiences
13:59justin_smiththe ease of having specific per project versions
13:59justin_smith(of various deps)
14:00wuschel^^ True. Saw the in project.clj
14:00wuscheltat
14:00wuschelh
14:00wuschel(damn)
14:00justin_smithso I can have a project where I try clojure 1.6, and that does not interfere with my clojure 1.5 projects
14:01wuschelSounds good. I guess I still have little knowledge where those dependencies get downloaded, where clojure is stored, etc.
14:01wuschelAlso, how hard is it to include a java package? Say, I want to play with the chemistry development kit (http://cdk.sourceforge.net/).
14:01wuschelWhat would be the key steps?
14:01justin_smithfind out the artifact name and version
14:02seangrovewuschel: I avoided clj-jvm for a long time because of my dislike for the java ecosystem and did everything in cljs
14:02justin_smithput them in project.clj
14:02justin_smithrestart
14:02justin_smithdone
14:02arrdemthe hell... are we standardizing on gists rather than refheaps now?
14:02wei__for people using migratus: how do you debug a migration error? the stacktrace for java.sql.BatchUpdateException is pretty useless
14:02seangroveI wouldn't recommend it, but it's possible. And once you've got your head around lein, it's really quite nice in hiding almost anything to do with Java
14:02amalloyjustin_smith: C-k's paredit-behavior is nice, but you can move blocks around just fine (and more carefully) with the default C-M-k
14:02wei__my migration runs in plain sql but fails using migratus
14:02hyPiRionwuschel: lein places every dependency in the ~/.m2 directory for development, and if you want to uberjar the thing, everything is packaged in the standalone jar file
14:02justin_smithwuschel: to try a different version of the lib, just change the version in the dep
14:03seangrovewei__: Are you able to catch the exception and call .getNextMessage on it?
14:03wei__ah, so that's what it means. trying that now
14:03seangroveLet me see what the exact call is...
14:03wuschelhyPiRion / justin_smith: I should have a closer look on that one. Thank you. I am on Win64, but I guess it should be the same concept there.
14:04hyPiRionwuschel: yeah, in a .m2 folder in your home directory
14:04seangrovewei__: This is my migration library https://www.refheap.com/e6d0b7c7e09f6271d228891f5
14:04justin_smithwuschel: yeah, may not be .m2, but will be in $HOME - that exists under win right?
14:04wuschelIt is just that the thought of that giant , unknown Java blob scares me a bit (; Not that the blob would not be powerful.
14:04wuscheljustin_smith: yep.
14:04justin_smithwuschel: I just wrote a shell script today to open up all my deps so I could recursively seasrch them
14:05hyPiRionwuschel: There is a pain point if you want to use a java project, which is not in a maven/clojure repository. That's by design, but it is possible to bypass that through some lein plugin (which afaik is not hard to use)
14:05justin_smithwuschel: http://sprunge.us/LAhN
14:05wuscheljustin_smith: Thanks!
14:05wuschelhyPiRion: Ok, I guess I will read into that. Cheers!
14:06wuschelLeiningen all the way, then.
14:06hyPiRionapart from that, Leiningen should make stuff easy, although I understand the concern of "I don't understand this"
14:06justin_smithwuschel: the things that still bug me about clojure are the preference of gigo over early reporting of errors, and the long start up time, otherwise as a former lisper / schemer / ocaml user it is awesome
14:06hyPiRionIt's a legitimate concern, and it should be documented what Leiningen does behind the covers
14:07wuschelI agree 100%. The startup time sucks, and then as I said: without knowing Java it feels a bit like running in the dark.
14:07seangroveThe small pool of lispers is pretty interesting
14:07hammerandtongshttp://techbehindtech.com/2010/12/11/leiningen-adding-git-submodule-to-leiningen-project/ # was about to ask if there was some way to do this
14:07wei__seangrove: thanks for the insight and code. out of curiosity what does v0/migrate! look like-- are you using plain SQL migrations or some DSL?
14:07seangroveI see a lot of people from my chicken scheme and CL days in the clojure community from time to time
14:08amalloyhyPiRion: isn't there a good blog post that goes into a lot of detail about the things lein has to do?
14:08seangrovewei__: https://www.refheap.com/8d3a7c485cde7e370225d687f
14:08wuschelChicken scheme is great. My favourite so far.
14:08amalloyhttp://www.flyingmachinestudios.com/programming/how-clojure-babies-are-made-what-leiningen-is/ is what i'm thinking of
14:08wuschelIf only the concurrency would be better.
14:08amalloyquite long, but covers a lot
14:09justin_smithif you are looking for good concurrency, clojure is the right place
14:09wuschelThanks for the links (:
14:09hyPiRionamalloy: I think there was some guy who explained task through task
14:09wuschelI currently having one eye on Clojure, the other on Julia (;
14:10seangroveYeah, I don't mean to say that the universal migration is every-other-lisp -> clojure, just that there seems to be a fairly small community of lisp people, and they all kind of wander around inside the same lake
14:11amalloyper task? man, i don't want to know that level of detail
14:11hyPiRionamalloy: Well, many people have been burnt by the dependency resolution for example
14:13hyPiRionnot saying that a detailed explanation on how `lein repl` is necessary, just some of the magic parts
14:22amalloy"if version ranges are present, lein asks maven to find you a compromise version that nobody will be happy with" belongs in any article about dependency resolution
14:32ProfpatschI’m trying to configure ac-nrepl. It works in the REPL, but can I also use it in my clojure-mode buffer.
14:33yediwhile using paredit: i have a form but now i wanna wrap the form in say a str call (+ 1 2) => (str (+ 1 2)), what's the best/quickest way to go about it?
14:34yediwhat ive been doing is highlighting the entire form with C-space and then typing open paren
14:34justin_smithProfpatsch: do you have global-auto-complete-mode turned on?
14:34yediwas wondering if there was something quicker
14:34justin_smithyedi: cursor before form: ( + C-<right-arrow>
14:35justin_smitherr ( str C-<right-arrow>
14:35justin_smiththat is
14:35justin_smithcontrol right-arrow slurps the thing to the right
14:35justin_smithcontrol left-arrow spits out the rightmost thing
14:36yedioh tiiightt
14:36yedihm, i have to disable the mac keyboard shortcuts for control-rightarrow though
14:36justin_smiththere are other bindings
14:37scottj(+ 1 2|) C-u M-( str
14:37justin_smithC ) is the other option
14:37scottjs/C-u/C-M-u
14:38justin_smithalso, everything is much easier if you periodically figure out what your most frequent commands are, and find shorter / simpler keybindings for them
14:39justin_smithControl-c + char (for any single char on your keyboard) is specifically designed to only be bound by users for their personal favorite commands
14:40justin_smithso your first 26 most favorite commands should be very easy to access
14:41yediooh C-( and C-) works pretty well
14:41justin_smithyeah, but it's too bad about the chorded control / shift
14:42s_kilkhi all. I've just hit an odd issue with selmer, the 'with' tag doesn't seem to work properly: "Unrecognized tag found {% endwith %} on..." . the relevant code snippet is here: https://gist.github.com/ShaneKilkelly/7697218
14:42s_kilkany ideas?
14:43scottjjustin_smith: if you make your shifts double as parens, then for me it's just control + shift, not control + shift + paren
14:43justin_smithscottj: shifts double as parens?
14:44yedijustin_smith and scottj: so many thanks
14:44scottjjustin_smith: you can make shift keys behave as parens when not used as a modifier
14:44yedithat just changed the gam efor me
14:44scottjjustin_smith: steve losh cadet keyboard blog article
14:44justin_smithscottj: woah, cool
14:44yedinow i just need to step up my repl-fu
14:45scottjjustin_smith: I use xcape in linux. shifts are parens, caps lock is control and escape
14:45amalloyscottj: fascinating. you just made me find out what C-u M-( does, even if it was an accident
14:45justin_smithI will look into that shift-paren thing
14:46Bronsa(
14:47gf3Guys, what's a cool hack-day idea I can work on?
14:47gf3/cc bitemyapp
14:48amalloyjustin_smith, scottj: i think swapping number keys with symbols (ie, implicitly pressing shift when on the top row) is a nice alternative change to the shift-as-paren thing
14:49justin_smithhmm, one day hack... - a template that takes all your clojurescript and bundles it with the version of the csound synthesis language that runs inside chrome
14:49justin_smith(they ported the code to nacl)
14:49justin_smithhttp://vlazzarini.github.io/
14:50amalloyi don't quite get how shift-as-paren works - i know i often press shift and then decide i didn't want to shift anything after all. having that turned into a paren sounds like quite a pain
14:50justin_smithgf3 allows controlling a synthesizer in the browser via html5
14:50gf3justin_smith: o0o0o neat
14:50justin_smithso yeah, hack some clojurescript onto it :)
14:51Profpatschjustin_smith: Yep, indeed.
14:52Profpatschjustin_smith: I have global-auto-complete enabled.
14:53Profpatschjustin_smith: Does it work with you?
14:53justin_smithProfpatsch: try running ac-nrepl-setup
14:53justin_smithProfpatsch: affirmative
14:55justin_smithgf3: you can do real time livecoding synthesis like in overtone (though of course nobody has written the pretty clojure dsl for it yet), but the engine is your browser, so you can serve it up for others to use
15:28Profpatschjustin_smith: I get “Namespace not found.“
15:29justin_smithrequire the ns you are in in the repl
15:29justin_smithor load the file
15:29justin_smiththen you will start to get hints for it
15:29ProfpatschHm.
15:29justin_smiththat message means it is communicating with the repl, but the repl does not know yet about the function you are typing
15:30justin_smithtry constructing a call to a function in clojure.core, you should see ac do its thing
15:32ProfpatschWill do, thanks.
15:37allsystemsaregohi all, what do I need to add to my project dependencies in order to be able to use the keyword "defrel" in core.logic?
15:37seangroveHrm, was ring.middleware.stacktrace moved somewhere? I don't seem to be able to require it
15:38justin_smithallsystemsarego: if you have core.logic, you just need to refer to defrel
15:38justin_smithallsystemsarego: though using require with an alias is better
15:38allsystemsaregojustin_smith, I get an error when attempting to use defrel
15:38justin_smith(ns your-ns (:require [clojure.core.logic :as logic])) (logic/defrel ...)
15:38allsystemsaregooh
15:39allsystemsaregolet me try that
15:39Profpatschjusting_smith: It seams to work in clojure files. Do you use it with Clojurescript?
15:40justin_smithProfpatsch: nope, have not tried it in clojurescript
15:40ProfpatschOk, I guess there’s more to that.
15:40justin_smithit could be it doesn't know how to properly load or resolve the cljs namespaces
15:40ProfpatschBut it works now.
15:40justin_smithcool, glad you got it sorted out
15:42justin_smithseangrove: you could unzip your ring jar and see if it is anywhere in the ring/middleware/ directory
15:42justin_smithor just open it if your editor supports that
15:42seangrovejustin_smith: Sorry, it was just that I hadn't included ring/ring-devel in my deps list
15:42seangroveerr, in my project.clj
15:42justin_smithseangrove: oh, cool
15:43justin_smithseangrove: regarding finding things in your deps I wrote this today https://gist.github.com/noisesmith/7697007
15:43justin_smithso that I could rgrep in my project dependencies
15:43justin_smithwill I trade disk usage for transperency? today I will
15:44seangroveOh, interesting
15:44seangroveYeah, with emacs' find-grep-dired worked with jars transparently
15:44seangroveOpening and editing clojure jars like any other file? Awesome.
15:44justin_smithwait, find-grep-dired works with jars?
15:45seangroveNo, I *wish* it did
15:45seangroveEmacs can just open them and edit them fine, if only it could f-g-d them as well
15:45justin_smithahh, yeah, I couldn't find the functionality, thus this hack, after which I can run m-x rgrep and find things to my bliss
15:47justin_smithI will love it until the first time I check in all the sources to all my deps to git
15:47justin_smiththen I will hate it
15:49seangroveamend it to add to .gitignore ;)
15:49justin_smithheh, true
15:50si14I just keep getting "REPL server launch timed out" in my project. Is there any common way to debug huge (around a minute) REPL startup time?
15:51justin_smithsi14: try starting a repl from the terminal
15:51si14justin_smith: I'm already doing this
15:51justin_smithahh, ok
15:51justin_smithsi14: can I see your project.clj?
15:52si14justin_smith: PMed it to you
15:52si14justin_smith: it's a bit messy :)
15:52justin_smithlooking now, thanks
15:53si14I suspect that prismatic schema can be at fault
15:53justin_smithhmm, maybe try removing the nrepl-middleware entries?
15:53justin_smithtemporarily of course
15:54si14at least in my experience I've found that in *some* (didn't really find why or when exactly) cases heavy class-based hinting can cause huge loading/compilation times.
15:54si14justin_smith: trying this.
15:55justin_smithalso you could try ammending -main to start an nrepl server; then doing lein uberjar followed by java -jar (your jar)
15:55justin_smithif that works then it is definitely the compilation lag
15:56justin_smithalso, if that is the case you could also try lein compile for the aot
15:57justin_smithsince you do specify that
15:57justin_smithalso it could be that just leaving out the aot would reduce the bootup time
15:58si14justin_smith: removing lein middlewares had no affect. Moreover, CPU is at 100% during loading, so I suspect it's compilation
15:58si14the question is why compilation take sooo long?
15:59justin_smithbecause you have a pile of deps that godzilla would find threatening in size
15:59justin_smith:)
15:59si14I've tried to omit AOT in dev profile (line 69), doesn't help much
16:00si14justin_smith: I thought it's quite idiomatic for Clojure projects :)
16:00yediso simple yet brilliant: http://feedproxy.google.com/~r/KrisJenkinsBlog/~3/6qkWJ-mWM40/clojure-less-than-greater-than-tip.html
16:01justin_smithif only I'd seen that article 15 years ago when I was first learning common lisp
16:05seangroveUhg... well, might be time to finish off the google apps integration.... need to make sure I have plenty of alcohol for afterwards, though.
16:06seangroveFirst step: "Pay a small fee using Google Wallet if it's the first time you are publishing an app on the store"
16:06seangroveLovely.
16:07seangroveGuessing ~$100...
16:07hyPiRionguessing 2 cents
16:08mr_rm&(clojure.data.json/read-str "{\"name\":\"Bob\"}")
16:08lazybot⇒ {"name" "Bob"}
16:09mr_rm&(clojure.data.json/read-str "{\"name\":\"Bob\"}" {:key-fn keyword})
16:09lazybotjava.lang.IllegalArgumentException: No value supplied for key: {:key-fn #<core$keyword clojure.core$keyword@5d8bde>}
16:09baglAnyone using Emacs' midje-mode? I can run in repl midje test just fine, I can use midje-mode commands for showing/hidding facts, but I cannot check them (C-c .). It just prints "Mark set" in statusbar... Any ideas?
16:09justin_smith&(clojure.data.json/read-str "{\"name\":\"Bob\"}" :key-fn keyword)
16:09lazybot⇒ {:name "Bob"}
16:09mr_rmjustin_smith: doh!
16:09mr_rmjustin_smith: i could swear the doc said to pass it as a map
16:09Bronsaeeew keyword args
16:10mr_rmnope, i was wrong
16:10mr_rmjust says to pass the pairs
16:10mr_rmthanks, justin_smith
16:10justin_smithnp
16:11justin_smithin general, if your maps are well constructed and you see "no value supplied for key" you called a function that expects an &keys
16:13mr_rmjustin_smith: makes sense
16:14tommo__can some1 explain the meaning of the [[]] in a function such as this: (fn [[a b]] [b (+ a b)])?
16:15justin_smithtommo__: destructuring
16:15justin_smith,((fn [[a b]] (+ a b)) [1 2])
16:15clojurebot3
16:15justin_smithtommo__: it mirrors the structure inside a collection
16:15justin_smithso you can concisely access the contents
16:15justin_smithtommo__: also works for maps
16:16justin_smith,((fn [{a :a b :b}] (+ a b)) {:a 1 :b 8})
16:16clojurebot9
16:16tommo__ah i see, ty
16:17justin_smithI like it because there is less noise in the function body that way, so fewer places bugs can hide
16:24patrkrishi folks. is the prim-seq function shown in the following URL built in to ClojureScript?
16:24patrkrishttps://github.com/swannodette/swannodette.github.com/blob/master/code/blog/src/blog/utils/dom.cljs#L39
16:26seangrovepatrkris: Yes
16:26justin_smithpatricko1: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L716
16:26justin_smiththat is where it is defined
16:27patrkrisah ok
16:27seangrove(inc justin_smith) ; Even though I got there first.
16:27lazybot⇒ 13
16:27justin_smithheh
16:28justin_smithsadly, most of the question askers here don't even know how to inc somebody
16:28seangroveI think technomancy is by far the channel leader
16:28patrkris(inc justin_smith)
16:28lazybot⇒ 14
16:28justin_smith$karma technomancy
16:28lazybottechnomancy has karma 86.
16:29justin_smith$karma seangrove
16:29lazybotseangrove has karma -2.
16:29justin_smithyou must have gotten so much it rolled over
16:29seangroveHaha, I'm bringing down the channel average here
16:30seangrove$karma bitemyapp
16:30lazybotbitemyapp has karma 14.
16:30seangrove-.-
16:30justin_smith$karma lazybot
16:30lazybotlazybot has karma 20.
16:30patrkrisI guess there is no separate documentation site for ClojureScript's API?
16:30justin_smith$karma clojurebot
16:30lazybotclojurebot has karma 33.
16:31seangrovepatrkris: No, but that's a good idea
16:33seangroveMaybe clojuredocs, but with "This function is available in : clojureclr, clj-jvm, cljs", etc.
16:33patrkrisyeah
16:34patrkriswho, except for David Nolen, would ever have known about prim-seq? ;-)
16:34justin_smithpeople who read the source for fun
16:34patrkrisbut i could've just grep'ed clojurescript.git
16:34seangroveBut I learned it from dnolen
16:35patrkrisyes... I guess there's nothing inherently wrong with having to read the source code :)
16:36seangrovepatrkris: How did you find you needed it?
16:36patrkrisbut I'm on my iPad and too lazy ;-)
16:36s_kilkhi all. im getting a strange error with the selmer html rendering library. I'm using the 'with' tag, but the page is blowing up on the corresponding 'endwith' tag. error: "Unrecognized tag found: {% endwith %}"
16:36si14justin_smith: thank you!
16:36patrkrisjust reading through David's blog about core.async and UI's
16:36justin_smithsi14: what worked?
16:37si14justin_smith: nothing. just wanted to thank you for help :)
16:37justin_smithso its still broken?
16:38yedi(inc justin_smith)
16:38lazybot⇒ 15
16:40tommo__which clojure book do you guys reccomend
16:41Pupnikclojure programming
16:41seangroveI've never found much use from programming language-specific books
16:42yediugh, everytime i visit prismatic i lose hours of valuable time
16:42seangroveOL, L.I.S.P., LoL, etc. all were more interesting for general concepts, and then blog posts, example projects, and source code for language-specific implementation details
16:42tommo__me neither, im a java dev by trade but i want to go into clojure with a fresh mind
16:43seangroveyedi: Is it that good? I've never used it.
16:45yediseangrove: yea, i'm a big procrastinate by reading kinda guy and i have to make sure to never visit prismatic if i have shit i wanna get done
16:46si14justin_smith: it's still slow. It works, but REPL starts before timeout in 1/2-1/3 of my attempts.
16:46yedii actually visit hn way more regularly cuz i know there'll only be a tiny # of articles i care about on the front page
16:48seangroveyedi: Hrm, that's pretty interesting.
16:48seangroveAs the accuracy of prismatic(s) improve, they cross a threshold and become damaging...
16:51algernonprismatic is bad. it makes it far too easy to sit at the computer for half a day, and not see anything less than very interesting.
16:52seangrovealgernon: Well, we knew this day would come.
16:53algernonsee you in a week! ;)
16:55ohcibiis there a built in faculty function?
17:00bitemyappseangrove: http://clojurewiki.com/
17:00bitemyapptechnomancy: http://clojurewiki.com/
17:00bitemyappgf3: what's up?
17:01bitemyappgf3: let me know if you still need a hack-day idea :)
17:03seangrovebitemyapp: Looks like it could be good. It'd be nice if wikis could have structured data/models though
17:03seangroveA standardish-schema for functions in this case
17:03bitemyappseangrove: yes, it would. Bonus is that it's git-backed, so if somebody really hates websites I can give them a git account.
17:04seangroveInstead of just making a new document, you'd make a new document/fn-def, put in the structured data, and you'd be able to link to it just like another doc
17:06seangrovebitemyapp: Looks like a decent start. Are you thinking about this superseding clojuredocs for function doc string, examples, clojure versions, and platforms?
17:06bitemyappseangrove: I'm agnostic to the idea.
17:07bitemyappI'm happy if it does, fine if something else does a better job. API documentation isn't a core strength of wikis, this is more for folklore, informal knowledge, speculation, discussion, gathering, categorization, etc.
17:07bitemyappbut if the wiki becomes the home for that, so be it.
17:07arrdembitemyapp: what is this?
17:07bitemyapparrdem: a wiki for Clojure users!
17:07seangrovebitemyapp: That sounds like a good middleground for me.
17:07bitemyappseangrove: in some places, I link out to ClojureWerkz's tutorials because their work is peerless in the subject described.
17:07bitemyappin others, I simply write out the material.
17:08seangroveYeah, I went through a bit and saw that
17:09justin_smithbitemyapp: I hacked together a script for when you just wish you could grep -r (or m-x rgrep) through all your dependencies https://gist.github.com/noisesmith/7697007
17:10bitemyappjustin_smith: that's quite handy, thank you!
17:10bitemyappI need to automate the backups for the wiki...
17:11justin_smithis git tag enough, or would you clone it too?
17:11bitemyappjustin_smith: when I run it, I get "unzip: cannot find or open" and then a dump of my directories/.m2
17:11arrdembitemyapp: if you copied this from the clojure toolbox then the parsers article needs fixing
17:11bitemyappjustin_smith: I rsync the whole dir.
17:12bitemyapparrdem: it's not copy-paste and it's not complete.
17:12justin_smithbitemyapp: prereqs are the unzip command, and the basename command
17:12bitemyappjustin_smith: I have both.
17:12justin_smithodd
17:12justin_smithmind sharing the output of lein classpath?
17:13justin_smiththat is how it is generating the list
17:13bitemyappjustin_smith: https://www.refheap.com/21337
17:14justin_smith cool, can I see the lein classpath output it generates that from?
17:14justin_smithoh
17:15justin_smithsomewhere \n turned into n
17:15justin_smiththat is what it is doing
17:15justin_smithin the sed, the s/:/\n/g is acting like s/:/n/g
17:16justin_smithmaybe it is an osx sed incompatibility
17:16bitemyappthat's a common issue.
17:16bitemyappsadface :(
17:17justin_smithI've fixed sed unportability before
17:18justin_smithmind telling me the variation of 'lein classpath | sed -e "s/:/\n/g"' that outputs one thing per line?
17:18justin_smithsince my osx box is at work
17:19bitemyappjustin_smith: looks like one big blog.
17:19bitemyappblob&
17:19bitemyappblob*
17:19bitemyapp/Users/callen/code/bulwark/testn/Users/callen/code/bulwark/srcn/Users/callen/code/bulwark/dev-resourcesn/Users/callen/code/bulwark/resourcesn/Users/callen/code/bulwark/target/classesn/Users/callen/.m2 etc etc
17:19justin_smithyeah, that \n needs to be something else
17:19justin_smithbut I am not sure what
17:20justin_smithbitemyapp: lein classpath | tr : '\n'
17:21justin_smithdoes that do it?
17:22bitemyappjustin_smith: that works perfectly.
17:22bitemyappjustin_smith: this would appear to be a lesson in using the simplest tool possible.
17:22justin_smithawesome, gist updated
17:22justin_smithyeah, I so rarely need to use tr, but lesson learned!
17:25bitemyappjustin_smith: ding http://clojurewiki.com/expand-deps
17:25bitemyapp~clojurewiki is http://clojurewiki.com/
17:25clojurebotOk.
17:25bitemyapp~wiki
17:25clojurebotwiki is http://en.wikibooks.org/wiki/Clojure_Programming
17:25bitemyapp~wiki is also http://clojurewiki.com/
17:25clojurebotAck. Ack.
17:25bitemyapp~wiki
17:25clojurebotwiki is clojurewiki
17:25bitemyapphrm.
17:28allsystemsaregoIs (require 'pldb) the correct way to import the pldb dependency at the repl?
17:28justin_smithallsystemsarego: it probably has a project name
17:29allsystemsaregothe one on github?
17:29justin_smithtry pldb.logic
17:29allsystemsaregothreatgrid?
17:29allsystemsaregook
17:29justin_smithpldb is the name of a project, the ns is called logic
17:29justin_smith(require 'pldb.logic)
17:30allsystemsaregoI tried it, and it says No such var: l/contains-lvar?
17:30justin_smithif you look at their source they refer to clojure.core.logic as l
17:30justin_smithit could be you have the wrong version of clojure.core.logic for pldb
17:31allsystemsaregook
17:31justin_smithpldb depends on version 0.8.3
17:31justin_smithdo you require some other version in your project.clj?
17:31allsystemsarego0.8.5
17:31allsystemsaregoso yeah
17:32justin_smithtry downgrading temporarirly
17:32allsystemsaregoI'll go back to my project.clj
17:32justin_smithit could be clojure.core.logic dropped or renamed the function pldb needs
17:32allsystemsaregook, thanks
17:33justin_smithalso pldb is so small, updating it to a newer core.logic may actually be pretty easy
17:33justin_smithif you feel ambitious
17:33allsystemsaregothat's for when I'm more comfortable with clojure
17:36jouiswalkeris there a way to prevent refreshing the page from resending post data?
17:36jouiswalkeri'm using compojure, but it isn't obvious to me
17:37justin_smithallsystemsarego: https://github.com/clojure/core.logic/commit/1375f34ef42ee6b288ccb110b5c8c4aeb87a39a9#diff-30dcdb8bdb2cc62ab14e86f0d21703d7 they merged in pldb
17:37justin_smithit is part of core.logic now
17:37bitemyappI feel like I have marbles in my mouth when I write on Twitter.
17:37bitemyappis there a Twitter++ where I get 280 characters?
17:37indigobitemyapp: There's your next project!
17:37indigo;P
17:37seangroveA working UI is a beautiful thing.
17:38allsystemsaregojustin_smith, thanks
17:38seangroveThe implementation is slowly catching up as well.
17:38bitemyappindigo: http://clojurewiki.com/ signup and add things please :)
17:38justin_smithjouiswalker: you can dynamically create a "request key" each time you render and send the page
17:38bitemyappseangrove: I actually didn't add carica on purpose, if you can believe it :P
17:38justin_smithjouiswalker: and not do anything if it comes in with a request-key you have not issued, or already served
17:39indigoA Clojure wiki written in Haskell, eh
17:39justin_smithit would be a hidden numeric parameter or random string in the form body
17:39seangrovebitemyapp: Well, are you going for an exhautive resource, an opinionated one, or an exhaustive resource with opinionated commentary?
17:40seangrovebitemyapp: Also, ridiculous feature request, but allowing read/write access to it from the channel via a clojurewiki bot would be wonderful
17:40justin_smithjouiswalker: on further consideration, don't use a number for the request key, use a uuid
17:40jouiswalkerjustin_smith: i'll give this a try.
17:40jouiswalkerjustin_smith: thanks!
17:41justin_smithnp
17:41seangroveBut you probably need more structure than a wiki easily provides to do it properly
17:41JaredRsup, justin_smith ?
17:41bitemyappseangrove: neat idea.
17:41justin_smithJaredR: Sup
17:41bitemyappseangrove: I'm not opinionated about the form the wiki takes. If people add stuff I left out, I won't remove, just add commentary.
17:43seangrovebitemyapp: I suppose ideally it would have 1.) structural data that 2.) can be edited and expanded as in any wiki and 3.) accessed via an api and finally a 4.) RapGenious overlay to allow meta-conversations to happen cleanly and clearly.
17:44seangroveAnd a unicorn, while I'm dreaming.
17:44bitemyappseangrove: a rapgenius-esque open source wiki is something I've wanted for awhile.
17:45bitemyappseangrove: the wiki is HApps (Haskell) based and backed by git, it's not out of the question.
17:47justin_smithwhat is rapgenius' backend? google is failing me
17:47seangroveRails
17:47bitemyappjustin_smith: a poorly maintained Rails application on Heroku
17:47justin_smithahh ok
17:47seangroveTom is a crazy skilled coder though.
17:47bitemyappdev-ops and coding aren't skills that always intersect.
17:50bitemyappseangrove: I noted that environ was recommended and demonstrated a pattern here: http://clojurewiki.com/Configuring%20Clojure%20Applications
17:53arrdemoh cool clojure-doc got a new theme since last I looked...
17:53indigoHm, I should expand the Clojure with vim page
17:53indigoBecause vim is awesome
18:03freshhawkif I have: (def x 'toUpperCase) and I want to use that java method ... (. "foobar" x) isn't going to work
18:03freshhawkhow does one call java methods dynamically with the '.' special form?
18:04freshhawkor without the '.' special form, but I'm not very good with the java interop
18:10justin_smithfreshhawk: you can use a macro, or use reflection
18:10justin_smith,(doc .)
18:10clojurebotExcuse me?
18:11justin_smith,(clojure.repl/doc .)
18:11clojurebotPardon?
18:11justin_smithhmm
18:11justin_smithhe appears not to like that call, but it works in a repl
18:11justin_smithfreshhawk: . needs to have its arguments resolved at compile time
18:12justin_smithas far as methods are concerned at least
18:12adhollanderseangrove: if you want to see a wiki platform with structured data, take a look at Semantic MediaWiki. Granted, it inherits all the cruftiness of Mediawiki...
18:12coredhello
18:13coredI'm reading Functional Programming for object oriented programmers, and found out an exercise which I have to implement the second function here is my implementation of that particular function (def second (fn [list] (nth list 1))) and here is the solution from the author (def second (fn [list] (first (rest list))))
18:14coredit's seems to me that my implementation is clear, but the author took another approach, is there some sort of best way to implement that or something?
18:14freshhawkjustin_smith, it will have to be reflection. So the method objects return from reflection are what I will be using?
18:15justin_smithhttps://groups.google.com/forum/#!topic/clojure/YJNRnGXLr2I here's a thread on the clojure ml that is apropos
18:15justin_smithyou really won't know any method names until runtime?
18:16justin_smithbecause otherwise you can do (def as-string #(.toString %)) and pass in as-string as a function to call
18:16justin_smithfor example
18:17freshhawkjustin_smith, it's a big ugly soap based api so I unfortunately don't
18:17justin_smithgotcha
18:17justin_smitheval is another option
18:17freshhawktrue
18:17justin_smithwhich is effectively another compile time in the middle of runtime :)
18:18bitemyappnow to play holiday restaurant roulette
18:19freshhawkjustin_smith, this thread is gold. thanks very much!
18:21bitemyappjustin_smith: added that to the wiki.
18:21bitemyapphttp://clojurewiki.com/FAQ
18:22justin_smithawesome
18:24si14awesome. my friend's lein can't even start.
18:25si14just timeout every time.
18:25justin_smithsi14: still?
18:25si14justin_smith: yeah
18:25justin_smithdid you try running lein compile first
18:26justin_smithso the aot stuff would be out of the way
18:26justin_smithor can it not even do the compile task?
18:28si14justin_smith: yes. doesn't help much
18:31si14meanwhile, SpaceX started countdown again.
18:31grim_radical9 minutes!
18:32si14I was impressed by today's shutdown instead of miserable explosion on launchpad.
18:33si14I mean, a lot of rockets just exploded without this sort of self-contro
18:33si14*control
18:40justin_smithsi14: I just thought of one more thing you could try, the standard voodoo option if things are acting weird
18:40justin_smithlein clean
18:40justin_smithcan't hurt
18:43si14justin_smith: it started at 10th or something attempt, but I'll try lein clean on the next restart, thank you :)
18:43justin_smithare there any other symptoms? running out of memory maybe?
18:45si14justin_smith: no, just very slow startup
18:46si14I'll run a profiler eventually.
18:46si14...and SpaceX aborted today's launch.
18:47si14:(
18:47johnjelinekhihi all
18:47JaredRstupid question... is there an editor for Clojure that has autocomplete and such?
18:47johnjelinekhow's it goin'?
18:47johnjelinekJaredR: Emacs
18:47JaredR*sigh* I was afraid you were gonna say that...
18:47JaredRVI GODDAMNIT ;)
18:48Licenserisn't Lighttable doing that?
18:48johnjelineklololol
18:48JaredRI just downloaded lighttable... it doesn't seem to have autocomplete, insert, etc.
18:48johnjelinekJaredR: what's wrong with Emacs? you can use Emacs in evil-mode to get your vim bindings working
18:49JaredRI have memory issues and having to refer to documentation every 10 seconds is exhausting, so I tend to rely on code insight and autocomplete to help me with my productivity
18:49johnjelinekJaredR: I'm in the same boat
18:49johnjelinekbut I just taught myself emacs today for clojure
18:49JaredRyeah?
18:49JaredRLOL OK
18:50johnjelinekyea
18:50JaredRwell, I'm on OSX so using emacs isn't the end of the world... *coughVIisbettercough*
18:50johnjelineklol
18:50johnjelinekditto and ditto
18:51johnjelinekI am having a problem though with running unit tests in emacs
18:51johnjelinekanyone available to help out?
18:52johnjelinekI created a brand new lein project
18:52johnjelinekwhen I compile the default test it shows "#'command-line-args.core-test/a-test"
18:53johnjelinekwhich I imagine is correct
18:53JaredRseancorfield: you there somewhere?
18:53johnjelinekbut when I run the tests, I get a compile error
18:53johnjelinekclojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: clojure.test.mode, compiling:(/private/var/folders/rh/wxb4f7d50151_tzpn2z_whdh0000gp/T/form-init5102129192986648799.clj:1:1) at clojure.lang.Compiler.analyze (Compiler.java:6380) ....
18:54johnjelinek$ lein --version
18:54johnjelinekLeiningen 2.3.4 on Java 1.7.0_45 Java HotSpot(TM) 64-Bit Server VM
18:54johnjelinekany thoughts how to troubleshoot?
18:56johnjelinekfixed it!
18:56johnjelinekwewt!
18:56johnjelinekI had to do cider-jack-in after opening a project file
18:56johnjelineknot before
19:03JaredRjohnjelinek: awesome! love it when something works out!
19:15justin_smithjohnjelinek: it decides what project to launch based on what file / directory you have open
19:16johnjelinekI've got a new question, I'm trying to change the namespace of the REPL buffer to the one of the file I'm in
19:16justin_smithso you otherwise get a default setup, that is not connected to your project
19:16johnjelinekso I try C-c M-n
19:16johnjelinekbut it says "Symbol's function definition is void: cider-repl-set-ns"
19:16justin_smithjohnjelinek: sounds like your cider is not up to date, or cider is not ready for prime time
19:16justin_smithcould even be both :)
19:16justin_smithnrepl still works
19:16johnjelinekhow do I check my cider version?
19:17justin_smithM-x package-list-packages
19:17justin_smithit will also let you update the list, and check to update packages that have new versions from that screen
19:19johnjelinekjustin_smith: I have 0.3.1 installed
19:21johnjelinekhow could I do it in the nrepl?
19:21justin_smiththere is an older nrepl.el package
19:21justin_smiththat cider is replacing
19:21johnjelinekooh, I see
19:21justin_smithbut it seems cider may have incomplete coverage right now
19:21johnjelinekit should have this functionality though
19:22justin_smithpart of the change is just that clojure nrepl / emacs nrepl.el was confusing people
19:22johnjelinekhttp://clojure-doc.org/articles/tutorials/emacs.html indicates cider should work fine
19:22justin_smitheither your cider is out of date, or they are wrong
19:23justin_smithyou can switch the ns in the repl using in-ns
19:23johnjelinek0.3.1 is latest
19:23justin_smithso they are wrong
19:23johnjelinekcouldn't it be something else with my setup that could be borking it?
19:23justin_smithseriously doubt it
19:23justin_smithit is trying to call a function that does not exist
19:24justin_smiththat is pretty cut and dried
19:24justin_smithin the repl buffer: (in-ns 'my.namespace)
19:24justin_smiththat is all you need to do
19:24justin_smithit's not complicated, you don't need the editor to do it for you
19:25justin_smithpersonally I don't even use in-ns
19:25justin_smithin the repl I run (require '[my.ns :as n])
19:25justin_smiththen I call (n/whatever)
19:25johnjelinekok, I'll try that
19:25justin_smithyou may need to ammend that to (require '[my.ns :as n] :reload) if you save changes
19:27justin_smithnotice that the content on that clojure-doc page is listed for 2012
19:27johnjelinekcool, it worked
19:27justin_smithit was just a search and replace of nrepl / cider
19:27justin_smithand the docs are not accurate yet, clearly
19:27johnjelineklol, if it's 2012, you'd think cider would only get better from then
19:27justin_smithcider did not exist in 2012
19:27justin_smithso I'm saying the docs are not yet correct for cider
19:28justin_smiththey switched some strings in the docs, without checking if those commands actually work with cider, I bet
19:29johnjelinekahh, ok
19:29johnjelinekgotcha
19:33johnjelinekjustin_smith: added an issue to the guide: https://github.com/clojuredocs/guides/issues/149 thanks :)
19:42justin_smithnp
19:54dabdstole 2 functions from onlisp: https://gist.github.com/dabd/7700137 please comment on style or better ways to define them. ty
20:02justin_smith,(reduce identity nil nil) ; dabd
20:02clojurebotnil
20:02justin_smithyou don't need to test (seq coll)
20:02justin_smithreduce handles empty inputs just fine
20:03justin_smiththough where you want to return [nil nil] you could use or
20:03dabd,(reduce #(if (f %1 %2) %1 %2) nil)
20:03clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: f in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:04dabd,(reduce #(if (> %1 %2) %1 %2) nil)
20:04clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox$eval89$fn>
20:04justin_smithyou need the init val
20:05dabdcan you post youre definition pls?
20:05dabdyour*
20:05justin_smithdabd: working on it
20:07justin_smithdabd: https://gist.github.com/noisesmith/7700208
20:07justin_smithfirst one updated, and works
20:08justin_smithfor nil or valid inputs
20:11justin_smithboth updated and working
20:12justin_smithoops, one bug in the latter
20:12dabdthe most fn may raise an exception depends on how the function f handles a nil value
20:12justin_smithyeah, that is the bug
20:12justin_smithfixing
20:14dabd(f h) -> (when-not (nil? h) (f h)) seems to work
20:14justin_smithI was looking for something more concise
20:15coventry(doc fnil)
20:15clojurebot"([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."
20:15justin_smithbecause otherwise the if seq coll version makes sense
20:15coventryDoesn't quite work.
20:15justin_smithcoventry: we don't know a-priori what arg to give f
20:15justin_smithright, I tried that :)
20:18justin_smithhttps://gist.github.com/noisesmith/7700208
20:18justin_smithit's a judgement call whether my version of the second is better
20:18justin_smithI am pretty sure my version of the first is
20:18justin_smiththat if could be an and
20:18justin_smiththat may help clarity wise
20:19dabdends up being almost as verbose as the when-not nil? version
20:19justin_smithright
20:22justin_smithI'd say use the destructuring so you don't have to call first / rest, but leave the check on seq coll
20:22justin_smithfor the second one
20:23dabdok thanks
20:23justin_smithhttps://gist.github.com/noisesmith/7700208 updated
20:24justin_smith(I also changed alignment of the last two args of reduce, because I think the extra line is worth the clarity)
20:57coventryJust had a programming interview where the problem was to implement a robot moving on an integer grid. Wrote it in nice functional style, so it hurt a little when the interviewer wanted me to make it throw an exception when it hit an obstacle. :-)
20:58justin_smithhah
20:58justin_smithrobots hitting obstacles? how totally out of the ordinary, better throw an exception!
21:01emaphisI take exception to hitting obstacles.
21:05dsrxmove :: Location -> Either Collision Location
21:05dsrxbleh add a direction in there somewhere too
21:07emaphisDepends on how much beer I've had.
21:08dsrxhmm, so it's a function of BAC too ;D
21:08dsrxI met a guy at thanksgiving dinner named "T. Scala"
21:08dsrxmade me wonder if he had a cousin "L. Clojure"
21:09emaphis:-)
21:09justin_smithQ. PHP never gets invited anywhere
21:10justin_smith(it's a vietnamese name)
21:11hyPiRionYou'd be surprised when you hear about Haskell Curry then.
21:53`cbpbitemyapp: The heckle thing kinda works now lol. It feels kinda silly though
21:54bitemyapp`cbp: why?
21:54bitemyapp`cbp: do you need the ability to ignore namespaces or what?
21:54`cbpno, i don't know it just does :D
21:54`cbpJust need to revert clojure.test now to show successes instead of failures
21:55`cbpand uh test selectors too i guess
21:55`cbpoh and mutate more stuff
21:56bitemyappheh
21:56bitemyapp`cbp: sounds fun :)
21:57`cbpbitemyapp: https://www.refheap.com/21341 :P
21:57`cbpthat -231 is randomized stuff
22:02bitemyapp`cbp: oh no, you should just change functions to throw an exception
22:02bitemyapp`cbp: much more reliable that way, and you can use the exception class to determine if it was caused by eris.
22:02bitemyapp(ErisException. "Are you testing this function?")
22:02`cbpwell i didnt think of that :)
22:02`cbpbut randomizing stuff is more fun
22:03bitemyapp`cbp: you really shouldn't randomize outputs
22:04bitemyapp`cbp: seriously, it'll miss stuff and be harder to understand
22:04bitemyapp`cbp: better to just use an exception class.
22:04`cbpaw
22:07coventryThe trouble is, you can only randomize one element at a time to effectively test coverage. So you probably do need to do it a higher granularity for it to be efficient.
22:11`cbpI think i had it all wrong
22:11`cbpoh well time to rewrite
22:12logic_progare there protocols for (1) map, (2) atom ? In particular, I'd like to implement my own datat structures that can be used in place of standard maps/atoms
22:12coventry`cbp: You might want to take a look at ztellman's sleight. It's useful for this kind of thing.
22:13llasramlogic_prog: For JVM Clojure most of that pre-dates protocols, but there are interfaces, and you can define types implementing those interfaces
22:14logic_progllasram: and if I do so, I can then use assoc/get/update aswell as @/swap! on them ?
22:14bitemyappcoventry: that may not be a good fit.
22:14logic_progllasram: if so, if ther sample code I can look at?
22:14llasramlogic_prog: Not `swap!`, but yes to the rest
22:15coventrybitemyapp: Actually, yeah, if he wants to break things at the function level. I was thinking that looking at what he has on github now.
22:16llasramlogic_prog: Someone had a macro which simplified implementing a map-like thing... Who/where it was eludes me at the moment
22:16bitemyappcoventry: would not robert.hooke or alter-var-root suffice?
22:16bitemyapp(fn [] (throw (MyException. "blah")))
22:16coventrybitemyapp: Yeah, for breaking things at the function level.
22:16bitemyappwell that's all that matters.
22:17llasramlogic_prog: For references, `@` is just IDeref and optionally IPending
22:17justin_smithI just answered a stack overflow question about a library I work on. It is a weird feeling.
22:17logic_progllasram: noted
22:17coventryIt seems rather inadequate, actually. You don't learn which forms within each function are being exercised by your tests, that way. But it's the only way for a strategy like heckle to run in reasonable time.
22:17logic_progllasram: if you don't mind explaining; why is swap! different from @ ?
22:18llasramlogic_prog: Because `swap!` is just for atoms and is explicitly defined as such. Check out the source
22:19logic_progllasram: how shold I be searching the code? https://github.com/clojure/clojure/search?q=defn+swap%21&amp;ref=cmdform is rather useless
22:19logic_progso I must be doing something wrong
22:20justin_smithlogic_prog: (clojure.repl/source swap!)
22:21logic_progjustin_smith: let me try that
22:21bitemyappcoventry: functions alone would be a substantial improvement. branches/forms could follow later *after* something working is released.
22:22logic_progjustin_smith: worked; thanks!
22:22coventryI just don't understand what this strategy gets you over something like cloverage, which actually will look at coverage at the level of forms.
22:22bitemyappcoventry: http://clojurewiki.com/ a wiki page a day keeps the bitemyapp away.
22:22bitemyappcoventry: how can cloverage understand which branches get exercised?
22:22`cbpooh a wiki!
22:22bitemyapp`cbp: yeah I finally launched one.
22:23bitemyapp`cbp: make an account and write stuff :D
22:23coventrybitemyapp: Tracing instrumentation. https://github.com/lshift/cloverage/blob/master/cloverage/src/cloverage/instrument.clj
22:29coventryAnd, if the sadomasochism of heckle's marketing is appealing, cloverage is actually way more invasive and controlling. :-)
22:30coventry"I'm going to watch your every thought." :-)
22:43bitemyappcoventry: is lshift or Jacek the official version of cloverage?
22:47bitemyappcoventry: this does seem nice.
23:02concurhey
23:03concuris there any way to paint an array as pixels in seesaw?
23:09glosolihmm what would you suggest for database migration?
23:11bitemyappglosoli: http://clojurewiki.com/Libraries#database-migrations
23:16justin_smithwhat is the predicate to check if you can use a thing as the first arg to get?
23:17justin_smithfor some reason I expected associative? to exist
23:17justin_smithnever mind, it does
23:17bitemyappjustin_smith: had me proper baffled for a moment there.
23:17justin_smithnot nearly as confused as I was, I am sure
23:18justin_smithalmost done with a lein plugin that encrypts / decrypts edn data
23:18justin_smithprobably mostly useful for config
23:18justin_smithalso regular functions to suck that data into your config, of course
23:19justin_smithno more unencrypted passwords in git, yay
23:21bitemyappjustin_smith: that's a good idea.
23:22justin_smithI've been wanting it for a while, the holdup was making it convenient to use
23:22justin_smithbecause if it is annoying it may as well not be there because people won't use it proplerly
23:23justin_smithso I have lein crypt show - outputs creds (looks for passwords in command line, then env, then a dotfile in home dir, then fallback to project.clj
23:23justin_smith)
23:23justin_smithlein crypt store
23:23cemerickjustin_smith: FWIW, get accepts a lot more than things that are associative
23:23justin_smithand lein crypt update (which acts like swap
23:24justin_smithcemerick: OK, associative is what I wanted actually :) thanks
23:24cemerickassociative? indicates that `assoc` will work, if that's what you care about
23:24cemerickah, cool
23:25justin_smitherr s/project.clj/project as merged and passed in by lein
23:25justin_smithso it would more likely be in the profiles.clj of course
23:40justin_smithhttps://clojars.org/noisesmith/cryptlj https://github.com/noisesmith/cryptlj
23:40justin_smithI still need to update the readme for the lein tasks
23:43bitemyappjustin_smith: I avoid having secure information in my git repos by simply using environment variables, by the by.
23:43bitemyappjustin_smith: you guys have a penchant for finding excuses to write code, it seems.
23:43justin_smithmakes sense, but with our workflow we have multiple developers running the server
23:44bitemyappI'm not sure what that means or what importance it has.
23:44justin_smitheasier to just hand them something that works than set them up with a bunch of scripts
23:44bitemyappjustin_smith: when I handed off the clojure app I deployed to my coworkers for them to tweak and re-deploy, it too, just worked.
23:45justin_smithscenario: we have multiple configs (development / staging etc.), someone else who isn't on the project full time needs to switch configs
23:46justin_smithit's best if they can just provide an environment name and everything else works
23:46justin_smithdo I had them a script with all the credentials for all the environments in it?
23:46justin_smiththat's where this comes in
23:46bitemyappin my case, there are simply secured env provider scripts
23:46bitemyappwhich I can use without writing any code...
23:46bitemyappyou just source them before running the app.
23:46bitemyappgenerally not even that is needed.
23:47justin_smithso if someone new joins the project, you give them a copy of the script?
23:47justin_smiththe script is in the repo?
23:47bitemyappno and no
23:47justin_smithdo they run the server on their own machine?
23:48bitemyappthey don't run the staging or production environments on their computers
23:48bitemyappwhen they're developing, they use the default config (overriding as they desire) and run things like the database locally
23:48bitemyappwhen they need to see if it works, they run the staging deploy script
23:49bitemyappif it works in staging, that is.
23:49justin_smithright
23:49bitemyappthey can run the test suite and poke at anything they want with the default local dev environ.
23:50bitemyappalso nrepl servers are embedded in the app by default, so they can nrepl into staging or prod if they have ssh access.
23:51justin_smithwe tend to have a schema and content that is changing rapidly as we develop - especially in early stages - so dev works out better with a shared db
23:51justin_smithand with a cdn
23:51justin_smithsoon likely also zookeeper
23:52justin_smithalso api keys
23:52justin_smith(client's social network credentials for example is a common one)
23:52justin_smithit is advantageous to provide all that transperently, and keep it all up to date, without credentials in git
23:53justin_smithof course during dev it is not the client's social key - it is some test key for that app
23:53bitemyappI don't really mind leaving test stuff in the repo at all.
23:56justin_smiththis method is an experiment (not tried in production yet), but what I am aiming for is reducing the incedental complexity of some app behaviors coming from the code, some from config files on the server / dev box, some coming from the environment - wanting a streamlining so that I can as much as possible push the config to one place and know it gets where it is needed