#clojure logs

2013-06-12

00:00RaynesIt's a long drive, devn.
00:00callendevn: I'm in MV.
00:00devnRaynes: im looking forward to the drive
00:00callenI just did the Bay area <---> LA pipe. It's a long drive.
00:00RaynesIt's true, callen is not an axe murderer.
00:00RaynesHe has been in my apartment.
00:00devni enjoy the drive south
00:00callenit's a boring drive.
00:00devni disagree :)
00:00SegFaultAXcallen: Is an axe murderer. I've seen his axe collection.
00:00Raynesfutile: Dude, it's okay.
00:00apricotsfutile: that sounds really neat. didn't realize osx let you build your own window managers
00:00devn(-<> futile)
00:00RaynesHugs all around.
00:01devnapricots: it doesn't lol
00:01futileapricots: it doesn't easily.
00:01Raynesdevn: Well, cool.
00:01Raynesdevn: Ever been to LA before?
00:01futileYou have to enable Accessibility mode for it to work.
00:01devnRaynes: long time ago when i was a wee one
00:01futileapricots: which meant I couldn't put it in the App Store.
00:01callenSegFaultAX: actually, I should've shown you Katya.
00:01Raynesdevn: Ever seen the third street promenade and/or Santa Monica pier?
00:01SegFaultAXIsn't there a spaces or places or whatever app that does window partitioning for OSX?
00:01callenSegFaultAX: I feel like you and Katya would get along.
00:01devnive been to santa monica and carmel
00:02devnbut im not sure about the promenade
00:02Raynesdevn: You should come down on a weekend and I can give you the Santa Monica tour grown-up style.
00:02devnlike i said it's been a long time, so i'm looking forward to looking around
00:02RaynesAnd a tour of the Geni office on the promenade, of course.
00:02devni wanna go to the damned aquarium again
00:02SegFaultAXOh wait, is that was we're talking about?
00:02callenSegFaultAX: there's a third party thingamajig for OS X I used to use to split windows. It worked okay.
00:02devnin carmel
00:02callenI forget the name of it though.
00:03devncallen: there are a dozen o fthem
00:03devnof them*
00:03callendevn: I've used most, I had one in particular I liked.
00:03Raynesdevn: I don't have a car though, so if you want to hang out you'll have to make like callen and drive me around too. :p
00:03callenit worked well for multi-monitor.
00:03devnRaynes: im renting one and driving around
00:03devnso of course, free rides!
00:03futileAww, someone PMed me an hour ago, but thanks to rcirc I had no idea and now he's offline.
00:03SegFaultAXRaynes: Santa Monica is fun.
00:04RaynesSegFaultAX: I work there. :D
00:04callenSegFaultAX: I liked it when I visited.
00:04Raynes<3 Santa Monica.
00:04SegFaultAXRaynes: I dated a girl whose family lived in Hawthorn so we partied all over that area.
00:04devni gotta run, but Raynes and callen -- i'll bug you guys closer to my arrival. let's write some codes and hang out.
00:04devncheers all
00:04SegFaultAX(Btw, Hawthorn is the fucking ghetto)
00:04Raynesdevn: Cheers
00:04futileCya devn
00:04SegFaultAXAnd she had friends who lived in fucking Compton and Inglewood or however it's spelled.
00:04callendevn: definitely!
00:05SegFaultAXdevn: See ya!
00:06SegFaultAXErr, 300
00:06RaynesSegFaultAX: I told him and he said he was looking forward to the drive.
00:06SegFaultAXRaynes: That's quite a commute to hack. :)
00:07futileugh. i hate irc. i was so much happier when nobody knew i was crazy
00:12wei_is a monad the right tool for a series of side effects where each task could fail? or is there a more clojure-y way to handle this
00:12seancorfieldback...
00:12callenwei_: a monad is a way to possibly accomplish what you described.
00:12seancorfieldSF->LA is a nice "zen" drive... I like I-5... very relaxing!
00:13callenseancorfield: I actually recited zen koans and listened to podcasts when I was driving to and fro.
00:13seancorfieldMy wife lived in Santa Monica when she was at Pepperdine and most weekends she drove back up to the Bay Area to hang with friends because she hated LA so much :)
00:13SegFaultAXseancorfield: You're like the only person ever who likes I-5. Woohoo 280 miles of orchards and cows!
00:13callenseancorfield: that's some impressive hatred for LA.
00:13seancorfieldI've driven nearly all 1,500 miles of it
00:14SegFaultAXseancorfield: You too!? :)
00:14seancorfieldwe do LA for the weekend pretty often for cat shows
00:14callenseancorfield: is cat show a euphemism for strip club?
00:14seancorfieldwe used to drive up to Portland for cat shows too but we haven't been up there for years
00:14RaynesI don't get all the LA hate.
00:15RaynesEspecially if you live in Santa Monica.
00:15seancorfieldno, my wife is a cat show judge...
00:15RaynesI guess if you like crackheads a whole lot or something.
00:15RaynesSF ftw.
00:15SegFaultAXRaynes: You've only been there a short while probably.
00:15callenSegFaultAX: yeap.
00:15SegFaultAXIt's still fresh.
00:15RaynesEh
00:15wei_callen: thanks. checking out algo.monads now
00:15callenseancorfield: I love cats.
00:15RaynesI can't have an opinion on LA until I've lived here how long then, SegFaultAX?
00:15callenwei_: there's other stuff worth poking around in for monads, like core.async.
00:16pmonksRaynes: until you get pulmonary edema from the smog.
00:16pmonksShould only take a couple of weeks.
00:16seancorfieldcallen: we used to breed Bengals... we still show some... mostly we go to cat shows b/c Jay is judging... which got us to Australia, England, Malta and Russia last year
00:16RaynesHave any of you ever lived in Alabama?
00:16SegFaultAXRaynes: Until you hate it, naturally. :)
00:16callenseancorfield: now I want a kitty in my lap :(
00:16seancorfieldSome ppl love LA, some ppl hate it. I haven't found many without an opinion...
00:16SegFaultAXRaynes: No true scottsman etc.
00:16RaynesYou can have an opinion on Los Angeles once you've lived there 10 years.
00:16callenRaynes: the more I live in cities, the more I'm trapped in them yet hate them.
00:17seancorfieldcallen: http://bangles.com - our cattery site but it's very out of date (since we stopped breeding)
00:17wei_my use case is transferring money. make a db entry, wire the money, notify recipients. if any piece fails, i need to abort
00:17SegFaultAXwei_: Well in that case you're looking for transactionality.
00:17callenwei_: nil = failure + maybe monad == happy funtimes.
00:17callenwei_: but yeah, you need rollbacks bro.
00:18SegFaultAXwei_: And you probably don't want the maybe monad in that case.
00:18seancorfieldwei_: you should read http://www.eaipatterns.com/docs/IEEE_Software_Design_2PC.pdf
00:18callenseancorfield: easy there killer, don't scare him.
00:18SegFaultAXI don't know if there is something like Either already implemented, but you almost certainly want that.
00:18seancorfieldYour Coffee Shop Does Not Use Two-Phase Commit
00:19callenwei_: wait a second, what exactly is this?
00:19callenwei_: is this for bitcoin?
00:19SegFaultAXseancorfield: That's an excellent article.
00:19wei_callen: yes!
00:19seancorfieldclassic piece about why transactions don't scale to real world scenarios ;)
00:19SegFaultAXseancorfield: Informative and entertaining.
00:19SegFaultAXwei_: You've been working on this for a while now I think, right?
00:20seancorfieldok, I need to go watch TV with my wife and drink wine... I'll be back on my Win8 tablet shortly... (be afwaid, be wery wery afwaid)
00:20wei_SegFaultAX: bitcoin-related stuff yes, but new project
00:21pmonksBanks use an interesting alternative for 2PC that might be worth looking into.
00:21SegFaultAXwei_: So here's the rub. Merely having monads doesn't imply anything about distributed transactions (which is what you're really looking for)
00:21SegFaultAXwei_: Monads are more like plumbing in that sense. You'll still have quite a lot of other synchronization work ahead of you.
00:21pmonksBasically each step in the process returns a "rollback callback" that can be called for to rollback the txn.
00:22tomjackEither is implemented via zero code, right?
00:22pmonksSo if step N fails, you can call the rollback callbacks for steps 0..N-1
00:22tomjackand is broken in a similar way to the Maybe we didn't implement
00:22SegFaultAXpmonks: You mean N-1..0
00:23callenwei_: well okay so first thing
00:23SegFaultAXpmonks: You want to unwind the transaction.
00:23callenwei_: if you're not an expert at security and you actually plan to handle other peoples' money (bitcoin), you're fucked
00:23pmonksYeah - it's basically just a way to generalise compensating transactions.
00:23callenwei_: you will get hacked, you will lose their money, and it will be your fault.
00:23callenwei_: but if this is just a learning project, god bless.
00:23wei_well, for the actual transactions I'm using an API
00:23pmonksOrder shouldn't matter (the assumption being that the callbacks can't fail)
00:24callenwei_: then why do you need to...implement...
00:24pmonksIt's basically 2PC but without all the standards rigmarole.
00:24pmonks(and your code is the txn mgr - there's not some 3rd party software doing that)
00:25SegFaultAXwei_: Doesn't matter, you still need to manage the distributed transactions so you can stay in sync with whomever actually /is/ processing the transactions.
00:25wei_SegFaultAX: yes, that's true
00:27SegFaultAXwei_: Read that article on 2 phase commit. It's a gem.
00:27SegFaultAXHonest.
00:27wei_thanks
00:28SegFaultAXwei_: (It isn't sufficient to get you started, but it will at least give you a groundwork in how others have tried and failed to do what you're about to attempt)
00:28SeanCorfieldwin8 tablet in the house :)
00:33callenSeanCorfield: I don't know how you can type on those things.
00:34SeanCorfieldPretty well really. It's a Dell XPS 12
00:34callenso it's a laptop?
00:34SeanCorfieldA convertible
00:34SeanCorfieldUsing it in tablet mode right now
00:36SeanCorfieldwei_: are you the guy from the Bay Area meetup that showed off the Bitcoin scratch game?
00:37wei_yes that's me
00:38SeanCorfieldCool. That was a great demo!
00:39wei_thanks! so far my projects have all been learning projects. no sum of money I can't afford to lose :) but appreciate you guys' help with doing things correctly.
00:40SeanCorfieldDid you go to the last meetup? With Tom Faulhaber... I couldn't make it but it looked like it was very well attended and well received...
00:45wei_couldn't make it to the last one unfortunately
00:46SeanCorfieldNo meetup in July in SF. Although San Mateo and the dojo in SF will happen.
00:46futileHow do you test a testing lib...
00:46futileThis is confusing
00:47SeanCorfieldWe'll be back in SF for Amit Rathore and Domain Driven Design
00:47SeanCorfieldwb futile :)
00:47futileHi.
00:47futileI've had bad luck in the past testing my lib using itself.
00:47futileMakes things really confusing.
00:47futileBut testing individual components is also hard.
00:48futileAnd testing the whole thing at once is just crazy.
00:48futileWhat would you guys do?
00:49SeanCorfieldI'd be tempted to create three parallel test suites, one with clojure.test, one with Expectations, and one with Midje
00:49SeanCorfieldThat will give you really good insight into each framework as well as highlighting weaknesses
00:50futileHmm. I like that idea a lot.
00:51futileActually that complicates the test base too much.
00:52futileBecause some of the tests will actually be written in Expectations-like and Midje-like styles.
00:52futileSo it'll be hard for this test lib and those ones to tell the tests apart.
00:52futileFor clojure.test I got around it by using test-hook-fn, which I just haven't implemented yet so there's no ambiguity over which lib it's for.
00:52futileThis is so tricky.
00:53futileIt's like performing surgery on an armed robber underwater while he's working out.
00:53SeanCorfieldThat's precisely why it's a good idea
00:53SeanCorfieldtricky, not surgery
00:55SeanCorfieldif you can't write the test suite in each of the three styles, that's a lack of feeling for what you're trying to create a bedrock for...
00:55SeanCorfieldwe have clojure.test suites for webdriver, and expectations suites for other stuff
00:56SeanCorfieldone of my team is doing the brian marick workshop at lambda jam so i expect us to consider midje as well going forward
00:56futileIt's just that I'm not a smart guy, so I get confused easily, and keeping things simple and easily understandable has always been my solution to that.
00:56SeanCorfieldso stretch yourself
00:56futileAnd this plan isn't simple enough for my brain to wrap around.
00:56SeanCorfieldseriously, this is a great opportunity to grow
00:57futileThis is one of those places I think tricky techniques should be avoided for everyone's sake.
00:57futileNot just mine.
00:57SeanCorfieldfocusing on testability in all three styles will really help you keep things simple and well-designed
01:01futileOops.
01:01futileJust realized I hard-coded asserters needing to be macros into the spec.
01:01futileSo they can give the reporter more info for failures.
01:07futileThese can't be combined into the function's argslist, can it? https://github.com/evanescence/test2/blob/master/src/test2/run.clj#L39-L40
01:12ddellacosta&((fn [{dog :dog cat :cat}] (println (str "DOG: " dog ", CAT: " cat))) {:dog "DOG!" :cat "CAT!"})
01:12lazybot⇒ DOG: DOG!, CAT: CAT! nil
01:12ddellacostafutile: does the above help?
01:13RaynesDOG! DOG! CAT! CAT! MEOW! WOOF! OMFG
01:13ddellacostaha, for some reason I always end up with animals in my example code
01:13RaynesI like to use famous serial killers.
01:13ddellacostaI guess it's not that unusual though.
01:14ddellacostahttp://blog.fogus.me/2013/06/04/fun-js-bilby/
01:14ddellacostaSerial killers! You are sick sir, sick.
01:14ddellacostabut, that is funny.
01:14Raynes&((fn [{toole :toole dahmer :dahmer}] (println (str "TOOLE: " toole ", DAHMER: " dahmer))) {:dog "TOOLE!" :cat "DAHMER!"})
01:14lazybot⇒ TOOLE: , DAHMER: nil
01:15ddellacostahahaha
01:15ddellacostanice
01:16ddellacostaguess you need to map your serial killers not to animals
01:16ddellacostathat makes sense in some alternate universe
02:54tomjack&(let [x 3 y 42] (cond-> x (even? x) inc :else (do y))) ; hmm
02:54lazybotjava.lang.RuntimeException: Unable to resolve symbol: cond-> in this context
02:54tomjacklazybot: :P
02:56tomjack,(cond-> 3 false :else when)
02:56clojurebot#<AssertionError java.lang.AssertionError: Assert failed: (even? (count clauses))>
02:56tomjack,(cond-> 3 false inc :else when)
02:56clojurebotnil
03:02tomjackhttps://www.refheap.com/f6d7758b7af3be352b7ad5b0c
03:31amalloytomjack: i don't think that does what you intend
03:32amalloysince cond-> doesn't "stop" at the first truthy test, you are just unconditionally returning (/ (inc y) 10), ignoring the value of x
03:33tomjackoh, duh :(
03:33tomjackthanks
03:33tomjackthat would have bit me later
03:33amalloypersonally i don't like cond-> very much
03:34amalloyif it stopped at the first truthy test, it would be easy to write a macro over it that does what cond-> *actually* does; given the current definition of cond-> there's not really any way to get it to stop at the first truthy test
03:34amalloyon top of that, the name strongly implies that it will act like a cond
03:35tomjackI remember arguing that threadiness implied that it won't act like cond
03:35tomjack:(
03:36tomjackI think I delete more cond->'s than I keep
03:37amalloytomjack: have you looked at the cond->-like stuff in useful? it's been there for years, and is more flexible than cond-> (although, admittedly, not as pretty)
03:37tomjacknope, will do
03:38tomjackI saw some text like "the algebra of arrow macros" somewhere
03:38tomjackbut it was a teaser like "feel free to ask me about that"
03:38amalloyeg, (fix x even? inc (fn [_] (-> y inc (/ 10))))
03:38tomjackfix?
03:38amalloyin useful
03:38tomjackI mean, what is the connotation?
03:38tomjackrepair?
03:38amalloyyeah
03:39amalloy"this function wants integers, but sometimes some dope passes a string; fix that with read-string"
03:39nopromptamalloy: said who?
03:40amalloyme, just now. scroll up about thirty seconds for the genuine original source
03:40noprompthehe, just logged in actually.
03:41nopromptbut it's a good coincidence i guess because i was acutally hoping you or Raynes would be on.
03:41amalloy$whatis logs
03:41lazybotlogs is is http://logs.lazybot.org/irc.freenode.net/%23clojure
03:41nopromptah, nice.
03:42amalloythough it sounds like you don't actually need the logs
03:42nopromptnot really but, it's good to know.
03:42noprompt:)
03:43nopromptso that fs code with the macro technique you showed me to conditionally load the java 7 fns.
03:43tomjackI think I have looked at useful.fn before
03:43tomjackbut forgot it. interesting
03:43amalloytomjack: not much new stuff has gone into useful.fn in a while, but useful.seq has some new gems
03:45tomjackrate-limited seems so much simpler than rate-gate
03:45tomjackI wonder why rate-gate is the way it is
03:45nopromptamalloy: it's a neat technique, but it feels, eh hackish. i'm wondering if fs could deprecate java 6 in 2.0.0?
03:46nopromptor, well, just what thoughts, if any, you might have regarding that.
03:46amalloyask Raynes. i have no horse in that race
03:46amalloytomjack: rate-gate?
03:46nopromptamalloy: sure thing, thought i'd ask. :)
03:46RaynesI've said on multiple occasions that I don't really care about 1.6 support.
03:47tomjackhttps://github.com/jkk/rate-gate/blob/master/src/rate_gate/core.clj
03:47Raynesamalloy is the one who brought it up, and you thought it was important enough to fix it.
03:47Raynes:p
03:47nopromptRaynes: fixed my tab completion. :)
03:48RaynesNice.
03:49amalloytomjack: rate-gate looks like it's queueing up too-fast requests, rather than discarding them like rate-limit
03:49tomjackI don't understand the look in the thread yet
03:49tomjackloop
03:50amalloyand also allowing stuff like "five times per minute"
03:50amalloywhereas rate-limit just says "if it's been less than X amount of time since your last call, i won't handle it"
03:50nopromptRaynes: i'm still interested in that directory walk problem with the "billions" of files, just haven't had a chance to really get in to it yet.
03:51Raynesnoprompt: That can be the 2.0.0 where we remove 1.6 support. ;)
03:51tomjackoh you have to understand RateGate too :(
03:51tomjackamalloy: I see
03:51nopromptRaynes: that's what i was thinking.
03:52tomjackand, ah, it's not a concurrent queue, so it can peek and then poll, I get it
03:53nopromptRaynes: anyhow, i _finally_ pushed the rest of that patch.
03:53Raynesnoprompt: I'll merge it tomorrow. Currently watching a depressing documentary about Skid Row.
03:54nopromptRaynes: indeed. i can't remember seeing a documentary that wasn't depressing somehow.
03:55nopromptamalloy: you have a horse?
03:55noprompt:P
03:55callenRaynes: SF?
03:55Raynescallen: Downtown LA.
03:55amalloylook again, now i'm in a boat?
03:56Raynesamalloy: Don't you wish your man was like m?
03:56Raynesme*
03:56nopromptcallen: been reading "Language, Logic and Truth" by A.J. Ayers.
03:57Raynescallen: The particular documentary is Lost Angeles.
03:59nopromptcallen: so far it's been a good read and worth the time.
04:01nopromptcallen: the book is definitely restoring my interested in reading philosophy again.
04:01nopromptugh, i'm not even gonna bother trying to correct my typing. ykwim.
04:12callennoprompt: :)
04:12callennoprompt: now I just need to turn you on to some Foucault and Zen Buddhism.
04:13tomjackLEIN_BREAK_CONVENTION= lein new _CARET__LBRACE__COLON___RBRACE_
04:13callentomjack: wut
04:13nopromptcallen: i stumbled upon Ayers while reading up on NLP oddly enough.
04:15callennoprompt: I'm not really an adherent of his particular brand of logical positivism, but it's cool stuff.
04:15nopromptcallen: but the first chapter of the book is a scathing critique of metaphysics which i ab-so-lutely love.
04:15callennoprompt: my fav in that realm is probably Popper.
04:15callennoprompt: yeah Ayers was pretty clear-headed about subjects like that.
04:15nopromptcallen: yeah, i haven't gotten to the parts where he talks about positivism yet, but he has made some mention of it.
04:16nopromptwhat i love is how he points out that entertaing a discussion on dualism/monism is nonsensical.
04:17mthvedtthe wikipedia page on monism has 'monad' in the see also section
04:17nopromptnice.
04:18mthvedtreality is just a monoid in the category of endofunctors, what's the problem?
04:18noprompt*for example.
04:19nopromptanyway, good stuff, totally loving it. well worth the $7 i paid for the book.
04:19nopromptdover books generally don't dissapoint.
04:19nopromptalthough i do have a few dry ones that i just couldn't, for the life of me, get through.
04:20nopromptgreek mathematical thought being one.
04:37samrathas anyone here used clodiuno?
04:41tomjackmthvedt: thanks, I had never heard that
04:49ro_styogthos: are you aware of a ring util fn that gives you a full url suitable for storing as a redirect-after-foo uri?
04:49ro_stie, composes :uri and :query-string
04:50ro_sti'm busy refactoring our wrap-access-rules to work with 0.6.2 (much nicer api, thanks!)
04:52ro_stfound it. ring.util.request/request-url
04:57ro_st?! it's not in 1.1.8
04:59callenro_st: there isn't a chance in hell yogthos is awake right now.
05:00callenro_st: ignore his away/back thing, I think his cat walks on his keyboard or something.
05:00clgvDoes enlive support selectors like [:table.class1 :tr.class2]? I always get an empty selection with that one whereas the selection for [:table.class1] is not empty and has the desired <tr> tags with the specified class2.
05:01ro_stcallen: tx :-)
05:03ro_stclgv: it totally does
05:04clgvro_st: well why does it not work on a table like <table class="class1"><tr class="class2">...</tr></table>?
05:05clgvI checked that those <tr>s are there
05:05ro_sti'm not sure. i just know that it does work for me. we've just refactored part of our views system to use enlive in some places and we defo do this
05:07clgvI wanted to use it fro extrating information from a website but I already failed implementing that first selector for the table rows I am interested in
05:07ro_sttry [:body :table] to see if you get the table?
05:10clgvI get the table
05:15clgvro_st: oh might that be due to a parsing error? there is a misplaced <input> between the <tr>s
05:15ro_styes, that's quite likely
05:15ro_stif the html is malformed
05:16clgvbut there is no syntax error. so I'd think tagsoup should be able to handle that
05:16ro_sttry just selecting :table :tr
05:19clgvthat way I only get the first <tr> before that stupid <input>. so thats the reason
05:19amalloyenlive uses jsoup, not tagsoup
05:19clgvwell, I do not need those <input>s so I just remove them via regexps
05:20clgvamalloy: ah ok. does that matter? I read tagsoup somewhere.
05:20amalloyi don't think it matters, really
05:20clgvactually, I think the parsing is fine except those check constraints like "<input> must not appear between <tr>s"
05:21amalloyafaik both of them read in rubbish html, and output valid html
05:21amalloyso there's no way it could produce an <input> in the wrong place
05:22callenamalloy: it's like an anti-proof of GIGO.
05:22callenMagical.
05:30clgvamalooy: hm ok it's pretty weird than. even removing the <input> in advance does not help.. seems to be another error...
05:31clgvthe seletor works in firefox' inspector
05:55tomjackinteresting.. https://www.refheap.com/c103ad88c6a803aa280acb179
05:55tomjackwonder how well that will actually work out
05:57tomjackhttps://www.refheap.com/36f68b88fba6e7fa2d6ceac23
06:05coder11what's up guys
06:06coder11can somebody help me with emacs ad clojure setup?
06:18callencoder11: github.com/bitemyapp/dotfiles/
06:20coder11thanks, callen!
06:21coder11there is a lot of stuff you have in your .emacs config :)
06:22callencoder11: I have 380,000 lines of elisp in my dotfiles repo.
06:25dnolencoder11: there's not much do beyond installing clojure-mode and nrepl via the Emacs 24 package manager.
06:25dnolencoder11: I assume you have Leiningen installed
06:28coder11dnolen. sure I have lein installed. I've installed clojure-mode and nrepl
06:28coder11using this tutorial: http://ianeslick.com/2013/05/17/clojure-debugging-13-emacs-nrepl-and-ritz/
06:28dnolencoder11: that's a lot more than the basic setup
06:29coder11My problem is that i don't have auto-completion in clojur mode
06:29coder11here is my .emacs config http://pastebin.com/nEiQ3mfw
06:29dnolencoder11: k that's more specifc, I don't use autocomplete, someone else might know something about that.
06:31coder11I guess I should add auto-complete mode to some sort of list or add a hook. I'm new to emacs and elisp unfortunately
06:31coder11thanks for help anyway :)
06:32hyPiRioncoder11: https://github.com/hyPiRion/emacs.d/blob/master/hypirion-clj.el#L20-L23
06:45coder11well, it seems like I have ac mode enabled. It works for symbols across one file, But it doesn't auto-complete others. eg. map, reduce, mapcat etc
06:45callencoder11: it's not necessarily Clojure aware unless you add that./
06:45hyPiRionwell, auto-complete cannot do that yet
06:46hyPiRion(afaik)
06:50coder11Well it's definitely not needed for standart clojure functions. But I really want autocomplete to work with other libraries like seesaw
08:32CookedGryphonUgh, does anyone know how to make emacs properly display ansi escape strings? It's really annoying for midje, I want to run autotest in my emacs repl and see the colours
08:32CookedGryphonSurely it should just be a set of font locks? But I can't seem to find anyone anywhere who's done it
08:37magnarsCookedGryphon: You'll have to find somewhere to hook in `ansi-color-process-output` from the 'ansi-color package. For regular comint buffers, that would be `comint-output-filter-functions, but I'm not sure how nrepl does things.
08:39magnarsCookedGryphon: there's also ansi-color-apply-on-region
08:43CookedGryphonthanks for the hints
08:49BeLucidI have (what I think) is an interesting little question. In the following code: https://gist.github.com/belucid/5764932 I'm creating a ClojureScript CouchDB view from some Clojure code. To avoid a lot of repetition, I'm creating multiple views using 1 function called from a doseq.
08:50BeLucidHere's the dilemma, the var named "type" on line 7 needs to be a string literal by the time it makes it into CouchDB as a view (think of it like a ClojureScript map/reduce stored procedure).
08:51BeLucidSo... how do I take my string var, and turn it into a string literal?
08:51BeLucidWithout just repeating that code 3 times w/ different string literals (which works fine by the way)
08:51BeLucidany thoughts?
08:56BeLucidHere's the version that works fine, but it's pretty obvious why I'm working towards something better: https://gist.github.com/belucid/5764991
09:25jweissis there an example somewhere of a good way to express a list like [a, b, c, (things-named "foo")] - where it's one list but some of the items are described with a single expression?
09:26jweissi know i can write it just like that, but trying to decide how to expand into the full list. protocol+mapcat?
09:47Steve973wow, it's cool to see so many people here
09:48joegallo,(list* 1 2 [3 4 5])
09:48clojurebot(1 2 3 4 5)
09:50jweiss,(list* 1 2 [3 4 5] 6)
09:50clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
09:50futileSteve973: most of them are not really here.
09:51futileGood morning.
09:51cbp`Hi
09:51Steve973good morning. I've just begun looking into Clojure. I have the In Action book
09:53futileSteve973: I've only heard the Joy of Clojure book is good
10:02Steve973futile, I like the Clojure In Action book so far. But I'm only about 50 pages in
10:04dhm_i recommend 'clojure programming' by emerick, carper and grand
10:04xeqiI've heard good things about clojurebook.com
10:04babilenSteve973: I would recommend "Clojure Programming" and "Joy of Clojure"
10:05Steve973for those of you who are making the recommendations, have you read Clojure In Action?
10:05babilenYeah, Clojure Programming is one of the best books around.
10:06Steve973and have you found it to be lacking in some respect(s)?
10:06Steve973I'm just curious because I'd rather finish it so that the $30 doesn't go to waste ;)
10:06cbp`I don't think any book goes beyond clojure 1.3 atm
10:07dhm_i have not read clojure in action
10:08futileI read the first chapter of Clojure Programming I think, where it gave the example of finding indexes in a string, and gave a Java example and a functional Clojure example.
10:08futileThat one example really sold me on Clojure.
10:08VFeyeah, the only major lacking thing is no recently updated ones for 1.4/1.5, though 1.3 -> 1.5 is less of a jump than 1.1->1.3
10:09babilenSteve973: I haven't read "Clojure in Action" (but meant to do it for a while now). I did, however, read "Programming Clojure (1st)" and "Practical Clojure" and strongly prefer "Clojure Programming" -- Currently reading https://leanpub.com/fp-oo and http://www.packtpub.com/clojure-data-analysis-cookbook/book
10:09VFeSince a lot of early examples no longer work correctly
10:10supersymthats a shame but expected problem with unstable programming interfaces, stuff changes ><
10:12supersymI like Github allows you to search on code now too, so I look for functions like say defprotocol, or multimethod or defmacro to see how others used them
10:12babilenSteve973: I would recommend to eventually read "Programming Clojure" and "The Joy of Clojure" -- The latter is a little bit dated by now, but a book that really explains the "why" rather than the "how" .. quite the eye opener (I think I read it a bit too early and missed out a little) -- http://pragprog.com/book/shcloj2/programming-clojure might be great too, but I haven't read the 2nd edition
10:15futileOh wait, I thought I bought Joy of Clojure but I have Clojure Programming sitting here as a PDF. Oops.
10:28alandipertbbloom: is it your intention to require reducers for fipp 0.3+?
10:28alandipertbbloom: i ask becuase the require in fipp.printer makes some things of ours not work (without fiddling) w/ jdk 1.6
10:40piranhais there any good library for html form handling? if it matters, I use hiccup for templating
10:47futilepiranha: compojure makes getting params really easy
10:48futilepiranha: https://github.com/weavejester/compojure/wiki/Destructuring-Syntax
10:48piranhafutile: yeah, I'm more interested in skipping all this dance with marking fields which are not correct, displaying errors and similar stuff
10:49piranhagetting data from request is not a problem :)
10:52clgvpiranha: there were some libs on the mailing list.
10:52piranhayep, I'm trying to find them, but no success yet
10:52piranhaah, https://github.com/codedreams/formula
10:53piranhafound at least one :)
10:53clgvhttp://github.com/alienscience/form-dot-clj
10:53clgvhttp://github.com/Kaali/pour
10:54piranhaclgv: thanks!
10:55clgvpiranha: "html form validation" was my search phrase
10:55piranhaheh :) I used 'processing' and that was wrong :))
11:04mpenetvalip is also nice, lower level, but simple is good
11:05mpenet$google valip
11:05lazybot[weavejester/valip · GitHub] https://github.com/weavejester/valip
11:05futiletechnomancy: do you use c.t's ability to call tests from within other tests often? and if so, do you use this in conjunction with fixtures tied to either the inner or outer tests?
11:19futilethickey: nice design, re: clojure.org
11:21gfredericksfutile: I've never once called one test from within another
11:21seancorfieldmornin'
11:21gfredericksthat is probably the weirdest advertised feature of c.t from my perspective
11:21futilegfredericks: I think most people don't use that feature of clojure.test, but I think technomancy mentioned he does
11:21futileseancorfield: Good morning.
11:21gfredericksseancorfield: good 10:18
11:22hyPiRiongood 17:19
11:22futileGood 10:19
11:22gfredericksUS central wins
11:22futilewoot
11:22cbp`mexico central :D
11:22llasramThat's an unexpected outcome
11:22futileI think I'm slightly west of gfredericks by 1 minute
11:22clgvgood 17:19 as well ;)
11:22futileTie?
11:22gfredericksaw crap
11:22clojurebotcount arities is http://groups.google.com/group/clojure/msg/fb9930ba2a25d2dd
11:22futileseancorfield is the tiebreaker
11:22llasramI'm going to blame it on all the PST people being asleep and all the EST people being about to head to lunch
11:23hyPiRionwell, he's certainly not 17:19
11:23mthvedtgfredericks: i think the idea is that it's a simpler way of doing test suites
11:23futileWoot.
11:23gfredericksI assume he's either in US central or the swedernetherdenmarks
11:23mthvedtif a test is a group of assertions, why have a separate 'suite' concept
11:23hyPiRiongfredericks: Europe in general, really
11:23gfredericksmthvedt: rather than grouping via metadata you mean? or namespaces?
11:23seancorfieldlazybot: UGT is Universal Greeting Time http://www.total-knowledge.com/~ilya/mips/ugt.html
11:23hyPiRionseancorfield: clojurebot*
11:23seancorfieldbah!
11:24gfredericksseancorfield: why are time zones always amusing to people?
11:24seancorfieldclojurebot: UGT is Universal Greeting Time http://www.total-knowledge.com/~ilya/mips/ugt.html
11:24clojurebotIk begrijp
11:24seancorfield~UGT
11:24clojurebotUGT is Universal Greeting Time: http://www.total-knowledge.com/~ilya/mips/ugt.html
11:24mthvedtgfredericks: yes, the docs advertise using nested tests instead of the default way of running all tests in an ns
11:24futileWow. I really like the idea of UGT.
11:24futileYes, let's move on.
11:25hyPiRionseancorfield: that is a nice page and good concept
11:25seancorfieldI took a decade off tho'... you know, for good behavior...
11:26futileseancorfield: me too!
11:26futileor the opposite, depending on what you meant
11:26seancorfieldfutile: why am i not surprised? (you got banned)
11:26futileseancorfield: because you were *there*
11:26futileAnyone going to LambdaJam?
11:26seancorfieldyes
11:27seancorfieldand one of my team
11:27seancorfieldi'm taking vacation to go - we get two conferences a year so i got clojure/west and will go to strange loop
11:27gfredericksfutile: yep
11:27hyPiRionI'm going to conj, which means I can't afford any other conference except EuroClojure
11:28seancorfieldmy whole team went to clojure/west, then other team members chose appnation/internetweek, lambda jam, and clojure/conj
11:28gfrederickshyPiRion: aw man now I mant to go
11:28gfrederickswant*
11:28seancorfieldi'll be at clojure/conj too - also vacation
11:28hyPiRiongfredericks: You won't be thar?
11:28gfredericksunlikely; I'll have a newborn at the time
11:29futilegfredericks: congrats
11:29hyPiRion:D
11:29gfredericksthx
11:30hyPiRionThat's a fair reason to not go
11:30futileIf my employer can help, I might go. Would be nice to meet some Clojure folks too.
11:30futileto #(jam)
11:34gfredericksGroupon has some 10 or 15 people going
11:34gfredericksafaik at least. I haven't exhaustively asked everybody.
11:48bbloomalandipert: in theory it can work w/ lazy seqs, but it would be slower. i have no interest in back porting it myself, but if it's a relatively small patch, i'd consider integrating
11:49TimMcgfredericks: We're trying to decide between Lambda Jam, Strange Loop, the Conj, and CUFP. Probably ~ one person to each.
11:51futileHey can someone PM me quick to test this?
11:51futileThanks.
11:51futileOkay someone did.
11:55seancorfieldTimMc: I hope you already have a Strange Loop ticket - they sold out ages ago...
11:55TimMcOh! Hmm.
11:55TimMcLamda Jam, the Conj, and CUFP. :-P
11:57gfredericksTimMc: welp I'll probably be going to just the first
11:58owengalenjonesif I am including a java file in lein project.clj with src/java but when I run lein repl it says no such namespace, am I correct that I need to aot compile the java?
11:58owengalenjonessorry, included with :java-source-paths
12:01teromowengalenjones: https://github.com/technomancy/leiningen/blob/master/doc/MIXED_PROJECTS.md this may help you
12:04piranhampenet: valip is not bad, but it's a bit frustrating that there is no ready-to-use tool which would help generate hiccup tree with errors and such; it's a fairly basic task which requires quite a bit of manual work if there is no good library...
12:04juhu_chapaHi all!
12:04gfredericksjuhu_chapa: good (UGT) morning
12:05juhu_chapaWhat does it meaning #' in (meta #' var)
12:05hyPiRionjuhu_chapa: #'foo is a short form of writing (var foo)
12:05gfredericks,'#'foo
12:05clojurebot(var foo)
12:06XPheriorowengalenjones!
12:07juhu_chapahyPiRion: :O thanks
12:09technomancyfutile: actually I don't call one test from within another; I just call functions which contain `is` calls from multiple deftests.
12:09futiletechnomancy: perfect.
12:10technomancyI guess it depends on how you define test; maybe that counts
12:10futileSo, nobody uses the "call a test from within a test" feature.
12:10futiletechnomancy: "deftest"
12:10futileThat was one of the scarier, more confusing features I was worried about not being able to port.
12:11futiletechnomancy: anyway the lib is done, all we need now are extensions that let you migrate away from c.t and the others
12:11futiletechnomancy: (which I'm working on and expect to be done in a few days)
12:18mthvedtfutile: i think clojure.test tests are the same as your runners.
12:18futilemthvedt: oh? how so?
12:18mthvedtin that they run code that pushes assertions as side effects, then return a result
12:18futilehmm
12:19mthvedtper the docs, you can only assert inside a deftest or with-test
12:19mthvedtand you make assertions by a side effecting call
12:19futilemthvedt: that sounds like the same as my asserters/definers
12:20futilemthvedt: in test2, a test-fn is just a function housing some assertions, and they push assertion results side-effectily
12:21futilemthvedt: you have to call test-fns to get the assertions to happen though, in both test2 and c.t
12:21mthvedtfutile: deftest wraps this in a fn that returns test results
12:21futilemthvedt: oh!
12:21futilethats kinda cool
12:21mthvedtfutile: https://github.com/clojure/clojure/blob/c6756a8bab137128c8119add29a25b0a88509900/src/clj/clojure/test.clj#L692
12:22mthvedtno sorry
12:22mthvedtwrong anchor
12:22mthvedthang on
12:22futilemthvedt: oh, so deftest is kinda like my run-test-fn: https://github.com/evanescence/test2/blob/master/src/test2/api/runners.clj#L17-L21
12:22futileI mean, c.t's deftest wraps c.t assertions in something like my run-test-fn
12:24mthvedtfutile: i might be wrong--i'm trying to follow the code now
12:25mthvedthowever, i think that treating test runners as first-class test suites would make it easy to nest, recombine, &c
12:25futilemthvedt: im not sure about nesting, but combining tests seems like nothing but trouble
12:26mthvedtfuitle: when i worked in big java, being able to group and recombine test suites was a killer feature.
12:26futilemthvedt: then what do you mean by "recombine"?
12:26futilemaybe we have different ideas
12:27mthvedtbasically, being able to make groups of tests out of other tests or groups of tests.
12:27mthvedtin an arbitrary fashion
12:28futilemthvedt: but what was the purpose?
12:29mthvedtfutile: exposing abstractions is its own purpose… but if you have a big app, you might have a unit test suite, then some suites that take longer to run.
12:29mthvedtyou might also have the DB tests, integration tests, &c.
12:29futilemthvedt: okay so one purpose is running only certain tests
12:29futilemthvedt: another purpose, it sounds like, is to group related tests for the sake of navigating your test suite
12:29futilemthvedt: does this sound right?
12:29mthvedtanother purpose is running tests under different configurations, and being able to programmatically inject configurations (without using Spring nonsense)
12:30futilemthvedt: configurations being like a "run-this-before-all-tests" function?
12:30futile(meaning, run this fn once before the whole suite runs)
12:31mthvedtfutile: could be setting things up and tearing them down, could be setting up state or options
12:31futilemthvedt: so it's just functions that surround the whole test suite?
12:31mthvedtlike say you want to run suite X with some feature turned off, then again with some feature turned on
12:31futilemthvedt: sounds like c.t's once-fixtures
12:31futilemthvedt: ah, i see.
12:32futilemthvedt: yeah, in test2 parlance, that sounds like a job for a custom runner maybe.
12:32mthvedti think a lot of the underlying problem behind the mess that is clojure testing is
12:32mthvedtpeople approach writing a test framework with the idea that "i think tests should do x, y, and z" where x y z happen to be use cases that person encountered
12:35holohi
12:35hyPiRionhello
12:36futilemthvedt: I don't think such a thing should be baked into the spec, but should be made possible by it via extension
12:36futilemthvedt: it looks like you can do that with a custom runner right now, and i think thats an appropriate solution
12:38mthvedtfutile: one thing that would help is if test results could be hierarchal
12:38futilehow so?
12:40mthvedti think i've basically described how you would nest tests without needing any changes to the test2 api--but you still need a way to report, "i ran this bunch of nested tests and here's what happened"
12:40futileHmm. I need to think about nesting more.
12:40futileIt may be something the spec needs to consider.
12:41futileBut if the reporter got a bunch of nested test-results back, that could make things really hard for it.
12:42futilemthvedt: I'm concerned that some reporters may not want to list things in nested order, and having nesting baked into the spec sort of enforces everyone to consider them nested.
12:42seancorfieldTimMc: just checked and Lambda Jam tix are still available (but only at the "late" rate of $475) and the conj has only 15 "early" tix left :)
12:42futilemthvedt: I wonder if nesting can be "faked" easily enough using the existing spec.
12:43tomjackI don't think clojure.test does any 'nested reporting'
12:44futilemthvedt: right now, custom definers can be used to create "nested" tests with fixture-like behavior that works properly with the nesting
12:44tomjackso emulating its 'nesting' should be easy except for maybe fixture problems
12:44tomjackand personally that seems like the correct behavior to me
12:44mthvedttomjack: the tests are nested but the reporting is flat, which i think is a flaw.
12:44mthvedtmany test frameworks have nested reporting
12:44mthvedtif you want to flatten a test tree, it would be maybe 1 or 2 lines of code
12:45futileYeah.
12:45tomjackhmm.. I retract what I said about correct behavior, I dunno
12:45futileI think nesting should be in the spec.
12:45futileFlat test suites are a subset of nesting, i.e. nesting with only 1 level.
12:46futileBut this still means that fixture-like behavior should still be the definer's job, not the runner's.
12:47futile(which is easier, and makes more sense)
12:51tomjackeasier in general? least change to current spec?
12:51futileeasier to implement
12:51futileand easier to understand in the spec
12:51futileand better separation of concerns
12:51mthvedtfutile: what exactly is a definer? just any macro that makes test-fns?
12:51tomjackweird
12:51tomjackseems the opposite of all of those things to me :)
12:51futilemthvedt: yeah
12:52mthvedtmaybe this is a simple vs easy debate
12:52futiletomjack, mthvedt: imagine how (describe) and (it) in this example would expand to just a fancy definition of several (defn ^:test ...) https://github.com/slagyr/speclj/#a-sample-spec-file
12:52futilemthvedt: no I think it's both
12:53justin_smithever try inventing a game from scratch? it is easy to mis-evaluate the simplicity of something you have designed yourself
12:53futilejustin_smith: yes.
12:53futilejustin_smith: everything is way harder than you think, even up til the point that it's done. that's a given.
12:53tomjackdoes 'nested test' mean something more than 'calling a ^:test fn from inside another test'?
12:53tomjackmore/different
12:54futiletomjack, mthvedt: oh! that's the confusion!
12:54futileI meant "nested test-results" all along.
12:54futileBut now I see that this is actually more confusing than I thought.
12:55tomjackI see, just a spec for the reporting, and a ^:test fn can report nested results however it wants?
12:55lunkhello, happy humpday
12:56futiletomjack, mthvedt: I was imagining a flat series of tests [t1 [t2 t3]] where the nesting just means they share some before/after functionality
12:56mthvedttomjack: that's what i was getting at, anyway.
12:56lunkcan you use let to define a local scopped ref when you use deftype to implement a protocol?
12:57mthvedtthe way test2 is currently written, you could nest arbitrary test-fns using, like, a subtest macro
12:57mthvedtthat traps reported results and reports them as a subtest
12:57futilemy understanding of nesting only applies to fixture-like behavior
12:57futilebut I don't understand how they would generate nested reports...
12:57tomjacklunk: you want a ref per instance? just make a field for it and pass it in to the constructor
12:58futileBut at least I've got the fixture-half of it down.
12:58futilemthvedt: that doesn't work.
12:58mthvedti g2g but
12:58mthvedtfutile: sure it does. if you're pushing reports as side effects, rebind where you're pushing them to, gather the results, and push those
12:58tomjackso in your [t1 [t2 t3]] example there'd be one each fixture call before the entire group?
12:59lunktomjack, thats what i have, but i dont want it to be an external ref... http://pastebin.com/JuRmsWPx
12:59futilemthvedt: oh, good ieea
12:59tomjackexternal?
12:59mthvedti don't think nesting fixtures baked into the spec is a good idea--there are too many different ways someone might want to do their own fixtures. there's only one way that i'd imagine you'd want a nested test report however.
12:59mthvedtbut i gotta run
13:00futilemthvedt: will respond on the mailingl ist
13:00lunktomjack, yes, that transactions ref vector could be referenced elsewhere or am i thinking about that wrong?
13:01tomjackso you want encapsulation?
13:01lunkyea, maybe using the wrong words, but thats what i desire, tomjack
13:01tomjackI think you're right, but typically you won't worry about encapsulation - the rest of your code should be using the protocol and not accessing the .transactions field directly anyway
13:03tomjackit looks like you could use a reify if you really wanted encapsulation for some reason
13:03lunkmaybe ill just ignore that little engineering detail and focus on computing stuff for now
13:03lunkthanks tj
13:03tomjack(defn portfolio [transactions] (reify IPortfolio ...))
13:04tomjackunless you really need the deftype for other reasons..
13:04lunkahh, maybe i will investigate that, havent realized a need for reify yet, off to learn new things
13:04lunkty sir
13:05tomjackand really, I guess it would be something more like (defn portfolio [] (let [transactions (make-your-ref)] (reify ...)))
13:06lunkthats what i was envisioning, in reality though, i have n sets of transactions and common IPorfolio code that just gets bolted on and called on n references
13:06lunkoverengineering yay
13:08tomjackin general, protocols and deftype/reify should be resorted to only when simpler things are insufficient. dunno where you are in clojure familiarity or in that project
13:08lunkbut, its not static is it tomjack, every call to Portfolio. will copy the logic, so no bottlenecks anyway, does that sound right?
13:10tomjacknot sure what you mean
13:11lunkim imagining, lets say there is another method, portfolio value, and you need to compute the value of a thousand transactions sets
13:12lunkis the portfolio-value logic in memory only once? or for each call to new Portfolio?
13:12lunkim thinking the latter after talking it out
13:13tomjackyeah if I understand you, the latter
13:14lunkyea, rough typing on my phone, thanks for your help
13:14tomjackwhat will happen is the portfolio-value method you define in the deftype will be compiled into an instance method on the Portfolio class. the 'logic' is 'in memory' only once in that you only have to have the one class with the one compiled instance method
13:14tomjackbut since it's an instance method you can, uh, call it on different instances
13:15lunkyea, way beyond my toy project, good to think about though
13:17futilemthvedt, tomjack: posted in the mailing list about this.. hope you guys chime in
13:27rkneufeldJust wanted to mention on the channel here that Luke Vanderhart and I just opened up contributions for the Clojure Cookbook http://clojure-cookbook.com http://github.com/clojure-cookbook/clojure-cookbook
13:28tomjackbeautiful
13:29tomjackdelightfully surprised by free CC ebook
13:32mthvedtfutile: i'm imagining something like this: https://www.refheap.com/15712
13:33futileAw I can't edit this.
13:33rkneufeldtomjack: thanks, I put a lot of time and effort into making it look nice.
13:33futilemthvedt: Why do you guys like this instead of gist? gist you can edit and stuff
13:34tomjackrkneufeld: it looks great, but I meant the whole idea is beautiful :)
13:34mthvedtfutile: i don't know, it seems to be the standard here
13:34futileaw
13:34technomancyfutile: with gist you can't talk to the person who wrote it on IRC or submit pull requests to make it better
13:35tomjackyou can edit a refheap if you're logged in
13:35mthvedtanyway, in the real thing you'd probably want to add some bells and whistles to your report
13:35futilemthvedt: I'm not sure I get this example. It's too detached from a real implementation so I'm lacking context.
13:36mthvedtso run-test-fn gathers and returns test reports, right?
13:36mthvedtthe idea is, the nest macro will grab a report using run-test-fn, and push that as a test report inside another test
13:36futilemthvedt: yeah, but it's separate from the definer
13:37futilemthvedt: and it looks like nest is sposta be a definer?
13:37mthvedtfutile: it's something you would put in other tests
13:37futilemthvedt: run-test-fn is something used internally by the runner
13:37futilemthvedt: all asserters/definers know about is that they can conj onto the magical atom *assertion-results*
13:37futilewhich is a flat list, tied to the current test-fn
13:38mthvedtfutile: right, but the idea is that the functionality of nesting tests is basically already done by a runner.
13:38mthvedtso why not steal code that's being used by the runner to do what we want?
13:39futilei cant put a finger on why, i just feel uneasy about that approach
13:39futilemy design-sense is tingling
13:39jcromartiedo I really need to physically mail the CA to rhickey?
13:40llasramOr hand him one in person at a conference. That seems to work too.
13:40jcromartie:P
13:40jcromartiefast track
13:41futilellasram: you did that?
13:41mthvedtfutile: i think maybe you imagine tests are bundles of assertions that you search for and run, and i'm imaging tests as modular functions that group assertions together
13:41llasramfutile: Yeah
13:41mthvedtwhich isn't to say they can't be both.
13:41futilemthvedt: hm
13:42mthvedtbut to my mind, this is the testing equivalent of with-out-str
14:01supersymhttps://github.com/Engelberg/instaparse pretty damn sweet stuff
14:10RaynesGood morning #clojure.
14:11dbushenkohi!
14:11chronnoHi there
14:12hyPiRionHello Raynes. Up early, I see
14:12RayneshyPiRion: Is that sarcasm? :p
14:13RaynesIt's 11:10AM.
14:13hyPiRionOh, I thought it was like 2 pm there or something
14:13hyPiRionAh, right, you're west coast.
14:14futileRaynes: hi.
14:14futilehyPiRion: UGT
14:14futile~UGT
14:14clojurebotUGT is Universal Greeting Time http://www.total-knowledge.com/~ilya/mips/ugt.html
14:14ucbg'day Raynes
14:14RaynesI wish that didn't exist.
14:14futile?
14:15RaynesIt is utterly impossible to say "good morning/afternoon/evening" without a reference to it being made.
14:15TimMcRaynes: You mean UGT? http://www.total-knowledge.com/~ilya/mips/ugt.html
14:15futileRaynes: the whole point of UGT is for people to stop *this* noise when someone joins
14:16futileit apparently fails at that.
14:16hyPiRionfutile: Well, I thought it was relatively late over there
14:16futileHey guys, look over there!
14:16TimMcfutile: Exactly. Every time someone tries to use UGT, you get a discussion of UGT instead of argument about time zones.
14:16Rayneswat
14:16TimMcSuch as now!
14:17futileGuys..
14:18futile,(letfn [(_ [] (_))] (_))
14:18clojurebot#<StackOverflowError java.lang.StackOverflowError>
14:18futileIt's almost a reactionface-emoticon
14:19ystaelfutile: kind of looks like a clojure very hungry caterpillar
14:19futile:)
14:19futileIt worked!
14:19TimMcfutile: Have you heard the Good Word of Swearjure?
14:20futileI only know of one Good Word.
14:20TimMc~swearjure
14:20clojurebotSwearjure is http://hypirion.com/swearjure
14:21futileWhoa.
14:22futileNever heard of %& bfore.
14:22hyPiRion~hello-swearjure
14:22clojurebothello-swearjure is https://github.com/hyPiRion/hello-swearjure
14:22futileRest for anon-fns?
14:22hyPiRionyeah
14:22tomjacksay you define a tagged reader which reads to something that contains alphanumerics
14:22tomjackcheating?
14:22futile,(#(vector %1 %&) 1 2 3)
14:22clojurebotcheating is making your sexp smile
14:22clojurebot[1 (2 3)]
14:23futileNeat.
14:23tomjack(if so, should #() also be disallowed? :D)
14:25j_m_bI have a question about how to make a "let macro" or "let function"... I have a number of tests which test different things, but they all need the same environment set up by let i.e. (let [username "james" ] (is (= username "james" )) (is (= username (fn-that-pulls-username-from-database "james")))). Is there a way to have one function or macro that will accept a form body that will reference the vars defined in the let?
14:25j_m_bi.e. (setup-environment-through-let `(is (= username "james")))?
14:25TimMctomjack: Yeah, I would consider adding a data-readers file cheating... unless it were also written in swearjure.
14:26futileGuys,
14:26tomjacknaturally
14:26futileIf you had to prove that your Clojure web app really should be using Postgres instead of Mongo, how would you go about it?
14:26futileConvincing arguments were not sufficient.
14:26arohnerfutile: read/write lock
14:26futileData was requested.
14:27llasramfutile: Pretty easy -- no application should be using Mongo. QED
14:27arohnermongo locks the entire database for every insert/update
14:27arohnerwrites block reads, and reads block writes
14:27tomjackwtf?
14:27arohnerif you run a slow query in production, nobody gets to write anything
14:27futileWow.
14:27arohnerat a certain scale, it is no longer possible to run non-indexed queries in production
14:27futileOkay I'll look for some documentation on that and present it.
14:28technomancyisn't that "if Math.random > 0.1" commit a good enough reason?
14:28arohnerha!
14:28OkasuMongo is devilish indeed.
14:29hyPiRiontechnomancy: Is it? In many cases, randomization is a great thing. Though I have no idea what commit you're referencing.
14:29llasramfutile: Also, this blog post: http://aphyr.com/posts/284-call-me-maybe-mongodb
14:30TimMchyPiRion: https://github.com/mongodb/mongo-java-driver/blob/1d2e6faa80aeb5287a26d0348f18f4b51d566759/src/main/com/mongodb/ConnectionStatus.java#L213
14:30futilehyPiRion: https://lh5.googleusercontent.com/-_f5JYBQuGeA/UaobK0eZ1YI/AAAAAAAAO28/Injl2M8AZic/w551-h228-no/Screenshot_01_06_2013_17_02.png
14:31TimMcDiscussion: http://stackoverflow.com/questions/16833100/why-does-the-mongodb-java-driver-use-a-random-number-generator-in-a-conditional
14:31hyPiRionstochastic logging, lol.
14:33supersymhyPiRion: swearjure..like brainfuck? nice food for thought though
14:33supersymi like
14:34arohnerthe swearjure talk at Clojure/West was awesome. definitely check it out when it's released
14:34hyPiRionarohner: yeah, I'm like a little girl waiting for Bieber on that one.
14:35supersymhaha
14:38futileI think I only like conferences for the useless-but-funny talks, like WAT: https://www.destroyallsoftware.com/talks/wat
14:38arohnerfutile: I've got more trash to talk about mongo, if you need any
14:38futilearohner: I need external proof more than talk
14:38futilearohner: something I can show to my boss. data, statistics, something.
14:38arohneris he a developer?
14:38futileHe suggested I profile the app to prove Mongo's slow.
14:38futileYeah
14:39arohnermongo's not slow, it's stupid
14:39seangrovearohner: You guys haven't written anything about Mongo at Circle?
14:39futileBut I'm sure there's documents out there that prove it's bad without needing to profile, right?
14:39arohnerseangrove: not yet. I've written a mongo -> datomic live importer though
14:39seangroveAh, sounds interesting
14:39seangroveWasn't blown away when I last used datomic
14:40seangroveFell in love with datalog more than datamoic itself
14:43tomjackseangrove: unrequited?
14:44llasramfutile: aphyr's blog post is a pretty strong fact-backed argument against using Mongo anywhere you aren't willing to occasionally loose data
14:44llasramlose, even
14:44seangrovetomjack: indifferent at best
14:47tomjackI really meant, if not datomic, then what?
14:48tomjackI can't think of any other databases which come close to satisfying me
14:50technomancybdb
14:50futileI've had fine experiences with postgres, and our data model is relational, that's why I keep coming back to it.
14:50seangrovetomjack: I feel slightly uncomfortable with this conversation - what level of satisfaction are we talking about here?
14:50seangroveFor simply being pretty kick-ass, I love me some postgres
14:51trinaryI haven't played with some of the newer postgres toys yet, like hstore or json columns.
14:51seangroveI certainly like the ideas behind datomic quite a bit, and it could be that I just need to give it another go on a side project, but I just wasn't blown away by it last time
14:54tomjackI'm excited to see new databases inspired by datomic
14:55dbushenkotomjack, which ones?
14:55tomjackfuture tense :(
14:55dbushenkooops :-(
14:56TimMcfutile: Profiling won't help if the problem is "oh crap we literally cannot shard this because it got too big already".
14:57futilellasram, arohner, TimMc: most of the problems seem to be about data failure or not being able to scale well, right?
14:58seangrovefutile: Also just some of the design decisions are baffling
14:58futileBut we haven't experienced those problems. I'm coming at this from the perspective of, this is the wrong tool, we have relational data models, we should be using a RDB
14:58seangroveLetting you write data and think that it's been saved, though it may not have been, and not knowing for sure unless you query for the last error
14:58futileAnd that's all I really can confirm is our problem with using Mongo.
14:58seangroveI believe that default has been changed now though
15:00futileWell we haven't noticed any data loss that I'm aware of.
15:00tomjack:D
15:01futileIf we did, we'd have heard about it by now.
15:01TimMcThat's not how data loss works.
15:01futileOh.
15:02TimMcIf the claim was "Mongo is red, and that's a terrible color", you could just look at yours and say "well ours is blue, so that's fine."
15:02technomancyheh
15:02TimMcData losingness isn't a property you can ascertain with a test run.
15:03technomancyMongo is silly because "Mongo" means "hello" in Javanese, but it's not actually implemented in Java.
15:03seangrovehaha
15:03futileBest answer yet.
15:03TimMcOr rather, it *can* be ascertained if it does lose data in that test run, but if it doesn't, you haven't learned much.
15:03seangroveTimMc: I prefer to consider it an advanced form of compression
15:04TimMcsnrk
15:04seangroveMongo has enough ability to determine if you *really* need to use the data in the future, and kindly discards it, without even bothering you about it
15:04RaynesWe're having the Mongo discussion again? :\
15:05futileNo.
15:06TimMcRaynes: The beatings will continue until morale improves^W^Wpeople stop using Mongo.
15:06RaynesI'll keep using Mongo and I'll enjoy it.
15:06RaynesDamn it.
15:06ToxicFrogI've been trying that with PHP for years, and yet people still use it :/
15:07futileOh that's why it works well for us.
15:07futileWe're using these: https://github.com/8thlight/hyperion/blob/master/mongo/src/hyperion/mongo.clj#L47-L56
15:08futileI mean WriteConcern/SAFE
15:08futile(oops)
15:12seangroveThere's no accounting for taste
15:12seangroveRaynes: Is refheap on mongo?
15:12RaynesYes.
15:13futileOkay so it sounds like I have no proof that we should switch to Postgres from Mongo.
15:13futileDang.
15:13seangrovefutile: It won't hurt until it hurts, so probably no big worry working with it
15:14TimMcIt's not going to eat your grandma or whatever.
15:14RaynesHave you ever lost data with mongo, seangrove?
15:14futileTimMc: that's a low standard
15:14ystaelTimMc: i think that's another one of those questions that can't be answered by test
15:15TimMcNo, I checked, it doesn't even have salivary glands.
15:15RaynesI bet you can test that with FutileTestFramework v2.0!
15:15seangroveRaynes: No, not personally, have't used it for anything super large
15:15RaynesComplete with fairy dust and unicorn piss!
15:15futileRaynes: that endeavour sounds...
15:15futilewait for it..
15:15futileFutile.
15:16ystaelwhat if i want grandma to be a midje metaconstant
15:16futilehttp://img684.imageshack.us/img684/1817/yeaaaaah.gif
15:16Raynesfutile: http://media.tumblr.com/c297572ee4a65d279f09742e92b3ba36/tumblr_inline_mgdub7xNX81qgfr6g.gif
15:16futileRaynes: thank you, thank you
15:17futileHeh I used that in an internal email thread at 8L. They love those pics.
15:17RaynesI propose we make the term "midje metaconstant" vulgar and forbid its use in this channel.
15:17CaptainLexIs it possible to dynamically change implementations of member functions of Java objects that have been instantiated?
15:18ystaelRaynes: ?
15:18ChousukeCaptainLex: If I understand you correctly, no
15:18CaptainLexChousuke: In specific, I'm wondering if I can reimplement the handler for a listener after it's been instantiated
15:19amalloyCaptainLex: no
15:19ChousukeCaptainLex: well, in Clojure you can use a generic handler that just calls a clojure function that's stored in an atom or something, but hm.
15:19amalloybut you can define a handler that depends on some mutable state, eg (atom (fn ...)), and then change that state so that the same method now does a different thing
15:20amalloy(although, actually, proxy objects have that feature built in, sorta)
15:20Chousukeand you probably can do it with invokedynamic somehow as well. but that's likely not worth the effort
15:21CaptainLexI'll just be nice and modular anyhow and put all the important handler info in its own function, then
15:21CaptainLexThe handler would become enormous if I didn't do that anyhow, in a real-world context
15:23CaptainLexBut thank you both, amalloy and Chousuke!
15:47futileSomething cool about being able to generate HTML from a CSV file using Hiccup in emacs via nrepl.el
16:03justin_smithregarding dataloss: I hear jeffrey dahmer spent less than 0.0001% of his life killing people
16:03justin_smithpretty reliable in the big picture
16:03justin_smith(number totally invented)
16:08TimMcimma quote that
16:08futilejustin_smith: but you forget that in the moment, now is 100% of the time.
16:08futileso at those moments, he spent 100% of his time killing people
16:09TimMcMongo never loses data 99.9% of the time!
16:09TimMc(More made-up numbers, obvs.)
16:14justin_smiththere is also that old joke
16:14futileI bet an IRC client in Clojure would be fun.
16:15futile... if only I cared about writing IRC clients anymore.
16:15justin_smith"I built that bridge over there, but do they call me John the bridgemaker? no..."
16:15justin_smith"butcha screw one goat!"
16:17xeqi$google irclj
16:17lazybot[flatland/irclj · GitHub] https://github.com/flatland/irclj
16:17futilecemerick: hey thanks for doing this Clojure book, it sold me on it
16:18futileIf only there was still a Cocoa bridge to Java :(
16:18futilere xeqi
16:20cemerickfutile: sure thing. If you think it's warranted, leaving a nice review @ http://bit.ly/clojurebook would be most appreciated. :-)
16:21seancorfield@clojurebook rocks :)
16:22patchworkData loss as murder?
16:22patchworkWill someone be prosecuted one day for knowingly and with premeditation erasing some bits?
16:22justin_smithmaybe understating the severity
16:23Wild_Cat`cemerick: yeah, your book rocks.
16:23cemerickWild_Cat`: wasn't just me, but thanks :-)
16:23Wild_Cat`yeah, yours et al. :p
16:24jcgrilloI second that
16:24awwaiidpatchwork, flipping the 0->1 can be just as dangerous as the 1->0
16:25futilecemerick: ha, at the end of page 55 you have "5" listed twice in the same paragraph and the only footnote on that page is #5
16:26tjb1982cemerick: I'm working with Friend and I've gotten the form and openid workflows to work (in a sort of cobbled-together, copy/paste from example kind of way). Is there an example somewhere that demonstrates how to integrate both workflows? Or any two workflows?
16:26futiletjb1982: fwiw I couldn't understand how to use Friend with OpenID so I just used openid4java
16:26futileoh, never mind, misread.
16:27cemericktjb1982: how do you mean, 'integrate'? Each workflow is necessarily distinct.
16:27tjb1982I mean I would like to be able to provide a way to use one or the other from the same page
16:28tjb1982maybe I just need to study it a bit more
16:28cemericktjb1982: That's more to do with where you put your forms and such than with friend itself. Have you looked at https://friend-demo.herokuapp.com/openid/?
16:28TimMcpatchwork: That has already happened.
16:29cemerickfutile: also, ^^ ...friend's openid support uses openid4java, takes ~3 lines ;-)
16:29TimMcDestruction of Evidence.
16:29tjb1982cemerick: I did. I have openid working.
16:31cemericktjb1982: I guess I don't understand the question. Just put another form on the "login" page that points at the URI that handles interactive-form, and the user can choose...?
16:31jcgrillo@futile: it's all about the platonic fives
16:32futileNot the reticulating splines?
16:32jcgrilloha
16:34tjb1982cemerick: that makes sense. My issue is not knowing how to configure that to happen. I suppose it's probably just a keyword arg for the interactive-form workflow, right?
16:34tjb1982like it is in the openid workflow
16:36cemericktjb1982: you mean, setting which URI it sits on?
16:36tjb1982cemerick: in the example for interactive form, it looks like it's outside of the workflow `:login-uri "/login"`
16:37tjb1982cemerick: I obviously need to spend some more time looking through the docs. Add to that that I'm a novice Clojurian
16:37tjb1982cemerick: but thank you
16:38cemericktjb1982: yup, you can move it inside as well, and it'll apply only within that scope
16:40tjb1982cemerick: wonderful. Thanks again
16:42pvncadWhat is best to drop elements from a sequence at fixed distance? e.g. I would like to drop 4th, 8th, 12th, 16th etc elements
16:43coredhello all
16:43coredwhich is the best roadmap to learn Clojure
16:43coredbooks/videos/tutorials/projects ?
16:44jcgrillopvncad: filter?
16:44coredI don't have any experience on functional programming also, but would like to learn
16:45pvncadcored: You can start with http://www.clojurebook.com/
16:45jcgrillocemerick, Brian Carper, & Christophe Grand wrote a nice book
16:45coredpvncad: thanks
16:45jcgrillothere are others as well
16:45coredjcgrillo: Brian Carper
16:45coredwill look at it
16:46coreddense book :-)
16:54seancorfield"reticulating splines"... what a great name for a band!
16:54tjb1982cored: Heroku has a great tutorial https://devcenter.heroku.com/articles/clojure-web-application. I would also check out Leiningen, too. Install that from the lein.sh or lein.bat script and then run `lein repl` to mess with the repl like you would python, or `lein new app` to see what a generic directory structure looks like for an app.
16:55pvncadjcgrillo: yes, I am using filter but felt that it was longer than needed
16:55pvncad(map second (filter #(not= (mod (first %) 4) 0) (map-indexed vector (range 10))))
16:55pvncadjcgrillo: any help to simplify?
16:56coredtbaldridge: thank you very much, will do that
16:56jcgrillopvncad: there's this http://clojuredocs.org/clojure_core/clojure.core/remove
16:56tbaldridgecored: I think you mean, tjb1982
16:57tbaldridgecored: although funny enough, my initials are tjb
16:59pvncadjcgrillo: both filter and remove take a predicate on values but not on index
16:59coredtbaldridge: oh yes :-)
16:59Raynescallen: ping
16:59jcgrillopvncad: yeah ive noticed ;-p
17:01pvncadjcgrillo: so, I am trying to eliminate the map and map-indexed calls
17:12jcgrillopvncad: yeah i get the idea, thought it would be easier than that. I'm still majorly noobish here. There's (indexed s) in contrib which might help..
17:13pvncadjcgrillo: thanks for the help. I haven't used indexed. Will take a look at it
17:13gfrederickspvncad: also ->>
17:14gfredericks,(>> (range 10) (map-indexed vector) (remove #(zero? (mod (first %) 4))) (map second))
17:14clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: >> in this context, compiling:(NO_SOURCE_PATH:0:0)>
17:14pvncadjcgrillo: for now, I am happy with (reduce into [] (partition-all 3 4 (range 20)))
17:14gfredericks,(->> (range 10) (map-indexed vector) (remove #(zero? (mod (first %) 4))) (map second))
17:14clojurebot(1 2 3 5 6 ...)
17:15jcgrillogfredericks: thanks! that is awesome.
17:15pvncad, (reduce into [] (partition-all 3 4 (range 20)))
17:15clojurebot[0 1 2 4 5 ...]
17:24pvncad(int (byte -127))
17:25hyPiRion,(int (byte -127))
17:25clojurebot-127
17:26gfredericks,(->> [int byte] (cycle) (take 100000) (apply comp) (#(% -127)))
17:26clojurebot-127
17:27pvncadhyPiRion: sorry, I copied that to wrong emacs buffer (instead of nrepl)
17:28jjidogfredericks: how does that work?
17:28gfredericksjjido: it threads -127 through int and byte and back again 100000 times
17:28hyPiRionpvncad: no worries
17:28gfredericksyou have to give the bots a workout from time to time or they get complacent
17:29hyPiRion,(recur)
17:29gfredericksha
17:29clojurebotExecution Timed Out
17:29hyPiRionbad to have them lazy and so forth
17:29jcgrilloha
17:32futile,lazy-seq
17:32clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/lazy-seq, compiling:(NO_SOURCE_PATH:0:0)>
17:32futile,+
17:32clojurebot#<core$_PLUS_ clojure.core$_PLUS_@e32fd9>
17:32futile,+
17:32clojurebot#<core$_PLUS_ clojure.core$_PLUS_@e32fd9>
17:32futileSame memory location!
17:32simon_Hi
17:33simon_Is there a function that will take an argument and a predicate and return the argument if the predicate returns true and nil (or false) otherwise?
17:33simon_in clojure core or core incubator
17:34amalloy#(when (%2 %) %)?
17:34jeremyheilerYou can use as-> I think
17:34hyPiRionamalloy: wouldn't and suffice?
17:34hyPiRion,(and (even? 2) 2)
17:34clojurebot2
17:34amalloyinstead of when? sure
17:34sritchiedoes anyone here have experience extending a clojure protocol from java?
17:34sritchieI know, crazy question...
17:34sritchienot implementing the backing interface, but actually extending
17:35futileHey so it's thundering here.
17:35futile(inc rain)
17:35lazybot⇒ 1
17:36jeremyheilerI guess as-> is only useful if you want to do something on the "else" clause.
17:37simon_my usecase is a -?> form where I want to filter inbetween
17:37simon_based on a predicate
17:38simon_so (-?> 5 (as-> even? x x) (+ 1))
17:38simon_looks somewhat awkward. is there something more idiomatic?
17:39hyPiRionsimon_: some-> ?
17:40hyPiRion,(some-> 5 even? (+ x 1))
17:40clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:0:0)>
17:40hyPiRionwhopos
17:40hyPiRion,(some-> 5 even? (+ 1))
17:40clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Number>
17:40jeremyheiler,(cond-> 5 (even? x) (+ x 1))
17:40clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:0:0)>
17:40hyPiRionoh right. Darnit.
17:40jeremyheiler,(let [x 1] (cond-> 5 (even? x) (+ x 1)))
17:40clojurebot5
17:41jeremyheiler,(let [x 2] (cond-> 5 (even? x) (+ x 1)))
17:41clojurebot8
17:41papachanhi
17:41papachansomebody can explain this => https://www.refheap.com/15723
17:41papachan?
17:41clojurebotI don't understand.
17:41jeremyheiler,(let [x 2] (cond-> 5 (even? x) (+ 1)))
17:41clojurebot6
17:41jeremyheilerThere :-)
17:41jeremyheiler,(let [x 1] (cond-> 5 (even? x) (+ 1)))
17:41clojurebot5
17:42jeremyheilerWait
17:43jeremyheiler,(let [x 5] (cond-> x (even? x) (+ 1)))
17:43clojurebot5
17:43jeremyheiler,(let [x 2] (cond-> x (even? x) (+ 1)))
17:43clojurebot3
17:43simon_but cond-> does not short-circuit
17:43papachanoh i find out
17:43hyPiRionpapachan: Oh, you understand?
17:43papachanyep
17:43papachanit enable/disable the reader
17:44papachanto protect the reader from injection
17:44simon_,(some-> 5 (#(when (even? %) %)) (+ 1))
17:44clojurebotnil
17:44simon_,(some-> 4 (#(when (even? %) %)) (+ 1))
17:44clojurebot5
17:44simon_thats what i want
17:44jeremyheilerCool
17:44simon_I thought there might be a #(when (pred %) %) builtin.
17:47papachanthe read-val things is a risk in production
17:50hyPiRionpapachan: you can use clojure.edn/read and clojure.edn/read-string for safer variants
17:50papachanhyPiRion: ok thanks
17:56jcgrillopvncad: (into [] (apply disj (into #{} (range 10)) (into [] (range 0 (count (range 10)) 3))))
17:56jcgrillobut yours was better i think
18:03jcgrillopvncad: actually, (sort (into [] (apply disj (into #{} (range 100)) (range 0 (count (range 100)) 3))))
18:13Morgawrmm.. weird, I'm trying to use goog.events.EventType/DRAGEND but it says it's undefined (in the google closure libraries it's there: http://docs.closure-library.googlecode.com/git/closure_goog_events_eventtype.js.source.html ctrl+f for DRAGEND)
18:13Morgawrwith DRAGSTART (or any other event type I tried) it works fine
18:13MorgawrDRAGEND returns undefined though.. is this a possible ClojureScript problem or is it the google closure library?
18:18simon_Hi
18:19Morgawrhi
18:19simon_Im using data.xml and getting the exception : XMLStreamException Prefix cannot be null ... seems to be because data.xml does not support namespaces.
18:19simon_is there any other clojure xml alternative or workaround that can work with big xml files?
18:19akurilinFor an Internet facing api, do you guys usually use something along the lines of nginx to proxy port 80/443 to 3000 (or whatever else you picked for jetty+ring)?
18:20simon_Or do I have to goto sax / stax myself? (I'd rather avoid that..)
18:20Raynesakurilin: That's what amalloy and I do, and it seems lots of other people.
18:20RaynesBut you probably shouldn't use us as examples of how to do things properly.
18:21aphyrIs there an equivalent to midje autotest for normal clojure.test tests?
18:21Raynesaphyr: There is if we write it.
18:21aphyrBeen mucking around with lein-reload but it looks like it doesn't work with lein2 any more
18:21akurilinRaynes, I'm doing that atm, just wondering if maybe there's a way to remove that additional failure/configuration point from the middle.
18:21akurilinRaynes, although generally, and I think this is most people's experience, nginx stays up pretty well when configured properly.
18:22Raynesaphyr: https://github.com/rplevy/ojo Let's do this shit.
18:22Raynesakurilin: It stays up pretty well when not configured at all, in fact.
18:22akurilinRaynes, hah, that's fair.
18:23aphyrRaynes: Sounds like a plan. I've got a large codebase here with a bunch of clojure.test tests, and it takes like 45 seconds to compile
18:23aphyrTake this off-channel?
18:24Raynesaphyr: Hop into #4clojure or #fflatland. We don't actually use it for either of those things.
18:35papachanoh, file (resource) is unavailable:
18:47futileDidn't go over.
18:47futileStill need to profile to prove PG would be better than Mongo.
18:47futileWhich is reasonable, I just have no idea how to do that in production.
18:50mikerodwouldn't @(promise) block indefinitely?
18:51hyPiRionmikerod: it would indeed
18:52mikerodhyPiRion: I saw it hear https://github.com/technomancy/leiningen/blob/master/src/leiningen/repl.clj#L123 .
18:53mikerodhyPiRion: I don't understand the purpose here.
18:54brehautmikerod: im guessing, but probably its to stop the main thread exiting (in a non-blocking way) while other threads continue to execute
18:54brehauterr in a blocking way, rather than a spinning way
18:55mikerodbrehaut: Oh, that makes sense to me. I haven't thought of using `promise` for this sort of purpose before.
19:22jcgrillo\quit
19:22TimMc(def block (comp deref promise))
19:31bbloomTimMc: well that looks like fun.
19:43tomjacktbaldridge: (= 3 (<!! (go (let [foo 3] 'foo))))
19:46tbaldridgetomjack: yep, I don't handle that special form correctly (quote ...)
19:56pmonksRandom n00b question: has there been any talk of reimplementing clojure.walk in terms of clojure.zip? I like the abstraction clojure.walk provides, but also like that clojure.zip won't blow the stack.
19:56bbloompmonks: 1) i don't think that is a n00b question
19:57bbloompmonks: 2) no, not that i know of
19:57bbloompmonks: 3) why don't you give it a try? the source code to walk is pretty short and accessible
19:57bbloomand if you succeed in replicating the API 1-to-1, i'm sure the mailing list would be interested to hear about it
19:57pmonksYeah I'm looking at http://www.ibm.com/developerworks/library/j-treevisit/index.html and thinking that it looks a lot like clojure.walk.
19:58pmonks(scroll down for the Clojure goodness)
19:58bbloomclojure walk is actually extremely limited in applicability, but luckily the code is extremely short, so you can start w/ walk and evolve to custom code as you need to
19:59bbloomswitching to a tail recursive version (even without zip) is as simple as using loop/recur and putting a stack-like structure into your loop arguments
19:59pmonksYeah - seems like clojure.zip is more powerful, at the expense of being pretty low level for simple tree walking.
20:05girlhello we must nupdate your compte in chase by this link o k http://goo.gl/GNiDw
20:12devnGood god this is cool: https://github.com/dentrado/musiklogik
20:13devngit clone that, lein deps it, open src/musiklogik/examples.clj, run some of the stuff in the (comment ...) form
20:13devnso cool.
20:13devndnolen: ^--not sure if you've seen that yet, but core.logic is being used to great effect
20:14tomjackthat is neat
20:15tomjackI wonder if condw will be necessary eventually
20:17devngood lord clojars needs some features
20:20technomancy"some features"?
20:25futiledevn: add them
20:26technomancythe biggest problem with clojars is definitely that the number of features is too low
20:26devntechnomancy: heh
20:27SegFaultAXtechnomancy: As an aside, it irritates me that maven central will give coordinates for every package manager under the sun except lein.
20:27devntechnomancy: it would be nice to see an activity log for pushed repos
20:28technomancydevn: like a timestamp next to each of the recent versions?
20:28devnin addition, i'd like to try and help improve search
20:28devntechnomancy: so im on the homepage, how do i see the full list of timestamped "recently pushed jars"?
20:29technomancysure, that would be a cool addition
20:30technomancyI think xeqi was working on adding pagination to search results
20:30devntechnomancy: i gotta admit, the way i originally phrased my statement "needs more features" was pretty stupid
20:30technomancyit's ok as long as you don't mind a few jokes being made over it =)
20:31devntechnomancy: how do people feel about design? the company i work for has in-house design people who have 20% time and would probably be down to spruce things up a bit
20:31devnis that something that's open for contribution?
20:31technomancydevn: no one's particularly fond of the current design, but gf3 at one point offered an alternative
20:32technomancyhttps://github.com/ato/clojars-web/issues/83
20:32technomancyso one of the main problems right now in my mind is that the transition off sqlite is kind of paused in mid-stream
20:32technomancyhoping to get some time to noodle on that soon
20:32devntechnomancy: is the idea to go to datomic? maybe? i was thinking about that for activity logs and search
20:33technomancysearch is already handled by lucene
20:33technomancythe DB is 5MB currently and not growing rapidly, so we have an in-memory DB being written to
20:33technomancywith an event stream being written to disk
20:34technomancyIIRC it's being written to everywhere it needs to be, but all the queries are still being served by sqlite
20:34technomancyjust a matter of shifting things over slowly and phasing out the sql portion safely
20:34devntechnomancy: im going to make it my next couple of months job to help out on clojars
20:34technomancysweet
20:34devnit's such an important part of the community
20:34jtoyhow can I do a doseq and then "break" out of it on a condition?
20:34hyPiRion(inc devn)
20:34lazybot⇒ 8
20:35jtoyim doing a bunch of network code and I want to break out on any errors that occur
20:35technomancyI might have some time tomorrow to sit down and gather my thoughts; do a more detailed "here's what we need to wrap up" on the DB side
20:35technomancyjtoy: if you have an error you should throw an exception
20:35devntechnomancy: that'd be great. the more we can get a list of priorities in order, the more i can bug people who i work with to get involved :)
20:36jtoytechnomancy: i want my other code to continue after the doseq rhough
20:37technomancydevn: cool... I need to head off but will be around tomorrow.
20:37devnjtoy: could you maybe gist an example of what you're working on?
20:37devntechnomancy: if im not around PM me -- im usually "around", but during work hours I usually don't jump to my IRC tab too much
20:38technomancycools
20:38jtoyok, give me a in
20:38jtoymin
20:39devnjtoy: im sure we could give you some advice, just thinking you might get a more pointed suggestion if you show what you're doing and what you want to happen
20:42devnhyPiRion: since you inc'd me I have to bug you to check up on that cl-format bug you and I discovered awhile back
20:42devnclojure.pprint scares the crap out of me
20:43devnhyPiRion: also, i think i have a few more bugs worth filing w/r/t cl-format given getclojure.org uses code-dispatch pprinting like crazy
20:43devnnone as annoying as the one you and i ran into, but definitely some funky behavior
20:44hyPiRiondevn: you mean the fn* one?
20:44devnyeah
20:44devndid that get screened or anything yet?
20:44Raynesdevn: I am acquiring a vehicle.
20:44Raynesdevn: A coworker is selling me his car for a ridiculously small sum of money.
20:44devnRaynes: radical
20:44hyPiRionI asked whether it was a bug or an intentional behaviour
20:44RaynesUnfortunately I do not even possess a California driver's license.
20:45RaynesBecause my Alabama license expired the *day* I left for LA, I have to take a behind the wheel test. Blech.
20:45devnhyPiRion: it seems unintentional to me?
20:45devnhyPiRion: what scenario would make that intentional?
20:46hyPiRiondevn: I don't know, I'm not sure I understand the rationale at times
20:46hyPiRionhttp://dev.clojure.org/jira/browse/CLJ-1179
20:46devngah
20:46devnno comment or anything?
20:47hyPiRionno comment except the "not approved" sign
20:48devnhyPiRion: i think i see why that wouldn't be an approved change
20:49hyPiRionI'm all ears
20:49devni take that back :)
20:49devni just peeked at the source
20:49gfredericksit feels wrong to me too, but I don't think I've ever known exactly why
20:49jtoydevn: https://www.refheap.com/15727
20:50devnjtoy: so you want what to happen?
20:50bbloomdevn: would love to hear your thoughts on fipp! :-)
20:50jtoydevn I want the doseq to end so i can continue with my other code
20:50bbloomdevn: i'm giving a talk on it too at cljnyc in a week or two. should be recorded
20:51devnbbloom: dude. getclojure.org is prime territory for finding test cases
20:51devntrust me on this.
20:51hyPiRiongfredericks: I'm still weirded out by the distinct/distinct? difference
20:52bbloomdevn: what kind of "test cases"?
20:52gfrederickshyPiRion: yeah the arity bit is bizarre
20:52gfredericks,(=)
20:52hyPiRion,[(distinct [1 2 1 3 2]) (distinct? [1 2 1 3 2])]
20:52devnbbloom: lots and lots of random code written by real people in IRC yields very interesting pprinted code results
20:52clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$-EQ->
20:52clojurebot[(1 2 3) true]
20:52gfrederickshyPiRion: should (=) be defined?
20:52bbloomdevn: oh, i don't have code dispatch yet, only data dispatch
20:52devnbbloom: check this out for example: http://getclojure.org/search?q=let&amp;num=120
20:53hyPiRiongfredericks: heheh, we're back to that discussion again
20:53devnbbloom: look at "(let [r (range 1 11)] ..."
20:53gfrederickshyPiRion: oh I can't remember if we had gone there before or not
20:53devnbbloom: note the way `for` is formatting its binding form
20:53bbloomdevn: ah yeah, it's really difficult to add extra formatting rules to pprint
20:53devnbbloom: similarly, check out the "(let [what's 'this?"
20:54hyPiRiongfredericks: hm, maybe it's because it's not a monoid?
20:54gfrederickshyPiRion: what isn't? =?
20:54jtoyany idea devn?
20:54bbloomdevn: i've been thinking about how to do something stylesheet-esque to let people add formatting rules easily for var usages
20:54devnjtoy: sorry, im looking
20:54hyPiRiongfredericks: yeah, and distinct? for that matter
20:54devnanyone else want to join in and help jtoy out? he wants to break out of his doseq if he hits a problem: https://www.refheap.com/15727
20:55gfredericksdevn: sounds like loop is better for that
20:55bbloomjtoy: why not just use loop/recur ?
20:55gfredericksor exceptions
20:55devnand there you have it! :)
20:55jtoybbloom: i have not used them before, would that solve my situation?
20:55devnbbloom: i gotta run, but we should chat more
20:56jtoydevn: thx
20:56devnhyPiRion: gfredericks: same for you dudes
20:56bbloomjtoy: yes.
20:56devncheers all
20:56xeqidevn: any time you want to spend on clojars is much appriciated
20:56devn:) looking forward to helping out
20:56devnciao
20:57hyPiRiondevn: cya, awesome that you'll burn some hours on clojars
20:57jtoybbloom: I can use loop/recur for non pure functions? im writing to the network
20:57hyPiRionJust don't get the idea that maven has solved a problem for you, because that's a time sink.
20:57hyPiRionjtoy: yeah, loop/recur is eager
20:58hyPiRion,(loop [a 10] (do (prn a) (if (pos? a) (recur (dec a)))))
20:58clojurebot10\n9\n8\n7\n6\n5\n4\n3\n2\n1\n0\n
21:00IamDrowsyjtoy: i'm not quite sure but you might also just doseq over (take-while abort-condition candidates)
21:11bbloom^^ that works too
21:29devni lie take-while more I think. good call IamDrowsy
21:29devnlike*
21:29devnthis goes back to that thread about idiomatic usage of loop/recur vs reduce
21:30devnin this case, idiomatic usage of loop/recur vs doseq in combination with take-while
21:34aphyrWho wants a totally immature but super-useful hack? https://github.com/aphyr/prism
21:44ryanfaphyr: hey, cool. as a clojure noob I ended up using midje specifically because I wanted that functionality
21:47aphyrYeah, me too.
21:47aphyrmidje has some issues with reloading though]
21:47aphyrHoping I can do better when there are syntax errors
21:50Raynesaphyr and I bonded and became besties as we created this.
22:22ddellacostaaphyr, Raynes: you guys are going to make me cry as that is exactly what I wanted
23:30tjb1982using Friend for authentication. Everything is working, generally, but I'm trying to set the `:default-landing-uri` to something like `/:username` (e.g., `/tjb1982`) -- I tried `(str "/" (friend/current-authentication))` but it's returning nil. Any suggestions?
23:31tjb1982i.e., `(str "/" (friend/current-authentication))` returns just "/"
23:38xeqiso you have `:default-landing-uri (str "/" (friend/current-authentication))` as an option?
23:38xeqitjb1982: ^
23:39tjb1982xeqi: yes to my interactive-form workflow
23:40tjb1982xeqi: scratch that. It is a level hgher in the default authenticate options
23:41xeqiI was wanting to make sure it wasn't hidden in a fn somewhere. I believe that is being evaluated when -> is putting together the middleware stack.
23:42xeqiyou could send everyone to the same default, and then do a redirect there... trying to see if there is a way to dynamically generate the default route
23:44tjb1982xeqi: that's what I was thinking, but I'm pretty new to clojure, and I've seen some interesting things happen so I wanted to be sure I'm not missing out on a better way to do it right there in the kwargs
23:46xeqiI don't see anything
23:47tjb1982thanks anyway