#clojure logs

2013-06-13

00:27technomancyRaynes: curious, could you do that with pdo and lein run?
00:28technomancypoint-free lein, man. it's the wave of the future.
00:29Raynestechnomancy: Could I do what?
00:30RaynesPrism?
00:30Raynestechnomancy: I'm not sure how I'd combine those two things to do this. Could you elaborate your idea?
00:42jeremyheilerAre there any examples of a library sharing code between Clojure and ClojureScript? (Unless doing that is dumb and I shouldn't worry about it.)
00:44sinistersnarejeremyheiler: what would be a use case for that?
00:47jeremyheilerI'm writing a library for App.net and I would love to share the namespace that contains the ~100 functions for hitting each endpoint. All that code is very generic, and every function calls an internal "request" function that deals with the details; which is clj-http and cheshire for Clojure.
00:48malynjeremyheiler: I haven't used it (yet), but lein-cljsbuild has a feature called "crossovers" that lets you share code between Clojure and ClojureScript. https://github.com/emezeske/lein-cljsbuild/blob/0.3.2/doc/CROSSOVERS.md
00:51tomjackjeremyheiler: I heard solving that problem is a priority for 1.6
00:51tomjackclojure 1.6 I mean
00:51jeremyheilermalyn: that looks promising.
00:51jeremyheilertomjack: do you know any of the details?
00:52tomjacknope. but I'm guessing it involves 'feature expressions' or some derivative of that idea
00:52jeremyheilerThat would be great.
00:53tomjackpedestal has shared code somehow that is not as much of a terrible hack as crossovers
00:53tomjackbut crossovers actually works I guess :)
00:54tomjackalso https://github.com/lynaghk/cljx may be worth looking at
00:54seancorfieldthat will be a really nice problem to see solved!
00:57jeremyheilercljx looks cool, but is probably overkill for my use case.
00:59tomjackI assume data readers aren't capable of implementing feature expressions already?
01:00jeremyheilerI'm reading about it here: http://dev.clojure.org/display/design/Feature+Expressions
01:02tomjack#host {:clj :require :cljs :require-macros} ?
01:02tomjackcan't do #_ though
01:02tomjackwhich may be a good thing imo..
04:58jamiitechnomancy: The repl is working now - https://github.com/jamii/lein-gnome
05:23clgvif I do (require '[quil.core :as q]) in my namespace shouldnt (defn bla [x] (q/fill ...)) compile cleanly?
05:24clgvI am trying to work around a HeadlessException when running the code on a server where I will not use th GUI parts
05:27tomjackclgv: are you using defsketch?
05:28clgvtomjack: no
05:28clgvI use "a/applet" directly
05:28clgvloading the namespaces throws the exception thus I wanted to wrap it in a try-catch
05:29tomjackI see, tricky
05:30tomjacklooks like processing initialization causes it?
05:31tomjackand then you can't compile that defn unless you catch and alias some other fake ns with dummy vars...?
05:31tomjack:(
05:32clgvthe problem is that I cannot use (require '[quil.core :as q]) as alternative to the entry in the namespace declaration
05:32clgveven on my dev machine it says "No such namespace: q"
05:34tomjackweird, works here
05:35tomjackbut it won't help anyway I don't think
05:36tomjackif you managed to catch the exception I predict you'd then get "no such var" troubles
05:36tomjacker, or "no such namespace"?
05:38tomjackhttps://www.refheap.com/b43b579e3f97b9fa495c775bd
05:38tomjackyeah this gives me "no such namespace: q"
05:38tomjackmy advice I guess is to put the gui stuff in a separate namespace..?
05:41asalehI have problem \w logging in my command lina app and uberjar
05:41asalehwhen I do "lein run --opts --more-opts --etc" it runs fine
05:43asalehbut when I do "lein uberjar; java -jar my-app-0.1.jar --opts --more-opts --etc" it fails on java.lang.ClassNotFoundException: clojure.tools.logging.impl.LoggerFactory
05:43asalehany hints?
05:46tomjackthat does not look like the name of an uberjar
05:46vijaykiranasaleh: look for *-STANDALONE-* jar
05:46asalehtomjack, that is just an example :)
05:47vijaykiranasaleh: :) can you paste the project.clj ?
05:47asalehtomjack, vijaykiran in reality I am runnin java -jar tcms-upload-0.1.2-SNAPSHOT-standalone.jar --dry-run --username asaleh --password ****** --xml-result /home/asaleh/clean-room/tcms-upload/testng-results.xml --plan 9032 --build-name new-build --manager-login asaleh --summary test26
05:48tomjackapparently clojure.tools.logging is not in that jar..
05:48asalehtomjack, vijaykiran https://github.com/AdamSaleh/tcms-upload/blob/master/project.clj
05:48bordatouecould someone help, I would like to know if there is any way to automatically compile the local .java files and load then to nrepl on making changes to the local .java files from emacs
05:48tomjackodd
05:49tomjackdid you already look in the jar?
05:49asalehtomjack, I didn't look, I just thought when I see tools.logging-0.2.6.jar in lib/ it should be in standalone jar as well
05:50tomjacklib/? you should upgrade lein :)
05:50vijaykiranasaleh: the jar on your github seems to have the class
05:51asalehvijaykiran, yep, I know, but problem starts when I try to recompile
05:54vijaykiranasaleh: odd - I get SEVERE: testng-results.xml (No such file or directory)
05:54vijaykiranasaleh: no exception
05:55asalehvijaykiran, tomjack I found some difference ... the jar-file I have recompiled has only impl.clj in /clojure/tools/logging/ ... jar on github has folder /clojure/tools/logging/impl/ and Logger.class and LoggerFactory.class
05:58vijaykiranasaleh: how are you generating the jar ? which version of lein are you on ?
05:58asalehstill Leiningen 1.7.1
05:59vijaykiranbordatoue: I'm not aware of hot-reloading java files - may be you can try JRebel ?
05:59tomjacklike I said.. upgrade
05:59asalehvijaykiran, lein deps;lein compile; lein uberjar
06:00vijaykiranasaleh: upgrade is your best bet - I'm using 2.2.0
06:00tomjackhave you tried `lein clean`? always worth trying when you're having trouble
06:00asalehtomjack, but I need to have 1.7.1 :) ... can I have them side-by side?
06:00bordatouevijaykiran: thanks
06:01tomjackwhen I switched over I just put it at ~/bin/lein2
06:01tomjackI think that should still work fine
06:01asalehok, will try
06:02tomjack(fwiw confirmed the uberjar from your master contains LoggerFactory on my lein 2.2.0 as well)
06:03asalehok, gave it a last try with rm -Rf tcms-upload;git clone git@github.com:AdamSaleh/tcms-upload.git; cd tcms-upload;lein clean;lein deps;lein compile;lein uberjar ...
06:03tomjackstrange problem though, were there even any AOT bugs back then that have been fixed?
06:04asalehand java -jar tcms-upload-0.1.2-SNAPSHOT-standalone.jar still throws exception
06:04tomjackdid you make any local changes not in git?
06:05asalehtomjack, just tried the clean clone and compile :)
06:05tomjackthen yeah, I'd say try lein2.. bizarre
06:11pyrtsaSilly thought: would it be possible to wrap `lein repl` to run all lines inside a (-> ...) macro?
06:12pyrtsaE.g. to get documentation about something, I could just append ` doc` to whatever I had written first. Or play with postfix in general.
06:12asalehtomjack, vijaykiran thanks, lein2 solved it :D
06:12tomjackweird, I skimmed the changelog for 'AOT' and didn't see anything relevant
06:22clgvtomjack: yeah I guess the refactoring is the only choice here
06:23clgvtomjack: you mean lein 2.1 changes?
06:29tomjackI just searched for 'aot' in everything since 1.7.1
06:30tomjackclgv: theoretically you could take ns-publics from quil.core and create a dummy ns to require in the catch, I think
06:30tomjackbut that would be kinda nuts
06:44ucb,(inc 2)
06:44clojurebot3
06:50mikerod##(inc 2)
06:50lazybot⇒ 3
06:50mikerodMaybe this is a dumb question, but what is the difference between clojurebot and lazybot ?
06:53tomjackthey are different bots, different code
06:53tomjackmany many specific differences
06:58rbarraud_Is there a FAQ on either or both u can give URL for?
06:58tomjack$google clojurebot
06:58lazybot[hiredman/clojurebot · GitHub] https://github.com/hiredman/clojurebot
06:58tomjack$google lazybot
06:58lazybot[flatland/lazybot · GitHub] https://github.com/flatland/lazybot
06:58tomjackthat's about it afaik
06:59rbarraud_Excellent... Thanx tomjack
07:09fsmunozGreeting!
07:09fsmunozQuick help: I'm trying to "translate" this: ((OracleStatement)stmt).setDatabaseChangeRegistration(dcr);
07:09fsmunozAnd given my lack of Java knowledge I find the ((OracleStatement)stmt)... intriguing.
07:09fsmunozLooks like some sort of cast
07:09augustlfsmunoz: that's a cast, you don't really need it in Clojure since it's dynamic
07:10augustlyou could annotate smtm to be an OracleStatement to avoid reflection though, if it's a call you do a gazillion times all the time :)
07:10augustlstmt*
07:10fsmunozaugustl: ty, so my translation is likely correct: (.setDatabaseChangeRegistration stmt dcr)
07:10augustlyeah
07:11fsmunozGreat mate, thank you. I was not getting the cast since stmt is a Statement, but now talking with you I remembered that not everything is dynamic :)
07:17mikerodThanks for the info!
07:35augustlfsmunoz: hmm, you might actually have to cast it though, to dispatch the correct method.. ;)
07:35augustlfsmunoz: so, (.setDatabaseChangeRegistration (cast OracleStatement stmt) dcr)
07:38noncomhi! if i get an exception in a future, there is no output of the exception to the console, it just silently hangs the future. is this ok?
07:39augustlif you dereference the future, the exception is thrown in the calling thread
07:40noncomi see, so if i never deref it, i never get an exception?
07:40augustlthis is an attribute of threads, not futures
07:40noncomcool! thanks, now i know it
07:40augustl^^
07:44fsmunozaugustl: ty!
07:54mikerod,(+)
07:54clojurebot0
08:14degIn a clojurescript app, I need to serialize some data in/out of browser local storage, including maps and vectors. It looks like I need to call js->clj and clj->js, but I'm not 100% clear about why; I thought cljs used the underlying js data structures.
08:15degWell, not quite true. I understand that cljs uses clj-style lazy data structures. But, I had thought that all the necessary conversions happened behind the curtains, and I would not have to think about them.
08:17noncom,(-)
08:17clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$->
08:18noncom,(+)
08:18clojurebot0
08:18noncom,(*)
08:18clojurebot1
08:18noncom,(/)
08:18clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$-SLASH->
08:18noncom,(or)
08:18clojurebotnil
08:21deg(TEST - does anyone see this? Just checking because I've gotten zero replies to any queries here the past few weeks. Checking that my IRC is working)
08:21deg,(print "hello world")
08:21clojurebothello world
08:25clgv,(print "hello deg")
08:25clojurebothello deg
08:25augustldeg: are you sure clj->js works? toString of a js object is probably as bad of toString on a js object that represents a clj value :)
08:32degaugust1: I'm serializing the string from clj data. But, the data comes from the dom, and I seem to need to js->clj it before I serialize it out.
08:32degOtherwise, it writes objects like #<array ....
08:32augustlperhaps cljs data structures has a better .toString than the JS ones
08:33augustlserialization of JS data structures (objects or arrays) are typically done with JSON.stringify, not toString
08:33degDoes JSON.stringify also do the "right thing" for clj data?
08:34augustlI would imagine not, clj data structures contains metadata etc.
08:34augustlwhat exactly are you putting into localstorage? Dom elements?
08:34augustl(ref "the data comes from the dom")
08:35degFor my purposes, metadata is not relevant. I'm just trying to persist arrays and maps that are mostly in the dom, but that I also manipulate in my cljs code.
08:35augustl(that's parenthesis in english, not a clojure snippet :))
08:35degIt feels like I must be doing something wrong; I'm thinking too hard about what should be a simple case.
08:35degYes, data comes from the dom.
08:35augustlwell, putting DOM objects in localstorage is certainly wrong, so I don't hope that's what you're doing :)
08:35augustls/DOM objects/DOM elements/
08:36degNot dom elements themselves. Just values in controls.
08:36augustlso it's just strings?
08:36augustlI can't think of DOM APIs that yields something other than strings or numbers..
08:36degMost were simple strings, but I get an array/vector from some of the more complex controls.
08:37degLike a selection box.
08:37augustlare you talking about code that traverses the dom and builds a data structure from that?
08:38degI'm moving towards that. But, right now, my code is even simpler. I have a form, and I want to save the user-entered data when I move to a different page.
08:39augustlso essentially you have a JS data structure, the fact that the source of it is the DOM isn't really relevant?
08:39degYes, I suppose so
08:39degI'm coming from the clojure world. JS and DOM are equally new to me, so I've conflated concepts.
08:39augustlI've never used cljs.. But I would imagine it's more convenient to build a cljs data structure instead of a js data structure
08:40augustland in the cases where you build js data structures, you make sure that what your function actually returns is a cljs data structure
08:40augustllocal mutation, etc ;)
08:41degThe structures I'm building are all cljs; at least that was my intention. But (using hiccups library) askig the DOM for the value of a control, I get back what seems to be a js array.
08:41augustlDavid Nolen recently blogged about just that - a function that internally builds up a data structure with raw mutable JS objects, and returns a cljs immutable value
08:42augustldeg: I'd be very careful about passing js data around, since it's mutable
08:42degSounds relevant. I'll search for that blog entry (or do you happen to still have the link?)
08:42augustland whenever you encounter js data, turn it into cljs values
08:42augustldeg: http://swannodette.github.io/2013/06/10/porting-notchs-minecraft-demo-to-clojurescript/
08:42augustldeg: specifically, the gist under "Local mutation"
08:43degthanks. I'll read that in a second. But, sounds like I'm probably doing the right thing -- explicitly converting js data to cljs as soon as I see it. But, I was just surprised that this doesn't happen automatically and under the covers.
08:44augustldeg: this is similar to the interop story for clojure on the jvm - if you call something that returns js data, you'll get js data
08:44augustlhopefully people are careful with it, though, so you only get js data when you use very specific functions or do interop
08:45augustlthe question then becomes how to turn cljs values into a string you can put in local storage. I would guess cljs has this built-in
08:46degMakes sense. I've not done any significant interop in clojure either. I'll just wrap the library calls. I guess, though, I'll digress and read the hiccups source, to understand why it doesn't already do so.
08:46degI assume there is some efficiency concern, i.e. some common case where the data is passed right back to js.
08:46degAnyway, thanks for your help. I think I'm on the right path now.
08:47augustldeg: np ^^
08:47augustlhow can hiccup be related to this, though? Doesn't hiccup only turn clojure data into HTML strings?
08:49degRight. I read the wrong line from ns requires at the top of my file. I meant domina.
08:49deg(Again, conflating too many new concepts together. Now that my code is working, taking the time to understand all the code I copied).
08:50augustl:)
08:50augustldoes sound a bit weird that domina doesn't always return immutable values
08:50augustlthe dom is inherently mutable, though, so if domina returns a DOM object, well..
08:51degRight. That's where I had the feeling I was doing something wrong. Time for me to read the source and learn what domina is really doing.
08:51degNo rest for the innocent.
08:51augustldeg: there are some ways of dealing with that, such as RFP, and other things, which basically lets you work with an immutable data structure and treats the mutable DOM as I/O
08:52degRFP is what? (I know if I google it i'll hit a million Request For Proposal pages :-) )
08:52augustlreactive functional programming
08:52degthx
08:52augustloh, it's FRP. Functional reactive programming
08:53piranha_it's FRP
08:53piranha_:)
09:12degWould I be over-simplifying to say that FRP is basically modern constraint propagation?
09:27jcromartieOK so, let's talk about clojurescript output
09:28jcromartiemy hello-world .cljs results in 800KB of JavaScript in the "out" directory
09:31maleghastjcromartie: Yeah, that's not optimal, huh?
09:31jcromartieI didn't delete "out" before passing {:optimizations :advanced}
09:31jcromartiebut after doing that, it's 676K in out
09:32jcromartieI know most of this is boilerplate cljs/closure stuff
09:33maleghastjcromartie: Hmmm… Still not great… Aren't you supposed to use Closure, after the CLJS to JS transformation, to 'improve' the resulting Javascript.
09:33jcromartiemaybe? I thought that it included Closure optimization
09:33maleghastHey, I'm guessing here - I've not gotten around to playing with CLJS at all yet :-)
09:35BobSchackTake a look here https://github.com/magomimmo/modern-cljs
09:36BobSchacktutorial 7 should have the optimizations you're looking for
09:37jcromartie"modern" cljs :)
09:37jcromartieas if a bleeding-edge language weren't modern enough
09:38jcromartie(I get the reference)
09:38hyPiRionhah, I never realized this
09:38hyPiRion,(let [v (vec {:a 1, :b 2, :c 3, :e 4})] [(keys v) (vals v)])
09:39clojurebot[(:a :c :b :e) (1 3 2 4)]
09:39hyPiRion,(let [s (set {:a 1, :b 2, :c 3, :e 4})] [(keys s) (vals s)])
09:39clojurebot[(:e :b :c :a) (4 2 3 1)]
09:40hyPiRionoh, clojure, you keep surprising me from time to time.
09:40jcromartieah ha, you can emit a single JS file, optimized and minified, at 13K with gzip
09:40jcromartienot too bad for a baseline
09:40maleghastjcromartie: You have just persuaded me that I want to know about CLJS, so thanks for that :_)
09:40jcromartiemaleghast: I'm persuading myself as I go along
09:41jcromartiemaleghast: I think it would be a boon for HTML game/interactive type dev
09:41maleghastFairy snuff ;-)
09:41jcromartieI prefer Lisp over Coffeescript's rather syntaxy-syntax
09:41jcromartiei.e. Coffeescript has lots of rules about whitespace and colons and whatnot
09:42maleghastI am getting quite excited about Pedestal, but again, I need time to __actually__ try it out - there's only so much you can learn / judge from just reading about something
09:43BobSchackjjcromartie: chris granger has a nice post about writing a game in clojurescript here http://www.chris-granger.com/2012/12/11/anatomy-of-a-knockout/
09:44muckerI find myself abusing the -> macro. How do I get past the inside out evaluation of lisp ? In ruby I would have a bunch of foo = expr ...
09:45hyPiRionmucker: Hmm. using `let` works, but the best trick is to just get more familiar with functional programming
09:46hyPiRionand with lisp, of course. With time, you end up being more immutable and the inside out evaluation is rarely a problem (at least in Clojure)
09:47muckerhyPiRion I can't use let freely, can I ? It needs to be (let (bindings) expr) I just want to say ((let foo bar) (+ foo bar))
09:49hyPiRionmucker: well, (let [foo 1, bar 2] (+ foo bar)) is easier to write than (do (let [foo 1, bar 2]) (+ foo bar)), isn't it?
09:50hyPiRionI understand your concern, and really, the best way to "get used" to it is by experience and practise. At least that's what I think
09:50jcromartiew00t, success
09:50jcromartieI want to at least understand how to use the CLJS compiler before using lein-cljsbuild
09:51muckerhyPiRion: yup :)
10:16jweisshow long have multiline strings with """ delimiters been available? Could have sworn that didn't exist before
10:17jweissor maybe it doesn't exist but it's shown here http://adambard.com/blog/clojure-batteries-included/
10:17Bronsayeah, they don't.
10:19clgvjweiss: no there is no special multiline string - but string literals can span multiple lines by default
10:19hyPiRionhuh, never seen that before
10:19augustljweiss: single quote strings can be multi-line
10:19arcatan"""foo""" is like "" "foo" ""
10:20arcatanso I guess the docstring in there will be "", but otherwise it works :P
10:21arcatanoh right, he has un-escaped "s, so it won't work anyway.
10:22tranceholichi, im new here, could i ask a question?
10:22girlshopping site verry chaeap and quick go .
10:22girlhi
10:22girlthis is a good site of shoping
10:22girlhttp://team-browser.com/
10:22girlcard visa maser .... all
10:22girlenjoy
10:22girli have buy iphone 5
10:22girlgood by
10:22maleghasttranceholic: Sure - go for it
10:22tranceholicmy `lein repl` hangs at the root directory of a project, but does not outside the project. Why?
10:25maleghasttranceholic: That's quite odd… What version of Leiningen are you using?
10:26Anderkenttranceholic: it might be trying to compile your main namespace and hanging on that, or maybe you have some weird injections?
10:28murtaza52What does this form mean - #_(dev/start) - (dev/start) is a call in a specific ns, however whats #_ for ?
10:28Anderkentmurtaza52: #_ is a way of commenting out a form
10:28tranceholicmy lein is 2.2.0
10:29murtaza52Anderkent: Thanks, and all this while I was wondering why it wa snot executing :)
10:32simon_Hello! Im new to clojure and have a question about memoize, it seems like it doesnt work for me.
10:32simon_http://pastebin.com/djd94092
10:33simon_(status-page "rbx") takes a couple of seconds to return.
10:33simon_The next time i run (status-page "rbx") i would expect it to return instantly, but it takes as long as the first time I called it.
10:33maleghasttranceholic: Can you paste your project.clj here -> refheap.com and paste the URL in here, please?
10:34tranceholicplease wait a minute...
10:34jweisssimon_: looks right to me
10:34jcromartiesimon_: works fine for me
10:35XPheriorI think my Java interop knowledge is failing me here. I have the class shown there, and want to access the _Fields enum on line 39. https://gist.github.com/MichaelDrogalis/ca1bd4629221b9c16ee1
10:35jcromartiesimon_: are you sure you're calling the status-page you think you are?
10:35XPheriorShouldn't it be (DataUnit/_Fields) ?
10:35AnderkentXPherior: it's a class, not a field. DataUnit$_Fields
10:35jcromartiesimon_: i.e. are you in a REPL and perhaps haven't reloaded the namespace where status-page was originally defined with a non-memoized version?
10:35XPheriorAnderkent: Ahhh, I forgot about that!
10:35XPheriorThanks a million Anderkent :)
10:35simon_Just killed my repl and tried again, same result.
10:36simon_its nrepl. Ill try with the lein repl.
10:36tranceholichttps://www.refheap.com/15741
10:36jcromartiesimon_: hm, yeah, it works fine with lein repl here
10:36XPheriorHuh, Anderkent. That's actually giving me unable to resolve symbol.
10:37simon_Yeah, in lein repl it seems to work, but not in the emacs one, maybe its just slow in emacs.. :)
10:37simon_Thanks guys.
10:37simon_And gals
10:38tranceholic`lein uberjar` worked fine and got a working standalone jar, FYI
10:38maleghasttranceholic: Hmmm, I just used your paste to create a quick test project and the repl launches perfectly fine for me...
10:39XPheriorNevermind, forgot the qualified namespace. Thanks!
10:40tranceholicthank you for your time, maleghast
10:43maleghasttranceholic: No problem - sorry to not be more help… What OS / platform are you on?
10:45tranceholicim on WindowsXP sp3 ; Cygwin; JDK1.7.0_21
10:48maleghasttranceholic: Hmmm… Should be ok… And you can run your app with lein, just not run a REPL?
10:51tranceholicright, `lein run` worked on the app, but simply `lein repl` hangs on the same root directory of the app's project...
10:51maleghasttranceholic: So you are running "lein repl" in the same directory as project.clj?
10:52tranceholicyes
10:52maleghastI figured, but worth asking, just in case...
10:53tranceholicaccording to lein tutorial, `repl` can run from anywhere...
10:53Anderkentlein repl does do different things in a project than outside, so it's possible there's a path that makes it go wrong
10:53Anderkenttranceholic: if you clear your ~/.lein and create a new empty project, does lein repl run?
10:54Guest44310hi. i'm using vectors a lot, because some datastructures I need have to have a good random access time. But every time I map a vector I get a list in return. Why is that? Why can't I just can get the datatype back I throw at the map?
10:54Anderkentif not, that's a lein bug. If it does, then it's something related to your profile/project config
10:55tranceholicwhat do you mean by `clear ~./lein`? `rm -r ./lein` ?
10:58Anderkenttranceholic: do you have anything in your user profile in %USERPROFILE%\.lein ?
10:58IamDrowsyGuest44310: because map takes any seq and returns a lazy seq. its implemented on top of seqs and not vectors. in the vector case you can use mapv
10:59Guest44310ah thanks. I didn't know about mapv
11:00ToxicFrogGuest44310: map is lazy, and there's no lazy vector type. So you have to- yes, what, IamDrowsy said.
11:01tranceholicsorry, i dont know how to get SERPROFILE%\.lein
11:02Anderkenttranceholic: just type %USERPROFILE% in explorer address bar
11:02Anderkentthen find the lein directory
11:02Anderkentbut well
11:02Anderkentif you didn't edit it
11:02Anderkentthere won't be anything there
11:02Anderkentso just try creating a new lein project with lein new, go into it and see if repl works
11:03Anderkentif not, report a bug at github.com/technomancy/leiningen
11:05ArseneReiI'm trying to understand -> (trush) w/ vectors, but I can't see the write way to re-write these filters as a trush list. https://gist.github.com/arsenerei/5774391
11:05dobladezis there a way to automatically activate a lein profile based on the OS type?
11:05tomjackso yeah jeanniki's point on clojure-dev is.. interesting https://www.refheap.com/95b2b6be8fcacf98bce152765
11:06tranceholicnow i typed `SRPROFILE% on explorer address bar, but no lein directory can be seen
11:06dobladezlike maven's <profile><activation><os> ... ?
11:07tranceholicand `.m2` folder found
11:07tomjackArseneRei: use ->>
11:08tomjack->> is for stuff like filter where the threaded operand comes last
11:08ArseneReiHrm…why did I think it was first.
11:10ArseneReitomjack: Ah…yes, I get what you're saying. Makes perfect sense. Thanks so much!
11:10john2xcan someone point me to a good api wrapper library written in clojure? i'd like to study it..
11:13tranceholicat a new project directory i just created, my `lein repl` still hangs, so it might be a bug, thank you very much folks.
11:16futileGood morning.
11:17devnhttps://github.com/tailrecursion/presioke
11:17devnThere are so many things that are cool about that. ^
11:19devnThis (https://github.com/tailrecursion/presioke/blob/2215b16d9add5aeb6e06a329428ad5f3636cbe24/src/html/index.html) is the same as this (https://github.com/tailrecursion/presioke/blob/master/src/html/index.cljs)
11:19devnlet that sink in for a minute
11:21noncomcan an imported function know from which was it called?
11:21noncom*it is called
11:22noncomlike i want to configure a library, imported in many namespaces to understand where from it is called
11:23noncomso in a namespace i call like (library/configure :my-name) and then when i call fnuctions in that library, it adds that :my-name to the call
11:24noncomso i could, for example, have a different textual output, depending on from which namespace is it called
11:24noncom???
11:24lazybotnoncom: How could that be wrong?
11:37TimMcnoncom: Clojure doesn't have built-in namespace "instancing", but I've seen a project that gives you something like that...
11:40TimMcamalloy_: Am I correct in recalling that you have a lib that allows one to require the same namespace several times under different names?
11:41tomjackdevn: wow. hoplon looks crazy
11:41hyPiRion,(let [f #(println *ns*)] (f) (in-ns 'clojure.core) (f))
11:41clojurebot#<Namespace sandbox>\n#<Namespace clojure.core>\n
11:41hyPiRion?
11:42tomjackTimMc: what do you mean?
11:42tomjack,(do (require '[clojure.core :as core1] '[clojure.core :as core2]) [core1/+ core2/+])
11:42clojurebot[#<core$_PLUS_ clojure.core$_PLUS_@61022c> #<core$_PLUS_ clojure.core$_PLUS_@61022c>]
11:43tomjackoh I guess that's only require'd once but aliased twice?
11:43hyPiRiontomjack: yeah
11:44hyPiRion,(do (require '[clojure.core :as c1 :as c2]) [c1/+ c2/+])
11:44clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: c1, compiling:(NO_SOURCE_PATH:0:0)>
11:44hyPiRionhrmf.
11:46TimMctomjack: The lib I'm thinking of probably does some very naughty stuff to accomplish its task.
11:49futileGotta figure out this test-nesting question.
11:50futileSeems like definers should have a way to "push" onto a stack, rather than just being given *assertion-results*
11:56futileRaynes: fine job with refheap I say
11:58futiletomjack, mthvedt: https://www.refheap.com/15744
12:00tomjackfutile: seems weird to me to have them in the top level
12:00futiletomjack: they all have to run in the top-level, right?
12:02futiletomjack: even with nesting, they should probably be allowed to run outside of the context of their nest, right?
12:02tomjackI mean given the report you show I'd expect to see something more like (defn ^:test outer "..." [] (expect = 1 1) (testing "While signed in" (testing "It lets you do stuff" ...)))
12:02futileWait!
12:03futileFixtures are inherently tied to nested tests.
12:05tomjackto me if 'test' a is nested inside test b, a should be inside of b in the code. def'ing a at the top level and somehow indicating "run this magically inside b" seems bizarre
12:05futiletomjack: by nested tests I never mean a test that's defined inside another test
12:06futileI always mean, a test that has the same context as other tests
12:06futileAnd by context I mean (1) a common scenario/pre-description, and (2) common around-each and/or around-all fixtures
12:07tomjackso the flow is, ignoring around-all and in pseudocode, (around-each outer) (outer) (around-each inner1) (inner1) (around-each inner2) (inner2) ?
12:08futileKinda
12:09futileassuming fixtures here are macros that take bodies: (do (outer1) (outer2) (around-each (inner1)) (around-each (inner2)))
12:10tomjackno around-each for outers?
12:10futileYeah, any level can have its own set of around-each's
12:10futileAnd each outer layer is also applied to the nested inner layers
12:11tomjackno clue what you're getting at :)
12:11futileso: (around-each-1 (outer1) (outer2) (around-each-1 (around-each-2 (inner1))) (around-each-1 (around-each-2 (inner2))))
12:12tomjackyeah that makes very little sense to me
12:12futiletomjack: https://www.refheap.com/15744#L-45
12:13futiletomjack: familiar at all with RSpec?
12:13tomjackused to be
12:13futileI'm thinking, exactly what RSpec does is right.
12:14Anderkentfutile: don't you want to just have something like defgroup that only makes all contained tests be indented, but doesn't trigger fixtures etc?
12:14tomjackbefore :each inside context?
12:14futileAnderkent: That makes a lot of sense.
12:14tomjackor alongside
12:14futiletomjack: yeah.
12:15futileAnderkent: but should it produce a flat list of tests that just happen to be wrapped in a fn that takes into account each fixture?
12:15futileThat's what I'd think.
12:18futileAnderkent, tomjack: aha! https://www.refheap.com/15744
12:19tomjackthe "while signed in" confuses me
12:19tomjackthe inner group is going to have an extra each fixture which signs in?
12:19futileThen each "group" could have once-fixtures, each-fixtures, a description, and optionally its own :parent.
12:20futiletomjack: yep
12:21tomjackseems like there's two separate things: 1) testing-like conj'ing of descriptions into the reporting context 2) adding fixtures per-test-fn
12:21tomjackthose two features should be sufficient to implement something crazy like defgroup, yes?
12:21futiletomjack: hmm
12:21futiletomjack: no I don't think nesting should be something you actively do, like conj
12:22futiletomjack: it should be something that's described statically.. like how in this refheap each test can have a :parent key which names a group
12:23tomjackeventually that's going to have to turn into some side-effect right?
12:23tomjacklike "hey now we're running assertions under a new heading \"foo\""
12:24futiletomjack: nope. it just needs a change to the runner to produce nested test-results, that's all.
12:24futiletomjack: https://www.refheap.com/15744
12:24tomjackI see
12:24futiletomjack: the runner will have to make sure they're all run in the proper group
12:24futiletomjack: the downside of this solution is that it's biased towards 1 very specific implementation of fixtures
12:25futiletomjack: the upside is that it actually works, and it's very static and compile-time friendly, instead of side-effect-based
12:25futiletomjack: plus using this, im pretty sure i know how to emulate both speclj and clojure.test perfectly
12:26tomjackI still maintain that it is impossible for you to emulate clojure.test perfectly without a custom runner :)
12:26futiletomjack: here let me show you exactly how it would be done
12:27tomjackI get what you mean now though, and test groups seem to make sense to me
12:28tomjackyour last refheap seems to imply I don't understand how you're going to do fixtures - I thought the fixtures would be baked inside the (defn ^:test ..) bodies
12:29tomjackif the default runner knows about fixtures then I retract my claim
12:30futiletomjack: https://www.refheap.com/15752
12:31tomjackyeah makes sense
12:31futiletomjack: but you're right, the downside is that fixtures are now hard-coded into the spec.
12:32pepijnde-Why is Lisp in Small Pieces so expensive? $100 for a book sounds kind of rediculous.
12:32futileIt's probably just that good.
12:32pepijnde-:o
12:33futileNot that I would know.
12:33futileBut why else? Supply/demand knows what it's doing.
12:33hyPiRionpepijnde-: http://www.amazon.com/Handbook-Neuroevolution-Through-Erlang-Gene/dp/1461444624
12:33hyPiRionThey are academic books, they usually cost that much. At least from my experience
12:34pepijnde-why? because poeple *have* to buy them?
12:34hyPiRionyeah
12:34pepijnde-btw, the french version of lisp costs less than half :)
12:34hyPiRionno wonder, it was originally written in French
12:35pepijnde-and there is probably less demand...
12:36hyPiRionprobably
12:45justin_smithwith emacs nrepl, I get this state where after an external nrepl is killed, every time I try to connect to another nrepl, it just shows "equal: Wrong type argument: bufferp, nil" but does not pop me into the normal elisp stack trace view
12:45futiletomjack: oh but the runner's implementation will be a pain, since you have to build a tree starting with only nodes.
12:46justin_smithI have debug-on-error set to t - most elisp failures actually pop up the debugger so I can trace the error
12:46justin_smithnrepl must shadow that variable or something
12:46hiredmanhttps://github.com/kingtim/nrepl.el/issues/280
12:46justin_smithany known fix for this other than restarting emacs?
12:47justin_smithOK, restarting emacs yet again
12:59seangroveIs there a pmapcat equivalent to pmap?
13:00seangroveBeyond just (apply concat (pmap ...)) of course
13:04futileseangrove: I don't see one.
13:09finishingmovewhat do you guys think of Racket?
13:10futilefinishingmove: I couldn't get into it nearly as easy as Clojure, mostly a stdlib thing
13:10futilefinishingmove: everything about Clojure has spoiled me except the jvm/lein startup time
13:11technomancyfinishingmove: racket is pretty amazing
13:11technomancyespecially for people new to programming
13:12technomancythere are two really bad things about it: no docstrings, and hash tables that really suck compared to clojure. but they do a better job than any other non-clojure lisp at supporting immutability.
13:12hyPiRionThe best thing is that you can walk through SICP with it
13:13technomancyyou can fix the hash table thing with a #lang directive in your own code, but it doesn't help when reading others' code. culturally they appear to prefer structs to coding straight against the data, which is unfortunate
13:13technomancyhtdp.org is no slouch either
13:17finishingmoveso basically racket is better for learning and clojure for real world application?
13:17technomancyfinishingmove: yeah, I wouldn't expect anyone without prior programming experience to learn clojure unless they were just insanely dedicated
13:18rbxbxfinishingmove: that's probably fair
13:18technomancythere's an assumption woven throughout the whole ecosystem that the user is a professional programmer
13:19finishingmovethere's a bit of irony in that, since you'll need a relatively industry-adopted language to make a living as a programmer... so in the end what to recommend to someone who wants to learn? :)
13:21maleghastfinishingmove: The tide is beginning to turn in the direction of Functional Programming in certain industries for a variety of good reasons, and Clojure is a very powerful, battle-tested Func Lang that is becoming popular in banking / finance, data insight etc. If you want to be able to move effortlessly job to job to job being a Polyglot Developer will help, as long as you can show you have the chops in each of your langs, and Clojure is fun to learn as
13:21maleghastwell, so what's not to like
13:21maleghast?
13:23finishingmovei don't think any of the Clojure-supporting IDEs are good enough to support a beginner programmer
13:24technomancyI'm not aware of anything in any language as good as DrRacket for beginners.
13:24finishingmovemaybe LightTable will be there in a year
13:24rasmustofinishingmove: why needs an IDE to learn programming?
13:25winknotepad is good enough to support beginner programmers.
13:25rasmustofinishingmove: s/why/who
13:25maleghastfinishingmove: Who the heck __needs__ an IDE - emacs + Emacs Live and you are golden
13:25technomancywell, Scratch is easier to learn, but that's cheating.
13:25futileWoot. Spec is probably 99.9% stable now.
13:26winkDrRacket is nice
13:27futilehttps://github.com/evanescence/test2/blob/master/SPEC.md :)
13:31AnderkentI know this ain't the heroku channel, but someone probably knows how to escape args to `heroku run` so that it doesnt pick up the -c 'java -cp' as it's own '--confirm' ?
13:32futileAnderkent: i dunno, but thanks for solving this spec problem for me :D
13:46finishingmoveis anyone using emacs on windows?
13:50piskettifinishingmove: at work occasionally
13:51finishingmovehow would i install emacs-live (or anything else for that matter) on windows?
13:51maleghastfinishingmove: I'm not sure why anyone would, at least not by choice, but it does appear to be completely compliant...
13:51finishingmovemaleghast, probably because they don't have a separate unix machine :p
13:52finishingmoveand are already stuck with windows
13:52finishingmovedue to circumstances
13:52maleghastyeah, but why not use Emacs under Cygwin in that case?
13:52piskettifinishingmove: just as do on linux. First install emacs 24 and replace .emacs.d on the users home dir with the contents of emacs-live
13:53piskettiand _then_
13:53piskettihttp://ftp.gnu.org/gnu/emacs/windows/ emacs from here
13:54finishingmoveyeah i have emacs for windows running
13:54piskettiby contents of emacs-live I mean the checkout from https://github.com/overtone/emacs-live
13:54finishingmovejust not sure what to copy from that repo ?
13:55piskettifinishingmove: then the rest is easy
13:55piskettifinishingmove: checkout the whole thing
13:55piskettigit clone
13:55maleghastfinishingmove: git clone [emacs-live repo] .emacs.d
13:58finishingmovedid that but not sure if it worked..
13:58papulI am trying to run a program written in clojure. When I run the command 'lein uberjar' I get this http://codepaste.net/xv5sbp. But I have jdk installed. I did 'whereis javac' and got this http://codepaste.net/boan6p
13:58finishingmovelooks the same after starting up
13:58papulwhat am I doing wrong?
13:58piskettifinishingmove: then its not working
13:59maleghastpapul: I don't think you have a full JDK installed - just having the runtime is not enough.
14:00papulmaleghast: But I have javac in /usr/bin
14:00papuland I did install openjdk 7
14:00ToxicFrogmaleghast: 'javac' is the compiler and part of the JDK, not the JRE
14:00maleghastpapul: ToxicFrog Yeah, I know
14:01maleghastwhat Clojure are you trying to run?
14:01ToxicFrogpapul: what's "type -a java"?
14:01maleghastHave you tried "lein run" instead of trying to create a .jar?
14:01piskettifinishingmove: did you have an empty .emacs.d in your user dir after the instalaltion of emacs?
14:01ToxicFrogIt might be finding the JRE JVM before the JDK JVM and exploding.
14:01papulToxicFrog: java is /usr/bin/java
14:01finishingmovepisketti, no i didn't have it actually
14:02finishingmovei think it's probably installed like a portable version
14:02papulmaleghast: I am following instructions really. This is my first time with clojure. Just wanted to try that app
14:02piskettiI don't have a windows box nearby so I can't go check but I think that was the case. Then I just replaced it the contents of with emacs-live
14:02maleghastpapul: fair enough - what's the app?
14:02papulmaleghast: Nightweb
14:02piskettiand of course kept the name
14:03papachanwhat is the best way in clojure to render 00010010 ?
14:03llasrampapachan: In what sense of "render"?
14:03papachan,(Integer/toString 18 2)
14:03clojurebot"10010"
14:03papachanllasram like this
14:04finishingmovepisketti, i have these folders in my emacs root : bin, etc, info, leim, lisp, site-lisp. Is that where I should extract emacs-live ?
14:04llasrampapachan: Looks like you already have it then, yes? :-)
14:05jcromartieI don't like it when people use "CLJ" instead of "Clojure"
14:05hyPiRionwell, you can use cl-format for that
14:05hyPiRion,(require '[clojure.pprint :refer [cl-format]])
14:05clojurebotnil
14:05hyPiRion,(cl-format nil "~b" 18)
14:05clojurebot"10010"
14:05holohi
14:05futileholo: hi again
14:06holohi! again? was i here recently?
14:06papachanhyPiRion: nice one
14:08futileholo: few days ago, you said hi and that was it
14:08maleghastpapul: Sorry, I am in a conf call and I need to start paying attention again...
14:08piskettifinishingmove: try M-: (expand-file-name user-init-file)
14:09piskettito find the place where you should put it
14:09holowhen running `lein run -m script.ipsql` I get "java.lang.ClassNotFoundException: script.ipsql" I've always ran this script without any problem. I think some refactoring outside the script (doing alot recently) may have caused this problem but can't find the reason
14:09holofutile, wow, nice memory. thanks
14:11futileholo: ok
14:12futileholo: I think I only remembered because your name reminded me of Halo (the original game) and Rolos and Hulo
14:12futilethe first two of which I only like
14:13holofutile, what are rolos and hulo?
14:13futilehulu.com
14:13futile(typo first time around)
14:13futilehttp://en.wikipedia.org/wiki/Rolo
14:13holoi know that one.. always stating the fact i don't live in the us, so no fun for me
14:14futilemost people arent in the us
14:15hololooks delicious
14:15futileit's in the uk too you know
14:15futileand elsewhere
14:16holorolos are in the uk and elsewhere?
14:16futileholo: they were developed in the UK according to that article
14:19holo"Do you love anyone enough to give them your last Rolo?"
14:19holoi must say today was my first contact with the rolo cult
14:19futileIs there a Rolo cult?
14:20futileWouldn't doubt it.
14:21ToxicFrogThat's kind of alarming
14:22ToxicFrogI'd give someone my last rolo in a heartbeat, they aren't that tasty
14:22jcromartieholo: is that some kind of marketing attempt?
14:23holojust copy pasted from wikipedia
14:24patchworkHow did rolos marketers get in the #clojure channel?
14:24patchworkIs not even IRC safe anymore?
14:25ToxicFrogawhat
14:25holoit's my 15 minute attention
14:25piskettiinsidious
14:25patchworkI've heard of viral campaigns but this is ridiculous
14:26futileToxicFrog: lies! they are quite tasty indeed
14:27maleghastRolos are made by Nestlé so they are fundamentally EVIL
14:27futileOops.
14:27hyPiRionWhy is suddenly #candies renamed to #clojure?
14:28hyPiRionI have no idea.
14:28maleghast*chuckle*
14:28ToxicFrogWe ran out of clojure.
14:28ToxicFrogThere's none left.
14:28futileI didn't take into account that I need some way to tell if one group is the same as another.
14:28ToxicFrogSo we had to find something to fill the channel with.
14:28futileRight now it literally compares the entire group-map.
14:28ToxicFrogOh wait, futile has found some! We're saved!
14:28futileI guess that's fine though, right?
14:28futileGuys, look at this: https://www.refheap.com/15752
14:29technomancystrategic paren reserves
14:29futileHow should anyone tell that test-1 and test-2 belong to the same group?
14:29futileRight now it just does (= (:group test-1) (:group test-2))
14:29futileIs that a stupid idea?
14:31futileI guess it's fine, although it kind of enforces that people probably can't reliably manually put ^{:group {...}} in their test-fn
14:31futileThoughts, you people?
14:32tomjacklook ma no macros https://www.refheap.com/600920453ce6bcb447988510b
14:33tomjackwhy oh why did the kanren people switch to scheme :(
14:34futile,(partial + 1 1)
14:34clojurebot#<core$partial$fn__4192 clojure.core$partial$fn__4192@140240a>
14:34futile,((partial + 1 1))
14:34clojurebot2
14:34futileOh. So it's just like #()
14:35justin_smithwhat is? partial?
14:35futileActually it literally seems to be #(apply ... %&)
14:35futileYeah
14:35futileOk.
14:35justin_smithyeah, the latter - almost
14:36justin_smithor maybe literally?
14:37hyPiRionno
14:37hyPiRionnot literally
14:37justin_smithidiomatically, partial is often used by people who want currying, and #(apply _ %&) would not likely
14:37justin_smithhyPiRion: what would expose the difference?
14:40hyPiRionlaziness.
14:43hyPiRionWell, I guess that's hard to show, because my example involves apply partial
14:45hyPiRionBut you can apply partial with an infinite list
14:45tomjack$findfn inc 3 4
14:45lazybot[]
14:45tomjackwhy doesn't it find deliver, I wonder?
14:45jweissyou'r elooking for a fn that takes inc and 3 as args and returns 4?
14:45justin_smithso (apply partial + (range)) vs (apply #(apply + %&) (range)) ?
14:46tomjackjweiss: no, just curious why it doesn't find deliver
14:46jweisstomjack: (deliver inc 3) returns 4?
14:46tomjack&(deliver inc 3)
14:46lazybot⇒ 4
14:47jweissthat is weird
14:47jweissinc is not a promise
14:47tomjackhyPiRion: I don't follow
14:47tomjack&(#(apply take 3 %&) (range))
14:47lazybot⇒ (0 1 2)
14:47clojurebotIt's greek to me.
14:48hyPiRiontomjack: How would the following work in #() form?
14:48jweisstomjack: i would have expected it to return apply, not deliver
14:48tomjack$findfn inc [3] 4
14:48hyPiRion,(apply (apply partial take 10 (range)) (range))
14:48lazybot[]
14:48tomjack:O
14:48clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
14:48jweissoh right, 3 wasn't a list
14:49hyPiRionoh what, that is supposed to work
14:49tomjackthat doesn't make sense
14:49tomjack(partial take 10 0 1 2 3 4 5 ...)
14:50amalloyyeah, i agree. that's a nonsense partial, hyPiRion
14:50hyPiRionhush, I had some smart idea and then you guys came along and broke it
14:51tomjackpartial is not literally #(apply ... %&) because there is no ... in core
14:51amalloy((partial bake idea) "#clojure")
14:51tomjackit's literally what it says right there in core.clj
14:51hyPiRion,(apply (apply partial (fn [& v] (take 10 v)) (range)) (range))
14:51tomjackwhich appears to be equivalent to what #(apply ... %&) is supposed to mean
14:51clojurebot(0 1 2 3 4 ...)
14:53tomjackhmm, scratch that?
14:53alandipertpiranha: https://github.com/tailrecursion/presioke contains all new hotness from hlisp/javelin world
14:53jweissweird, i never looked at the impl for deliver before, it just calls its first arg with its 2nd. but the docs sure make it sound like it only works on promises, not IFn's.
14:54jweissso deliver doesn't really do anything, you can just invoke the promise to deliver it.
14:54technomancyjweiss: clojure is chock-full of functions that do undefined things on arguments they're not documented to work with
14:54amalloytechnomancy: that sounds like a correct description of every function ever
14:55hyPiRionyeah
14:55technomancyamalloy: every function lacking preconditions I guess?
14:55hyPiRion,(conj {:a :b} {:c :d}) ; woo!
14:55amalloytechnomancy: every function including them too, surely
14:55clojurebot{:c :d, :a :b}
14:55jweisstechnomancy: yeah, i know, i'm more surprised that deliver isn't even needed than by its undocumented feature
14:55justin_smithevery function lacking preconditions in a language that is not statically typed?
14:56murtaza52would the datomic free version run on android ?
14:56tomjackalandipert: does flapjax really solve "pervasive use of ... shared, mutable state"?
14:57technomancyamalloy: throwing an assertion error is technically undefined I guess
14:57alandiperttomjack: if you're quoting me... yes?
14:57technomancy"You are technically right, which is the best kind of right."
14:57tomjackdoesn't flapjax pervasively use shared mutable state?
14:57technomancyI mean unless the docstring calls it out
14:57amalloytechnomancy: my point is that if it's not documented to work with arguments xyz, then any behavior it takes in response to xyz is undefined
14:57alandiperttomjack: the key with any attempt to mitigate is a library structured to separate the mutation from your application logic
14:58alandiperttomjack: the same way FP lang evaluators heavily mutate when they run your code, but the programming model they present tries to eschew immutability
14:58technomancyamalloy: I guess that works if you define "works" to include exceptions
14:58jweissi have a hard time avoiding the mistake of assuming clojure would tell me if i did something crazy like accidentally pass a function to deliver.
14:58justin_smithin some languages "undefined" has a specific technical meaning (nostril demons)
14:58alandipert*eschew mutability
14:59amalloyjustin_smith: provide an example of a language in which "undefined" means something other than "anything at all"
14:59hyPiRionamalloy: is it defined if you say it is undefined for any other values except xyz?
14:59hyPiRionit's very meta, after all.
14:59jweisslol
14:59jweissgood question. is "undefined" a definition?
15:00justin_smithamalloy: well in that case I think clojure does a bit better than "undefined" with random function arguments
15:01dobladeztechnomancy: Is there a way to automatically activate a lein profile based on the OS type?
15:01justin_smithie. if passing (+ nil nil) was an undefined behavior, crashing the vm would not be a bug
15:01tomjackalandipert: afaict flapjax is not capable of separating mutability from application logic
15:02technomancydobladez: that's been discussed but not implemented. seems like a fine idea.
15:02tomjackI mean, it's miles better than what we had before
15:02tomjackif the goal is to mostly separate, makes sense that flapjax satisfies the goal
15:02dobladeztechnomancy: I'll try to find some time and try to do it myself. Any pointers? You think it's possible with a plugin or hook?
15:03dobladezI'm thinking... may be something more generic than "by OS type" would be "by JVM property" (say, via regex matching on a JVM property)
15:03technomancydobladez: definitely possible with a hook, but it'd be better to put it in Leiningen itself. basically it comes down to changing the :default profile in the default-profiles atom in leiningen.core.project.
15:04tomjackoh, I see presioke is using javelin not flapjax?
15:05hyPiRiondobladez: what do you mean by jvm property though? By the jvm properties given to lein?
15:05technomancydobladez: actually this would be very difficult in a plugin due to chicken/egg issues
15:05dobladezhyPiRion: No, I mean, you say "activate this profile if propery X matches Y"
15:06dobladezhyPiRion: you know, JVM system property "os.name" gives you the OS name
15:06hyPiRionyeah, and you can dispatch on java version probably too
15:07dobladezso, activating a profile by java system property is more generic that hardcoding it to be by OS
15:07dobladezright
15:07hyPiRionbut I'm not sure whether I see the rationale for that behaviour.
15:07hyPiRionWell, I mean
15:08dobladezI do... I've used than in the past when using backported libs from JDK 1.6 to 1.5 (java.util.concurrency comes to mind)
15:08tomjackare flapjax and javelin meant to be used together in hlisp?
15:08dobladez(on maven)
15:08tomjackare they alternatives or complementary?
15:08technomancyin general I favour flexibility, but I'm also a bit wary of implicit profiles being added silently.
15:09technomancythat has historically been a pain point around lein repl
15:09dobladezno no, I don't mean adding implicit profiles
15:09technomancywell, not that the profile is implicit, but the activation is implicit? that is a fair bit different.
15:09dobladezI mean, having a way to activate an explicity profile automatically, given an "activation rule"
15:10technomancyyeah, and typically these would be present in project.clj, which makes them very visible.
15:10technomancyless so when in ~/.lein/profiles.clj, but I don't think it would be used for that as much
15:11tomjackoh I guess hlisp is now hoplon?
15:11hyPiRionhmm....
15:11dobladezsay.. something like this on profile.clj: :profile-activation { :myprofile (when-jvm-property "os.name" "Linux") }
15:11laliluna@seancorfield: I checked the Jira issue of java.jdbc, but none of those seems to be a simple issue. The transaction thing sounds interesting, but I wonder if I could start with something simple like adding left join to the DSL.
15:12hyPiRion{:profiles {:profile ^{:when (fn [] (some-prop))} {profile-data-here}}} ?
15:13hyPiRionwell, :when is kind-of a bad name perhaps.
15:13technomancyif you only want to match against system properties it's easy, but a more general way of declaring things might also be useful
15:14technomancy{:profiles {["os.name" #"Mac"] {:dependencies [...]}}} or something
15:14tomjackjavelin seems to make even less sense for those goals than flapjax to me
15:15technomancyneed to grab lunch; can continue this when I get back or in a github issue or list thread
15:15hyPiRiontechnomancy: well yeah, but what if you want to do something without that profile?
15:15dobladezok... that would be inside the profile itself... I like that... may be some explicit :activation keyword to make it obvious
15:15technomancyhyPiRion: the predicate only determines whether it's included it the :default profile; you can still `with-profiles` to get a different set of profiles.
15:16hyPiRionoh, so something like `with-profile -default` then?
15:16hyPiRionor explicitly use a pair of profiles
15:18dobladezhyPiRion: hmm I think of cases where I what `with-profile xyz` to turn off the auto-activated ones... and other cases where I'd want the auto-activated ones still active :-\
15:18dobladezs/I what/I want/
15:20hyPiRiondobladez: well, you can do `with-profile default,xyz ...` to use the auto-activated ones, and `with-profile xyz ...` to turn them off
15:21hyPiRionIf I understood technomancy correct
15:22dobladezright, but I mean I'd like (in some cases) for the auto ones to always auto-activate
15:22dobladezand leave the option to do -xyz to stop them from doing so
15:22seangroveWow, there's no :as :xml in clj-http?
15:23hyPiRionwell, then use `with-profile +default` or something
15:23hyPiRionit sounds like a very complex task anyhow
15:23hyPiRionbut not impossible with aliases
15:24dobladezhyPiRion: thing is, I want it to be automatic... otherwise, we are back to where we are today :-)
15:25hyPiRiondobladez: what? they are on by default. You explicitly set them off by specifying something like `with-profile abc`, and leave them on by specifying `with-profile +abc` or `with-profile default,abc`
15:25dobladezmy current use case: I need different dependencies depending on OS type. This is always the case for this particular project. So, I'd use a couple of os-specific profiles. However, I also use profiles for other things (dev, prod, etc)
15:28dobladeztoday lein doesn't have that - or + prefix on profiles, right ?
15:29tomjackhmm I think I see why minikanren is full of macros
15:30tomjacknot lazy so you need to use a macro to avoid being to eager..
15:35tomjackYES! https://github.com/thheller/clojurescript/commit/ac764ec98b1e90af3667047cef8ca292e2a9eb58
15:38dakroneseangrove: xml is... xml
15:39dakroneseangrove: I (thankfully) don't have a lot of experience parsing it, but if you'd like to add support for it, it might be useful
15:39dakroneseangrove: that being said, output coercion is pluggable, so you could alway implement it
15:43futileHow would you guys solve this?
15:43futilehttps://www.refheap.com/15758
15:43futileRecursion or something?
15:44arrdemfutile: so you are trying to express that some set of tests triggers others?
15:45futilearrdem: no, they have a shared "context" aka group
15:45futilewhich for now doesnt mean anything except how they're grouped/nested
15:45futileBasically, given all the terminal-nodes of a tree, which contain data about their parents, how do you build up the tree?
15:46arrdemso how to invert a bottom up directed graph into a top-down parent -> children tree?
15:47futileSounds right.
15:47degIs there an idiomatic HOF that applies a function to each value in a map, building a new map with the results?
15:48futileWhat I love about this is that the inputs and outputs are simple and understandable.
15:48futileWhat I don't love is how hard it is to implement.
15:48futile(for a beginner like me)
15:48degBasically map for maps or update-in that acts on all elements.
15:50XPheriorHas anyone in here had any experience using Clojure Cascalog and Pail from the up and coming Big Data book?
15:50XPheriorI know there's a #cascalog IRC channel, but it's quieter than a ghost town in there.
15:50arrdemfutile: pondering... this should be recursive and cute if my gut tells the truth.
15:50chronnodeg: I don't know one, but you can do something like (into {} (for [[k v] {:a 1 :b 2}] [k (inc v)]))
15:51futilearrdem: hmm recursion, yeah sounds right, but a little scary
15:51futilearrdem: I can't see any way without recursion really
15:51llasramXPherior: I use Cascalog pretty extensively. Pail, not so much
15:51futilearrdem: btw I updated it, refresh to see
15:51degchronnon: yup, thanks. That's exactly what I'm doing already but it feels a bit awkward... both verbose and does a round-trip into a seq and back to a map.
15:52futilearrdem: updated to make it easier to understand
15:52XPheriorllasram: My place is trying to use Hadoop in an append-only fashion. Can't for the life of us figure out how to work with Pail.
15:53arrdemfutile: I think that the approach is going to be to follow the parent link all the way back up, then group children based on their parent value.
15:53XPheriorllasram: Can't even find a good example on how to write a custom tap. :/
15:53amalloyarrdem: "all the way back up" will work for trees of depth one, but not deeper trees
15:54llasramXPherior: In what sense do you mean "append-only"?
15:54amalloyi think you walk over the node-list once, building up a list of maps like {:node-id x, :parent y, :children [a b]}
15:54XPheriorllasram: Only ever reading a Hadoop file, or adding to the end of it.
15:54amalloythen you go over that list, and for each node whose :parent is nil, you recursively produce its tree
15:54arrdemamalloy: yep that's what I was thinking.
15:55XPheriorThat's supposedly the point of Pail. "Updating" a Hadoop file in a safe way.
15:55llasramXPherior: Taps aren't so bad. There's pretty much just an interface in Cascading you implement, generally in Java. Cascading itself has lots of examples
15:55arrdemamalloy: you just solve the root location better
15:55futileamalloy: the first part makes sense, the second part still confuses me
15:55XPheriorllasram: I've seen them. I'm not sure why, but it's not clicking.
15:56arrdemfutile: he's saying that the children of node N are (let [id <something>] (filter #(= (:parent %1) id) nodes))
15:56llasramXPherior: Oh. You never append to actual individual files in Hadoop. Hadoop distroes with 2.x code or with backported patches do support it for e.g. HBase, but you still can't do it from MapReduce jobs
15:56llasramXPherior: Instead you just add to a collection of files, usually with something like a new directory per day
15:57arrdemfutile: so you just apply that to every node, recuring as long as the resulting list of children is non-empty
15:57XPheriorllasram: Hm, yeah. I get that. But Pail is supposed to make that transparent.
15:57llasramXPherior: No slight to all the great work nathanmarz has done with Cascalog and Storm, but Pail seems to be something they made up for their book and nobody actually uses
15:57futileOh, and then you start with those whose parents is nil!
15:58futileamalloy, arrdem: that sounds perfect, thanks! Trying now :)
15:58XPheriorllasram: Heh, yeah I got'cha. Do you have any custom Tap code that I can look at?
15:58cbp``deg: reduce-kv is slightly more efficient than that
15:58futileRaynes: please implement elisp and all emacs features in refheap so I can use it easilier without refheap.el
15:59Rayneslol
15:59RaynesI'll get right on that futile.
15:59futileThanks.
16:00XPheriorllasram: Do you recommend we just straight up work with HDFS?
16:00llasramXPherior: Unfortunately nothing recent and open source.... But really, the implementations in Cascading are no more complex than anything else would be
16:00XPheriorHm, alright.
16:00llasramI need to drop off IRC for a meeting, but would be happy to chat more about Clojure<->Hadoop later
16:01XPheriorNo worries. Thanks for the info, llasram!
16:02arrdemfutile, Raynes you're looking in the wrong place! go help port emacs to clojure!
16:02futileActually that doesn't sound like a half-bad idea.
16:02tomjacklazy logic :) https://www.refheap.com/7cb54abc300fc4f470f919774
16:02futileNot that I have the time or knowledge to do it, but it would by default be pretty portable, and Clojure seems like a fine language for an editor.
16:03cbp`Isn't that kind of what lighttable aims to be?
16:03arrdemtomjack: what are you building? a new logic system?
16:03tomjack60 LOC
16:04tomjackI'm just porting Control.Monad.Logic as an experiment
16:04futilecbp`: no, that's a completely different editor.
16:04futilecbp`: emacs is great because of its extensibility.
16:04arrdemcbp`: ibdknox would answer that better than I can but LT does provide the "editor as a single object" structure I'd expect to see in a clojure-idiomatic *macs
16:04tomjackeventually will either try to improve core.logic, or, yeah, new logic thing.. but the latter seems unlikely
16:04futilecbp`: or maybe LT is extensible too. i didnt look into it
16:04arrdemtomjack: mmkay cool!
16:04cbp`light table aims to be extensible too I think
16:05tomjackminikanren seems so unmini..
16:05futilecbp`: oh then maybe its awesome.
16:05tomjackeh actually it is really small
16:05futileI just remember really hating LT's concept of "move a snippet of code around on your screen, detached from the file it's in"
16:05tomjackjust conceptually big
16:06cbp`I'm not sure about the whole implemented in clojurescript thing though. I'd like a multithreaded editor
16:06futilecbp`: for what?
16:06futilecbp`: emacs got along just fine without multi-threading for years
16:06futilethe vast majority of things I do with my editor can be single-threaded, and the few that can't should realistically not be part of an editor
16:07cbp`And now emacs live brings along a bunch of git utilities that slow my emacs to a crawl while searching for a file :(
16:07arrdemfutile: LIEZ. out of band compile and code analysis is awesome!
16:07Bronsaisn't emacs still single-threaded?
16:07futilearrdem: oh.
16:07futilesee, i told you im not very smart about this stuff
16:09futileThe main feature I love about emacs is that it's really just an extensible text-navigator/manipulator, which works on any text. If LT doesn't have that it's not going to be so fun to use.
16:10futilenever mind. i dont know what im talking about.
16:10cbp`I was trying to teach some friends clojure and got them to try lighttable for the instarepl and "easy connect" to projects but they preferred notepad++ + lein repl :P
16:11futileheh
16:14amalloythat tree-building thing was a fun little exercise, futile: https://www.refheap.com/78caa69723d40f0f04139e531
16:14futileamalloy: Well I'm glad you had fun solving the hardest algorithmic part of test2 remaining :)
16:15futileamalloy: I was still stuck on (group-by (comp :group meta) test-fns)
16:16SegFaultAXfutile: The easiest way would be to take the transitive closure of the dependency graph, then group accordingly.
16:16futileSegFaultAX: that sentence assumes I've been to college, doesn't it?
16:16futile:P
16:17RaynesIt assumes you know how to google.
16:17SegFaultAXfutile: Or that you've read I suppose.
16:17amalloyfutile: all of wikipedia is available to you
16:17RaynesI haven't been to college either, bro.
16:17futileoh.
16:17piskettiRaynes: Are you planning to?
16:17amalloythat may be a better approach, SegFaultAX
16:17Raynespisketti: I have a full time job.
16:18RaynesSo nope.
16:18piskettiRaynes: Yes. Full time job and college studies don't go well together. I know
16:19gzmaskquestion about uberjar: I have an ring/compojure web which has some static js/css files under resource folder. when I conjured my uberjar, it appears that I lost those files when I run only the standalone jar file.
16:20RaynesI don't need college, pisketti, I have an amalloy.
16:20piskettiFair enough
16:21amalloyif just being near me were a substitute for a college education, i'd switch careers to "standing next to people, as a service"
16:21RaynesBetter switch careers then./
16:21piskettiamalloy: If you could scale that a bit, you'd be a millionaire
16:21cbp`gzmask: are you referring to them by url?
16:21CaptainLexpisketti: He doesn't need to scale, just find the right demographic
16:22gzmaskcbp`: by relative url
16:22gzmaskcbp`: is the jar file containing the static public files or I'll have to externally host them?
16:25SegFaultAXamalloy: You could be the first SNPaaS!
16:25amalloySegFaultAX: i can't help but feel you're calling me a snap-ass, and if i knew what that meant i'd be offended
16:26cbp`gzmask: the jar contains the files
16:26SegFaultAXamalloy: Relevant (I think) http://xkcd.com/37/
16:26SegFaultAXamalloy: For some reason that's what it made me think of )
16:30arrdempisketti: he lurks here doesn't he? I think he's scaling pretty well, but the monitization needs work
16:30cbp`gzmask: you should refer to them by like: "/css/foo.css"
16:35gzmaskcbp`: i figured it out. I use gaka/css to generate the static file. so I'll have to run the function before I uberjar my app
16:35gzmaskcbp`: I assume the function is ran at compile time, which is when I run lein uberjar. but it is not being run
16:36gzmaskcan I specify a function to be run at 'lein uberjar" ?
16:39jchaunceyi have a deftype that i want to create in another namespace whats the best way to do that
16:40jchaunceyive tried (my.ns.MyType. args) in the repl and that dosnt work
16:41SegFaultAXjchauncey: Is this a namespace you control or are you trying to monkey patch an external ns?
16:41SegFaultAX(If it's the latter, why would you want to do that?)
16:42jchaunceyi control it
16:42SegFaultAXjchauncey: Then just open the file and add it?
16:43jchaunceyi just have a generic http api call that creates a wrapper type for convience, normally i only create them in 1 spot but in this case i need to do it in another namespace
16:51tomjackfutile: arrdem: do we really need multithreading to handle that?
16:51tomjacki.e. 'concurrent vs parallelism' or whatever
16:51tomjackconcurrency.
16:52tomjackdoes LT run on node.js?
16:53tomjackor does it open a browser
16:53tomjack..I guess the latter
16:53callentomjack: it's a node.js desktop app toolkit that works by rendering a web page.
16:53callentomjack: it doesn't really "open" a browser.
16:53SegFaultAXtomjack: What they should have said is that emacs needs and async solution. The underlying model doesn't matter in particular.
16:54gzmaskhow do I serve dynamic content in compojure as css type? I use (get "/aaa.css" (some_fun)) and browser outputs the css as plain text
16:54tomjacksweet
16:54tomjackso we really don't need multithreading for any of tat
16:54tomjackthat
16:54tomjackjust if you actually want to use multiple cores, then we'll have to have multiprocessing or something :(
17:02futileamalloy: this is what I was thinking, except it doesn't quite work yet: https://www.refheap.com/15764
17:02futilere tomjack and arrdem too
17:03futileIs this an inefficient/terrible solution?
17:03tomjackthat `:nested (partial attach-children all-groups)` sticks out
17:03SegFaultAXtomjack: multiprocessing? No.
17:03futileAlso I think attach-children is wrong, something about needing to return a seq of maps rather than a map. But it's kind of confusing me
17:03futiletomjack: yeah that's a bit ugly
17:03tomjacknot that it's ugly
17:03amalloyfutile: you've made it O(n^2) for no particular reason
17:03tomjackwho ever calls :nested?
17:04SegFaultAXtomjack: But potentially some implementation of green threads.
17:04futileamalloy: okay so it is inefficient then.
17:04futileamalloy: it was mainly because I couldn't understand your solution, being so really smart.
17:04tomjackSegFaultAX: in node.js?
17:04futiletomjack: its the way it nests groups
17:04SegFaultAXtomjack: I thought we were talking about emacs.
17:04tomjackno, LT
17:05technomancySegFaultAX: there are OS threads implemented on a branch
17:05SegFaultAXtomjack: For what?
17:05SegFaultAXtechnomancy: ^
17:05tomjackwell, I wasn't :). I was talking about someday (today?) when LT is calling out to git and compilers and shit
17:06futiletomjack: yeah this thing is really broken, never mind
17:06SegFaultAXMy mistake then.
17:07tomjackcbp` unfairly dissed cljs and I had to defend it :)
17:12futileamalloy: (your solution being the thing that's really smart; dang ambiguity)
17:23gzmaskhttp://stackoverflow.com/q/17097254/914774
17:36arohner what is the proper way to refer to a protocol in another namespace w/ (extend-protocol)?
17:36arohnerI'm doing (extend-protocol foo.bar/Baz ...), and getting "Could not resolve Protocol"
17:37arohnerI've required foo.bar
17:47mindbender1arohner: just tested it. It works for me
17:47mindbender1how are you referring to the protocol
17:48technomancydevn: how goes?
18:07mikerodWhy does (require 'clojure.main) seem to hang forever?
18:10mikerodSometimes I suppose.
18:21tomjackcore.async-logic seems kind of like a nightmare, hopefully I'm going about it wrong
18:22tomjackseems like with cljque it would have been a mechanical translation from the sync code
18:32mindbender1,((fn [& coll] (when coll true)) nil)
18:32clojurebottrue
18:33amalloymindbender1: (list nil) is truthy, of course
18:34mindbender1amalloy: that causes NullPointerException
18:34hyPiRionwhat, no
18:34amalloyhuh?
18:34amalloyno it doesn't, that's a crazy claim
18:34mindbender1when passed to for
18:34hyPiRion,(list nil)
18:34clojurebot(nil)
18:34hyPiRionwhat passed to for?
18:35mindbender1,(list nil)
18:35clojurebot(nil)
18:35mindbender1try it
18:35hyPiRion,(for [a (list nil)] [a a])
18:35clojurebot([nil nil])
18:37mindbender1sorry
18:37mindbender1file-seq was the culprit
18:37mindbender1I had a file-seq inside for
18:39hyPiRionyeah, you have to doall those
18:40mindbender1hyPiRion: ok thanks
19:03tomjacklooks like I basically reimplemented part of core.logic
19:03tomjackI knew that should have been the case
19:03tomjackbut I didn't understand take*
19:05tomjacknow I understand why map-sum and -inc and conde and all that :)
19:07tomjackback to debugging my core.logic program :(
19:21dnolentomjack: heh, were you playing around with lazy sequences or something?
19:22SegFaultAXSo I asked this the other night but unfortunately I dozed off and didn't see the replies...
19:22SegFaultAXWhat are some good task/work queues for Clojure. I've played around with Die Roboter, but it's essentially unmaintained at this point.
19:23SegFaultAXIt doesn't seem like there is a solid winner, either. Is everyone just rolling their own solutions for async job processing?
19:26muhooSegFaultAX: i've seen examples in clojure programming of using a blocking queue for that. i was going to go that route.
19:26jodaroSegFaultAX: do you need a client/server type thing?
19:26jodaroor just in process?
19:27jodaroi've used gearman off and on in the past
19:27jodarohttp://www.gearman.org/gearman
19:28jodaroand started writing a clojure lib for it: https://github.com/joshrotenberg/clearman
19:28jodarobut
19:28jodaroit definitely suffers from the "hasn't been looked at in a while" syndrome too
19:28SegFaultAXI'm not particular about the implementation. Being able to shove jobs into a queue and have a worker pool (somewhere) process them.
19:29SegFaultAXThink of like, Sidekiq or Resque or Celery
19:29mthvedtsegfaultax: doesn't java itself have things for async processing in simple use cases?
19:29SegFaultAXmthvedt: Sure. But this is #clojure
19:30SegFaultAXmthvedt: It's stunning to me that there isn't a standard solution for this.
19:30SegFaultAX[in Clojure]
19:31mthvedtsegfaultax: yes, it would be nice if there was a clojure lib, but there's no law saying you can't use java
19:31jodaroif something out there works already and its not pure clojure
19:31jodarothen it probably makes sense to just write a wrapper/implement the protocol
19:31mthvedtin fact one design goal of clojure was to make it easy to use "java for java things"
19:31jodaroi think i went pretty "clojure-y" in my implementation
19:32SegFaultAXI think both of you are missing the point a little.
19:33muhooi mean, isn't this what send-off is for?
19:33muhooi.e. agents?
19:33SegFaultAXWhy doesn't Clojure have a standard "async job queue" solution already. I don't care if it's new or something based on Java etc.
19:33SegFaultAXmuhoo: Well, no. Because you probably don't want to waste cycles on your app server processing background jobs.
19:33tomjackwell there's core.async..
19:34SegFaultAXtomjack: Nope.
19:34muhooSegFaultAX: so wait, did you mean across servers, or in process?
19:34SegFaultAXmuhoo: The former, probably.
19:34muhoothere's rabbitmq
19:34tomjack'standard'?
19:34tomjackas in, 'popular'?
19:34SegFaultAXmuhoo: Sure, as the queue part.
19:34muhooand a good clojure wrapper for it, IIRC, if you're going cross servers
19:35SegFaultAXmuhoo: There's more than just the queue part to running a worker pool though.
19:35tomjackdnolen: https://www.refheap.com/2883107ad83013c34a6acf7cd
19:35tomjacksomehow I acquired the delusion that run* didn't return a lazy seq
19:35tomjack(in core.logic)
19:36SegFaultAXmuhoo: Also "across servers or in process" is a false dichotomy. There /might/ be a working running on the same server but not in the same process, for example.
19:37muhooSegFaultAX: then i'm not sure. i've used java blocking queue for messages. i'm about to start playing with worker queues in clojure right now. examples i've seen use either agents or java blockingqueues.
19:37SegFaultAXmuhoo: You realize that agents and blockingqueues are two /parts/ of the solution right? And really don't have anything to do with each other.
19:39tomjackare you saying you want a contrib library for that?
19:39tomjackor just a popular project?
19:39tomjackand presumably it's a bit more than a library?
19:40SegFaultAXtomjack: Let me give you an example. In the Ruby world, there are a number of standard libraries for this.
19:40SegFaultAXDelayed job, sidekiq, resque, etc.
19:41tomjackI guess bin/resque is the "bit" I was referring to
19:42jodaroresque is redis backed
19:42jodaroso already you've got some other piece
19:42SegFaultAXSure, you could use redis as the transport or queue.
19:42SegFaultAXBut that's just part of the problem.
19:42jodarowow, sidekiq has a fancy dashboard
19:43jodarohttps://github.com/jxa/resque-clojure
19:43jodarolooks unloved
19:43jodarobut
19:43jodarocould be a good starting point
19:44tomjackhmm, why does the resque readme never mention redis config?
19:44tomjackoh I was looking at the dev readme
19:45tomjackso wow resque-web is a whole deal
19:45SegFaultAXtomjack: Resque is less than ideal. Stick with sidekiq.
19:45SegFaultAXtomjack: It's really inefficient.
19:46jodarooh yeah
19:46jodaroanother fancy dashboard
19:46muhooSegFaultAX: well i'm curious, since it seems i'm about to have to tackle what sees to be a similar problem.
19:46SegFaultAXAnyway, the point is it baffles me that this isn't a solved problem already.
19:46SegFaultAXThis is an absolutely common use case.
19:46tomjackdo you think you can solve 'the' problem with one project?
19:46jodaroSegFaultAX: well, it is solved, just in a few places in various states of "solved"
19:46SegFaultAXtomjack: Sure.
19:46tomjackyour problem, surely
19:47technomancySegFaultAX: part of the point of die roboter is that you can do it in ~100 lines, so rolling your own isn't the worst thing in the world
19:47SegFaultAXjodaro: From a community standpoint it isn't solved, then.
19:47jodarogearman is protocol based which is kind of cool
19:47SegFaultAXjodaro: You have a bunch of half-assed or unmaintained solutions.
19:47jodarobut you don't have clojure all the way down
19:47jodarothen again
19:47SegFaultAXtechnomancy: Well and the fact that it uses in-band job specs because they're just clojure forms.
19:47jodaroif you liked the protocol you could write the server in clojure as well
19:48SegFaultAXAs opposed to out-of-band job specs.
19:48technomancySegFaultAX: code-as-data, yeah
19:48muhoohttps://github.com/bdesham/simple-queue actually seems designed for what i need
19:48SegFaultAXtechnomancy: That's a useful feature of Die Roboter. But it has some rather obvious shortcomings.
19:48SegFaultAXtechnomancy: But it doesn't seem like there is a "standard" solution for "I need an async job/work queue"
19:48jodaroSegFaultAX: yeah, i agree, although i'd say that often half-assed is more like good starting point
19:49SegFaultAXjodaro: Usually not.
19:49technomancySegFaultAX: we used that model for petabyte-scale indexing pipeline, so if there are shortcomings inherent in sending the job over the wire, I don't think they're obvious =)
19:49jodaroin a glass half full kind of way
19:49SegFaultAXtechnomancy: Evaling jobs seems less than ideal.
19:50SegFaultAXtechnomancy: Was this for Pulse?
19:50technomancySegFaultAX: no, before heroku
19:50muhooeval? o_0
19:50technomancypulse uses redis because it's OK being lossy
19:50SegFaultAXmuhoo: Die Roboter uses clojure forms to convey job specifications (eg raw code over the wire)
19:52technomancythe only practical downside I can think of is that you don't get line numbers for exceptions in die-roboter's model
19:52tomjackI think I like that idea, but I want my services to know their SHA
19:52tomjackif you solve my problem, it's ok that you don't get line numbers. just take the job and run it locally. you will get the same error.
19:52technomancytomjack: oh absolutely; I would never deploy that to a mixed cluster
19:53technomancyI don't think it's the responsibility of the job system though
19:53muhooSegFaultAX: OIC, it's using rabbbitmq, and so it's dealing with text
19:53tomjackright
19:54muhoodoesn't seem like a limitation of die-roboter, seems like a limitation of using a MQ service and having to serialize the job.
19:54SegFaultAXDoesn't seem very DRY either. Having the option to send the job on the wire is nice, but also chews up a lot of extra bandwidth re-transmitting the same data over and over.
19:54tomjackwell, yeah
19:55tomjacktransact the job code into datomic :)
19:55technomancySegFaultAX: why?
19:55technomancyjust have the job delegate to an existing defn
19:55muhooabusing datomic as a message queue?
19:55tomjackno
19:55tomjackabusing it for code distribution
19:55technomancySegFaultAX: it's a superset of a model that requires predefined job declarations
19:56muhoooh, hmm. sure, no security implications there :-)
19:56SegFaultAXtechnomancy: Well I hadn't thought of that, good point.
19:57SegFaultAXtechnomancy: Would you use die roboter again for this type of thing?
19:57technomancySegFaultAX: if I needed guaranteed delivery of idempotent jobs, I would dust it off, yeah.
19:58technomancyif you don't need guaranteed delivery, I'm not sure I'd tie myself to AMQP because the protocol is very baroque
20:00technomancyI feel like the hard part in that kind of system is dealing with errors and making them highly visible; maybe if I had the luxury I would read up on Erlang and OTP and lean more in that direction.
20:02tomjackkafka and kestrel seem much more approachable to me
20:02SegFaultAXMaybe porting die-roboter to Redis would be worthwhile.
20:02tomjacktechnomancy: what did you mean 'lossy'?
20:03tomjacklosing jobs?
20:03technomancytomjack: with AMQP if you don't ack a message after a given timeout the worker is assumed lost, so the message is put back on the queue for another
20:03tomjackbut there's some problem with redis that prevents doing this?
20:04technomancyyeah, all you can do with redis is pop an item off a list
20:04SegFaultAXtomjack: Redis doesn't broker messages like that. So yes.
20:04tomjackI had struggled to try to understand how the redis-backed queues were doing it
20:04tomjackbut assumed there must be some way I hadn't found
20:04technomancywell redis isn't HA to begin with
20:05technomancyso I don't think you're ever going to get the same kind of guarantees that you do with amqp
20:05technomancyeven if you build some kind of "in-progress" quarantine set for claimed jobs
20:06callenSegFaultAX: I still think a "Jiraph for task queues" would be nice.
20:06SegFaultAXtechnomancy: For my use case I basically never need to be guaranteed that a job ran. And the jobs usually don't return data to the thing that enqueued them.
20:06SegFaultAXSo for me, Redis is a totally worthwhile backend for a job queue.
20:06tomjackthis was my point about solving 'the' problem
20:07tomjackcould you build one project which handled e.g. both cases?
20:07SegFaultAXtomjack: Sure, you could extend die-roboter to be agnostic.
20:07technomancySegFaultAX: my noodling near the end of my involvement with die-roboter was some mildly-nutty handling of serializing exceptions so they can get punted back to the sender
20:07SegFaultAXtomjack: And degrade appropriately based on the transport.
20:08mthvedtcan storm be turned into a job queue
20:08tomjackso you figure out some abstraction which is general enough to cover everyone's use case
20:08technomancyif you don't care about timeouts and error handling you could probably toss like half of the lib
20:08mthvedtstorm is clojure
20:08technomancymthvedt: storm is crazy complicated
20:08jodarohttps://github.com/ptaoussanis/carmine
20:08tomjackwell, if you can, please do :)
20:08jodarothat looks pretty awesome
20:09jodaroi bet you could write a bad ass work/job queue with that and redis and a weekend of clojure hacking
20:10technomancyjodaro: I should put that on the seajure hack night projects list
20:10technomancyI bet you could have something that works in 2 hours
20:11jodaroprobably
20:11jodarogreat
20:11jodarothere goes real work
20:11technomancyyeah, now that you've thought of it you have to go implement it
20:11jodaroneeds a cool name
20:11technomancythems the rules
20:11jodarothats one hour right there
20:11technomancy(that's how slamhound happened anyway)
20:13callenmthvedt: turning storm into a job queue would be the most extreme case of overkill I've ever heard of.
20:13callenmthvedt: that said, you could translate workflows into storm topologies.
20:13tomjackstorm plugs in to job queues
20:13callenmthvedt: but why do you need a clustered real-time infrastructure for it?
20:13tomjackwell, queues..
20:13mthvedtcallen: was spitballing
20:13jodarobrew install redis; lein new werken
20:14jodarohalfway there
20:14callenmthvedt: sure. funny thought though.
20:14technomancyprobably won't be able to beat die-roboter in the theme song department but you can give it your best shot
20:18hiredmanhttp://www.youtube.com/watch?v=SqqCyM6v6B8
20:18callenRaynes: http://inchingforward.blogspot.com/2013/06/adding-markdown-support-to-clabango.html
20:19tomjackI wonder if closure's advanced is deterministic in a useful way
20:19jodarochallenge: accepted. https://github.com/joshrotenberg/werken
20:20jodaromaybe i'll call in sick tomorrow
20:20jodarocall in hacking
20:21callenjodaro: task queue lib?
20:21jodaroyeah
20:21callenSegFaultAX: that's some expert-mode Tom Sawyer dude.
20:21callenSegFaultAX: teach me your secrets.
20:21jodarospur of the moment "holy shit! that sounds way more fun than work!" project
20:22jodaro[18075] 13 Jun 17:17:57.697 # Server started, Redis version 2.6.13
20:22jodaro3/4 of the way there
20:22jodaroheh
20:22callenjodaro: I know that feel. I have a backlog of projects like that. #sadface
20:22jodarototally
20:22callenjodaro: one request - pluggable backends ala Jiraph.
20:22jodarohmmm
20:22jodarowell ....
20:22jodarothe challenge was kinda redis specific
20:22technomancyI thought about doing pluggable backends for die-roboter
20:22callenjodaro: satisfy a set of methods/protocol that make it work, then it works with different backends.
20:22technomancybut IMO it's just not worth it
20:22jodaromainly because carmine looks so rad
20:22technomancydifferent queues have different semantics
20:23callentechnomancy: it's an itch for me because I had to work on a job queue about a billion items long once.
20:23jodarocallen: i'll definitely try to keep that in mind
20:23callentechnomancy: so stuff like RabbitMQ/Redis was pretty much straight out.
20:23callenjodaro: but even a simple redis task queue would be very nice
20:23jodarobaby steps
20:23callenSegFaultAX: have you tried Carmine's?
20:24technomancyrabbit can keep queues on disk these days
20:24jodaroi've actually only toyed with redis in the past
20:24jodaroso
20:24jodaroit will be a learning experience for me
20:24callentechnomancy: from my tests, rabbit choked several orders of magnitude away from a billion.
20:24jodaromy coworker is all hot on redis, though
20:24callenjodaro: redis is sexy.
20:24jodaromaybe i can get him involved and he can get his clojures on
20:24callenjodaro: you'll like it.
20:24jodaroyeah it seems pretty nice
20:25jodarolua support
20:25jodarothat could come in handy here
20:25callentechnomancy: rabbit's really not made for long-lived job queues.
20:25technomancyyou'll end up with something a lot simpler with redis because there are certain guarantees you simply can't make =)
20:25jodaroheh
20:28jodaroi'll be able to guarantee your job might get run
20:28jodaroseems good enough
20:28devnhm, is there a way to destructure cleanly in a ->>
20:29jodarobetween the repl and redis-cli, this is a darn nice environment, i'll say that
20:29callenjodaro: redis is a happy place.
20:31devnit'd be cool to do something like (->> {:a 1 :b 2} [[{:keys a b}] [a b]]) => [1 2]
20:31muhoowhat's the appeal of redis? it's a kv store, right?
20:31callendevn: I'm not sure, if you figure it out, let me know.
20:31callenmuhoo: data structures as a service with atomic commands.
20:32devnit's really not ->> anymore if it does that
20:32devnit's just a shame I can't just drop a let into -> or ->>
20:33justin_smith,(->> {:a 1 :b 2} ((fn [{:keys [a b]}] [a b])))
20:33clojurebot[1 2]
20:33callenmuhoo: sproc'ish lua scripting, low latency, nice cli. It's just a very low overhead and smooth experience to use redis most of the time as a developer.
20:33muhoocallen: thanks
20:33callenmuhoo: so queues for example, in Redis are trivial because it as things like LPUSH and RPOP
20:33jodarostrings, hashes, lists, sets and sorted sets.
20:33jodaronice
20:34callenmuhoo: bitmaps, for which it was good commands for doing population counts, etc.
20:35callenmuhoo: http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/
20:35callenmuhoo: http://redis.io/commands
20:36callenmuhoo: I talked to the guy on the phone, I should be talking to him again about the project tomorrow.
20:43tomjackcallen: that is a neat trick
20:44tomjackis the requirement for sanity that you've got an idempotent monoid?
20:45tomjackhmm, I dunno what I mean
20:46tomjackoh, yes, a=(a*b)*b <=> a=a*(b*b)
20:46tomjackwell, that's wrong too, but anyway neat trick
20:48callentomjack: wait, what did I do?
20:48tomjackthe bitset blog post
20:48callenoh
20:48tomjackthe rest of what I said was meaningless I think
20:48tomjackobviously it's gonna work out when you're working with a set of bits..
20:50tomjackbut 'setbit' is dangerous
20:54tomjackI think every time I've said "garbage-in garbage-out" about clojure to someone, I've thought "I don't believe what I am saying"
20:55bbloomtomjack: it's a trade off
20:55bbloomtomjack: if you want to prevent garbage in, you need to add asserts or static verification
20:55bbloomthat comes with complexity
20:55bbloomor performance impact
20:56tomjackcomplexity of implementation?
20:56tomjackfor the language author
20:57bbloomno
20:57tomjackfor language users?
20:57bbloomdepends on the particular restriction you're trying to impose
20:58bbloomfor example ##(keyword "x y") could incur a performance penalty by regex matching it's input
20:58lazybot⇒ :x y
20:59tomjackthat's a good one
20:59bbloomthat would be complexity for the language implementor, who needs to consider all those possible error cases & handle them & throw nice errors
20:59bbloomyou could imagine a type system with variants of asset
20:59bbloomlike you could have assert, check, and assume
20:59bbloomassert throws an error if some condition isn't met
20:59bbloomcheck would check the condition & then annotate the symbol as meeting the condition or not
21:00bbloomand assume would just say "eh, fuck it" and opt in to garbage in / garbage out
21:00tomjackeh, I remain unswayed
21:00bbloomi'm not suggesting you actually do this
21:01tomjackI mean by your keyword example
21:01bbloomi'm saying that there are dynamic properties that you'll never be able to check or verify either satically OR at runtime or that you wouldn't want to check
21:01bbloomthere can be much more complex things to check
21:01mindbender1garbage in garbage out is the law of truth
21:02tomjackthese things I do not want in my language
21:02bbloomlet's say i have a function that accepts a lazy sequence and needs to know that the number of entries in the sequence is even
21:02bbloombut the seq does not fit in memory
21:02bbloomyou can keep a count & throw an error… AT THE END
21:02bbloomyou can't throw an error up front
21:02bbloomthat's garbage out
21:02bbloomyou got a lazy seq out that was invalid
21:03bbloomgarage in / garbage out is the only sensible design for a dynamic language without a type system when performance is critical
21:04tomjackok, yeah
21:04tomjackthat I can agree with
21:04tomjackthat a static type system adds complexity.. dunno about that
21:04bbloom*shrug* i think that optional typing is the way of the future, but we're not quite there yet :-P
21:05tomjackI've thought about that, but I see one problem
21:05bblooms/optional/pluggable/
21:05bbloomclojure has a type system. it has like 9 types: 8 java primitives plus "object" :-)
21:05tomjackmaking things the way I want them would require e.g. fixing the behavior of keys
21:06bbloomi assume you're talking about my msg to the mailing list just now? are you in favor of my suggestion?
21:06tomjackit's hard to say
21:06brehautbbloom: and arrays?
21:06tomjackI think so
21:06bbloommy hesitation now was jean's msg that i overlooked
21:07tomjackbut if I get the optional typing I want, there will be many other problems in clojure.core
21:07bbloomapparently keys is, logically, (partial map first)
21:07bbloombut that is bugged too
21:07tomjackI can't fix them all, it'd be a different language. so, oh well :(
21:07bbloomso i want either my proposal, or fixing keys to properly mimic (partial map first)
21:07tomjackI'd definitely rather have your proposal
21:08bbloomme too :-P
21:08bbloombut the jean's comment basically means that my proposal is a breaking change, so i don't think we can get it
21:08tomjackexactly
21:08tomjackno one can even tell if they rely on garbage-out behavior in previous versions
21:09bbloomin the absence of my proposal, i don't really care about fixing the illusion of (partial map first), even though i think it is in fact a bug in that interpretation of keys
21:09tomjackI always wondered why sometimes calling keys on the wrong thing caused craziness in my repl
21:09bbloomtomjack: yea, relying on garbage-out is the biggest issue facing dynamic language APIs
21:09bbloombrb
21:10tomjackand yet if you try to embed a language which attempts to solve some of these problems inside clojure, people won't use it, because it's not clojure :)
21:11tomjackI guess the approach could be to bootstrap inside clojure and then fork off
21:13tomjack..oh, yes, like bodol
21:15papachan,(cl-format nil "~{~R~^, ~}" [1 2 3 4])
21:15clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: cl-format in this context, compiling:(NO_SOURCE_PATH:0:0)>
21:16bbloom,clojure.pprint/cl-format
21:16clojurebot#<CompilerException java.lang.ClassNotFoundException: clojure.pprint, compiling:(NO_SOURCE_PATH:0:0)>
21:16papachan,(require '[clojure.pprint :refer [cl-format]])
21:16clojurebotnil
21:16papachan,(cl-format nil "~{~R~^, ~}" [1 2 3 4])
21:16clojurebot"one, two, three, four"
21:17bbloombwa? you can require/refer in clojurebot?
21:17papachanbbloom: yes
21:19bbloom,(require '[clojure.core :refer (inc) :rename {inc cl-format}])
21:19clojurebot#<IllegalStateException java.lang.IllegalStateException: cl-format already refers to: #'clojure.pprint/cl-format in namespace: sandbox>
21:19bbloom,(require '[clojure.core :refer (inc) :rename {inc cl-format2}])
21:19clojurebotnil
21:19bbloomodd, so i can mess up clojurebot's names if i'm the first person to import a namespace?
21:20bbloom,clojure.walk/prewalk
21:20clojurebot#<walk$prewalk clojure.walk$prewalk@636c8d>
21:26Denommusdamn
21:26DenommusI was able to run a clojure app in android
21:27Denommusbut now I want my launcher activity to be a Java activity, but no matter what I try, the application crashes. And since I don't have a backtrace or something similar, I have no idea on what's happening
21:57DenommusI think I understood the problem
21:57Denommuswhen my clojure application is compiled, it defines a class called "Application", which is then used by the AndroidManifest
21:58Denommusbut this class is being generated by android code
22:02papachanDenommus: any github to see your project?
22:06Denommuspapachan: no, I'm just starting
22:06Denommus*this class is being generated by clojure code
22:06papachanApplication class?
22:06Denommusyes
22:06Denommuswith the defapplication macro
22:06Denommus(defapplication com.spell.chat.Application)
22:07DenommusI think clojure needs this class to run correctly, I can't just remove it from AndroidManifest
22:07Denommusbut if I try to put a bootstrap Java activity, it crashes. I guess because it tries to run before the Application class is even loaded
22:08Denommusis there any tutorial covering how to use a bootstrap Java activity?
22:08papachangenerally you can extends the Application Class
22:09Denommusyes. Clojure is doing that with (defapplication com.spell.chat.Application)
22:09Denommusbut I don't know what would be the implementation under the hood
22:10DenommusI think the implementation under the hood actually loads the clojure environment, so that clojure code can run
22:11Denommusdifficult sittuation
22:11clojurebotclojure is the best
22:11Denommushave you ever done android development with clojure, papachan?
22:12papachanDenommus: not yet
22:12DenommusI'm successful if I don't use a java activity as my launcher
22:12Denommusbut then the application takes 5~10 seconds to load
22:13beppuWhat could it possibly be doing to make it take that long to load?
22:13callenthat sounds about standard for Android Clojure apps.
22:13Denommusit loads the whole clojure environment. That's expected, actually
22:14Denommusthe problem is not taking that long to load, I could be away with it in my application because I could use the time to log the user in asynchronously
22:14Denommuswhile showing some loading animation
22:15Denommusbut, to do that, I'd need a Java launcher, which I don't seem to be able to use
22:19Denommuswell, I'm going home
22:19Denommusbye
22:21dcooper8so is emacs/swank still used for clojure?
22:22technomancydcooper8: swank still works but isn't actively maintained; nrepl.el is recommended instead
22:22brehauthttp://technomancy.us/163
22:23brehautthanks technomancy, now i look like an idiot
22:24bbloomheh, that domain name w/ that tld sounds like a verb
22:24bbloomproblem? technomancy it!
22:25technomancythe guy who owns technomancy.org is a php hacker
22:25brehautim sorry to hear
22:26technomancyoh, no it's just python
22:26technomancymy bad
22:26brehautmaybe he got a clue since you last looked
22:26bbloomcould be worse. there could be a gay canadian porn star with the same name as you (as there is for me)
22:26brehautawkward
22:26bbloomyou can imagine how that would be confusing if you were looking for my github account, right? :-P
22:27bbloomthe day i got that google alert was… surprising
22:27brehauthaha
22:28technomancyheh: http://www.kindle-maps.com/blog/how-to-walk-across-dublin-without-passing-a-pub-full-publess-route-here.html
22:29bbloomtechnomancy: awesome.
22:30bbloomthey say "here's the route", but i wonder if they could show the union of all the routes
22:30bbloomlike is there only one route? is this a bug that one pub closed?
22:30brehautbbloom: but then they'd have to write more code with open street maps javascript, which is roughly comparable to performing surgery on yourself with only a darning needle
22:34bbloomsurely the solution is mobile pubs.
22:34bbloommotorized beer carts
22:34technomancyyou mean ... epubs?
22:34brehaut~rimshot
22:34clojurebotBadum, *tish*
22:35brehautopen source ipa http://yeastieboys.tumblr.com/post/52208987616/digital-ipa-recipe
22:35brehautgood luck sourcing the hops
22:40brehautrelated: http://yeastieboys.co.nz/beer/gunnamatta-ipa/ earl grey IPA
22:50sineerlamina looks pimp! Exactly what I needed and much more!! and the doc... amazing stuff
23:00dpwright_I'm trying to create a function inside a macro and add it to a list during execution of that macro (ie at compile time)
23:01dpwright_I have the body of the function stored inside a variable called body, so that (fn [] body) doesn't work because what I really want is (fn [] ~@body) or something, except since this is happening as part of the macro and not the value returned from that macro, it's not quasiquoted or anything like that, so ~ style syntax won't work
23:02dpwright_is it possible to do this? Or am I being stupid and should I just return commands to do that from the macro and have them execute outside of the macro like a sane person would do?
23:02dpwright_actually, I think that's probably the answer, isn't it? :-P
23:16cgagi'm playing with clojurescript and node-webkit and getting this error when i try to connect with the browser repl
23:16cgagUncaught Error: URI file:/robots.txt is invalid for field ppu
23:16cgagI can get rid of it by just manually deleting any lines referencing robots.txt in the compiled js, has anyone run into this and solved it in a more elegant way?
23:26futileNow then.
23:45futileI'm not gonna lie about it: programming is hard.
23:58futileThis whole thing feels...
23:58futile...futile