#clojure logs

2014-09-04

00:39ben_vulpesi have isolated and reproduced my multipart upload nightmare!
00:39ben_vulpeshttps://github.com/survantjames/crazy_clojure_deps
00:40ben_vulpesxeqi: ping: i think there's some kind of conflict with kerodon and clj-http
00:40ben_vulpesthe resolution of which is way over my head
00:41ben_vulpesdakrone: ping see above
00:41ben_vulpesi have also spammed both of your issue pages on github
00:42ben_vulpesand now i am clocking out as the babe has just finished the last episode of voyager and must now mourn. ttyl!
00:45joobusis there a functional difference between these two: (def asdf {}) and (def asdf (ref {}))
00:47joobusthey seem to behave the same when doing key lookups...
00:48joobusand I assumed a {} was just a reference to begin with
00:48arrdemhttp://grimoire.arrdem.com/1.6.0/clojure.core/ref
00:48arrdemhttp://clojure.org/refs
00:48arrdemgoogle is your friend
00:49arrdem{} is defined to be a literal map why would it be a ref
00:55technomancygoogle is your foe
00:55technomancyalways trying to steal your private information and trick you into using G+
00:59Jaoodannoying as hell on android by default, you take a photo and you get something like "your photos are ready to be shared on G+"
01:01arrdemyeah... turned that one off right quick
01:02joobusre: google, found this yesterday https://imgur.com/wbjCmbt
01:04arrdemshrug. it's their business model, and US data ownership / "privacy" laws allow it. I don't think it's right but I'm not gonna fault them for it either.
01:05joobusthanks for the help tonight arrdem, night guys
02:40huyhi
02:41jkjmorning
02:41jkjspooky..... lein with-profile uberjar does AOT but lein compile does not
02:41jkjshould it work like that
02:41jkjit's just thatthe aot-compiled class is needed by the rest of the code
02:53jkjwonder if :dev profile skips aot or something
02:58jkjlein with-profile -base compile ... aot works
03:41sm0kefor leiningen how do i specify a merge policy for conflicting files while creating uberjar?
03:41borkdudejackjames I switched over to emacs-prelude now. It works ok so far. One question I have is, in emacs-live C-space space selected succeeding sexprs, but in the emacs-prelude defaults, it selects only one sexp. Do you know what to change perhaps?
03:57sm0ke:uberjar-merge-with seems relevant
05:06reducedHi
05:07reducedhttps://gist.github.com/anonymous/59ce0b0b001252d524a1
05:07reduced(for [v val1]
05:07reduced (println (keys v)))
05:07reducedwhat is wrong in all this
05:07reduced(def val1 {:x [1 2 4 5]
05:07reduced :y [1 1 2 3]
05:07reduced :z [2 1 2 3]
05:07reduced })
05:07reduced(for [v val1]
05:07reduced (println (keys v)))
05:29karlsrecycle: v will be a list of (key value)
05:30karlswhoops, they're gone
08:54lvhProject organization question. If I have a component with an API (let's say a protocol) and some implementations (i.e. a riak backing store, a sql backing store...) where would they live?
08:55lvhRight now I have e.g. myproject.store.core and myproject.store.riak. I don't know if myproject.store and myproject.store.riak would even work, or if that would be desirable
08:55lvhmaybe it should be myproejct.store.api
08:55tbaldridgelvh: I tend to use .api or even .protocols and then have .impl.riak
08:56lvhtbaldridge: so, is that myproj.api, or myproj.store.api? I.e. do you have an api file that covers all your app's APIs?
08:56lvhthanks!
09:21tbaldridgelvh: I tend to divide by module first, then by api/impl/etc.
09:21tbaldridgeSo myproj.store.api
09:21tbaldridgenot saying that's the perfect way, just a way
09:22lvhtbaldridge: yeah, no, that resonates :) thanks
09:30yogsotothHi I have a http-kit server I can run with lein run, but I can't compile it; lein compile foo.server returns me a "Method code too large!" error
09:30yogsotothAnd to circumvent this the only way I found was to:
09:31yogsototh1. lein clean ; 2. lein compile foo.server (broke) ; 3. lein uberjar ; and then I have a working uberjar (the compilation create a .class)
09:31yogsotothIs there a way to control how leiningen compile things?
09:32yogsotothSo I could simply stop the compilation after it try to generate the first .class?
09:32clgvyogsototh: the error sounds like one of your clojure function uses a lot of inlining functions or huge macro expandions
09:32clgv*expansions
09:33yogsotothYes, I am not sure, but this is certainly schema + swagger with complex schema
09:33yogsotothif I use less routes, all work fine
09:34yogsotothI only have 6 routes thought.
09:34clgvmaybe you can delegate all routes directly to individual functions?
09:35yogsotothI really don't know how to do that. Actually I use a macro provided by swagger to generate the right api.
09:37clgvyogsototh: I'd reread there docs and in case it's still not clear why it fails and how to use it right, you should report an issue
09:39yogsotothYes thank you. I'll try to find a way. In the worst case, I'll look into the code ;-)
09:40djcoinI don't want to start a flamewar, but Would you recommend using Emacs over IntelliJ w/ Cursive ?
09:40djcoin(or the other way around)
09:40caternyes
09:41djcoin(and yeah sorry, what would be the benefits of one vs the other?)
09:41djcoinIntelliJ seems pretty capable, index stuff and may be easier, no?
09:42caternif you're familiar with IntelliJ I guess you can use it
09:42cflemingI'm biased since I develop Cursive, but I think it's a pretty nice environment now
09:42cflemingIn a lot of ways it's more sophisticated than Emacs, in some ways it's still catching up
09:42cflemingBut I'd say it's definitely easier to get started with
09:43teslanickI had trouble getting cursive+intellij12+clojurescript to work properly, but I'll admit that I didn't fight with it for very long.
09:43caterndjcoin: there you go. you've got to be a Cursive developer to say Cursive is a pretty nice environment :P
09:43cflemingteslanick: when was that?
09:43teslanickCouple weeks ago
09:43puredangerhere's a video about getting started with Cursive and ClojureScript from tbaldridge https://tbaldridge.pivotshare.com/media/cursive-and-clojurescript/12952/feature
09:44cflemingHmm, that should have been ok, I'd be interested to know the problems you had
09:44cflemingpuredanger: Nice, I hadn't seen his cljs one
09:44puredangerI think he posted it last night :)
09:44teslanickcfleming: I can give it another whack over lunch and let you know
09:44caterndjcoin: personally I think Emacs is just way better in general. so if you're looking for a place to develop software in general, I'd suggest Emacs and using it for Clojure incidentally; but if you're just looking to use Clojure only, it's a toss-up
09:44cflemingpuredanger: That would explain it then :-)
09:45puredangera number of people at Cognitect have switched from Emacs to Cursive as their daily tool
09:45tbaldridgeI stopped using emacs when cider decided to start hanging my box when I printed 2000 lines.
09:45caterntbaldridge: and started using an IDE that will start hanging your box all the time? :)
09:46cflemingcatern: Have you used IntelliJ?
09:46caterncfleming: in passing
09:46tbaldridgecatern: never had it hang my box, and an IDE written in a modern language is a joy. GPU accelerated UIs and multicore indexing means the IDE just screams.
09:47cflemingtbaldridge: I've got to admit even I was surprised that speed was a major benefit of Cursive for you - it's good to hear, though.
09:47tbaldridgecatern: don't confuse InteliJ with Eclipse, the latter is a pile of junk, in my experience.
09:47djcoinlol
09:47djcoin:)
09:48djcoinThat's pretty harsh!
09:48tbaldridgecfleming: yeah, the syntax highlighter could be a tad faster I think, it boggs down when loading clojure/core.clj but that's about 7000 loc these days.
09:48tbaldridgeFor normal clojure stuff it's super fast.
09:48mavbozotbaldridge: wow
09:49puredangerI use Eclipse pretty regularly, but mostly for the Java parts of Clojure
09:49cflemingYeah, clojure.core is always a bit of an issue for Cursive, it's just so big
09:49tbaldridgecfleming: to be fair it also boggs down in Compiler.java, but that's 10k loc :-)
09:49TimMcclojure.core bogs down my browser
09:49cflemingAnd having it spread over various files with load-file pretty much sucks too
09:50cflemingtbaldridge: Heh, yeah, there's only so much you can do with some of those files :)
09:50tbaldridgepuredanger: interesting, I noticed clojure/clojure includes Intelij project files, any reason for using Eclipse?
09:51puredangerI've used it since before 1.0 and it's comfortable for me
09:51tbaldridgefair enough
09:51puredangerRich uses Intellij for it
09:51tbaldridgepuredanger: that's why I use it, Rich always knows best
09:51tbaldridge:-P
09:52mavbozopuredanger: what is rich's pc specs?
09:52puredangermavbozo: macbook pro
09:52mavbozopuredanger: 16GB of RAM?
09:53caternit's java developer madness to want to go back to an IDE when your language has great support for non-IDEs
09:53puredangermavbozo: dunno
09:53caternhas superior support, that is
09:54tbaldridgecatern: nah, it's just a question of how much you want to hander a soldering iron ;-)
09:54puredangercfleming: I've taken a couple stabs at using Cursive but the keybinding stuff wore me out. Is there any way to better package a set of keybindings to start with? I don't even care what they are necessarily.
09:54teslanickcatern: I don't understand, care to elaborate your position?
09:54tbaldridges/hander/handler
09:54fairuzHi guys. I tried to use nginx-clojure. Got it running. Accessing localhost:8080 shows the nginx default html page. But when I go to localhost:8080/clojure, there's an error saying classdefnotfound: clojure. How do I fix this? Apart from starting nginx, what else should I do? Thanks :)
09:55mavbozopuredanger: so, rich rarely use emacs for developing clojure then?
09:55mpenetso apparently arguing about editors is still a thing
09:55cflemingpuredanger: Yeah, I really need to fix that - since v13 there's a new API I can use to make Clojure-specific actions specific to Clojure files, but I still can't create bindings based on the keymap the user has configured.
09:55puredangermavbozo: he uses aquamacs I think. <shudder>
09:56cflemingpuredanger: So short answer - it'll get better soon, but still not as nice as I'd like.
09:56puredangercfleming: I'm really talking about the case of a user that is coming to Intellij/Cursive fresh and just wants a reasonable setup
09:56caternteslanick: IDEs are heavy, language-specific, slow, overcomplicated, difficult to customize, don't have console support, often die, have proprietary components, etc. etc. etc.
09:57cflemingcatern: That's why real men use textedit
09:57teslanickI meant the other side of it: "when your language has [superior[ support for non-IDEs"
09:57tbaldridgecatern: can be true, except when stuff like cider makes my emacs just as slow, overcomplicated and difficult to use. I want something that just works, and Cursive hit that sweet-spot for me.
09:57puredangerI think we're fortunate to have many good tool options for clojure and there is a good tool for everyone
09:57cflemingpuredanger: Yeah, I know that pretty much sucks right now. One thing I'm considering is having some sort of popup when the user first installs to offer a choice of keybindings
09:58ohpauleez+1 - the tooling is very amazing
09:58caternteslanick: well on the whole, I'd guess the Emacs support is better than Cursive or... whatever for Eclipse
09:58ohpauleezacross the board (generally speaking)
09:58puredangercfleming: I would be happy for that.
09:58cflemingpuredanger: i.e. emacs-like, or one based on the OSX keymap, etc
09:58caterntbaldridge: shrug. I don't see such slowness, overcomplication, or difficulty
09:59fairuzoh nvm.
09:59cflemingpuredanger: The Jetbrains guys don't go much for those sorts of popups but I'm starting to think it's the only way
09:59cflemingpuredanger: There aren't many plugins that need as many keyboard shortcuts as Cursive does
10:00mavbozoa friend of mind, after spending a week to customize his intellij to be just like his emacs, found out that his 4 GB i3 macbook air cannot handle intellij smoothly
10:00puredangercfleming: I'm happy to have a manual step to load a set of keybindings too - I just want that as one step, not setting each individually
10:00mavbozoso, intellij is quite good for clojure but be sure your pc is powerful
10:01cflemingpuredanger: Yeah, I hear that. Another option would be just to distribute some exported keymaps that people can import - still not a very nice user experience, but at least it's just one step.
10:01caternoh also you should feel deep revulsion and sickness at the thought of using a Java IDE to develop in Lisp
10:01mavbozobased on puredanger answer, macbookpro is powerful enough for rich
10:02puredangercatern: even one written in Java? :)
10:02cflemingMBP works fine for IntelliJ, it's what I use
10:02rweirmbp with 16gb of ram handles intellij fine - my company buys jillions of them for that very purpose
10:02caternpuredanger: abstraction!
10:02cflemingI have 4 projects open at any one time, 8GB RAM handles it easily
10:03cflemingCursive is a pretty big project, it's using around 120M right now
10:03mdeboardintellij
10:03cflemingI give IntelliJ 1G, it handles 4 large projects ok with that
10:05cflemingpuredanger: I'll let you know when the keymaps thing is better
10:05puredangercfleming: no worries :) thx.
10:06dnolen_djcoin: after 7 years I'm tired of Clojure/Emacs, Intellij Cursive rocks - at this point I would recommend w/o question to people who want to try Clojure w/o hassle
10:06ToxicFrogI used IntelliJ for Clojure for a while, but I don't think I used Cursive, but some other clojure plugin.
10:06ToxicFrogEventually ditched it in favour of Sublime Text.
10:06dowwiednolen_ you try vim?
10:07tbaldridgeToxicFrog: LaClojure, I think. That's how I got started
10:07cflemingToxicFrog: That was probably La Clojure
10:07dnolen_dowwie: I've tried pretty much everything, but I used Emacs still for many other things
10:07djcoindnolen_: alright, thanks a lot. I tried Emacs in the past, then switched to Vim, and now as I'm planning to dive more into Clojure was thinking about going straight to Intellij which seems nice. Thanks :)
10:07dnolen_s/I use
10:07tbaldridgeToxicFrog: then I moved to whatever netbeans had, then to vim, then emacs, then back to Intellij
10:08ToxicFrogcfleming, tbaldridge: Yes! That's the one!
10:08lvhtbaldridge: I was wondering what that thing in the core.async videos (the for-pay ones) is; Intellij?
10:08tbaldridgeyes
10:08mavbozodnolen_: isn't Lighttable good enough for newbies?
10:08ToxicFrogI liked intellij but found it had way too much overhead (both resource and cognitive).
10:08dnolen_mavbozo: Light Table is good for newcomers but I found it frustrating for actual work
10:09cflemingToxicFrog: Yeah, they haven't updated La Clojure for a long time now, it's unofficially deprecated in favour of Cursive
10:09ToxicFrogcfleming: yeah, I think I switched to ST before Cursive came out.
10:09dnolen_Cursive provides just good experience as LT w the exception of in editor eval of CLJS
10:09dnolen_for newcomers
10:10cflemingToxicFrog: ST is actually meant to be pretty nice for Clojure these days
10:10cflemingdnolen_: Yeah, I need to get a CLJS REPL going for Cursive
10:10dnolen_cfleming: ST drives me insane for Clojure dev :)
10:11dnolen_whack REPL, horrible namespace switching and inferior paredit (all these things things still seem to be true)
10:11puredangerI think Nightcode is a pretty good basic editor experience too
10:11lvhawesome thing that doesn't "click" until you actually use it: multimethods
10:11dnolen_I watched the Clojure Unity people use it
10:11dnolen_do not want
10:11lvhI'm sprinkling some multimethod all over everything and it's just so awesome
10:11ToxicFrogcfleming: I've found it so, but I also suspect I'm not really using ST to its full potential in many ways
10:11ToxicFrogE.g. I don't use paredit or the REPL
10:11cflemingdnolen_: I'll take your word for it, I've never used it. I tend to use it for my non-dev work but no more than that. That's a nasty list of non-features though :-)
10:12dnolen_cfleming: it's a fine text editor, but I really want something *better* than Emacs for Clojure
10:12cflemingdnolen_: Well, soon you'll be able to extract methods with Cursive, instead of doing it by hand like some sort of base animal :)
10:13clgvIf I get the following expception I should see some :tag metadata containing a primitve type somewhere in the macroexpansion, right? Exception: "Can't type hint a local with a primitive initializer"
10:13clgvI used tools.macro to get the expansion
10:13clgvand *print-meta* true
10:15TimMclvh: Careful, multimethods make code reloading a bit of a nightmare.
10:15TimMcclojure.tools.namespace or whatever might help, though...
10:15dnolen_cfleming: my main Cursive pet peeves (they might exist) - pretty printed stepping macroexpand, macros that create bindings
10:15tbaldridgeclgv: yeah, I'd like to fix that at some point as it even throws an error if the two tags match
10:15lvhTimMc: Why's that? The new defs don't override the old ones?
10:15dnolen_cfleming: indentation is also a bummer for me - I nearly always prefer 2 space indent
10:16TimMclvh: I don't remember the details at this point, sorry.
10:16clgvtbaldridge: damn, I got this when changing a previously working macro :(
10:16lvhTimMc: Ah. Thanks anyway for the heads up :)
10:16dnolen_cfleming: the Emacs like indentation rules just results in crazy looking code
10:17clgvso I did not find any primitive tags, what can I look for to find the reason?
10:17TimMclvh: I *think* just running defmethod again won't replace the definition.
10:17cflemingdnolen_: Yeah, the first is planned (I need to improve the formatting code a bit), it'll be interactive - i.e. expand next step, and highlight what just got expanded
10:17cflemingdnolen_: optionally pretty print gensyms and hide FQNs too
10:17tbaldridgeclgv: not seing the code, I don't know. I always got this error when trying to type-hint a let symbol that was already inferred from the binding of the let.
10:18ephemerondnolen_: Which indentation rules?
10:18clgvtbaldridge: yeah that's what I thought the exception meant, as well
10:18cflemingdnolen_: the second is tougher, it'll be fixed with an extension API which I'm working towards
10:18clgvso going to check all :tag bindings
10:18dnolen_ephemeron: the always align fn argument rule, it's an abomination for any function with more than 3-4 letters
10:19cflemingdnolen_: when you talk about the Emacs indentation rules, you mean in Cursive?
10:19martinklepschI wrote a post about s3 direct upload using core.async and transducers: http://www.martinklepsch.org/posts/using-coreasync-and-transducers-for-direct-s3-upload.html — would be interested in any feedback :)
10:19dnolen_cfleming: yes Cursive does the same thing
10:19dnolen_I want a knob for it
10:19cflemingdnolen_: Ok, what would you rather it did?
10:19dnolen_I've disabled it in Emacs
10:19dnolen_cfleming: always two space indent
10:19dnolen_except for obvious stuff like literals, binding forms
10:21ephemeronIt seems reasonable to provide an alternative to vertical alignment, I agree.
10:22mdrogalisdnolen_: Yeah, concur. I've worked with people who use Cursive, and I see all sorts of non-standard whitespace formatting.
10:22cflemingdnolen_: Ah, I see - yeah a lot of people have asked for that. I'll get it in there soon. You want the default to be like Only Indent is in Cursive right now, right?
10:22cflemingmdrogalis: Anything in particular jump out at you? It should pretty much format like Emacs now, which is the de-facto standard.
10:23mdrogaliscfleming: I have to admit that I don't use cursive, I just work with a few who do. I think they somehow got the editor to format in a really weird manner.
10:23mdrogaliscfleming: So in short, maybe there's nothing to fix. :P Heh.
10:24cflemingmdrogalis: That's my favourite sort of bug report :)
10:24tbaldridgemdrogalis: cfleming: I finally got it working after messing with the indent settings for about an hour. The defaults are a bit odd. So yea, the first attempt by a newbie will produce some odd looking code.
10:24clgvtbaldridge: it would be great to get the name of the offending binding... as with other clojure compiler errors where details are missing ;)
10:26cflemingtbaldridge: Interesting, I thought the defaults were fairly sane these days. Do you remember what you changed?
10:26hugodwhat are people's biggest complaints with cider?
10:27lvhHow do I spell "take everything from this channel, dump it on that channel over there, and block/park until it closes?"
10:27cbpcider is like a box of chocolates
10:28cbpyou neer know what youre gonna get
10:31hugodcbp: is that caused by running from snapshots and melpa builds?
10:33clgvthat's a thing I always wondered. are there stable builds for e.g. cider?
10:33lvhI have a bunch of expressions that eval to channels that give some items and then close; I'd like to evaluate them in order, waiting until one is done before doing the next one, and collecting all the itmes (in order, on a chan). Here's what I came up with: https://gist.github.com/lvh/a78a817ae19e141cd529
10:33lvhI don't know if that's a good way to spell it.
10:33cbphugod: of course
10:34lvh(i know that code waits for each sub-part to be done before publishing all of the individual results)
10:34hugodclgv,cbp: there is a 0.7.0 stable release
10:34lvhI guess I want pipe & "park until this thing closes"?
10:36clgvhugod: ah ok so you can jump manually from release to release?
10:37hugodclgv: yes - the 0.7.0 emacs lisp code is in the melpa stable repository
10:39mavbozoclgv: i used cider from melpa before but found it breaks often, so now i use melpa-stable
10:43clgvhugod: ah ok. thanks for the information. my emacs experience is pretty limited ;)
10:46TimMc++ for mimicking the Emacs de facto standard here
10:46TimMcwhoops, was in scrollback-land
10:51borkdude,(+1 2 3)
10:51clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
10:51borkdude,(+ 1 2 3)
10:51clojurebot6
10:52borkdude$(+ 1 2 3)
10:52borkdude&(+ 1 2 3)
10:52hyPiRionlazybot is dead
10:52tbaldridgeborkdude: what are you trying to do?
10:52borkdudetbaldridge I was showing my colleague how #clojure evaluates exprs
10:52borkdudetbaldridge but I forgot some of the characters
10:54TimMcborkdude: There's also ##(+ 1 2 3) if the expression starts with a paren
10:54TimMcand if lazybot weren't dead
10:59clgvhyPiRion: does he get an update eventually? :P
11:01hyPiRionRaynes, amalloy_: lazybot is dead.
11:04mdeboardlong live lazybot!
11:04dnolen_cfleming: I don't really care about default just want the knob - are you saying it's already possible?
11:05borkdude is it possible to start lein cljsbuild auto with cursive? (just trying it out now)
11:09borkdudeof course I can run it externally
11:16cbp~java
11:16clojurebot
11:16cbpo_O
11:16mdeboardhey
11:16mdeboardgood job emacs
11:16mdeboardyou rendered whatever the hell that character is
11:16mdeboardapparently some kind of unicode thing
11:16cbpnot for me :-o
11:17hugodcfleming: in what ways is cursive more sophisticated than cider?
11:17mdeboardcbp: Are you using rcirc/
11:17cbpname: HOT BEVERAGE
11:17cbpI'm using erc
11:17mdeboardOh, you're one of those
11:18mdeboardone of THOSE people
11:22lvhhm; has anyone written regexes-over-arbitrary-values yet?
11:22lvhI want to express something like "this thing is a sequence of these elements, then these five elements in any order, then these three elements, then..."
11:23trptcolinlvh: like https://github.com/jclaggett/seqex
11:23lvhI guess maybe I can write that as take
11:23lvhoooooo
11:23lvhtrptcolin: Thank you :)
11:23trptcolinor or https://github.com/cgrand/seqexp
11:33TimMclvh: I recall encountering some Java library that did that, maybe 3-5 years ago.
11:34TimMcIt was in use by an NLP project, probably to recognize certain grammatical constructions.
12:08jtackettHey guys, I’m looking for a way to get around the heroku request time out issue
12:08jtackettI have a long running process that I need to display on the next page upon request
12:14rweirprolly want the heroku scheduler thing?
12:16JumblemuddleHow would I go about creating a program that can interact directly with an external monitor? (Think Ms-Powerpoint)
12:17klyed2jtackett: never used heroku, but you might want to have a self-rescheduling task, and your page load auto-refreshes until the task flags itself as completed
12:18jtackettthat’s a good idea
12:18jtacketthow do you have the page auto-refresh?
12:18klyed2jtackett: javascript or look up refresh meta tag for html
12:19rweirJumblemuddle, pretty sure powerpoint doesn't do that
12:20rweirJumblemuddle, you'd have to look at whatever GUI toolkit you used's multiple monitor support
12:22Jumblemuddlerweir: Hmm, I guess I hadn't thought about it much. I suppose it just creates a window and resizes it to the monitor? If so, it would be very different on linux. I wonder if xorg would allow for 2 x-session, where 1 first one would control the 2nd?
12:22rweirthat sounds like a really weird way to show two windows
12:22Jumblemuddle(I'm attempting to create a presentation program in clojure)
12:22JumblemuddleYa, it does feel like a hack.
12:23JumblemuddleAlthough, having it just be an extended monitor, makes me feel ocd.
12:23dbaschjumblemuddle: this is not really a clojure question, it’s more about Swing or whatever you’re using like rweir said. See for example: http://stackoverflow.com/questions/4627553/java-show-jframe-in-a-specific-screen-in-dual-monitor-configuration
12:24JumblemuddleYa, I was hoping there would be some fancy clojure library for it. However, I can see how it wouldn't be clojure specific. Thanks for the help!
12:26dbaschjumblemuddle: you may want to ask here: https://groups.google.com/forum/#!forum/seesaw-clj
12:27JumblemuddleInteresting, thanks.
12:33upwardindex,(byte (.byteValue 128))
12:33clojurebot-128
12:33upwardindexWhy does this throw ArrayIndexOutOfBoundsException on my machine?
12:39trptcolinare you using it as an index? i don't think either Long.byteValue or clojure.core/byte can throw that exception
12:39upwardindextrptcolin: I’m simply writing in the repl what I wrote here but without the comma
12:40upwardindexI get “ArrayIndexOutOfBoundsException java.lang.Byte.valueOf (Byte.java:101)” as an answer
12:43trptcolinupwardindex: want to link a gist w/ details? stack trace, clj/java versions, etc?
12:43klyed2upwardindex: possible a function/macro is defined?
12:44dbaschupwardindex: what version of clojure?
12:44upwardindexdbasch: 1.5.1, I’ll put up a gist with all info as suggested by trptcolin
12:46thesaskwatchhi .. most of the sql generation libraries/db cliients seem to use globally bound database var, is this idiomatic clojure?
12:47mpenetno not really
12:48thesaskwatchit doesn't sound very safe to me, that's why I find it weird
12:48mpenetmost sql clients don't do that, ex clojure.java.jdbc
12:49mpenetKorma does, but I am not sure it's in good shape these days
12:49trptcolinsee http://blog.clojurewerkz.org/blog/2014/04/26/major-breaking-public-api-changes-coming-in-our-projects/
12:50thesaskwatchmpenet: yes, that's the main client, but it's only a wrapper over jdbc .. I don't see sql generation there beyond simple cases
12:50mpenetthere are a few lib dedicated to that I think
12:51thesaskwatchtrptcolin: I agree with this point of view, that's why I'm asking
12:52mpenetsee under "sql abstraction": http://www.clojure-toolbox.com/
12:54thesaskwatchmpenet: thanks
12:55mdrogalisthesaskwatch: FWIW, HoneySQL is my choice of SQL lib these days.
12:56thesaskwatchmdrogalis: readme says updates are not implemented
12:56thesaskwatchmdrogalis: though https://github.com/jkk/honeysql/issues/7#issuecomment-52526575
12:57mpenetmdrogalis: but HoneySQL only support select I think
12:57mdrogalisthesaskwatch: They actually are implemented, but not documented.
12:57mdrogalisI have an issue open to add it to the README
12:58thesaskwatchmdrogalis: ok, I'll dive into it. But do I understand it correctly that it generates sql string that I can later send to clojure jdbc?
13:02thesaskwatchok, this example makes sense https://github.com/sorribas/clj-blog/blob/9678eb4ff06e8c9f1ea01b42bc008b9cbefd365e/src/clj_blog/db.clj
13:04mdrogalisthesaskwatch: Correct.
13:12danneui think it's much easier to just use jdbc directly
13:13danneuthough i wish the driver allowed positional parameters "WHERE id = $1 AND x = $2" instead of "WHERE id = ? AND x = ?"
13:15csd_Is it possible to do an equivalent of macro-expand for a function? I'm trying to figure out how to solve http://www.4clojure.com/problem/158
13:20danneuspeaking of clojurewerkz apis, i wonder why they choose style A over style B https://www.refheap.com/89801
13:22danneuby going with style A, it's now nontrivial to modify the options programmatically (associng into map).
13:22danneukorma vs honeysql is another example
13:27mikerodI posed the question yesterday as to why Clojure cannot provide type inference in a situation like: (doseq [my-thing (.getThings ^ThingHolder holder)] (.doThingMethod my-thing))
13:27mikerodWhere: ThingHolder#getThings returns Collection<Thing>
13:27mikerodand: Thing#doThingMethod is an instance method
13:27llasramcsd_: I see the analogy you're trying to draw, but not really...
13:27mikerodTo keep reflection away, I have to: (doseq [my-thing (.getThings ^ThingHolder holder)] (.doThingMethod ^Thing my-thing))
13:27technomancymikerod: it may be that doseq calls seq rather than using the array directly?
13:28mikerodtechnomancy: Well, I dug into Compiler some. It "sort of" has to do with Java type-erasure it seems.
13:28csd_llasram: my other thought is to use eval + reduce, to wrap the args successively around the decurryed function
13:28mikerodbut when I dug down that route a bit more, it is still possible to find the parameterized type information in the class files
13:28technomancymikerod: I suspect it could be done but just wasn't deemed worth the effort at the time
13:28mikerodtechnomancy: yes, I think it'd be very difficult
13:29mikerodIn a general sort of sense
13:29mikerodHowever, when dealing with a reasonable amount of Java interop - it does get a bit frustrating/verbose if you are wanting to avoid reflection
13:29technomancyyou could write a type-preserving-doseq I bet
13:29technomancybut doing it in the general case would be tricky
13:30mikerodNewer people to Clojure always assume that the type info will be inferred in this sort of case, since the information is "available"
13:31technomancy"It's Java; it's not supposed to be easy."
13:31mikerodtechnomancy: exactly, for `doseq` it shouldn't be too hard. but down at the compiler inference level for like Compiler$InstanceMethodExpr#getJavaClass level - looks hard
13:31csd_llasram: doing eval + reduce works but it seems like there has to be a better way
13:32csd_also 4clojure blocks eval evidently...
13:33mikerodThen again, there are heterogenous seqs you could create as well, so then it doesn't even make sense to try to auto-hint some of them for their Java interop. I just found this topic interesting and now I can see why the inference doesn't work.
13:33mikerodtechnomancy: "It's Java; it's not supposed to be easy." - I'll remember this advice and use it in response to anyone new who sees this lack of inference to be a weakness. :P
13:35mikerodit is still less verbose typing than Java would require overall though, so I guess it isn't really a weakness. I just say use `(set! *warn-on-reflection* true)` when you develop.
13:35llasramcsd_: Well, you definitely don't need `eval`, but `reduce` is on the right track :-)
13:35llasrams/the/a/
13:36technomancymikerod: just because not all seqs are homogeneous doesn't mean they shouldn't be hinted for cases when you know they are
13:37mikerodtechnomancy: yes, but I'd imagine that would get ugly with something like (doseq [o (concat (.getThings x) (.getSomethingElses y))] <...>)
13:37csd_llasram: just got it :) tricky
13:37mikerodif the compiler was attempting to type hint the o
13:38technomancymikerod: seems completely reasonable to just leave the hints off in complicated situations
13:38technomancyat least for a first pass
13:38mikerodtechnomancy: yes, that's what I was thinking
13:39mikerodif there is a "union of types" inferred for a seq, then just stop auto-inference
13:39llasramcsd_: (partial partial #(reduce deliver %&)), right?
13:39llasramj/k
13:40csd_that went over my head but i did reduce #(%1 %2) f n
13:40csd_where f was the function chain and n was the vector of numbers
13:40llasramcsd_: Yeah, good job. For obfuscation purposes, `deliver` acts like `#(%1 %2)` :-)
13:41csd_never seen that before
13:41llasramI do sometimes wish for a real `funcall` in the language... Not often, but
13:42bjais there a handy function for showing the source of a namespace when I'm in my repo?
13:42bjarepl?
13:47jtackettbja: if you require the ns and name it something, then you’ll always now
13:47jtackett(require namespace.util :as nameOfns)
13:47trptcolinbja: that would be pretty cool. but i think something like (println (slurp (clojure.java.io/resource "clojure/string.clj"))) is the best you have
13:47trptcolinkeeping in mind that the source of an ns may be spread across files
13:48jtackettoh you mean where it is in your directory
13:48jtackettnvm
13:48bjatrptcolin, understood. I'm just trying to figure out why lein classpath and lein deps :tree seem to be lying to me
13:48trptcolinplugins?
13:48arrdemllasram: what would funcall do for you?
13:48technomancysame thing it does in every language
13:48technomancytry to take over the world!
13:48llasram(inc technomancy)
13:48llasramheh
13:49arrdemwow... Raynes and Lazybot both MIA...
13:49danneui understand that a macro captures lexical scope at definition. like if you redefine `if`, then a macro with `(if ...) will expand to (my.ns/if ...). But what if you don't export your `if` redefinition?
13:49llasramarrdem: Do you mean "when would it be useful"?
13:50arrdemllasram: essentially.
13:50trptcolindanneu: that sounds like not a macro feature - more of a syntax-quote feature
13:50bja...
13:50bja(-> "ring/util/codec.clj" clojure.java.io/resource slurp println) shows me assoc-conj in the source code
13:51bjayet (require '[ring.util.codec :refer [assoc-conj]]) fails
13:51llasramarrdem: when you have a collection of arbitrary functions you want to call in a non-`apply` fashion
13:51llasramIt doesn't happen often, and #(%) or #(apply %1 %&) works fine, but the actual name "funcall" would (IMHO) be clearer
13:52trptcolinbje: got any deps that are uberjarred up and including different versions of ring.util.codec?
13:52bjaI don't think so, and I've actually :exclusions [ring] out of just about everything else
13:52trptcolinthose can be tricky
13:53bjamaybe there is something that has a dependency somewhere
13:53trptcolinthat wouldn't help for uberjarred libs
13:53bjabut I don't understand why require would find a different thing on the classpath than clojure.java.io/resource
13:58danneuanybody know of a js markdown lib and a clj/java markdown lib that are compatible enough?
13:59MagBoHey, beautiful people! lein is so painfully slow I wonder if there is a way to run it as a server?
13:59trptcolinbja: .class files come first
13:59trptcolinin the lookup order of require
13:59danneuMagBo: what are you trying to do
14:00MagBodanneu: building projects on a slow network.
14:00MagBoI'm not even sure what's the bottleneck — JRE bootstrapping or network :)
14:01danneuMagBo: the only time i use lein during dev is when im booting nrepl and booting the webapp server (lein ring server-headless)
14:01technomancyMagBo: there are a few options here https://github.com/technomancy/leiningen/wiki/Faster
14:02MagBo<3 I'm sorry that I didn't read the docs
14:02MagBoThank you so much.
14:02danneuoh, https://github.com/yogthos/markdown-clj comes with the compiled js. <3 u yogthos
14:03technomancyMagBo: well in this case it's the wiki, not the official docs, so it's a bit more obscure
14:04csd_Why are vectors not considered seqs
14:05technomancyseqs are O(n)
14:05technomancyI mean, lots of reasons, including that
14:06csd_doesnt it satisfy ISeq though
14:08MagBotechnomancy: btw, can I msg you w/ offtopic? I'm curious about how and if you're using Erlang. :-)
14:08technomancyMagBo: sure
14:09llasramcsd_: I'd argue "just because they aren't implemented that way"
14:09technomancyyou can get a seq from a vector, but that doesn't mean they're the same tihng
14:10llasramtechnomancy: Sure, but
14:10llasramI can't off the top of my head think of why vectors don't directly implement `ISeq`
14:10llasramClojure separates `Seqable` from `ISeq` so you can `seq` things which don't directly implement `ISeq`, but e.g. lists do the latter
14:10Bronsallasram: it might be implementation defined but I associate ISeq with conj=cons
14:11Bronsai.e. I'd expect conj to behave like cons on a seq
14:12llasramOh, interesting. Yeah, otherwise I'm not sure how you'd get the current behavior of `(cons x (seq a-vector))`
14:12llasramEr
14:12llasramYou know what I meant
14:12llasram(conj (seq a-vector) x), but actually my previous attempt shows exactly how you'd get that :-)
14:35stompyjits interesting how both clojure and data related hn posts get upvotes, but fewer comments
14:36bjafwiw, it was the 0.9.2-incubating store-core that got me
15:09shiranaihitowhat's the right way to :require several namespaces that share a common "prefix"?
15:09shiranaihitosomething like [some.thing other1 other2] doesn
15:09shiranaihito.. 't seem to work :p
15:12llasramshiranaihito: (:require [some.thing.other1] [some.thing.other2]), or
15:12shiranaihitommm
15:12llasramshiranaihito: (:require [some.thing (other1 :as other1) (other2 :as other2)])
15:12shiranaihito(:require [clojure.contrib sql sql.tests]) <-- this is the kind of way i've tried.. but it doesn't seem to work
15:12shiranaihitoi must be missing something here :p
15:13llasram(doc require)
15:13clojurebot"([& args]); Loads libs, skipping any that are already loaded. Each argument is either a libspec that identifies a lib, a prefix list that identifies multiple libs whose names share a common prefix, or a flag that modifies how all the identified libs are loaded. Use :require in the ns macro in preference to calling this directly. Libs A 'lib' is a named set of resources in classpath whose contents define a library of
15:14shiranaihitoyep.. but that doesn't really tell us much about how to use it in practice :p .. in fact, this is a common problem with the Clojure docs
15:14llasramshiranaihito: Actually, what you were trying to do should work fine
15:14llasram,(require '[clojure.core protocols reducers])
15:14clojurebot#<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/core/reducers__init.class or clojure/core/reducers.clj on classpath: >
15:14llasramThanks, clojurebot
15:14shiranaihito:P
15:15shiranaihitowhen do i need to quote a vec in :require.. ?
15:15shiranaihitoi've been getting by without quoting :p
15:16llasramshiranaihito: The entire body of your `ns` form is processed quoted, so you don't need to quote anything inside it yourself
15:16shiranaihitook, cool :p
15:16shiranaihitohm
15:16llasramshiranaihito: But `require` is a function, so you need to quote symbols you pass to it
15:16llasram,(require '[clojure set data])
15:16clojurebotnil
15:16llasramThere we go
15:16shiranaihitowell.. this isn't working: https://www.refheap.com/89811
15:17shiranaihito(the last line in particular)
15:17llasramWhat exception do you get?
15:17shiranaihito"java.lang.RuntimeException: No such var: user/schema" .. but "schema" does exist there
15:17shiranaihitoand Cursive doesn't think "user" gets imported
15:18llasramOhhhhhhhhh
15:18llasramThere's a specific problem with namespaces named "user"
15:18shiranaihito:D
15:18shiranaihitowtf :p
15:18llasramWork-around -- don't use the token 'user' as the component of a namespace
15:18shiranaihitowell this is .. sad? :p
15:19shiranaihitofeels like something hacky is going on
15:19shiranaihitoat least it works when directly referenced
15:19llasramshiranaihito: It should only be a problem if you use `user` an an alias, like (:require [whatever.path.user :as user])
15:20shiranaihitothis works though: [c2d.module.user :as user]
15:20llasramIt works there, but will probably explode elsewhere
15:20shiranaihitohuh?
15:20shiranaihitohow long has this been a problem and why isn't it fixed?
15:22shiranaihitowell, i don't want to call it anything other than "user" because i'm dealing with.. *users*, and i want the singular form.. :o
15:22llasramI think a few reasons... It's probably mostly/only a REPL issue, and maybe specifically a REPLy issue
15:22llasramHere's some discussion: https://github.com/technomancy/leiningen/issues/1619#issuecomment-51144655
15:22llasramAnd Clojure has a feature where it auto-loads a namespace named just 'user', so I think people avoid using 'user' to refer to anything else
15:23shiranaihitoluckily i don't really care about the REPL :)
15:23stompyjnot sure reserved keywords are hacky
15:23shiranaihitoit's not like it's a reserved keyword in the language
15:23technomancyclojure allows too much ambiguity here
15:24technomancyyou have an unfortunate overlap between the alias and an existing namespace
15:24technomancyyou would probably get something similar if you required something :as clojure.set
15:25shiranaihitowell, how about naming the built-in "user" as "_user" or something.. to let people have their own namespace called "user" without problems?
15:25stompyjright, but you drop into a repl
15:25stompyjyou need a ns right?
15:25technomancyshiranaihito: sounds reasonable to me, but you're unlikely to convince rich
15:25shiranaihitoi just want to be able to name my namespaces the way i want to :P and now i want "user" :) i don't think it's unreasonable of me :p
15:26technomancyalso that's a breaking backwards-incompatible change, technically
15:26stompyjso we change user to _user
15:26octewould a try-catch make any differences for return values for a function?
15:26stompyjthen someone wants to use _user
15:26technomancythe whole point of namespaces are really to be unique and not conflict with each other, so...
15:26stompyjthen what? :)
15:26shiranaihitowhere's the default "user" ns used anyway?
15:26octereturning a value from the try part
15:26octewith no exception thrown
15:27shiranaihitotechnomancy: yes.. i'm perfectly fine with that rule *for namespaces i've created* .. but not fine with Clojure preventing me from using a specific, *extremely* common concept as a namespace's name
15:28shiranaihitohow many apps don't have "users"? :p
15:28technomancyyeah, I didn't pick the name, but that ship has sailed
15:28stompyjshiranaihito: I hear what you’re saying,but this kind of game can be played ad finitium
15:29stompyjsometimes you just have to make a decision and frustrate 1 out of 10000 users
15:29shiranaihitosure, the ship has sailed, but that's got nothing to do with whether this is a problem or not :) .. you were just suggesting i should "make my namespaces unique" .. and that's what i'm planning to do, but wouldn't expect Clojure to get in the way there :)
15:29stompyjyou could fork clojure, and change it
15:29shiranaihito:P
15:29stompyjwho knows, you could be the next Rich :D
15:29shiranaihitoi doubt that :p
15:29shiranaihitobut alright.. i guess i'll manage, as long as it works when directly referenced
15:30technomancyI am sympathetic but skeptical that much can be done about it.
15:30shiranaihitoyep
15:31stompyjsame, I was sort of teasing you
15:31stompyjbut I’m sympathetic too
15:31shiranaihitowell, i'd guesstimate that it couldn't be *too* difficult to "fix" this
15:31stompyjbut as you know, naming is always difficult
15:32shiranaihitois the "user" namespace mostly just used within the REPL?
15:33technomancyshiranaihito: it's also used to hack into the clojure boot process
15:33technomancysince clojure has undocumented behaviour of automatically loading user.clj if it's found on the classpath
15:33shiranaihitothat doesn't sound like a common task either :p
15:33technomancyI think component uses it?
15:33technomancyor some wrapper around component, maybe
15:34shiranaihitoi'm not familiar with "component", but that's alright
15:34shiranaihitooh well
15:39hiredmancomponent does not
15:40hiredmanjig does crazy things like that, so maybe it does that
15:41stuartsierra'component' doesn't do anything with user.clj. My `reloaded` template includes user.clj stuff.
15:42stuartsierraI've been thinking of replacing it with something like `dev.clj` instead.
15:46arrdemrasmusto: ping
15:46justin_smitharrdem: saw that tweet, and realized my deadline is in good shape and I could get back on IRC again :P
15:47arrdemjustin_smith: :P thanks
15:47arrdemcc puredanger
15:47puredangereh?
15:47arrdempuredanger: thanks I'll bug him
15:53shiranaihitoarrdem: how disheartened should i be about Vars' performance? :)
15:53arrdemshiranaihito: don't worry about it.
15:53shiranaihito:p
15:53shiranaihitoi saw Oxcart on HN today
15:53shiranaihitosounds good
15:53arrdemoh ffs the project's dead and _now_ it makes HN again?
15:53dgaffneySup folks! I'm pretty green to clojure and am playing with an API project. I'm wondering how, in the route function on line 14 of this gist, I would be able to leverage the collection and action to serve as a namespace and function, respectively, with the params passed through to that function - I come from ruby, so in that case I would just do something like collection.classify.constantize.send(action, params), but this ain't ruby, so, I du
15:53dgaffneynno how to do this yet - thoughts? (GIST: https://gist.github.com/DGaffney/665be9368f2798493233)
15:54shiranaihitoarrdem: dead? :x
15:54shiranaihitowell, i'm not sure how i ended up looking at Oxcart
15:54shiranaihitobut you've called it quits?
15:55arrdemshiranaihito: http://arrdem.com/2014/08/05/of_oxen,_carts_and_ordering/
15:56arrdemshiranaihito: issue is that clojure was designed to be a dynamic language and is a limiting/complicating substrate for building a static compiler. the performance gain was kinda minimal (< 25%) and I didn't finish the real low profile build target before GSoC ended and I went back to school.
15:56justin_smithdgaffney: I would pass the handler function to call as an argument to respond
15:56shiranaihitoarrdem: i wouldn't call 25% minimal
15:57amalloyarrdem: fundimental =~ s/i/a/
15:57justin_smithso instead of ["user" "create" params] pass [user-controller/create params]
15:57justin_smithwhere user-controller/create does the action you desire
15:57arrdemamalloy: in the post?
15:57amalloyyeah
15:57arrdemmeh
15:57dgaffneymm - i see hot it is justin_smith
15:58dgaffneythanks!
15:58justin_smithdgaffney: typically I have a "controller ns" (like user-controller) for each endpoint, and then define handlers for various parameters or subroutes there
15:58arrdemgit commit -m "amalloy sees all my flaws"
15:58dgaffneyrgr!
15:59amalloyclojurebot: amalloy |sees| all your flaws
15:59clojurebotA nod, you know, is as good as a wink to a blind horse.
15:59shiranaihitoarrdem: so like.. that's it then.. no performance improvements for Clojure on the horizon? :)
15:59arrdemshiranaihito: 1.7.0 is projected to have Rich's blessed implementation of static linking, which is rumored to achieve a 10%-15% speedup on par with Oxcart's performance on "normal" (non-benchmark) programs.
16:00shiranaihitooh? sounds good
16:00shiranaihitobut that's not related to Vars?
16:00justin_smithdgaffney: in your case, "respond" could disappear altogether (replaced by directly calling the handler wanted for the route), or it could remain as a place where middleware is applied (though you can also apply all the middleware to the route itself)
16:00TimMcOoh, are we editing blog posts?
16:00shiranaihitoroughly how much worse is Clojure's performance compared to Java btw?
16:00shiranaihito(me is still a noob :p)
16:01arrdemshiranaihito: vars are just a binding structure used to achieve dynamic linking and to simplify the compiler. the performance overhead is actually kinda minimal and the interactive development benifits are huge.
16:02llasramshiranaihito: It depends on how you write your code. You can generally achieve exactly the same speed as Java, but usually not with the most idiomatic Clojure
16:02dgaffneyjustin_smith: I think I'll do something like (respond user-controller/create params) and leave that middleware as a general one - it'll probably just json it anyways.
16:02llasramshiranaihito: In practice you almost always trade the former for the latter (and the associated increase in expressiveness and flexibility))
16:02stompyjshiranaihito: the way I like ot think about it is, out of the box, its probably the fastest dynamic language you’ll find
16:02shiranaihitoarrdem: well.. "dynamic linking" goes over my head :P and i'm still confused about you calling the "< 25%" improvement "minimal" :)
16:03justin_smithshiranaihito: the difference in clojure vs. java runtime performance really depends heavily on what the bottlenecks of your task are - clojure tends to be bad for numerics or CPU-bound tasks, but if your main concerns are keeping threads in sync as you work on pervasively concurrent tasks it can be much closer to java in performance
16:03dgaffneynow, here's the other question justin_smith - these four controllers are going to be remarkably similar - what do clojure humans call the practice known as modules in ruby?
16:03dgaffneyI guess its just another namespace and you call out to the namespace from user-controller?
16:03shiranaihitollasram: alright.. well, what's the most common performance detriment in idiomatic Clojure?
16:03dgaffney(This clojure thing is winning me over finally, I think)
16:03justin_smithdgaffney: I will often make a higher order function that outputs my controllers in such a case
16:04justin_smithie. from some code I was just editing now (def culture-detail "construct the culture commentary action" (commentary :culture-detail :culture-detail :culture-filter))
16:04shiranaihitodgaffney: i'm still new to Clojure too, but convinced that it's the best environment overall :)
16:04shiranaihitowell.. relatively new
16:04justin_smithdgaffney: the above returns a new request handler, parameterized on those keywords
16:04shiranaihitostompyj: you're probably right about that
16:04dgaffneycool cool
16:05llasramshiranaihito: I'd guess either extra allocations or lost JIT opportunities via additional layers layers of indirection. Hard to know for sure, and also not worth worrying about
16:05justin_smithdgaffney: where commentary gathers some data from the db and renders a request, and those keys help it find the right data and do the right actions to it
16:05dgaffneyalright, I may buzz back in but that helps me get past this block for now!
16:05dgaffneynice - thanks man!
16:05stompyjshiranaihito: I ported one of our data api services from ruby to clojure
16:05stompyjand went from 6 aws boxes to one
16:05stompyjreduced LOC by 20%
16:05shiranaihitollasram: altight.. well, today i was worrying about whether Clojure functions tend to get inlined by the JVM :)
16:05stompyjand tests by 50%
16:05shiranaihitobut i guess they do
16:05shiranaihitostompyj: oh? nice :)
16:06dgaffneyooh! One more question. Say I want sub folders in my src/project-name folder - any weirdness there, or can I just make the folder?
16:06stuartsierraBiggest (and easiest-to-fix) performance problem in Clojure programs is reflective Java method calls.
16:06dgaffneyi.e. does that sub folder structure have to be mirrored in the code somehow?
16:06dnolen_justin_smith: most of your statements about Clojure numerics or perf are not accurate - it's really more of question of whether you want to write lower-level code directly in Clojure or not.
16:06TimMcdgaffney: It has to match the namespaces.
16:06allenj12does anyone know if there is a nth equivalent for the vector type in core.matrix
16:06justin_smithdgaffney: a nested set of folders and a nested set of namespaces should follow one another in structure
16:07TimMcdgaffney: foo.bar-baz.quux lives in src/foo/bar_baz/quux.clj (note the underscore and hyphen)
16:07dnolen_shiranaihito: there is an optimizable subset of Clojure for people that need it - in some cases it's simpler to just write Java - in other macro code generation is a net win
16:07dgaffneyso if we were to throw those controllers, it could look like.. uhh... controllers.user/create?
16:07shiranaihitostuartsierra: so i'm fine if i just "type" function parameters? .. there was something about Leiningen, i think, that helps find the reflective calls.. ?
16:07justin_smithdgaffney: right
16:07allenj12when i try nth on a vector type in core.matrix it says nth not supported
16:07dgaffneygreat. Whats the deal with underscore/hyphen? Just 'cause?
16:08justin_smithallenj12: nth is for linear time lookup, why do that to an associative datatype?
16:08llasramjustin_smith: Hmmm, not true
16:08TimMcJava doesn't like hyphens in package names, but Clojure prefers it to underscores in names.
16:08stompyjshiranaihito: I left the JVM in disgust and anger about 14 years ago, resolved never to come back, but last year clojure brought me back :)
16:08dgaffneyrgr - thanks TimMc
16:08technomancydgaffney: "just cause" basically yeah
16:08technomancyit's dumb
16:09TimMc(where "doesn't like" = blows up, and "prefers" refers to idioms, not compilation considerations)
16:09dgaffneyI'm of the belief that every language being used will eventually have some just 'cause reasons - no biggie!
16:09amalloyjustin_smith: nth is O(1) on vectors
16:09shiranaihitostompyj: why so angry? :P .. btw, Java 1.8 is pretty sweet anyway :)
16:09allenj12justin_smith: o wow im silly should be using .get shouldnt i be
16:09hiredmanallenj12: there are, core matrix has specialized functions for 1d and 2d matrices and a general function for more
16:09hiredmanallenj12: but I forget what they are, so check the docs
16:09stuartsierrashiranaihito: `lein check`
16:09amalloystuartsierra: reflection is so easy to fix i'd almost rather say boxed numbers are a bigger performance problem, because i spend hours tracking those down when i care about performance of course, reflection costs much more if left unfixed, but it's easy to fix
16:10shiranaihitoah, thanks
16:10stuartsierraOr `(set! *warn-on-reflection* true)` in the REPL
16:10stuartsierraThen reload.
16:10stompyjshiranaihito: I’m sure java is 1000x better now. Java when it was at 1.1 / 1.2 was a different beast I think :)
16:10stompyjapplets were still a thing, and EJBs were the only option for server side stuuff
16:10TimMcstompyj: I came back around 1.5 and was all "WTF is this generics stuff?"
16:10amalloythere's also a flag you can put in project.clj to make it always activate warn-on-reflection
16:11amalloy:warn-on-reflection true
16:11hiredmanallenj12: mget is the function you want
16:11amalloyoh, but that's deprecated, so instead you're supposed to say :global-vars {*warn-on-reflection* true}
16:11allenj12hiredman: ahh kk,
16:11stompyjTimMc: hahahaha, yeah, since my Cloversion(tm) I’ve been checking out Java again
16:13TimMc
16:35allenj12anyone here use gorrila? im trying to plot two sets of points and a line and its not really coming out right.. not scaled correctly or something
16:41SagiCZ1allenj12: whats gorrila?
16:42allenj12SagiCZ1: its pretty cool for like practicing machine learning stuff, its like ipythonnotebook if you know that.. its an editor in your browser that has multiple cells for editing and a nice plotting library
16:42amalloytoday, on "Weird things programmers say": "What is gorilla"
16:42justin_smith(inc amalloy)
16:42amalloylazybot is super-lazy today
16:43justin_smithmay not even be on line
16:44{blake_}Brain and brain! What is brain?!
16:47justin_smith🎶 what is love? 🎶
17:04hiredmanugh
17:05SagiCZ1allenj12: cool thanks :)
17:08puredangerI can't believe no one has yet said Wot Gorilla? https://www.youtube.com/watch?v=wootFX07sX0
17:15borkdudejackjames thanks for recommending emacs prelude, today I switched over
17:16razum2um1justin_smith: hey! i made this: https://github.com/razum2um/aprint
17:16jackjamesborkdude, don't think it was me, because i don't know what that is
17:16borkdudelol ok
17:17borkdudewhoever it was then
17:17serjeem___Is there a generally accepted way to build/document the apis for libraries in clojure?
17:18serjeem___i'd love something like haddock for the documentation. i'm leaning towards potemkin's import-vars for exposing the api
17:19razum2um1justin_smith: readabilyty matters, isn't it?
17:19justin_smithserjeem___: one thing that helps is defining a schema for the input / output of the "exposed" functions
17:20justin_smithhttps://github.com/Prismatic/schema
17:20serjeem___oh yeah, absolutely
17:21justin_smiththere is also autodoc http://tomfaulhaber.github.io/autodoc/
17:21serjeem___i'm more concerned with just the namespace layout of the package
17:21justin_smithand codox https://github.com/weavejester/codox
17:22serjeem___those look great!
17:22serjeem___thanks :)
17:25allenj12can someone tell me why this is happening
17:25allenj12https://www.refheap.com/89817
17:26tac_is # length?
17:26tac_,#'(1 2 3)
17:26clojurebot#<CompilerException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:0:0)>
17:26justin_smithallenj12: split with returns all items for which the pred is true, followed by all items afterward
17:26tac_guess not
17:27justin_smithallenj12: maybe you want < as your condition
17:27allenj12justin_smith: it should have a non empty list either way
17:27justin_smithtac #() is a shortcut to create an anonymous function
17:27justin_smithallenj12: absolutely not - the first item returns false, so the first list is empty
17:27aperiodictac_: it's the reader's macro dispatch character: http://clojure.org/reader (see the bullect labeled "Dispatch (#)")
17:27allenj12justin_smith: oooo
17:28allenj12justin_smith: is there a a function that does [(truthy) (falsey)]
17:28justin_smithcomplement inverts the truth value of a predicate
17:28justin_smith,(filter (complement even?) (range))
17:28clojurebot(1 3 5 7 9 ...)
17:29hiredmanallenj12: group-by
17:29justin_smithahh, yeah, that's probably what he's looking for
17:29allenj12perfect! thanks guys, gonna go eat now
17:31hfaafbpartition-by is probably closer
17:31hfaafbv0v
17:31hiredmanit depends
17:31hfaafbah nevermind thats contiguous
17:32hiredmanyeah
17:36SagiCZ1can anyone remind me how the deep map destructuring works?
17:36SagiCZ1(let [<insert_magic> {:a {:x "deep"} :b 0}] ..) ==> "deep"
17:38justin_smith,(let [{{x :x} :a} {:a {:x "deep"} :b 0}] x)
17:38clojurebot"deep"
17:38SagiCZ1thank you
17:38SagiCZ1(inc justin_smith)
17:38lazybot⇒ 72
17:38justin_smithnote how symmetrical the destructuring and the map are
17:40SagiCZ1yep.. nice
17:40SagiCZ1thats how i can remember it
17:41jozi9hi
17:42danneuWhere is the ring middleware that's responsible for parsing :request-method from <input type="hidden" name="_method" value="PUT">?
17:43danneumy only middleware is compojure.handler/site so i'm surprised it parses it at all
17:43hiredmanthe name on that is _method, why would it end up as the value in a map for :request-method?
17:43hiredman:request-method in the top level ring map is the http verb for the request
17:44hiredmansite adds in a bunch of other middleware that parses and keywordizes stuff
17:44danneuhiredman: yeah, i'm trying to figure out which one does it http://weavejester.github.io/compojure/compojure.handler.html#var-site
17:45justin_smithdanneu: your request should have a :request-method key, this is part of ring rather than the middleware I think
17:45hiredmandanneu: what makes you think any part does?
17:45justin_smithdanneu: since the server has to handle a request differently based on method
17:45hiredmandanneu: https://github.com/ring-clojure/ring/blob/master/SPEC#L62-L65
17:46justin_smithdanneu: ie. for a GET, my server has the key / val :request-method / :get in the request map
17:46hiredmandanneu: to begin with turning a field with a name _method in to a map value under :request-method is pretty nonsensical
17:46danneusure, but <form method="put"> isn't going to send a put request
17:47justin_smithhiredman: but some frameworks make a pseudo-method that way
17:48hiredmandanneu: so you are looking for a middleware that emulates put requests for forms?
17:49danneupretty much all frameworks have that middleware
17:50hiredmanso are you looking for that middleware to use it, or are you seeing that behaviour and trying to figure out where it comes from?
17:50danneuhiredman: the issue is that is <input name="_method" value="put"> seems to work out of the box, so i'm trying to find the source to see what it expects the override header to be sinc x-method-override doesn't seem to work
17:50danneuin other words, im trying to send an ajax PUT
17:52gfredericksseancorfield: does a new query option (:timeout) for calling .setQueryTimeout on a prepared statement sound like a reasonable addition?
17:52hiredmanso you are trying to send an ajax put?
17:52seancorfieldgfredericks: sounds a bit edge case-y...
17:53danneuhiredman: yeah. here's an example of how you'd implement the middleware (https://github.com/myfreeweb/ringfinger/blob/master/corefinger/src/main/clojure/corefinger/middleware.clj#L47-L53) - i'm just trying to see if ring has it
17:53seancorfieldwhy not construct the PreparedStatement yourself (and set such options) and pass that into query or execute!
17:53seancorfieldDo people really set query timeouts as a matter of course??
17:53lazybotseancorfield: Definitely not.
17:54hiredmandanneu: so you don't really care about the form field at all, you care about this x-method-override header?
17:54amalloygood guess as always, lazybot
17:54danneuhiredman: yeah, but the logical start of my journey would be to track down where the middleware that handles the form field is defined
17:54danneuand i can't even find that so far
17:55hiredmandanneu: but you don't really care about x-method-override right? you just want to send a PUT request via ajax?
17:56danneuhiredman: yeah. $.ajax supports GET or POST so for every other framework ive used, the ajax analogue of name=_method'
17:57danneuis that x-method-override header
17:58hiredmandanneu: I am pretty sure jquery's ajax stuff lets you do puts
17:58gfredericksseancorfield: I have no idea how common it is; I think there's a lot of duplicate logic involved in creating the prepared statement yourself
17:58danneuhiredman: "Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.
17:58danneuhttp://api.jquery.com/jquery.ajax/
17:59gfredericksseancorfield: what about a generic mechanism for supplying a function to bash on the prepared statement prior to executing the query?
18:01danneuhiredman: https://github.com/weavejester/compojure/blob/e6681da00d6c65231a35130a1dcc4a8c7a1bae7e/src/compojure/core.clj#L14-L22 Oh, so compojure itself does it and it only supports _method in :form-params
18:01danneuseems like ring-core needs a wrap-method-override middleware
18:02amalloygfredericks: that sorta exists, right? you can call prepare-statement yourself, modify it, and then pass it to query or whatever
18:02gfredericksamalloy: I might be missing something, let me check
18:03amalloyyou don't have to do a *ton* of repeated work like preparing the whole thing with raw jdbc; a lot of the stuff in prepare-statement is still useful to you
18:05gfredericksthere's some logic around where the connection comes from and whether the connection gets closed in the case of non-transactional use
18:05gfredericksand passing a prepared statement directly to query bypasses that logic
18:06amalloyreiddraper: is there a way to lazily sample a generator, rather than providing a number up front? alternatively, is there a reason that would be a bad idea?
18:06hiredmanthe connection handling stuff for the non-deprecated bits of jdbc seem to be terrible
18:07gfredericksthis stuff here: https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L788-796
18:07gfredericksamalloy: shouldn't be a bad idea
18:08gfredericksamalloy: it's already lazy it looks like
18:08gfredericksso (gen/sample g Long/MAX_VALUE) if you want :)
18:10gfredericksamalloy: I think it was intended just for repl usage, so an infinite lazy seq isn't an obvious feature
18:10amalloygfredericks: sure, infinite+lazy is not a good default
18:10hiredmanI had this app where I created one derby connection at start up, and everything just used that, and I would randomly get errors because I was using query results or whatever after some resource had been cleaned up, and I was using the new api
18:11hiredmanso there was no with-connection or anything to for the seq in side of, and of course the connection was never closed, so who the hell knows what was going on
18:12hiredmanI ended up just switching to creating a new connection every operation, because the app is just recording my music listening habits
18:12hiredmanbut, the lesson is clear, use the deprecated java.jdbc interface
18:12hiredmanthe new stuff is terrible
18:12gfredericksyou can get away with crazy stuff in personal projects; I have an atom that pretty-prints ~1mb to a file every time somebody swaps it
18:13gfrederickshiredman: the new api has something similar to with-connection; it just expects that you're passing it around explicitly
18:13seancorfieldgfredericks: so if prepare-statement accepted :timeout you'd be set - you could do (query {:timeout ...} sql params) and it would pass through and work the way you wanted
18:13gfredericksseancorfield: right
18:14gfredericksoh wait
18:14gfredericksno
18:14seancorfieldok, i thought you were asking for changes to query :)
18:14gfredericksI mean
18:14gfredericksyes
18:14seancorfieldif the first arg to query is a map, it is passed as named args to prepare-statement internally
18:14gfredericksit is in prepare-statement that the change would go
18:14seancorfieldso it's prepare-statement that needs to support :timeout, not query
18:14seancorfieldok
18:14hiredmangfredericks: I was!
18:15gfrederickshiredman: you think the API is a bad idea or the impl is bugg?
18:15gfredericksbuggy*
18:15hiredmangfredericks: dunno
18:15seancorfieldwell (query db-spec options sql params) i think
18:15gfrederickshiredman: okay I'll assume your "lesson is clear" comment was casual then
18:16gfredericksseancorfield: yeah I was assuming there was some way to add options like that
18:16seancorfieldit would probably be a good idea for execute! to support an initial map of options argument and treat it the same way
18:16hiredmangfredericks: the whole thing needs to scrapped and rewritten to return things that implement CollReduce instead of seqs anyway
18:16hiredmangfredericks: buggy or a bad api, either way, better not to use it
18:18reiddraperamalloy: gen/sample-seq
18:18gfredericksI've been using it in production for a while without serious issues
18:19seancorfieldtell you what gfredericks, create a ticket as a placeholder for expanding options to prepare-statement - I can add :timeout specifically and some keyword arg that takes a function to manipulate the PreparedStatement if you want, and I'll also work on expanding execute! to accept a map of options and pass it through
18:19seancorfieldhiredman: I saw your ticket about supporting reducers / transducers... good idea...
18:20reiddraperamalloy: sample is just built with (take n (sample-seq foo))
18:21gfredericksseancorfield: personally I don't need both :timeout and the manipulation function, just either one
18:21seancorfieldas for whether the API is "terrible" or buggy, it's used successfully in production code by a lot of people and a variety of databases
18:22seancorfieldpatches are welcome for improvements at any time
18:23gfrederickshiredman: I got JDBC-100
18:23gfredericks(inc seancorfield) ;; for java.jdbc
18:23lazybot⇒ 14
18:25seancorfieldthanx gfredericks
18:26hiredmanseancorfield: sure, and I understand as a maintainer it is frustrating when someone says things don't work without pinpointing what it is because you are completely willing to fix things
18:26seancorfield:) I counted to ten and didn't get angry
18:27seancorfieldbut, yeah, the idea of creating something more fluent leveraging transducers etc sounds appealing
18:28seancorfieldthe new API came about because the community wanted it (and so did Clojure/core) and I have to say I'm finding it much easier to work with than the old one... but JDBC is a fussy beast and finding a really clean way to work with it is always a struggle
18:28hiredmanmaybe I will switch back to a single connection and see if I can track this down
18:29seancorfieldI'm curious, hiredman, how do you feel about SQL DSLs in general? (since that seems like a more composable way to go with reducers/transducers but adding a DSL to java.jdbc was rejected by the community and Clojure/core)
18:29seancorfieldhiredman: and of course it may also be a quirk of Derby that doesn't show up in MySQL etc (which, heaven knows, has plenty of its own quirks)
18:30seancorfieldfwiw, at world singles, we create a pooled datasource (using c3p0) and pass that to every query / execute! / etc and let it do the with-open thing and it seems rock solid
18:31cflemin__Hi all, does lazybot occasionally forget to archive this channel?
18:31hiredmanseancorfield: well, I am not wild about them when I come across them in projects, but I have dabbled a little myself in creating them
18:32cflemingYesterday's archives are only there till 17:54
18:32dbaschcfleming: it probably crashed
18:32hiredmanseancorfield: I think returning something that implements CollReduce would be orthogonal to how you write the sql
18:32cflemingdbasch: arg
18:33cflemingOk, thanks
18:33seancorfieldhmm, maybe I'll spend some time experimenting with it over the weekend (wife's away so I'll be bored), although I have some documentation to finish for another OSS project I maintain which is higher priority
18:33hiredmanwe use c3p0 at work too
18:33seancorfieldhiredman: will you be at Strange Loop?
18:33hiredmanno
18:33hiredman:/
18:34seancorfieldbummer. I was going to suggest we got together for an hour to brainstorm some CollReduce ideas for the API. If you have any suggestions, feel free to add to JDBC-99
18:35hiredmansure
19:00turbofailyou know what'd be really nice? if ranges had a coll-reduce implementation that didn't require materializing a sequence
19:05hiredmanthere is a jira issue for that
19:05hiredman(and several patches?)
19:06amalloyyes, i wrote it
19:06amalloyrich didn't like any of the versions
19:07amalloymy conclusion is that trying to make reducers also act like lazy sequences is just doomed to fail: you want either a reducer or a seq, and you can't have both
19:11turbofailyeah i can see the issues with that
19:11turbofailstill it'd be nice to just be able to reduce over a large range of numbers relatively quickly
19:17turbofailthough on further inspection, my experimental RangeColl implementing CollReduce really isn't that much faster
19:22amalloyturbofail: ranges are already chunked, so it's not too slow
19:23amalloywhere you actually get some noticeable improvement is if you implement CollFold as well
19:24turbofailah
19:38hiredmanI imagine it also makes a difference if you have a more complex transformation to get rid of intermediate seqs
19:38hiredmaninstead of just jumping right to reduce with + (which I assume is how everyone benchmarks these things)
19:57danielcompton cfleming: do you have any update on Cursive in IntelliJ 14? Colin T said there's been quite a few API breakages
19:58talioslotso-changes, an IJ-14 build would be lovely tho
19:58cflemingdanielcompton: I'm afraid that's pretty much the state of the update. I know a lot of people want this but maintaining a new branch against an unstable API is a lot of work for me.
19:59danielcomptoncfleming: has the IntelliJ 14 API not stabilised yet?
19:59cflemingI'm already maintaining 3 (12, 13, 13.1)
19:59danielcomptonouch
19:59cflemingdanielcompton: not sure, I haven't looked at it. The issue is that for every release I have to merge all the changes to all the branches and adapt the code. So even if it's relatively stable now it's still more work.
20:00cflemingdanielcompton: I figure the longer I can put it off the more stable it will be :-)
20:00danielcomptoncfleming: right, are there many people using 12 or 13.1?
20:00danielcomptonI mean 12 and 13
20:01cflemingdanielcompton: yeah, there are.
20:02danielcomptondarn
20:03cflemingCurrent stats from the latest version: V12: 507 V13: 775 V13.1: 3434
20:04cflemingdanielcompton: so mostly v13.1, but significant users of earlier versions.
20:05danielcomptonInteresting... making compatibility decisions is never fun
20:05danielcomptonAlthough deleting the code afterwards can be
20:06cflemingdanielcompton: no, it's not. I'd like to maintain support for older versions since in a lot of corporate settings upgrading is non-trivial (machines are built out automatically using vagrant or the like, and so on)
20:07cflemingdanielcompton: I asked on the mailing list a while ago why people hadn't upgraded from 13 to 13.1, and many people just can't
20:07danielcomptoncfleming: right. I don't have much experience with that kind of environment, but it makes sense you'd want to support
20:07danielcomptonthem
20:07cflemingdanielcompton: eventually I can probably maintain older versions of Cursive against older versions of IntelliJ, but right now there's only one version so it's merging for me.
20:07talioscfleming - did any say WHY they can't go to 13.1? that wasn't that major a change...
20:09talioscfleming - is the project structures as a cursive-core with each intellij version bridging into core, or just a monolithic project? ( I suppose the IntelliJ AST is quite deeply woven tho.. 0
20:09cflemingtalios: Yeah, partly it was just that a lot of people hadn't gotten around to it, but at least one large client builds all their dev workstations using Vagrant, so devs can't pick their own versions. It's already a pain for them that they have to upgrade Cursive every month or so.
20:10danielcomptoncfleming: that's why you have an enterprise version
20:10cflemingtalios: It's a monolithic project. It's too hard to break out since the API changes are often not at the top (extension) layer but deep in the details. Or both.
20:11cflemingdanielcompton: Hehe, right - I'm tempted!
20:13Shayanjmping arrdem
20:13TimMccfleming: Bless you for maintaining compatibility with multiple version.
20:15TimMcespecially with apps, which are hella harder to do that with because you have to keep switching context...
20:15cflemingTimMc: Thanks! It's definitely a reasonable amount of work.
20:20cflemingTimMc: Users of older versions tend to suffer more bugs since I can't test as extensively on them, I have to rely more on crowdtesting :-)
20:26Bronsas
20:44danielcomptonWhat's the recommended way of preventing sensitive information from a record being printed? When I went to add multimethods for print dup and the other one whose name I forget, I found it quite difficult
20:45danielcomptonThere were quite a few private vars and functions I needed to get at to copy the standard impl for a record
20:46hiredmandanielcompton: if someone can call println on your record, why wouldn't they be able to call (println (seq yourrecord)) ?
20:47danielcomptonhiredman: I'm trying to prevent a Java Keystore password from showing up in stack traces when the record is dumped
20:47hiredmandanielcompton: ah
20:47danielcomptonWe're using component and if any of the components fail to start then it prints the component map
20:48TimMcyikes
20:48danielcomptonGreat for debugging, not so great for operational security
20:48hiredman*shrug* dunno, I've never had that set of circumstances
20:48hiredmanyou could use a deftype instead of defrecord
20:48danielcomptonhiredman: do they work with component?
20:48hiredmansure
20:49danielcomptonwe ended up storing the file path to the password on disk. It's only used once on startup so we just slurp it
20:49hiredmancomponent uses a protocol which a deftype can implement (and the protocol is actually just the default, you can swap it out for multimethods, etc)
20:49TimMcdanielcompton: I would make a feature request on component (perhaps with patch) to have whitelisting of things to print (or other customizations.
20:51danielcomptonTimMc: it doesn't really seem like a component level problem to me? Could a component alter the print stack trace behaviour? The record could be printed in other contexts too.
21:01TimMcdanielcompton: Including program state in the stack trace sure sounded component-specific.
21:02TimMcIn general there really isn't a way of systematically ensuring that bits of information don't get printed unless you use a pretty cool type system or something.
21:06danielcomptonTimMc: You can override the print multimethods, except that a lot of the useful things you need are private
21:59fairuzHi guys. I use nginx-clojure as the web server for my clojure web apps. Do I need to generate jar for my web app and put it inside nginx each time I modify something? Or is there anything I can do to just point the source of my web app to nginx-clojure? Thanks
22:15justin_smithfairuz: I don't think many people here use the nginx-clojure plugin to run clojure webapps
22:16hiredmanit looks insane
22:16hiredmanloading the jvm as a shared library in to nginx
22:18fairuzjustin_smith: hiredman: oh ok. What's the web server people usually use? I;m just starting clojure, so trying to catch up on the components needed.
22:18justin_smithfairuz: http-kit standalone, deploy as an uberjar, run with java -jar, then put an nginx reverse proxy in front
22:18justin_smiththat's my best bet, at least
22:18hiredmanit really depends, I use jetty with various webservers (including nginx) as a reverse proxy in front of it
22:20fairuzoh ok
22:20fairuzI will try out http-kit then
22:21seanawayJust in case there are Reagent users here who aren't in #clojurescript - is there a mailing list (or IRC channel) for Reagent?
22:22hiredmanfairuz: I wouldn't bother
22:23fairuzhiredman: with http-kit?
22:24hiredmanfairuz: yeah, jetty is very standard, ring comes with a nice jetty adapter, etc
22:24seanawaydoes jetty support web sockets these days?
22:25fairuzhiredman: I saw lein comes with Ring jetty adapter. This is enough I suppose?
22:25hiredmanfairuz: lein doesn't come with anything
22:25hiredmanfairuz: lein is a build tool
22:26hiredmanfairuz: ring is a specification of a way to model web requests in clojure, it does have a jetty adapter
22:26justin_smithfairuz: you may think of the jetty adaptor that comes with lein-ring
22:26justin_smithfairuz: but one can use ring without the lein-ring plugin
22:28fairuzjustin_smith: hiredman: I'm confused now. So it's either I use lein to start a ring server for me. Or I can just ditch lein and put ring as a dependencies for my project, and just start my app from there?
22:28justin_smithfairuz: lein-ring is a plugin that you can use. Ring is a library that runs a web server, that can be run with or without lein-ring
22:29justin_smithfor the former, it uses a jetty adaptor if none is provided by you
22:29justin_smithfor ring without lein ring, I think you'll need to provide some server that ring can use
22:30justin_smithat runtime, you can either create an app container and deploy an uberwar, or create a standalone (using a built-in container like jetty, or a standalone server like http-kit)
22:31hiredmanfairuz: there is a lein plugin that will run a ring app using jetty, but it is strictly a developement thing and you should not use that to run your actual app
22:31fairuzah ok
22:32hiredmanyou can package you app as a war file using the same lein plugin which you can deploy to any servlet container (most java webservers)
22:32fairuzhiredman: noted
22:32hiredmanyou can also add jetty as a depdency then run launch it yourself from within your app
22:33hiredmanor use jetty-runner to run the war file as a standalone kind of thing
22:33fairuzBut the easiest will be using lein uberjars and just start the standalone jar? (I suppose there's a built-in jetty in there)
22:33justin_smithfairuz: there can be, if you set it up right
22:33ddellacostahello #clojure
22:34ddellacostaI seek your assistance with getting checkouts working
22:35justin_smithfairuz: but part of why I like http-kit (aside from the websockets and performance) is that instead of launching a container, that then wraps your app, you create the server process as a part of your app
22:35ddellacostawhich is to say, I have no idea why it is not working for me. I've got a checkouts dir, installed the lib first, symlinked in the checkouts dir, the versions in project.clj in main project match, etc.
22:35ddellacostabut no dice.
22:35justin_smithddellacosta: any reason to use a checkout instead of the much simpler "lein install" of the work in progress?
22:35hiredmaneasiest is hard to quantify, I like jetty-runner and a war file, that is my well traveled rut
22:36ddellacostajustin_smith: that's all I've been doing, and I'm tired of it; I'm running lein install every ten minutes, restarting repl, restarting web app...etc. etc.
22:36ddellacostajustin_smith: I'd love to see my changes get picked up right away.
22:36justin_smithddellacosta: OK, good luck
22:36ddellacostajustin_smith: I take it you haven't had much luck getting checkouts working either. :-(
22:37justin_smithyeah, I gave up pretty early, because I found lein install reliable
22:37ddellacostayeah, it is that, I'll concede
22:37ddellacostajust time-consuming. *sigh*
22:37justin_smithddellacosta: maybe someone else here can tell you exactly how to make checkouts work reliably though :)
22:38ddellacostac'mon, that was a straightforward hint people ^
22:39justin_smithperhaps I need to make some sort of unjustified and overstated false claim about how checkouts work, so that the person who knows how to use them will righteously contradicts me
22:39ddellacostajustin_smith: that give me a chuckle. :-)
22:40ddellacosta"actually, checkouts are completely broken unless your dependent projects are all AOT compiled, everyone knows that"
22:40justin_smithwithout the quotation marks, that may have even worked
22:40ddellacostaheh
22:43justin_smithddellacosta: I assume you are using require :reload after updating the checked out namespace definitions?
22:43ddellacostayeah. :-/
22:44dgaffneyHey everyone! Here's hopefully a question that can get answered easily - what's the simplest way to convert a java.util.Date. to a string that looks like "2014-09-04"?
22:44justin_smithand lein classpath is showing the checkout dirs, and not some jars?
22:44ddellacostajustin_smith: yeah, good question, let me try that
22:45ddellacostadgaffney: well, it requires installing another lib, but clj-time provides simple ways to do that. https://github.com/clj-time/clj-time
22:45justin_smith,(subs (pr-str (java.util.Date.)) 7 17) ; dgaffney here's a hack way to do it
22:45clojurebot"2014-09-05"
22:45justin_smithdgaffney: probably better to use a proper Formatter
22:46fairuzthanks justin_smith, hiredman for the inputs :)
22:46dgaffneyjustin_smith: Thanks - I know that there's a good way to do it, but I want something quick and dirty, as this is the only date as of this time, and shockingly, I don't think it's going to need a whole bunch of that type of stuff in the project.
22:47dgaffneyAfter day one of clojure, it's a super awesome language that lends itself to clean writing, but then I'll turn a corner where I'm like "but but string interpolation" and just have to get used to this way. I like it though!
22:47dgaffneyv. v. simple.
22:47justin_smith,(pr-str (java.util.Date.)) ; dgaffney: just so we are clear on what that is doing
22:47clojurebot"#inst \"2014-09-05T02:46:48.354-00:00\""
22:47dgaffneymm
22:48dgaffneyis string joining not just (join "cat" "dog")
22:48dgaffney?
22:48ddellacosta&(str "cat" "dog")
22:48lazybot⇒ "catdog"
22:49ddellacostadgaffney: join will let you interpolate something
22:49justin_smith,(clojure.string/join ", " ["cat" "dog" "fish" "ebola"])
22:49clojurebot"cat, dog, fish, ebola"
22:49dgaffneyalright. And with *vars* in there do you wrap a let binding or just slam it in the list?
22:49ddellacosta&(clojure.string/join "-" ["cat" "dog"])
22:49lazybot⇒ "cat-dog"
22:49ddellacostajinx
22:49dgaffneyhah!
22:49justin_smithdgaffney: there is format
22:50justin_smith,(format "%dof%d" 7 9)
22:50clojurebot"7of9"
22:50ddellacosta,(println "test")
22:50clojureboteval service is offline
22:50dgaffneyahh nice
22:50dgaffneyalright, I got the gist
22:50dgaffneynow its off to write this thing that writes out GEXF files
22:51dgaffneythis, but in clojure: https://gist.github.com/DGaffney/25d879da9982d8273113
22:51dgaffneyweee.
22:57justin_smith,(apply format "%1tY-%1td-%1tm" (repeat 3 (java.util.Date.))) ; dgaffney: one liner, no extra libs needed
22:57clojurebot"2014-05-09"
22:57justin_smithdgaffney: you can look up the javadoc for java.util.Formatter for more options
22:58fairuzjustin_smith: Just got http-kit running. Looks good. Thanks
22:58justin_smithdgaffney: oh, I had day and month switched, but that should be trivial to sort out :)
22:58justin_smithfairuz: cool, yeah it's not too hard
22:59fairuzjustin_smith: The only hard thing is to familiarize myself with clojure syntax itself
22:59fairuz:)
22:59justin_smitheventually, you will miss it when forced to use Algol family languages
23:01justin_smithdgaffney: and please please please use the formatter option if the other option is using that subs hack above :)
23:43munderwoIm trying to start a clojurescript browser based repl following the instructions here https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments
23:46munderwobut I get a No such namespace: cljs.repl.browser at line 1 src/indifference/core.cljs
23:47Licensermunderwo I fought with the same goal last week :(
23:47munderwoanybody go any ideas what might have changed from when the instructions were written and now?
23:47munderwoawsome! did you work it out?
23:48LicenserI gave up :P
23:48munderwoahh bugger..
23:48Licensertook me two days to get something semy working by glueing together 6 different things then I apearently changed something and everything blew up again and I simply surrendered to my incompetence
23:49munderwoi’ve had it working before…. maybe I was using austin
23:49munderwohmm.. how have you gone using interop with node libs?
23:55ddellacostaargh, we really need better docs for CLJS
23:55ddellacostamunderwo, Licenser: have you checked out Austin? https://github.com/cemerick/austin
23:56ddellacostamunderwo: ah, I see you mentioned that. Yeah, use Austin.
23:56Licenserddellacosta that I hand't
23:56ddellacostaLicenser: you're not incompetent, the getting-started docs really need some work.
23:56Licenserthanks ddellacosta
23:56munderwoyeah I think I got it working with Austin a little while ago.. now just gotta get it working at that.
23:56Licenserddellacosta you only say taht because you don't know me :P
23:56ddellacostaLicenser: haha...well, let's just say, I know for sure that we need better docs for getting started in ClojureScript.
23:56Licenser:)
23:57ddellacostaLicenser, munderwo: also take a look at dnolen's posts for some good getting started stuff, if you haven't already: http://swannodette.github.io/ In particular, http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/
23:57ddellacostanot repl related specifically
23:57munderwoddellacosta: the clojurescript repl docs look really nice and clear. But the code is wrong in them AFAICT
23:57munderwothose are good pointers thanks!
23:58ddellacostamunderwo: np
23:58Licenserddellacosta the starting wasn't so hard but getting emacs + repl + the rest to work nicely was a nightmare