#clojure logs

2013-02-20

00:00Raynespbostrom: Yup, that's probably it.
00:01pbostrombut I assume there is a reason why that tester sym gets def'd
00:01Raynespbostrom: There probably isn't any reason to generate a different symbol every time. A fix is probably to do the (gensym "tester") bit in the let right before the init-defs, add that symbol to the init-defs, and then pass that symbol to evaluator.
00:03RaynesThen it'll only ever generate a def for that single symbol and it will be accounted for by init-defs so it shouldn't affect the number of defs allowed at all.
00:05RaynesDoes that make sense?
00:08pbostromRaynes: I think so, so it follows that the tester-str is also only read once, outside of the evaluator
00:09Raynespbostrom: Nope.
00:09RaynesThat part is important.
00:10RaynesAll that needs to change is where the tester-sym comes from.
00:10Raynes(the reason it is important is because the test can change per-evaluation)
00:10Raynestester*
00:12pbostromok, so only one gensym, pass the tester gensym and the tester-str to the evaluator, and which will always redef the same symbol
00:12Raynespbostrom: Yessir, that should do it.
00:13RaynesAlso, good work tracking that down.
00:14pbostromnp, thanks for the help, I'll try it out
00:40pbostromRaynes: I think that worked, want me to send a pull request?
00:41Raynespbostrom: Please do!
00:45yedi_i like the diversity of function 'shapes' in lisp
00:47amalloythey're all (round), yedi_
00:52pbostromRaynes: just sent it, let me know if I messed something up
00:54ChongLiI think he's referring to the shapes of the trees
01:33Raynespbostrom: Going to look at that here in just a bit. Busy with something else at the moment
01:43xeqipbostrom: what are you using clojail for?
01:51nonubynewb q: I want to map in a -> however i want to subsituted arg to be the 3rd pos rather than 2nd pos due to map fn col, best workaround?
01:52nonubywrap in a let and create a partial fn in the let binding?
01:53RaynesProbably to not use ->
01:53Raynes-> is designed for the specific case where it works.
01:54RaynesYou tend to lose readability benefits when you push it into doing what you want.
01:56Raynescallenbot: http://www.youtube.com/watch?v=Le-3MIBxQTw new moosic for you.
01:56nonubyfair point but rather avoid (f (g (h (i x)))) issue without needless decompisition to seperate defns
01:57amalloyyou can interject a ->> clause, although the improved readability is way lower that way: (-> x (foo blah) (bar baz) (->> (map inc)))
02:05callenbotRaynes: nice. Also I added the results for laser with type-hinting
02:05callenbotRaynes: it made no difference, not that I'm surprised.
02:05RaynesIt was more significant than that on my machine when I ran it (multiple times)
02:05RaynesBut it was never really that significant.
02:06Raynescallenbot: Just finished the move to laser and pushed to master.
02:07callenbotRaynes: there was a slight difference but the increase in std dev leads me to believe it's almost a wash.
02:07RaynesSTD levels!?!?!
02:07RaynesJesus, you gave laser stds.
02:07callenbotRaynes: more to my point - the semantics of the template engine will define its terminal performance, not things like type-hinting.
02:07callenbothiccup is the exception to the rule.
02:57noprompti'm a bit confused about writing macros for clojurescript
02:57nopromptdo the source files need to be in the same place as the cljs files?
03:24ro_stthey have to be .clj files, but they can be with your cljs or in a separate folder structre
03:26RaynesRuh roh.
03:28ro_stas long as the cljs compiler can find them
04:10Raynescallenbot: Live refheap is running laser.
04:17fredyrls -l
04:17lazybotdata dev etc media mnt opt root sbin selinux srv swap sys usr
04:18fredyrwops
04:46clgvhaha. lazybot seems not to be secretive about its filesystem
04:46clgvls -l /home
04:46lazybotbin boot root sbin src srv swap usr var
04:46clgvls
04:46lazybotboot etc lib sbin srv sys tmp usr var
04:47clgvok it is cheating
04:47Rayneslol
04:47Raynesecho hi
04:47lazybothi
04:47clgvRaynes: you added a honeypot simulation to lazybot? ;)
04:48RaynesThat is all amalloy_ 's doing.
04:49clgvbut you let him ;)
04:49RaynesHe has commit rights just like me. :p
04:50clgvthats no excuse :P
04:50Rayneswhoami
04:50lazybotRaynes
04:50clgvwhoami
04:50lazybotclgv
04:50Raynespwd
04:50lazybot#clojure
04:50Raynesmutt
04:50lazybotWoof!
04:50clgvwhy are those commands not prefixed?
04:50RaynesBecause they're jokes.
04:51clgvah ok. so you want to have them triggered from time to time ;)
04:51RaynesAye.
04:52RaynesPeople have a tendency to forget that their IRC client isn't their terminal.
04:52Rayneshttps://github.com/flatland/lazybot/blob/develop/src/lazybot/plugins/unix_jokes.clj
04:52RaynesAnyways, Anthony go sleep.
04:58clgvgood night^^
04:58clgvls
04:58lazybotdata dev etc lost+found root src swap usr
04:59clgvls
04:59lazybotbin boot data home lost+found media proc selinux srv swap sys usr var
04:59clgvah there is random selection in it ^^
05:31progoho hum. I started storing a list of maps (containing functions of ns A) in a namespace B. Now I have to re-eval both namespaces in order to get effect of modifying those functions.
05:31progoI know an indirection with #' probably helps but not exactly certain...
05:33progoah, probably with @#'foo-balls
05:35progobut it quickly descends into code that doesn't look much like anything in the Style guide, The Joy of Clojure. You know, (def foo [#'foo #'bar #'fez]) and later of a (doseq [f foo] (deref f))
05:40augustlwhat's the name of the class for a .clj file with (:gen-class) in the ns macro and a -main method defined?
05:40augustlneed to run it with jsvc, where the argument is a jar file and the name of the class where main can be found
05:45dbushenkois there any good parsers combinators library for clojure?
05:53lucianugh, there's a collision on the name flatland between clojure (http://flatland.org) and python (https://pypi.python.org/pypi/flatland). i can't find similar schema systems for clojure
05:53aroemers_dbushenko: https://github.com/blancas/kern
05:53aroemers_dbushenko: no experience with it though
05:55dbushenkoaroemers_, wow! never heard of it! thanks!!
05:55aroemers_Has anyone had the problem that lein deps would say it could not resolve a dependency, without saying which one? As in, the first and only thing lein deps says is a resolve error...
05:55clojurebotAlles klar
05:56aroemers_I already tried lein -U deps.
05:56aroemers_clojurebot: I am not German! I'm Dutch!
05:56clojurebotHuh?
05:57aroemers_dbushenko: no problem, I only knew it because of the clojure mailing list
06:23ucbaugustl: I think you can find that out when you do your :aot; I think the classes are left in target/
06:25augustlucb: what's my :aot? :)
06:26ucbaugustl: your ahead-of-time compilation; I've little experience with creating java classes from clojure, but I suspect that the name will be related to the ns/filename your creating the class in
06:27ucbWhen compiling, generates compiled bytecode for a class with the
06:27ucbgiven package-qualified :name
06:27ucbaugustl: ah! from the docs. ^^^
06:27ucbstupid limechat :/
06:28augustlI should probably just set a :name then instead of relying on the autogenerated name
06:29ucbprobably a good idea
06:46clgvaugustl: there are replacement rules for the characters that are not allowed in java variable names or class names, e.g. "-" -> "_", "*"-> "__STAR__" and such
06:46augustlclgv: ah, I see
06:47clgvaugustl: they should be located somewhere near this method clojure.lang.Compiler/munge
07:10augustlclgv: in the class file itself, you mean?
07:18augustlanyone ever put a clojure app under jsvc? Or got some suggestions for how I should run a clojure program on a server that isn't a servlet .war? :)
07:20augustlseems the easiest way to become jsvc compat is to just write the jsvc main in Java
07:26mknoszligaugustl: simply using the uberjar doesn't work?
07:27augustlmknoszlig: well, I need to make a main class that's jsvc compatible, jsvc doesn't just execute a main
07:27augustlso I'm wondering what people typically do - use jsvc, or do something else
07:28mknoszligaugustl: i see ... in that case i guess you could generate that class in clojure code (using proxy or reify) i guess
07:30mknoszligaugustl: or gen-class
07:41degWhat causes "NullPointerException [trace missing]"?
08:15aperiodicaugustl: i run all my sites from uberjars
08:15aperiodicaugustl: the startup's faster since you're not compiling the clojure code, and it's an easy command to wrap in init/upstart/monit scripts
08:17aperiodicaugustl: and you're only starting 1 jvm
09:06DerGuteMoritzhey guys, is it possible to implement a protocol on primitive array types?
09:10DerGuteMoritzah okay, it works just like that
09:10DerGuteMoritzsorry for the noise :-)
09:59samratIn nrepl.el, I'm trying to make stacktraces show up in the nrepl buffer itself: https://www.refheap.com/paste/11543, but I don't see the whole stacktrace.
10:00samratany ideas what I'm doing wrong?
10:03augustlaperiodic: so you just run them with java -jar?
10:03augustlaperiodic: how do you handle crashes etc?
10:42gfredericksaugustl: I'm curious about that too; SCPing and running an uberjar is easy, but keeping it up is the not-easy part.
10:42gfredericksat least if you're not used to ops stuff :)
10:43aperiodicaugustl: upstart scripts
10:44aperiodicthey're pretty trivial to write and the process will be instantly restarted if it crashes
10:47aperiodicthough i've been known to have my fair share of public-facing things running from a tmux session =P
11:06S11001001aperiodic: the tricky part is knowing when not to restart (e.g. too many restarts in n secs); upstart handles that, right?
11:17TimMcWhat's a good way of being notified of failures of a service?
11:19bbloomTimMc: log analysis is the only sane way. don't rely on exception notification services
11:20TimMcSo I guess what I want is a desktop app that watches log files for specific triggers.
11:21bbloomdesktop app?
11:21bbloomTimMc: the simplest thing to do is to use a syslog config that sends you an email
11:21brianwongif this is a public facing service
11:22brianwongthan services like Pingdom give a good end-to-end check on it
11:24TimMcBasically, I want to hack togehter little backup scripts and other non-public services that run on my laptop (or other primary computer.)
11:24TimMcI had one doing backups of a doc collaboration site, but I didn't notice it had stopped working until 4 months later. :-P
11:26brianwongin that case, I do not have any helpful suggestions. Most monitoring solutions I am familiar with are overkill for watching a local process on a workstation
11:27TimMcYeah, it's an odd little niche.
11:27bbloomTimMc: nah, it's pretty common
11:27bbloomTimMc: you need a heartbeat
11:28brianwongfirst thing you should do is find out if your workstation's service manager can start/restart it
11:28TimMcI have upstart, so that's a start.
11:28bbloomi know a few folks who run 10+ cron jobs a day on their machines & they get a status email from them. basically you add 1 extra cron job that runs after all the other ones and sends you a little text email with the output & any errors or anything
11:29bbloomlog & grep & sendmail get the job done pretty easily
11:29TimMc:-)
11:39clgvTimMc: fail2ban watches logs and usually bans ip addresses on certain ports. it can send mails as well. there is a good chance to get it configured to only send you a mail
11:41kastermaDoes anyone know how to get multiple incanted plots into one window? I am running an algorithm trying to keep an eye on multiple properties and the different windows are rather cumbersome.
11:41kastermas/incanted/incanter/
11:54technomancyno, I like incanted
11:54technomancyincanter is for incanting plots
11:54technomancywhen you incant them, they get incanted... makes sense to me =)
11:56kastermamine must have become too incanted
11:59clgvkasterma: do not use `show` if you do not like the windows. instead embedded the plots in a your jframe where you want to have them ;)
12:00kastermaclgv: i.e. no way to avoid thinking of JFreeChart to do this?
12:01clgvkasterma: jfreechart is only responsible for the chart. incanter puts them in the jframe when you call show
12:02kastermaclgv: thx, I think that points me in the right direction to figure this out.
12:20TimMcbbloom: I like that approach, with cron.
12:25pbostromxeqi: ping
12:47jasonbrayIs there a specific version of JFreeChart I should use with Incanter? Getting a 'No matching method found' for draw in ChartFrame when saving pdfs.
12:53clintnewsomDoes anyone out there know how to join a persistent vector in clojurescript?
12:55dnolenclintnewsom: what do you mean join?
12:56clintnewsomsorry, i mean to join as a string
12:56clintnewsomi.e. (clojure.string/join ", " [1 2 3])
12:58dnolenclintnewsom: you need to (:require [clojure.string :as string]) in your namespace delcaration and (string/join "," [1 2 3]) will work.
12:59clintnewsomthank you!
13:05brianwonghey clintnewsom!
13:05brianwongim learning clojure as well
13:05clintnewsombrianwong: awesome!
13:05brianwonghappy to know that you are hacking away
13:06clgvjasonbray: it installs the version it needs
13:07clgvjasonbray: so if you did not specify a different (newer) version manually it should work. otherwise there is a bug
13:09clintnewsombrianwong: :-) good to see you here! you need to lead the cljoure revolution at nypl!
13:10brianwongim afraid I do not have the clout. I can at least use it for my projects.
13:12clgvnyp?
13:12brianwongwe both work for the new york public library
13:12clgvah ok^^
13:14clintnewsombrianwong: btw, I can't make it, but the Clojure meet up tonight looks pretty good
13:14brianwongit wasnt on my radar. Unfortunately, I cant make it either. Thanks for the heads up though.
13:20gtrakare folks planning on hanging around wednesday afternoon at clojure/west?
13:21jeremyheilergtrak, yeah, i'll be around. my flight out of there is thursday.
13:26augustlhow do I see the full stacktrace in lein repl, instead of just the message?
13:26gtrak*e
13:27augustlwhat's a good way to print the whole thing?
13:27gtrak.printStackTrace is the java way, clojure's got a package somewhere
13:27gtrakhttp://clojuredocs.org/clojure_core/clojure.stacktrace/print-stack-trace
13:28augustlnice, thanks
13:29jeremyheiler(pst) also works
13:30jeremyheilerThat is, clojure.repl/pst
13:30gtrakah
13:35callenbothaving a grand time with korma lately.
13:36callenbotnot sure how I'll feel when a more complicated query comes up though.
13:47callenbotdsantiago: how did you do the caching in stencil? LRU?
14:07dsantiagocallenbot: The cache is pluggable.
14:08dsantiagohttps://github.com/davidsantiago/stencil#manual-cache-management
14:09ChongLiis there anything wrong with going ahead and extending the type of javascript objects for protocols like ILookup
14:09ChongLi?
14:10ChongLimakes it a lot cleaner to use them instead of aget all over the place
14:10callenbotdsantiago: but how does it work? :(
14:11amalloyChongLi: that's a feature that's so obvious i'm pretty sure they thought of including it in cljs itself, but didn't include it; i bet there was a reason
14:12callenbotdsantiago: I'm considering giving Clabango a bionic upgrade.
14:12ChongLiamalloy: that's why I asked
14:12amalloyperhaps it's because you can't lookup anything but strings?
14:12callenbotdsantiago: stencil won the clojure template benchmark thing I did btw.
14:13ChongLihmmm
14:13ChongLiso it's really a broken implementation of the protocol then
14:14ChongLidomina does this
14:14ChongLihttps://github.com/levand/domina#event-objects
14:17muhooi'm trying to access the raw body using this http://groups.google.com/group/compojure/browse_thread/thread/455e667c26913bd , but i can't find this request function anywhere. bare use, so i have NFI where it came from. also can't seem to find this duck-streams namespace, and there's no 'compojure namespace either.
14:17technomancyhttps://github.com/technomancy/leiningen/wiki/Faster <- tips for getting Leiningen to start faster; comments welcome
14:18technomancyor ... it's a wiki, I guess, so you can edit it yourself. whatever
14:18muhoo(request :body) <-- would be great, if only i could find that function.
14:19technomancymuhoo: duck-streams is from old monolithic clojure-contrib
14:19weavejestermuhoo: What do you mean by request function? I can't seem to access the thread you're linking to.
14:19muhoois that where request comes from?
14:19weavejestermuhoo: The request is passed into the handler function as an argument.
14:19weavejestermuhoo: e.g. (defn handler [request] ...)
14:20xsynI'm very new to Clojure, and I was wondering if there was a way to go into a block, what for each function to return and only once it's returned go to the next function
14:20muhoonot if i'm um using the "/:id/food" destructuring, it appears
14:20xsynmake something procedural out of a functioal language
14:20xsynala https://gist.github.com/xsyn/4998355
14:20weavejestermuhoo: Check out: https://github.com/weavejester/compojure/wiki/Destructuring-Syntax
14:21weavejestermuhoo: If you have a route like "/:id/food"
14:21technomancyxsyn: that's how clojure works by default, though if you need multiple calls to become one expression you can use `do`
14:21weavejestermuhoo: Then you can do something like (GET "/:id/food" [id :as {body :body}] …)
14:22xsyntechnomancy: so I should remove the do in my example?
14:22dnolen_Added a bunch of ideas for GSoC 2013 projects, http://dev.clojure.org/display/community/Project+Ideas some them are doozies
14:23ChongLidnolen_: wow you're going to mentor all of these?
14:23technomancyxsyn: the do doesn't make sense since its first form is a map. that map will never get returned.
14:24dnolen_ChongLi: no way, they are just ideas
14:24ChongLiah ok haha
14:24xsyn*nod*
14:24ChongLiI see Ambrose has some stuff in there
14:24technomancyxsyn: each request can only have one response
14:26muhooweavejester: http://groups.google.com/group/compojure/browse_thread/thread/455e667c26913bd0
14:26xsyntechnomancy: cool, I think I was trying to be lazy and cheat that. So I should just set up a setup a couple of routes.
14:26muhooweavejester: yep, (GET "/:id/food" [id :as {body :body}] ...)
14:26weavejestermuhoo: Oh wow, that's old.
14:26muhoo looks like the winner, thanks!
14:27weavejestermuhoo: I think that example is back from version 0.1.0. It might predate Ring.
14:28ChongLiis clooj meant to sound like kludge?
14:40dnolen_ChongLi: heh yes it is
14:45ChongLihmmm, adding piggieback keeps breaking my project due to its use of an older gclosure library
14:48pbostromChongLi: I ran into that as well
14:50pbostromChongLi: are you using cljsbuild? I noticed that cljsbuild picks up the old Closure library because of the piggieback dependency, I don't understand why though, it seems like cljsbuild should maintain it's own Closure dep
14:51ChongLiyeah, cljsbuild
14:54cflemingHi everyone
14:54ChongLihey there
14:54cflemingI'm having a problem with AOT compilation
14:55joegallodo tell
14:56cflemingI'm working with a Java framework - when I try to AOT compile a file containing something like (def myvar (SomeClass/staticMethod x y z)) the compiler will attempt to evaluate the LHS during compilation
14:57cflemingI had expected that it would generate code with a static initialiser and call the code at class initialisation time
14:58cflemingi.e. like Object myvar = SomeClass.staticMethod(x, y, z) would in Java
14:58joegallowhat is the evidence that you're using to determine that the latter behavior is what is happening? i'm not sure, but i think you've made a leap there.
14:58joegallothat is, I do A, I get B stacktrace, I've decided that C is why.
14:58joegalloYou've told us A and C.
14:58cflemingI get an NPE during compilation, and the stack trace shows the compiler trying to execute the function
14:58hiredmancfleming: top level forms are executred when code is loaded
14:59hiredmancfleming: code is loaded when code is compiled
14:59meegoflHi
15:00meegoflSmall Q regarding maps and lists
15:00cfleminghiredman: is there a way to get the effect I want, i.e. to AOT compile something but defer the execution to when the NS is require'd?
15:00meegoflhow can i create a map from 2 lists such as (key1 key2 key3) (val1 val2 val3)?
15:00hiredmancfleming: that are lots of ways
15:01gfredericksmeegofl: zipmap
15:01hiredmanfor example how do you normally defer execution of until you want it?
15:01cflemingI could use a function, but in this case the static method is expensive
15:02meegoflgfredericks: Thanks
15:02hiredmanso what do you normally do when a function call is expensive?
15:02cflemingI guess I could memoize it or something, but that seems like a fairly complex solution to a simple problem
15:02meegoflis there a way to do the same when first list items are not marked with ':'?
15:03technomancycfleming: why do you say memoization is complex?
15:04cflemingtechnomancy: I guess I'm thinking of the implementation rather than the use of it
15:04cflemingThis is something that's fairly simple to achieve in Java, I just wanted to check I wasn't missing something obvious
15:05cflemingIn this case the code is called a lot of times, and for performance reasons just initialising a constant would be better
15:06technomancyJava's model is different because it doesn't have the compiler at runtime, so it's forced to introduce an otherwise-unnecessary distinction.
15:07cflemingWhy do you say it's unnecessary?
15:07warzim trying to learn good formatting practices. is there any way to make the following middleware function, for ring, more concise or clean? https://gist.github.com/ryancole/4999031
15:07cflemingIn this case it's pretty much exactly what I want.
15:08warzall it does is lookup a record in a database, using clutch, and add it to the ring request map
15:08technomancycfleming: yes, your case is relatively uncommon, and it's easy to introduce delays either by a function or via `delay`. having a single execution environment that supports compilation as well as runtime is simpler.
15:08technomancyand more powerful
15:08technomancyit just seems awkward because it's unfamiliar
15:09technomancycfleming: instead of introducing an entire new mode of operation just to support delaying something to runtime, you can use existing mechanisms for delays. fewer moving parts, etc
15:11cflemingBut if I use delay, I'm still going to get the same problem with AOT compilation, right?
15:11ChongLino
15:11cflemingi.e. it will be evaluated during compilation
15:11technomancydepends on when you force the delay. it's up to you.
15:11ChongLidelay delays evaluation
15:11cflemingAh, I see - I have to deref it
15:11ChongLithat's the entire reason it exists :)
15:12ChongLiyou have to force it
15:12cflemingThanks.
15:12ChongLiyou could also just wrap it in a function of no arguments
15:12ChongLiand then call taht
15:12cflemingThe perils of having to integrate with Java frameworks
15:12ChongLiclojure has a lot of nice features for integrating with java frameworks
15:12ChongLijust takes some getting used to
15:13cflemingYeah, but it has some awkward corners sometimes
15:13cflemingAnother question - is it possible to get reflection warnings without actually fully compiling?
15:14cflemingIn this case I'm only really trying to AOT compile to check that I've caught all the reflection warnings.
15:14ChongLiyou mean with *warn-on-reflection* ?
15:14cflemingIf I could do that then I can do without AOT for the majority of what I need to do.
15:15cflemingRight. Ideally I could do a lein check-reflection-warnings that would give me the warnings without having to compile everything.
15:15ChongLiput (set! *warn-on-reflection* true) at the top of a source file
15:15hiredmancfleming: have you seen `lein check` ?
15:16ChongLicfleming: if you work in a repl you can just set that at the start of your session
15:16ChongLiand then as you work you'll get the warnings
15:16ChongLihttp://clojuredocs.org/clojure_core/clojure.core/*warn-on-reflection*
15:16cfleminghiredman: I haven't, what does that do?
15:17hiredmanread the docs for it
15:17cflemingChongLi: I can't do that since this code is loaded inside the framework
15:17hiredmanhuh
15:17hiredmanno docs
15:17hiredmantechnomancy: what gives?
15:18cflemingI can't find anything on it
15:18hiredmanwell just try it
15:18cflemingUnfortunately I'm not using leiningen yet for this project
15:19ChongLiahhh
15:19hiredmanwell, that is your mistake right there
15:19ChongLimy hair is on fire!
15:19technomancyhiredman: dunno; I didn't write that one
15:19technomancyIt does say "Check syntax and warn on reflection." at least though
15:19cflemingunfortunately it's not a trivial project to convert (intellj plugin)
15:19ravsterhello all
15:19technomancyoh dear
15:20hiredmantechnomancy: it doesn't show up in lein's help
15:20cflemingInteresting, that does sound like exactly what I want.
15:20hiredmantechnomancy: hah, nm wrong version of lein of course
15:20technomancyaha
15:23cflemingtechnomancy: btw, the wget command in the lein 2 upgrade page needs a --no-check-certificate
15:23technomancycfleming: erhm... that's really not a good idea to recommend by default
15:24cflemingUnfortunately the github cert isn't trusted
15:24technomancyyou should probably fix your CAs
15:25cflemingThanks, I'll look into that
15:25Frozenlo`,(= 0.0 0)
15:25clojurebotfalse
15:25technomancyif I put that on the wiki the security berserker we keep on staff would come after me
15:25hyPiRion,(== 0.0 0)
15:25clojurebottrue
15:26Frozenlocko_O
15:26FrozenlockThe more you know...
15:26cflemingUnfortunately it looks like 'lein check' just compiles the code
15:26pjstadigFrozenlock: given what you know...be careful when dealing with JDBC
15:27hyPiRion,(== 0 0.0M) ; worth a shot, but digdec is mean
15:27clojurebotfalse
15:27hyPiRiongenerally use (< (abs (- a b)) epsilon) for floating point
15:28technomancyinexact numbers can't generally be equal to exact numbers
15:29TimMc,abs
15:29clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: abs in this context, compiling:(NO_SOURCE_PATH:0:0)>
15:29TimMcMath/abs, I guess
15:30brehautis anyone else getting "Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: No reader function for tag ordered/map" when running lein kibit ?
15:31Frozenlock,(= 4/2 2)
15:31clojurebottrue
15:32FrozenlockAt least this works.
15:33hyPiRion,(identical? 4/2 2)
15:33clojurebottrue
15:33hyPiRionwoop
15:33hyPiRionNow, that's dangerous to do in general.
15:34FrozenlockEh, after #=, I feel like nothing's dangerous :P
15:35rcgis there something like junitreport for clojure tests?
15:35rcgi want to have some nice summary of unit test results
15:36rcgfor now i run the stuff simply via leiningen
15:36rcghowever, having a better overview would be nice
15:40FrozenlockI'm lost on this one... any idea what might be causing this? java.lang.NullPointerException: Numbers.java:3755 clojure.lang.Numbers.gt
15:49stuartsierraFrozenlock: Somewhere your code is comparing a nil to a number with >
15:49Frozenlocknvm, I was passing a `nil' when I was sure it was only numbers.
16:05rhin0xhi
16:05rhin0xI started toying with clojure 1.4 and have a question
16:06xeqipbostrom: pong
16:07rhin0xwhy does '(map-indexed print "abcd")' give me '(0 a1 bnil 2 cnil 3 dnil nil)'
16:07rhin0xto be more specific
16:07rhin0xthe nil are in strange places when I look at it
16:07jeremyheilerrhin0x, print returns nil
16:08rhin0xshouldn't this be like this '(0 anil 1 b nil 2 cnil 3 dnil)'
16:08rhin0xI know
16:08rhin0xhouldn't be there a nill after every pair
16:08rhin0x?
16:09TimMcrhin0x: The printing of the output is being mixed with your explicit print commands.
16:09jeremyheilerThe nils are being printed concurrently with the output.
16:09TimMc&(doall (map-indexed print "abcd"))
16:09lazybot⇒ 0 a1 b2 c3 d(nil nil nil nil)
16:10rhin0xok, now it makes more sense :)
16:10TimMcConcurrency + lazy side-effects.
16:10yedican we take a second to point and laugh and feel superior: http://discursive.com/2013/02/19/rails-you-have-turned-into-java-congratulations/
16:11yedii know doing so is beneath some of you, but it'll make you feel good!
16:12rhin0xthank you very much
16:12yediseriously though, i liked this quote: "Frameworks that Eat Frameworks don’t like it when you Customize the Frameworks they Eat"
16:17ldhjust reading that myself
16:28ravsterI'm trying to use wrap-basic-auth, but the following line inside a cond is blowing up with a "Can't cast to clojure.lang.IPersistentMap" error --------------------> ((:headers req) "authorization") (wrap-basic-authentication (partial create-session! handler) user/login)
16:29ravsterI don't think its the wrap-basic-auth call, since the following works just fine -----> (def login (wrap-basic-authentication login-handler user/login))
16:30xeqiwhat is req?
16:30ravsteroh, gah. just got it. I made the create-session! partial expect a full request, and wrap-ba is giving it only a usermap.
16:33ravsternvm. create-session! doesn't get called at all
16:34ravsterxeqi: https://www.refheap.com/paste/11560 <----- is the req
16:34pbostromxeqi: you were asking me what I was using clojail for; I put together a shareable web-based repl: http://cwo.io/
16:37xeqipbostrom: neat. and that would be really annoying
16:39pbostromxeqi: I'm working on integrating with paste sites like gist and refheap, and I started to notice that if I pulled in a paste with any defs it would blow up in different ways, luckily I was able to fix it with help from Raynes
16:45olenhadHey guys, whats the current status of source maps for cljs?
16:46ravsterfixed create-session! but it still doesn't get called. And the authentication function user/login doesn't get called either.
16:49ToBeReplaceddnolen_: Is there a way to have create an n-dimensional domain in core.logic.fd ... wondering how to represent cartesian coordinates
16:52dnolen_ToBeReplaced: no way to do that which is built in.
16:52olenhadOr rather,has any existing project started on multilevel source maps for cljs?
16:53dnolen_ToBeReplaced: tho the idea is that you could do that w/o much hassle yourself. I need to iron out the constraint protocols a bit more before it can be done reliably
16:53dnolen_olenhad: source map merging is already in a branch in ClojureScript
16:53dnolen_source-map is the branch
17:01ToBeReplaceddnolen_: okay thanks
17:02ravsterhttps://www.refheap.com/paste/11563 <-- is there something wrong with my wrap-basic-authentication call? I'm unable to get anything printed from the user/login function.
17:05harobHi all, I have a performance question: I would have thought that it is better to declare a regex outside of a frequently called function rather than inside it, to avoid having the regex be re-generated each call. But when I test in the REPL, `(time (dotimes [i 10000000] (re-find #"[1-9]ab(c|d)" (str i "abdblabla"))))` is just as fast as `(time (dotimes [i 10000000] (re-find r (str i "abdblabla"))))`. How is this possible? Is the Clojure compiler doing somethin
17:05harobsimilar to string interning, to effectively only create the regex once?
17:07dnolen_harob: well it's a literal constant and Clojure optimizes those
17:07TimMcI believe regex literals (#"...") are compiled and stored as static fields.
17:07TimMcIn any case, yes, the reader compiles them in advance.
17:08harobOk, that makes sense, thanks.
17:09harobDo you know if the same applies to inner functions bound with letfn within frequently called functions? I get similar benchmarking results, but I don't have a good mental model for how Clojure is handling those.
17:10AtKaaZcan the currently defined namespace be aliased like with :as when :require happens in a different namespace?
17:11AtKaaZaliased within itself I mean
17:11TimMcI doubt it, but give it a try.
17:12AtKaaZit doesn't work like (ns a :as b)
17:12AtKaaZI find myself copy pasting code which is fully qualified to the alias, then i've to search/replace
17:12TimMcWell, de-aliasing is easy enough.
17:13AtKaaZwell this seems to work (ns runtime.q (:require [runtime.q :as b]))
17:13TimMcs|\balias/||
17:13TimMcI'm surprised it works.
17:13TimMcIt's pretty confusing, though.
17:14AtKaaZi like it :)
17:14AtKaaZi can't believe i didn't try it before asking, what was I thinking?!
17:15sritchiedo you guys have advice for toggling development mode vs production mode in a compojure app?
17:15harobWhen I benchmark, `(time (dotimes [i 100000000] (letfn [(g [x] (inc x))] (g i))))` is as fast as `(letfn [(g [x] (inc x))] (time (dotimes [i 100000000] (g i))))` ; does this mean that Clojure is not regenerating the function each time in the first case? I have trouble seeing how it could handle things like closed-over variables in that case.
17:15sritchieI'm looking for dev mode to fire up a clojurescript repl, production mode to skip it
17:15harobsritchie: We use the RING_ENV environment variable, which I think is a common idiom."
17:16hyPiRionharob: `time` is generally a bad way to benchmark
17:16hyPiRionuse criterium instead
17:16hyPiRion(At least that's a bit better, though not perfect)
17:17harobhyPiRion: Do you mean because of the warm-up iterations of the hotspot compiler? Or for another reason?
17:18hyPiRionwell
17:19hyPiRion,(time (reduce + (range 1000000)))
17:19clojurebot"Elapsed time: 1417.94432 msecs"\n499999500000
17:19hyPiRion,(time (reduce + (range 1000000)))
17:19clojurebot"Elapsed time: 1323.675351 msecs"\n499999500000
17:20TimMcharob: GC, hotspot, caches, statistical analysis...
17:20hyPiRionIt's hard to say anything when you got variation
17:20sritchieharob: gotcha
17:21harobFair enough, point well taken, although in this case I was trying to check if two operations were the same order of magnitude speed.
17:21sritchie(defn dev-mode? [] ( = "dev" (System/GetEnv "RING_ENV")))
17:21technomancysritchie: you can put a config file in dev-resources which tells it to launch the repl; that will only be visible via resources from lein if you're not in production
17:22FrozenlockIs there a map that will keep the order by which its elements were added?
17:22technomancysritchie: I recommend not managing that kind of config by hand; either use environ or carica
17:22sritchiecool, hadn't seen carica
17:22ravsteranyone here with experience in using remvee's basic-auth library for ring? I'm figure out what I'm doing wrong. https://www.refheap.com/paste/11563
17:23technomancyravster: you need to pass req to the handler you get from wrap-basic-auth
17:23holohi
17:24technomancyravster: or better yet just use wrap-basic-auth as a real middleware
17:24holois anyone being able to use google openid login url successfully in clojuredocs.org? I'm using https://www.google.com/accounts/o8/id but it doesn't work
17:25ravsterreal middleware?
17:25ravsterI'm trying to get both basic- and cookie-auth working, and basic-auth wouldn't play with that.
17:26ravsterso I'm trying to call it only when there isn't a user in :session.
17:26ravsterhow do I pass the req? I've tried (partial create-session! handler req)
17:27sritchietechnomancy: feeling slow --
17:27ravsterstill getting -----------> java.lang.ClassCastException: api.utils.basic_authentication$wrap_basic_authentication$fn__115 cannot be cast to clojure.lang.IPersistentMap
17:27sritchietechnomancy: how can I actually switch based on the value in ring_env? I can do it manually, but you're recommending against this
17:27sritchiemanually meaning, System/getEnv
17:28technomancysritchie: I just mean I don't recommend setting RING_ENV by hand on each dev box you work on; using environ is fine
17:28technomancycheck (:ring-env env) or whatever
17:28technomancyactually no, that's silly
17:28technomancypick a better name
17:29sritchieoh, I see, the "environ" library
17:29sritchiethought you meant the java env
17:29technomancyoh right
17:30sritchienice! okay, great, environ looks like the way to go.
17:31sritchieand pick something other than RING_ENV because ring's using it? seems like it might be good, since ring uses the same switch, right?
17:31technomancyoh, does ring actually use that? if so that's fine.
17:31technomancyotherwise choose a name that actually reflects what you want to use it for
17:32callenbotsritchie: http://www.luminusweb.net/
17:32callenbotsritchie: best practices for this can be found in Luminus
17:32callenbotsritchie: you should try using it
17:33callenbotsritchie: we use lein ring and all that fun stuff.
17:33sritchieinteresting, cool
17:33sritchiedoes luminus pick up where noir left off?
17:33callenbotsritchie: no, it's more "close to the source"
17:33callenbotsritchie: it uses lib-noir but it is largely vanilla Ring.
17:33brehautyogthos: you are required in the lobby
17:33callenbotsritchie: I've got a fairly involved Luminus-derived vanilla Ring app that you could learn from.
17:34sritchiecallenbot: I'd love to take a look
17:34sritchieI've just started working more on paddleguru.com
17:34sritchiewhich ran on noir
17:34sritchie(needs a designer :)
17:34technomancyenviron is pretty straightforward to figure out on its own though
17:34sritchietechnomancy: yup, environis a great tip
17:34callenbotsritchie: what's the database?
17:34sritchiecouchdb
17:35callenbot :
17:35sritchieit's been really good, really hoping that cemerick keeps devving on the plugin
17:36callenbotI'm not allowed to say anything, I promised Raynes I'd be nice.
17:36callenbotsritchie: I used to work with one of the largest Couch clusters that existed at the time. I've not worked with it since. Draw thine own conclusions.
17:36cemericksritchie: I'm saved by the couch api not moving much ;-P
17:36sritchiecallenbot: where did you go from couch?
17:37callenbotsritchie: mixture of PostgreSQL, MongoDB, and Redis depending on the problem being solved.
17:37callenbotsritchie: for the analytics stuff I used to use couch for, I use PostgreSQL or Hadoop.
17:38callenbotsritchie: but I used Couch for what was literally its prime use-case and it was still fairly awful.
17:38harobAlright, so I benched with criterium and got the same results: `(letfn [(g [x] (inc x))] (criterium.core/bench (g 200)))` is the same speed as `(criterium.core/beanch (letfn [(g [x] (inc x))] (g 200)))` . I'm deducing that this means that there is no perf overhead to having a letfn function declaration within a frequently called outer function. Does anyone have any intuition of how Clojure can do this (i.e. not regenerate the function each time)? And does that
17:38harobonly apply if the inner function does not close over any variables?
17:39callenbotsritchie: this is vanilla Couch I speak of, I haven't tried CouchBase 1.x or 2.0
17:39callenbotmostly due to emotional scarring
17:39cemerickbbloom: FYI: (template (foo ())) => (foo nil)
17:40sritchiecallenbot: man, I'm curious about what the pain was
17:40sritchiecallenbot: building views with mapreduce has been working really well
17:40bbloom,`()
17:40clojurebot()
17:40callenbotsritchie: you're working on a side project
17:40bbloomcemerick: ok, i'll fix it :-)
17:40cemerickcallenbot: couchbase != couchdb
17:40callenbotcemerick: I KNOW THAT
17:40callenbotcemerick: I was clarifying that I was speaking only about CouchDB
17:40cemerickOKAY
17:40callenbotsritchie: you could make-do with flat files on a side project.
17:41callenbotcemerick: I wouldn't have made the distinction otherwise.
17:41sritchiehaha, fair enough. you're saying if I tried to use this at twitter I'd be a bit fucked.
17:41callenbotsritchie: that's not really the point
17:41callenbotsritchie: it sucks for small stuff too.
17:41callenbotsritchie: I asked you what database you were using because one of the pages felt slow.
17:41sritchieah
17:41sritchiegotcha
17:42cemerickcallenbot: The preponderance of large couch deployments (and very, very large bigcouch deployments) doesn't back that up.
17:42sritchiecemerick, what say you?
17:42callenbotcemerick: lots of people use MySQL too
17:42callenbotcemerick: doesn't mean it doesn't suck.
17:42sritchiecallenbot: what specific problem did you find?
17:42callenbotreligion, databases, etc. Number of deployments don't mean much.
17:42sritchiespeed?
17:42sritchie
17:42clojurebotspeed is dangerous
17:42cemerickbbloom: I could put a patch together if you care to wait, but I figure it's a quickie.
17:43sritchieif it sucks, I want to know, I just haven't hit too much pain yet
17:43bbloomcemerick: annoyingly, i can't see a way to do it without special casing it
17:43cemerick"sucked for me" isn't much of an argument
17:43ravstertechnomancy: how would I pass the request object to the handler function from wrap-basic-authentication?
17:43cemerickbbloom: I thought it was special-cased in LispReader? ;-P
17:43callenbotsritchie: http://blog.woobling.org/2009/05/why-i-dont-use-couchdb.html I don't need to repeat what others have covered.
17:43callenbotcemerick: ^^
17:44cemerickI don't have a dog in this fight, particularly. But, saying "couch sucks" is silly.
17:45callenbotsritchie: I've also found that if you need to query "documents", Lucene is an order of magnitude faster
17:45sritchiecallenbot: yeah, I'm not a huge evangelist, just looking for what to watch out for as we move forward
17:47callenbotsritchie: I'd avoid using unusual abandoned document stores for anything important unless you really know what you're doing.
17:47technomancysomeone's database choices are like their ex-girlfriends; you don't know all the details, and you probably don't want to.
17:47brehauttechnomancy: haha
17:47brehautand wise
17:47callenbottechnomancy: it's something I have experience with and I don't want some poor schmuck contractor to have to clean it up.
17:47callenbottechnomancy: I don't pipe up unless I know
17:48callenbotmost of my career has been cleaning up fuck-ups and careless decisions like that.
17:48callenbotI'd rather less of it be so.
17:48callenbotengineers should know better.
17:48technomancybrehaut: I can't remember who said that, or I'd attempt proper attribution
17:48technomancycallenbot: for paddleguru.com? really?
17:48callenbottechnomancy: I said it was whatever for a side project.
17:48bbloomcemerick_away: heh check this out:
17:49bbloom,[(list*) (apply list nil)]
17:49clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$list-STAR->
17:49bbloom,[(list* nil) (apply list nil)]
17:49clojurebot[nil ()]
17:49technomancycallenbot: ok, fair enough
17:50bbloomcemerick_away: pushed 33c5b5a & deploying it now
17:50sritchiecallenbot: yeah, I don't anticipate hundreds of thousands of users, unfortunately
17:51callenbottechnomancy: but if you're being paid to build something, you shouldn't subject your client to absurd and not-thought-out technology decisions. I use my side projects to test new things, personally.
17:51sritchieyeah, this is something I started, then handed off to a buddy --
17:51technomancysure
17:51sritchiehe's been using couch for a while, now I'm coming back into clojure from some time in scala-land
17:51callenbotsritchie: pro-tip: don't bother trying to make views faster. Just cache.
18:05edoloughlinI'm returning to a dormant project and migrating it to 1.4. I've discovered that in the CCW repl I can no longer redefine functions. The (defn) or (defn-) evaluates and returns ok but the functions are not changed - whatever was loaded when the repl started is still executed. Any ideas?
18:06RaynesHas refheap been working well today?
18:07callenbotRaynes: works here boss.
18:07RaynesGood news.
18:07RaynesI kinda pushed a total rewrite of the views and then just bugged off and went to bed last night.
18:07Raynes:p
18:07RaynesDidn't do much QA.
18:09callenbotRaynes: it's a free service. *shrug*
18:09RaynesI still kind of care about it though
18:09RaynesEspecially since it is now a live example of laser.
18:09callenbotSure.
18:09ravsterokay, so (do(let [foo (wrap-basic-authentication (partial create-session! handler req) user/login)])) works and "lein test" returns 1 failure and 1 error. But if I have the wrap-basic-auth call all by itself, lein test gives 0 fails and 2 errors. What am I not understanding over here?
18:10callenbotRaynes: seems snappy/fast to me.
18:10callenbotRaynes: are you caching recent pastes?
18:10Raynescallenbot: No.
18:10RaynesDefine 'caching'
18:11RaynesI never run pastes through pygments more than once. I store that in the db to speed thing sup.
18:11RaynesBut no caching of anything besides that.
18:11callenbotRaynes: db caching
18:12callenbotso, no, I guess.
18:13RaynesIt's probably faster because it isn't on heroku, callenbot.
18:13callenbotRaynes: where's the MongoDB instance?
18:13RaynesOn the same server.
18:13callenbotRaynes: that'd be why.
18:13callenbotRaynes: fast VPS
18:15brehautoh nice, jetty has aquired spdy support
18:15brehautapparently a while ago too
18:15callenbotbrehaut: GAE is Jetty
18:15callenbotbrehaut: SPDY is Google
18:15callenbotbrehaut: GAE is Google
18:16technomancyoh oh, I know this
18:16technomancytransitive property of "is"
18:19hyPiRionWell
18:20hyPiRiontransitivity isn't enough here I think. Like mathematically.
18:20augustlconverting from Ruby's bcrypt to the JBcrypt module is proving to be quite challenging..
18:20TimMcNeeds to be symmetric as well, yeah?
18:20callenbotaugustl: don't.
18:20hyPiRionTimMc: +1
18:20callenbotaugustl: use lib-noir crypt.
18:21hyPiRionThough I'm usually thinking of isa-relation and uses-relations
18:21callenbotaugustl: although that itself is [org.mindrot/jbcrypt "0.3m"]
18:23augustlah, it was actually quite easy, I just had to figure out how sorcery (super magic authentication system for Rails) worked
18:23augustlit uses its own salt for some reason, that it appends to the password before authenticating against the bcrypt hash
18:23callenbotaugustl: that is awful.
18:24augustl(org.mindrot.jbcrypt.BCrypt/checkpw (str password-from-user salt-from-sorcery) bcrypt-hash-from-sorcery)
18:24augustlcallenbot: isn't the bcrypt hash both a hash and a salt?
18:24technomancywell... for a library named sorcery, you should expect it to do crazy magic behind your back
18:24technomancy(says a guy named technomancy)
18:24augustlindeed :) I'm glad I ported this system from Rails to Clojure
18:25callenbotaugustl: I came to Clojure from Python
18:25callenbotaugustl: although i used to do Ruby
18:25augustlnot that Rails itself is bad, but this particular app is full of magic libraries like sorcery, that I have to reverse engineer to achieve portability ;)
18:26brehauttechnomancy: magic like making maven reasonable?
18:26brehautor some approximation of reasonable
18:27callenbotaugustl: I prefer to work with things I mostly understand or better.
18:27augustlspeaking of maven and magic :) I'm using ZeroMQ in this project, managing the JNI glue is quite painful. Ruby-gems will automatically compile their own native extensions on demand, seems I have to do it by hand for maven/leiningen.
18:27technomancyrubygems still needs dev headers, and recompiles them for every install, which is nuts
18:28technomancyaugustl: you can do it automatically with lein, it's just the responsibility of the packager to compile it properly
18:28technomancy...and nobody who uses native deps has bothered to document it yet =\
18:29amalloyi wonder if anyone has an opinion on the nicer-looking way to implement a multi-arity function by reducing itself. given that the two-arity clause works, which is better for 3+ args? ([x y & more] (reduce f (list* x y more))), or ([x y & more] (reduce f x (cons y more)))?
18:30Bronsa(reduce f (f x y) more)?
18:30hiredmanamalloy: x y & more is an error if you have a 2 arity
18:30hiredman& more matches 0 or more args
18:30lazybotjava.lang.RuntimeException: Unable to resolve symbol: more in this context
18:30amalloy&((fn ([x y] y) ([x y & more] more)) 1 2 3)
18:30lazybot⇒ (3)
18:31amalloyi dunno if you still have lazybot on /ignore, but the result is (3)
18:31hiredmanamalloy: sure, but it is a logical error
18:32amalloyi don't understand that claim
18:32augustltechnomancy: ah, so it is possible to create jar files that compile the JNI stuff on install?
18:32augustlif so, got a link? :)
18:32hiredman,((fn ([y] y) ([x y & more] more)) 1 2 3)
18:32clojurebot(3)
18:32hiredmanoh
18:32technomancyaugustl: no, not on install. you compile them and put the artifacts in the jar and deploy that jar
18:32technomancycompiling on install is crazy
18:32hiredman,((fn ([y] y) ([x y & more] more)) 1 3)
18:32clojurebotnil
18:32hiredman,((fn ([x y] y) ([x y & more] more)) 1 3)
18:32clojurebot3
18:33hiredman,((fn ([x y & more] more)) 1 3)
18:33clojurebotnil
18:33augustltechnomancy: isn't that problematic? Since the reason it should compile on install is that it needs to know about the stuff you already have on your system, in my case the install of zeromq itself
18:33callenbotamalloy: http://blog.darevay.com/2011/08/briefly-the-arity-reduce-pattern-in-clojure/ ?
18:33technomancyaugustl: the jar should include zeromq
18:33technomancystatic linking is the only way to do this that isn't crazy
18:34technomancyhttps://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/classpath.clj#L42
18:34augustlbut the compiled zeromq itself is architecture specific (32bit vs 64 bit)
18:34technomancyaugustl: where "should" here is a Leiningen convention; maven itself has nothing at all for this unfortunately
18:34technomancyaugustl: yep. put them both in the jar.
18:34augustlI see
18:35hiredmanlogically [x y & foo] is not a function that takes some number of arguments greater than 2, it is a function that takes 2 arguments or more
18:35technomancythe alternative is either 0) rubygems or 1) what you're currently suffering through.
18:35augustlso it would make sense to create a jar for jzmq that includes this and put it on clojars?
18:35technomancyaugustl: I think someone's already done that
18:35hiredmanso and (([x y] …) ([x y & more] …)) logically both overlap at arity 2
18:35technomancyalso: 32-bit? seriously? =)
18:35augustltechnomancy: I'll check that out, tnx
18:35callenbotwho runs zeromq on a 32-bit server?
18:36callenbotjeez, let me whip out my 486DX web server
18:36technomancyaugustl: worst case: you add an architecture-specific line to :dependencies
18:36amalloyi don't see your point, hiredman. as long as i'm aware, when writing my function, that the [x y] clause exists and (f 1 2) will be sent to it, then writing [x y & more] to expect 3+ args is fine. i'm aware that i don't *need* the two-arg case, if i wanted to implement that in my 2+ arity, but implementing 3+ in terms of 2+ is often clearer
18:36amalloyer, in terms of 2
18:37augustlcallenbot: is zeromq specifically bad in 32 bit? Or are you talking about 32bit in genreal?
18:37technomancyaugustl: we could use some help documenting this stuff if you're familiar with JNI
18:37technomancymost people won't touch it
18:38augustlbeautiful.. https://www.refheap.com/paste/11569
18:38augustltechnomancy: I would love to help out, I'm set on using zeromq and I've certainly felt the pain
18:38amalloyfor example, the defintion of clojure.core/=
18:38hiredmanamalloy: regardless of what the compiler allows, both arities in that case accept 2 args, which is ridiculous
18:39augustltechnomancy: what wold you like documented specifically?
18:40hyPiRionhiredman: There are worse things
18:40hyPiRionlike
18:40hyPiRion,(false? (Boolean. false))
18:40clojurebotfalse
18:40TimMcThere are always worse things. :-)
18:40technomancyaugustl: well... the process of packaging a jar that contains native components, I suppose
18:40augustltechnomancy: I see
18:40amalloyhyPiRion: the discussion doesn't seem in need of a red herring at this time
18:41augustltechnomancy: seems like it exists for zeromq yeah, https://clojars.org/brh/jzmq-native-deps for example
18:41technomancyaugustl: I suppose some kind of integration with autotools might be necessary? that kind of stuff is over my head.
18:42technomancyat least we should document the structure of the jar that Leiningen looks for
18:42augustlme too, I don't really know what all this stuff actually is..
18:42hyPiRionamalloy: Ah, no intent to direct the talk away from the arity thing.
18:43hyPiRionPing me when you need that red herring.
18:43hiredmanamalloy: anyway, core does it that ways [x y] [x y & more] so it is unlikely to change suddenly
18:44amalloyindeed. i wasn't asking whether to use [x y] [x y & more] (i have no intention to do anything different), just seeing if anyone felt strongly about the body of my [x y & more] clause
18:50bendlas,(unchecked-multiply 0xcafebabe 0xcafebabe)
18:50clojurebot-6848008922003888892
18:50bendlas,
18:50bendlasArithmeticException integer overflow clojure.lang.Numbers.throwIntOverflow (Numbers.java:1388)
18:50bendlasuser> ,(unchecked-multiply (Long. 0xcafebabe) 0xcafebabe)
18:50clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
18:50bendlas,(unchecked-multiply (Long. 0xcafebabe) 0xcafebabe)
18:50clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
18:51hiredmanbendlas: unchecked math only works on primitives
18:51bendlasthis is a bug, right?
18:51amalloy,(unchecked-multiply (unchecked-int 0xcafebabe) (unchecked-int 0xcafebabe))
18:51clojurebot790811295510209796
18:51bendlasso unchecked multiply defaulting to checked multiply when faced with boxed values is a feature?
18:52TimMcThat's surprising and unexpected behavior.
18:52FrozenlockIs there some css and compojure functions to pretty-print clojure code in a webpage? (with colors and all that sweet stuff)
18:53hiredmanbendlas: I doubt anyone has bothered to care because most people who want one want the other
18:53hiredmanthe main argument for both unchecked math and primitives are speed
18:53TimMcI'm more concerned about the misleading error.
18:54amalloyTimMc: misleading?
18:54TimMcWell, more "baffling".
18:54bendlasit's unexpected, but at least it doesn't fail silently
18:54TimMcNot sure what's to be done about it, though.
18:55bendlasin this case it's unexpected, because unchecked- fns are supposed to fail silently
18:55TimMcbendlas: Only once you hit a large enough number.
18:57TimMcIt would be much safer to fail on boxed inputs, always.
18:59bendlasTimMc: I'd say so too, edge cases still should have clean edges
19:14sritchiecemerick: do you have any good advice for a clojurescript repl in emacs?
19:14Rayneshttp://24.media.tumblr.com/tumblr_m4awrpjJjL1rvnefzo1_500.gif
19:16callenbotsritchie: if you discover such a thing, come back here and tell us about it.
19:16sritchie:)
19:16callenbotsritchie: https://github.com/dustingetz/cljs-bootstrap
19:17bendlassritchie: not cemerick, but inferior-lisp in combination with lein cljsbuild browser-repl has served me well
19:17sritchieah, yeah, that makes sense
19:17sritchiejust have inferior-lisp run that command for cljs files
19:17cemericksritchie: see piggieback
19:17bendlasI think there is even a tutorial for that on google
19:18sritchiecemerick: link?
19:18sritchieoh, was searching for piggyback
19:18cemericksritchie: http://github.com/cemerick/piggieback
19:33sritchieanyone using shoreleave?
19:33ohpauleezyes
19:33ohpauleez:)
19:33muhooheh
19:33RaynesI was about to say that I bet ohpauleez is using it.
19:33RaynesI wonder if anybody uses laser.
19:33RaynesOh wait.
19:34ohpauleezsritchie: I know of a good few people that are using it in production
19:34sritchielooking at shoreleave-remote
19:34ohpauleezI have a few apps in production that are using various pieces
19:34sritchievs fetch, for example
19:34ohpauleezsritchie: Most people just the the remote stuff and the pubsub stuff
19:34sritchieor some other similar thing I haven't heard of
19:34sritchiegotcha
19:35ohpauleezsritchie: remotes in shoreleave are CSRF-protected. Additionally the interfaces are extended to handled pooled XHR, one-off XHR, JSONP
19:36ohpauleezthe whole suite of shoreleave is basically protocols extended to JS internals, so you can use them with standard Clojure functions
19:37muhoowhat about the *read-eval* thing?
19:37ohpauleezsritchie: updates forthcoming, but https://github.com/shoreleave/shoreleave-baseline
19:38sritchiehey, nice
19:38sritchiethanks
19:38ohpauleezmuhoo: shoreleave server side uses safe-read (as does fetch). In the next release (once 1.5 final is out, that'll be replaced with read-edn
19:39TimMcHas Core not yet released an edn-reader contrib?
19:39muhooohpauleez: cool, thanks
19:39ohpauleezTimMc: I'm not sure if the reader contrib has cut the release yet. The code is there
19:40tommo_guys, how can i execute an expression x times?
19:41gfredericksdotimes
19:41tommo_<3
19:41gfredericks,(dotimes [n 3] (println n))
19:41clojurebot0\n1\n2\n
19:41TimMcWow, clojurebot got an upgrade!
19:42TimMcThe old version would have spammed 3 or 4 lines to the channel.
19:44gfredericksyeah he's been like that for a month or two I think
19:44gfredericksat least
19:44gfredericks,(println "0\\n1\\n2\\n")
19:44clojurebot0\n1\n2\n\n
19:53FrozenlockRaynes: after your picture, now it's the repository that's changing under me. -_-
19:53RaynesFrozenlock: Heh, which repository?
19:53Frozenlockclojail
19:53RaynesOh, you were doing something with clojail?
19:54RaynesI have this feeling we might have talked about this already and I've forgotten, so sorry if so.
19:54FrozenlockI'm *using* it, not changing anything.
19:55FrozenlockStill, I'm curious if there's any important modificiations...
19:57RaynesFrozenlock: This last one is important if you're allowing def.
19:57RaynesAny update can be pretty important with clojail.
19:57RaynesThere are holes that need fixed right now, as xeqi will testify since he found all of the damn things.
19:57xeqiamalloy found one of them
19:57Raynesamalloy doesn't count, he is a clojail dev.
19:58amalloyafter all these reports, you're claiming xeqi isn't?
19:58sritchieohpauleez: Exception: java.lang.NullPointerException: null
19:58sritchie StringReader.java:33 java.io.StringReader.<init>
19:58sritchie RT.java:1705 clojure.lang.RT.readString
19:58sritchie core.clj:3361 clojure.core/read-string
19:58sritchiewhoops, sorry
19:58Raynesxeqi has never fixed any of them, amalloy.
19:58sritchiegetting that in the remote example.
19:58RaynesAnd that's bad and he should feel bad.
19:58amalloyheathen
19:58sritchieohpauleez: 0.2.2 is the current version?
19:58sritchieohpauleez: this is with shoreleave-remote-ring
19:58ohpauleezI would use the snapshot, or baseline (which is 0.3 - to be released)
19:59Raynesyogthos: You're pretty hilarious.
20:00yogthoslol
20:00yogthosyou saw that eh :P
20:00Raynesyogthos: You don't need to do a pull request FOR EVERYTHING
20:00yogthoshaha did you see the break though :P
20:00RaynesNope.
20:00yogthosso glad we got travis going
20:00RaynesBecause I don't look at 90% of your pull requests.
20:00RaynesBecause they're unnecessary. :P
20:00sritchieohpauleez: 0.2.2-SNAPSHOT is more up to date than 0.2.2?
20:00yogthosI added get-in to session, but forgot we were using it from core :)
20:00sritchieI don't see a higher snapshot
20:00yogthos:)
20:00RaynesI trust you, you write good code, you don't break things (well, usually).
20:01yogthosusually :P
20:01yogthosand when I do, I fix it eventually :)
20:01ohpauleezsritchie: Oh weird, I thought there was a 0.2.3-shapshot
20:01RaynesYes, yes you do.
20:01yogthosbut helps me keep it clear too, I like the paper trail
20:01ohpauleezsritchie: https://clojars.org/shoreleave/versions/0.2.3-SNAPSHOT
20:01RaynesWell, you're free to keep doing it.
20:01RaynesIt's just amusing to me.
20:01sritchiegotcha
20:02sritchieohpauleez: but not for shoreleave-remote
20:02yogthoslol
20:02ohpauleezsritchie: 0.3 is *just* around the corner
20:02sritchieso to play with that for now,
20:02sritchieI should use baseline locally, sounds like?
20:03ohpauleezsritchie: Yeah, baseline is meant to be used like people use CS:One
20:03ohpauleezyou clone it, and write your application
20:04sritchieI'm sad the modularity is gone
20:05sritchiethe remote functionality would be great for very simple apps, for example
20:05sritchieI'm writing a tile server in clojure with a cljs front end --
20:05sritchiethe remotes allow the cljs to call the server, which generates and caches tiles
20:06sritchiewhich would be great to break out
20:07ohpauleezsritchie: It'll be back
20:07ohpauleezonce I push all the 0.3 releases of the modules
20:07ohpauleezif you want
20:08ohpauleezjust go in src/shoreleave and rm the directories you don't want
20:08FrozenlockRaynes: This might be the desired behavior, but I just realized that clojail doesn't seem to use the example.policy file. Rather, the permissions are specified in the :context
20:08RaynesFrozenlock: The policy file is what you have to set globally so that once the JVM sandbox is activated, it doesn't affect your non-sandboxed code.
20:09FrozenlockOh!
20:11FrozenlockThat explains why I couldn't change my sandbox policy by changing the example.policy...
20:11RaynesYep.
20:11RaynesAnd if your sandbox policy was the example policy you'd be allowing everything.
20:12RaynesProbably not what you want. ;)
20:12FrozenlockActually in this case, that's exactly what I want :P
20:13FrozenlockSo why a sandbox you might ask... I prefer having it ready, in case I want to change the policy.
20:14callenbotshoreleave is impressive but the cljs compilation errors were brutal.
20:14ohpauleezcallenbot: all fixed on 0.3
20:14callenbotnot specific to shoreleave, I mean.
20:15callenbotin general it was just really hard to tell why any particular bit of cljs was breaking.
20:15callenbotyogthos got bit by some of the same things I did.
20:15ohpauleezaahhh there were some warnings from old print stuff and local storage
20:15callenbotohpauleez: I'll give it another whirl when 0.3 hits but cljs needs source maps in a BAD way.
20:15ohpauleezcallenbot: But yes, debugging in CLJS is a challenge sometimes
20:15callenbotit is seriously the only reason most people I know don't use it.
20:15Frozenlockcallenbot: nonsense! You just have to find your "k" property, undefined for the object "l".
20:16callenbotFrozenlock: that is far from representative of the errors I've encountered. I usually see worse.
20:16FrozenlockWorse than a munged name? Must be hell to debug :p
20:17callenbotFrozenlock: yes.
20:17callenbotI love cljs but the errors are a 100% blocking issue for me to use it in anything
20:18callenbotyou need to have a PhD like the prismatic guys to work past that :)
20:19ohpauleezcallenbot: I don't think it's that bad
20:19callenbotohpauleez: is websockets or browserchannel in the cards for shoreleave?
20:19ohpauleezyou *do* need JS knowledge to effectively use it
20:19callenbotohpauleez: I have a decade of serious-face-not-jQuery JS experience.
20:19Frozenlockohpauleez: that's quite a big deal.
20:20ohpauleezcallenbot: People ask me about that a lot (websockets) - I've done it in one app without an issue.
20:20ohpauleezIf someone submitted an issue (a patch even better) I would totally put it in
20:21callenbotohpauleez: BrowserChannel might be better than ws.
20:21callenbotohpauleez: http://closure-library.googlecode.com/svn-history/r144/docs/closure_goog_net_browserchannel.js.html it's already in Goog Closure.
20:21ohpauleezSo, I already have the base of some stuff around the HTML5 messaging API (which I support in the pubsub)
20:22ohpauleezif I took on BC, I'd do a refactor across the modules to some protocol
20:22ohpauleezas it stands right now, I use remotes+JSONP for most things
20:22callenbotohpauleez: https://github.com/ohpauleez/shoreleave/issues/7
20:23callenbotohpauleez: fyi BrowserChannel works even on IE 5.5 :P
20:23ohpauleezcallenbot: BC is technically in CLJS core
20:23ohpauleezit's used for Browser REPL
20:23callenbotohpauleez: that's the point I was making.
20:23callenbotohpauleez: that it's already supported to some degree
20:24ohpauleezahh gotcha
20:24callenbotI just want shoreleave to offer it as an option ;)
20:24ohpauleezahah
20:24callenbotohpauleez: BECAUSE I NEED SPEEEEEEEEEEEEEEEEEEED
20:24ohpauleezI want that to. patches welcome
20:24ohpauleez:)
20:24ohpauleezremotes + JSONP + SPDY on JETTY has been acceptably fast for all my stuff
20:24callenbotohpauleez: I need to fix clabango first.
20:25ohpauleezexcept one thing, where I needed ws
20:25callenbotohpauleez: what'd you need ws for?
20:26augustlwhat's the easiest way to execute a .clj file in the context of a leiningen project? My use-case is a script that imports old data from a json file into the database.
20:27ohpauleezAV workbench, where I was streaming raw data packets to the client in a browser
20:27ohpauleezand the browser was building png objects
20:27ohpauleezand flipping the image themselves
20:27callenbotyogthos|away: that pull request is the nicest I've been to anybody in months.
20:27callenbotaugustl: lein run?
20:28augustlcallenbot: that only supports one single main though, I might have a bunch of different tasks
20:28callenbotdafuq.
20:28callenbotaugustl: https://github.com/technomancy/leiningen/blob/master/src/leiningen/run.clj
20:28callenbotaugustl: false, sir.
20:28augustland I already use :main to run my actual app
20:28callenbotaugustl: read the code
20:28callenbotaugustl: it does what you want.
20:29callenbotaugustl: somehow you're even lazier than I am, bravo.
20:29Frozenlock,gentlemen
20:29clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: gentlemen in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:29Frozenlockwrong command?
20:29TimMc~gentlemen
20:29clojurebotYou can't fight in here. This is the war room.
20:35technomancy~botsnack
20:35clojurebotThanks! Can I have chocolate next time
20:37yedicallenbot: this breaks clabango
20:37yedivar wizard_options = {buttons: {nextText: '<i class="icon-download"></i>'}}
20:38yedii wonder if it also breaks djangos templating library too
20:42brehautyedi: how is it used in the template?
20:42brehautbecause i'd be surprised
20:42brehautdjango.template.Template("{{ buttons }}").render(django.template.Context({"buttons": {"nextText": '<i class="icon-download"></i>'}})) #=> u'{&#39;nextText&#39;: &#39;&lt;i class=&quot;icon-download&quot;&gt;&lt;/i&gt;&#39;}'
20:43yedibrehaut: sorry it doesn't break clabango, but it breaks the javascript. the }} just is removed at the end
20:48callenbotyedi: patch it!
20:48yediyea
20:49yediit's a great opportunity for me to do some opensource hacking
20:49abp`Why don't you guys just use hiccup. :P
20:51sritchieohpauleez: almost working w/ remotes :)
20:51sritchieUncaught Error: goog.require could not find: shoreleave.remotes.http_rpc
20:51sritchiethat just started appearing
20:51yedihey brehaut: i just realized that was the django template fn (not clabango's) it also seems to be missing the }} at the end
20:52ohpauleezsritchie: That looks like the CLJS compiler is messing up the import statements
20:52yedistarting to look like it's that way by design possibly?
20:52sritchieohpauleez: yup
20:52sritchiewill retry in something clean
20:52ohpauleezcool, thanks
20:52ohpauleezkeep me posted because I have deep knowledge in that part of the CLJS compiler
20:52ohpauleezsritchie: ^
20:52sritchiewill do
20:53abp`ohpauleez: Had that error too. Quite a while ago.
20:53ohpauleezabp`: With shoreleave-remotes?
20:53ohpauleezor just in general
20:53abp`ohpauleez: Yep
20:53abp`shoreleave-remotes.http_rpc
20:54ohpauleezhmm, I'll try some things with baseline and see if I can get it repro
21:08pppaulhow can clojure cure my sleep deprivation?
21:10brehaut(count (repeat :sheep))
21:11brehautwhen that returns, you'll probably be sleepy
21:11abp`pppaul: It hardened mine out. To much things to try, to mich code to write.. :(
21:13pppauli must find more uses for (diff)
21:14abp`3am here, experimenting with graph visualizations
21:14warzhm idk about this but in this one code file of mine, im calling a function that doesnt exist but the error is wrong number of args passed, instead of no function found or something like that.
21:14warzprobably because im using "lein ring server", and it think the function is still there, or something.
21:14warzbecause it was, but i renamed it.
21:15brehautwarz presumably you have reloaded the namespace?
21:15warzwell i think ring does that on its own? it seems to reload everything else
21:15mattmoss~coffee
21:15clojurebotGabh mo leithscéal?
21:15abp`Yeah, another case of lein ring not reloading properly..
21:15mattmosso_O
21:16brehautwarz: ring doesnt do that by itself, though i think lein-ring includes that middleware itself.
21:16abp`I think it stumbles when errors occur until they are fixed. At times I just restart lein ring to get the right traces or a working app.
21:17abp`But often I glance at the trace or my last written code and know what I messed up. :)
21:18lazybotRaynes: I feel bad
21:19warzyea i mean it was definitely just some funkyness in it reloading while i was editing, and continuning to edit caused it to work itself out
21:20abp`yup. Sometimes you can refresh the page like mad till the stacktrace goes away and you get and old working version of the app.
21:23sritchiedo you guys know how to serve images in compojure?
21:24augustlsritchie: there's a built-in ring middleware for serving all files in a directory on the classpath
21:24augustlring.middleware.resource
21:24sritchieaugustl: I'm actually requesting an image from another service,
21:24abp`sritchie: Or (compojure.route/resources "/")
21:24sritchieand passing it directly through to my user
21:25sritchiewhich is obviously inefficient, but I'm mocking out a map tile server
21:25sritchieso for now, I'm just getting my tiles from another tile server --
21:25maleghastI am feeling very n00b-esque this evening, but… If you had a large(isn) vector of maps and you wanted to find a specific map, how would you do it?
21:25sritchiethen I'll replace that back end with a thrift database
21:26sritchieaugustl: just not sure how to properly pass the value through.
21:26abp`maleghast: Probably (some (fn [m] (when (thats-it? m) m)) maps)
21:27maleghastabp`: Hmmm… Yeah. I was hoping for something more convenient, I must admit...
21:28xeqisritchie: are you setting the content-type, say with ring.util.response/content-type ?
21:29abp`maleghast: You were asking how to find some map. ;)
21:29ohpauleezmaleghast: (some #{the-map} [all-the-maps])
21:30ohpauleezsets are functions
21:30maleghastabp`: Yes, but I have around 150 maps in a vector and I want find a single map based on the value of one of its keys. It would be great if there was a way to do this easily...
21:30ohpauleezthat is O(n)
21:30abp`xequi sritchie aren't wrap-file-info, wrap-head and probably wrap-content-type what he wants?
21:31sritchiethat looks right
21:31maleghastohpauleez: Ok, that'd work if I knew the complete map, but I only have one value - so I know all the keys and only one value.
21:31jeremyheilermaleghast, do you want to know if the value is not nil, or something specific?
21:31ohpauleezmaleghast: partial-map and unify it
21:31ohpauleezusing core.logic
21:31abp`lol
21:32xeqiabp`: I had the impression those only helped with files/resources, they might be sufficent
21:32maleghastohpauleez: Ok… I was looking for simple.
21:32ohpauleezthat is, by the very definition, simple
21:32ohpauleezperhaps not easy :)
21:32ohpauleezyou can also just use (keep)
21:32ohpauleezand look for the key/value
21:32abp`xeqi: Well, looking at there: https://github.com/weavejester/compojure/blob/1.1.3/src/compojure/route.clj#L26 it's only underpinning file/resource related things but seems like the way to go
21:33ohpauleezand it'll keep the entire map
21:33maleghastohpauleez: I know what you mean ;-) Thanks :-)
21:33ohpauleez,(doc keep)
21:33clojurebot"([f coll]); Returns a lazy sequence of the non-nil results of (f item). Note, this means false return values will be included. f must be free of side-effects."
21:33abp`,(doc some)
21:33clojurebot"([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"
21:33abp`Now guess whats more efficient. :P
21:33maleghastsure
21:34pochoIs there a function that takes a map and a function and replaces each value in the map with a value determined by the function?
21:34ohpauleezpocho: That seems like you just want to use (map …), no?
21:35pochowait I think I want fmap
21:35pochoSo many functions to remember.
21:35ohpauleezyeah fmap is a good call, there's a ML thread about this
21:36ohpauleezhttps://groups.google.com/forum/?fromgroups=#!topic/clojure/PsyR-_Hp9Cg
21:38yedii'm really loving the fact that my vars can have non alphanumeric characters in the name
21:38brehaut,(apropos
21:38clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
21:38brehaut,(apropos 'map)
21:38clojurebot(sorted-map ns-unmap zipmap mapv map ...)
21:38brehaut,(doc mapv)
21:38clojurebot"([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & ...]); Returns a vector consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."
21:40TimMcOK, conjing this to my wishlist: Find all the free variables in an s-expression in Emacs.
21:40TimMc(to help with refactoring)
21:40brehautTimMc: +1
21:40TimMcTotally feasible, yeah?
21:40yediwhat is a free variable?
21:41TimMcOne which is not bound. :-)
21:41brehautTimMc: seems like it. i wonder if there is a kibit rule (not that kibit is working for me)
21:41barry_Hi all. I've been banging my head against this for a day, and am hoping there's a lobos guru in the house...
21:41yedialso when using the -> macro, if i have parens around a function call would it work the same as without
21:41barry_If I aot any modules in my project, lobos fails to find lobos.migrations.
21:41aduhi barry_
21:42barry_(i.e. call to lobos.core/migrate does nothing)
21:42barry_Removing the :aot from my Leinagen 2 project.clj, and everything's great.
21:42jeremyheileryedi, it will work. usually you only add parens for the 2nd or more args.
21:42yedifor example, are these equivalent?: (-> "a b c d" .toUpperCase) (-> "a b c d" (.toUpperCase))
21:42yedijeremyheiler: ah ok, thanks
21:42TimMcbrehaut: I guess I don't want the free variables, actually -- what I really want is a list of lexical bindings that an s-expression uses.
21:43TimMcPerhaps if their binding sites could be highlighted...
21:43jeremyheileryedi, np
21:44barry_hi adu
21:45warzim trying to debug an error, and i think its because i dont know how to do variable arity functions. the error looks like its running all of the code in this function instead of just the one with no params: https://gist.github.com/ryancole/5001570
21:45warzam i doing that incorrectly, or is there actually an error in clutch? (i dont think there is because im pretty sure ive done this exact query in simpler code)
21:46brehautwarz: you have multiple arities correct i think
21:46warzhrm, ive got something wrong then, i bet. maybe clutch doesnt take the database as a first param like that, but i could have sworn it could.
21:46brehautwarz: something in clutch is chucking that exception
21:47brehautwarz: it can do, or you can dynamically bind it
21:47brehautwarz: it looks are you meaning to call id?
21:47warzhm i wonder if its because theres only 1 result and im using map
21:48brehautoh, i wonder if its because db is not a url
21:48brehautits a string
21:48warznah ive been using that the whole time and it was working when i was using variable scope db binding
21:48warzi thought id take it out and now i get this error
21:48warzill try putting it back in and see if it errors
21:49brehautok, well looking at the exception soemthing is calling seq on a string and getting chars and then calling nth on that char
21:49brehautwarz: (thats a guess)
21:50brehautwarz: i think something is expecting a seq of seqs
21:50brehautcan you update the gist with an example of the call that is failing
21:51warzi updated the gist to include the additional file
21:52warzits a ring route handler, and im requesting the one without an id
21:52warzwell i do have an error in that fikle
21:52warzbut i dont think itd be being called
21:53brehautwarz: https://gist.github.com/ryancole/5001570#file-foo-clj-L10 do you really mean to be calling {:key (id)} rather than {:key id} ?
21:54brehautwarz: i dont think its actually in your codepath atm but that does look like a bug anyway
21:54brehautwarz: not to mention, you are calling all-items with an id in you route, when i think you want to be calling single-item
21:54warzyea thats most likely an error. it was originally :keys.
21:55warzyea, thats what i was mentioning earlier about the error. i adjusted that and updated the gist incase you hadnt hit it, yet.
22:00warzwell i think youre right about the url
22:00warzi think clutch/with-db accepts a string
22:00warzbut clutch/get-view does not
22:00warzit works if i move back to with-db
22:01brehautright, https://github.com/clojure-clutch/clutch/blob/master/src/com/ashafa/clutch.clj#L26-L35 looks like its translating it if needed there
22:01augustlsritchie: the :body of a ring response can be streams
22:03sritchiegotcha
22:09aduaugustl!
22:09augustlyo
22:31pppaulsometimes i find using clj-http much easier than using clutch
22:39muhoook, i'm going in, to try to get piggieback working with a browser cljs repl in nrepl.el. i may not make it out alive. may god have mercy on my soul.
22:41alandipertmuhoo: we're all rooting for you. that would be excellent.
22:44xeqimuhoo: I've had it work before, it was awesome to control a webgl renderer from emacs
22:44technomancyhas anyone hooked it up to gecko's internals yet?
22:45technomancylike in the context of the browser itself rather than the page?
22:46xeqitechnomancy: ?
22:50pbostrommuhoo: I spent some time getting it to work recently, one caveat: piggeback has a dep on an old version of the Closure compiler, so if you're using cljsbuild it's going to pick up the old version
22:51abp`pbostrom: Can't circumvent that via exclusions?
22:52muhooc
22:52pbostromabp`: I'm not familiar with exclusions
22:52muhoorun lein-pedantic, it'll tell you all about it :-)
22:53abp`pbostrom: You can exclude dependecies of your dependencies to pull in newer versions
22:53abp`pbostrom: Like that: https://github.com/technomancy/leiningen/blob/master/project.clj#L14
22:54abp`muhoo: Thanks for reminding me to use pedantic. :)
22:54pbostromabp`: cool, thanks let me give that a shot
22:55abp`pbostrom: As muhoo said, https://github.com/xeqi/lein-pedantic
22:55xeqimuhoo: haha
22:55muhooxeqi: didn't realize that was yours. nice work.
22:57brehauthuh. im already using pedantic apparently.
23:03ibdknoxwarz: you were asking about LT. Next thursday 0.3.0 will drop
23:03warzawesome! :D
23:04ibdknoxit's why I've been... sparse
23:04warzwell, i use it every day so im looking forward to it. :)
23:04ibdknoxthis will be a night and day difference
23:05warzbased on the few adjustments that i asked about and you said were changing, even those would be awesome
23:05warzso yea im excited
23:15ChongLiam I alone in this little train of thought?:
23:15ChongLicljs on cljs -> light table sans jvm -> light table on chrome os
23:16ChongLiwould make for a fantastic developer machine
23:17technomancyxeqi: well I'm not really interested in using cljs for making web sites, but my browser is written in JS, and it sucks to have to use that to extend it
23:22callenbottechnomancy: you could use cljs to write browser extensions. If that's not what you meant by "extend it", what do you want to do?
23:44yogthoscallenbot: indeed :)
23:45callenbotyogthos: you weren't supposed to agree :(
23:45yogthoslol
23:45yogthosif we're talking about error reporting in cljs compiler, it could use some work to say the least :P
23:45muhoohmm, well, almost. lockus replus: https://www.refheap.com/paste/11578
23:47pbostrommuhoo: did you refresh your page in the browser after you started the repl?
23:47muhoonope, i know not to do that :-)
23:48pbostromno, you do need to do that
23:48muhoooh? hmm, ok.
23:48muhooi've blown away repls by reloading before.
23:49pbostromthe repl listens on port 9000, then you have to load the page with the bit of cljs that sets up the long polling connection to that port
23:51muhoook, that makes sense. cljs repl starts the server
23:51muhooalso, it hates advanced mode: "Uncaught TypeError: Cannot read property 'bf' of undefined " whitespace no such problem
23:52muhoohaha WARNING: Wrong number of args (0) passed to cljs.core/array at line 127 file:/usr/local/share/java/lein-repos/repository/org/clojure/clojurescript/0.0-1586/clojurescript-0.0-1586.jar!/cljs/core.cljs
23:53muhoook, that's enough fun for tonight. didn't expect to get it working, but that was pretty close.