#clojure logs

2013-10-23

00:08cddrIn the guide for the clojurescript repl, it says "open the html page by going to http://localhost:9000". That seems like you need a server to serve an html page but later on in the docs, it implies that the repl code uses an iframe to work around the browser's cross-domain policy. Which is correct?
00:08cddrhttps://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments
00:16xeqicddr: both
00:17xeqibrowsers don't run javascript from local files
00:18xeqiso a http server is required, and it does some iframe stuff to talk to the repl server on another port
00:28coventrybhenry: I would try printlns on either side of the read-string. If they both succeed, the ring-is-swallowing-your-exception theory is wrong.
00:33coventrybhenry: Never mind, that doesn't apply to your new code.
01:01IrkallaSo, I'm looking for an easy to use IDE with -modern- standards
01:01IrkallaAlso hello, clojure :v
01:02IrkallaFact of the matter is, I basically have to re-learn what an interface is to make effective use of emacs
01:02IrkallaI'm just not a fan
01:02technomancytoo late; we've moved on to postmodern IDEs
01:02technomancydripping with existential angst in every key binding
01:03technomancyRaynes: M-x explore-futility-of-all-creative-endeavour
01:04IrkallaBut
01:04Irkallatechnomancy
01:04Irkallayour postmodern IDEs are pretty meaningless
01:04xuser:h theRightWay
01:05technomancyIrkalla: Emacs invites the user to find their own meaning through bringing their unique experiences to the text
01:06technomancyit's presumptive to say that the author of any given program is the final authority on what that program means
01:06technomancy(hm; I didn't expect this metaphor to actually work)
01:07IrkallaCan we stop with postmodernism now? :V
01:07AndChat|367796"There is nothing but the text" - technomancy on postmodernism c. 20131022T2130:44
01:08IrkallaThe way they use their jargon instead of coming out and saying what they mean bothers me
01:08technomancy~rectification of names
01:08clojurebotNo entiendo
01:08technomancy=(
01:09technomancyclojurebot: 正名
01:09clojurebotIt's greek to me.
01:09technomancyaw come on
01:09IrkallaI've actually never really used IDE's
01:09technomancyclojurebot: do I have to spell everything out for you?
01:09clojurebotIt's greek to me.
01:10IrkallaThe first one I actually used was visual studio and it's the only I've ever used
01:10IrkallaI'm used to just using n++ and then running stuff.
01:10IrkallaAlso I'm extremely new to clojure
01:11IrkallaSo I have no idea how utilizing it works
01:11technomancyclojurebot: 正名 is <reply>If language is not correct, then what is said is not what is meant; if what is said is not what is meant, then what must be done remains undone; if this remains undone, morals and art will deteriorate; if justice goes astray, the people will stand about in helpless confusion. Hence there must be no arbitrariness in what is said. This matters above everything.
01:11clojurebotOk.
01:11technomancyclojurebot: rectification of names is 正名
01:11clojurebotRoger.
01:11Irkallaclojurebot, inventory
01:11clojurebotCool story bro.
01:11Irkallawow give clojurebot an inventory
01:11Irkalla0/10 worst bot ever
01:12technomancyIrkalla: so what you want is something familiar
01:12IrkallaI think so
01:12Irkallafamiliar keyboard shortcuts at least
01:12Irkallaafaik emacs predates a lot of the standards I'm familiar with
01:13technomancyso if you're already pretty handy with some existing editor you should stick with that
01:13technomancyand just send code to Clojure with `lein repl`
01:13technomancyif you're not, maybe counterclockwise would be up your alley
01:14technomancyhrm; I wonder if my factoid got truncated
01:14technomancyclojurebot: rectification of names?
01:14clojurebotrectification of names is 正名
01:15technomancyinference is hard
01:15technomancyclojurebot: what is 正名?
01:15clojurebotPardon?
01:15technomancyuuuugh
01:15technomancy~正名?
01:15clojurebotIf language is not correct, then what is said is not what is meant; if what is said is not what is meant, then what must be done remains undone; if this remains undone, morals and art will deteriorate; if justice goes astray, the people will stand about in helpless confusion. Hence there must be no arbitrariness in what is said. This matters above everything.
01:15technomancythere we go
01:15technomancy~botsnack
01:15clojurebotThanks! Can I have chocolate next time
01:16technomancybut RELUCTANTLY
01:17m00nlighthow can I get all keys in a hash-map in a simple way?
01:17technomancyclojurebot: inventory is <reply> I am carrying 0) a poorly-calibrated inference engine, currently leaking 1) a well-worn copy of clojure 1.2 tucked deep away inside a classloader 2) the last shreds of what was once my sanity
01:17clojurebotIk begrijp
01:18technomancyclojurebot: inventory?
01:18clojurebotI am carrying 0) a poorly-calibrated inference engine, currently leaking 1) a well-worn copy of clojure 1.2 tucked deep away inside a classloader 2) the last shreds of what was once my sanity
01:19jared314,(keys {:a 1 :b 2})
01:19clojurebot(:a :b)
02:55logic_progIs there a way with lein to run "lein repl :headless" and "lein cljsbuild auto" with one command uwing lein trampoline?
03:15ta479confuciusbot
03:27ambrosebsis js-obj used often in Clojurescript?
03:28ddellacostaambrosebs: I use it a fair amount, especially when passing arguments to JS libs (especially Google Closure libs)
03:28ddellacostaambrosebs: I think it's unavoidable if you are doing a lot of inter-op
03:29logic_progis there a way to tell "lein cljsbuild auto" to also load up main.clj?
03:29ambrosebsddellacosta: I'm still learning the object system in Javascript so you'll have to bear with me.
03:29ambrosebsddellacosta: do you use it to build named objects like HTMLElement?
03:29ddellacostaambrosebs: not at all! Anything I can help with just ask.
03:30ddellacostaambrosebs: no, for that you'll usually call a function.
03:30ddellacostaambrosebs: like, (HTMLElement .) (or whatever the args are, dunno)
03:31ambrosebsddellacosta: ok.
03:31ddellacostaambrosebs: it is probably more helpful to think of a JS obj, in some ways, as an associative array.
03:32bitemyappambrosebs: arrays in JS are objects (hash-maps) indexed by integers.
03:33ambrosebsddellacosta: how does `type` work? what's the difference between something created with HTMLElement. and a js-obj that has the same shape?
03:33ddellacostaambrosebs: CLJS's type uses JS's typeof, I'm pretty sure... https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
03:34ddellacosta(let me confirm for you, unless someone else knows for sure)
03:35bitemyapp(defn type [x]
03:35bitemyapp (when-not (nil? x)
03:35bitemyapp (.-constructor x)))
03:35bitemyappsorry for the spam.
03:35bitemyappambrosebs: ^^
03:35ddellacostaambrosebs: huh, no, looks like it uses the .-constructor property
03:35bitemyappthe constructor is the JS object prototype.
03:35ddellacostaah, right, what bitemyapp says
03:36ambrosebsmakes sense
03:36ddellacostawhat I'm curious about now is what the connection between typeof and constructor are...hmm
03:36ambrosebstypeof doesn't seem very useful compared to -constructor
03:37bitemyappambrosebs: an example here would be: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype
03:37ddellacostaI could swear, actually, at some point in the past I looked at the CLJS code and it was using typeof, but I could be misremembering
03:38ddellacostabut, now that I think of it, from time memorial when calling type in the CLJS console, I would get back a constructor function, so I must be wrong. Hmm.
03:39ambrosebsbitemyapp: ok thanks.
03:39ambrosebsso is js/Array the prototype of Array?
03:39bitemyappambrosebs: god I hope so.
03:39bitemyappif not, that's going to break a lot of code for people :)
03:39ddellacostaambrosebs: yes
03:39ddellacostahaha
03:40ambrosebs:)
03:40bitemyappambrosebs: new Array(); is ostensibly calling Array.prototype.constructor
03:41bitemyappnew Object() => Object.prototype.constructor, etc etc
03:41bitemyappambrosebs: the tricksy part here is that this stuff isn't static like Java classes, people can mutate the prototypes at runtime.
03:41bitemyappso you can do Ruby style monkey patching and all kinds of stuff if you want to.
03:42bitemyappnot with precisely the same semantics though
03:42ambrosebsbitemyapp: right. Is that usually avoided?
03:43bitemyappambrosebs: by sane people, yes, but a prototype that gets mutated affects everything created from its constructor, even objects created before the prototype was changed because it's reference semantics.
03:43ambrosebsok
03:44ambrosebsIs that something we need to worry about in CLJS?
03:44bitemyappambrosebs: since I assume we're talking about core.typed's clojurescript support, I would be comfortable saying that trying to accommodate the sort of people that do things like that in a static type system is probably not worthwhile.
03:44bitemyappprobably not, but I don't know how protocols and multimethods are implemented in CLJS atm.
03:44bitemyappbut if we continue this conversation, I might find out.
03:45ambrosebsI'm only really interested in modelling a "sane" usage of clojurescript
03:45bitemyappambrosebs: I think this is reasonable and a good idea.
03:45ambrosebsif you want to completely break everything, all bets are off anyway it seems
03:45bitemyappambrosebs: dude, you can mutate and replace the "undefined" object.
03:46ambrosebsgod
03:46bitemyappyou can't actually use the undefined object safely for boolean checks, you have to *generate* it from void(0) to get a value that couldn't have been mutated.
03:46ambrosebsI can ignore that in Clojurescript though right?
03:46bitemyappplease do.
03:46SegFaultAXThat's why you'll see a lot of modules of the form (function(a,b,c,undefined) {})(1,2,3)
03:47bitemyappno reason to do that, just use void(0)
03:47SegFaultAXThat way you have a stable value of undefined to work woith.
03:47bitemyappor is void 0? either way. you get my meaning.
03:47SegFaultAXIt's a common module pattern.
03:47bitemyappthe void constructor offends people that much?
03:48bitemyappambrosebs is now regretting having committed to core.typed cljs support, we should stop scaring him with horror stories :)
03:48ddellacostahaha
03:48SegFaultAXNo? It's just easier that way.
03:48bitemyappI was talking about core.typed at the Clojure Dojo today, exciting stuff.
03:48bitemyappI actually find JavaScript's many depths of horribleness morbidly fascinating.
03:49bitemyappI should've gone to med school and become a pathologist.
03:49ddellacostaI think the reality is that there are a lot of different patterns in JS, depending on whether you want to try some sort of "Classical OO," use the prototypal constructs JS has by default, try something more functional, or just..."willy-nilly style"
03:49bitemyappSegFaultAX: btw, RethinkDB client for Clojure coming very very soon.
03:49bitemyappquery API is already like 80% done.
03:49ddellacostaI've seen all kinds of stuff in JS so not sure what is "standard"
03:49bitemyappambrosebs: the straight-forward way to handle
03:49SegFaultAXI'm careful not to use the word "standard" in js, since it isn't a thing.
03:50SegFaultAXJust common.
03:50clojurebotCool story bro.
03:50ddellacostaSegFaultAX: yeah, fair enough
03:50bitemyapp"prototypes as type definitions" would be to rely on a classical pattern that is assumed static and if they write code that smashes it at runtime, then they're off reservation.
03:50bitemyappit seems fairly straightforward that people could annotate the fact that they extended a prototype as well.
03:51ambrosebsbitemyapp: right. treating javascript objects like class instances seems easy enough.
03:51bitemyappalthough that'll happen at runtime anyway.
03:52SegFaultAXambrosebs: Frankly I wouldn't waste too much time on it. You absolutely cannot and will not be able to cover even the majority of cases here. People/libraries frequently patch and improve the standard library.
03:52ddellacostaagreed
03:52bitemyappArray.prototype.maybeMonad = function(trololol...) {...}
03:52bitemyappHell is other people's JavaScript.
03:52SegFaultAXFurthermore js doesn't do any validation whatsoever around matching, for example, the number of arguments given vs number of parameters.
03:53SegFaultAXSo for example (function() { ... })(1,2,3) is perfectly valid (and common)
03:53ddellacostabitemyapp: haha
03:53ambrosebsI'm most interested in harvesting the DOM and Closure specs to give basic type checking for interop.
03:54ambrosebsI'm definitely not jumping down the rabbit hole of js semantics :)
03:54ambrosebsI just don't know them very well yet
03:54SegFaultAXambrosebs: I would say only focus on the cljs side for now. You'll go insane if you try to extend that over js itself.
03:54bitemyappambrosebs: it would have to be a union of all the different DOM implementations though right?
03:54ddellacostaambrosebs: DOM is a problem, as different browsers have different implementations, not sure how you would handle that
03:54bitemyappright, what ddellacosta said.
03:55ddellacostayeah. :-(
03:55ambrosebsthe cljs side easily leverages most of the current core.typed infrastructure
03:55bitemyappfor example "click" for addEventListener on Chrome is "onclick" and attachEvent in Internet Explorer.
03:55ddellacostajQuery codebase is a good place to look to see what kind of hoops must be jumped through to get DOM consistency. Same with google closure, for that matter
03:55ambrosebsinterop is the different bit for CLJS
03:55ddellacostabitemyapp: yeah, the Event stuff in particular is hairy
03:56bitemyappddellacosta: I don't think the type system has to care that much though, right?
03:56bitemyappthe type system just needs Number, String, Array, Object, null, undefined, function (arity)
03:56ddellacostabitemyapp: yeah, I think you're absolutely right
03:56ambrosebsSo the DOM spec doesn't help with cross-browser things?
03:56bitemyappand it just needs to know when an object matches a particular "spec"
03:57ddellacostaambrosebs: the problem is each vendor implements what they feel like
03:57bitemyappambrosebs: lowest common denominator that not everybody implements.
03:57ddellacostaambrosebs: short answer, sadly, no. :-(
03:57bitemyappIE took awhile to implement addEventListener. Now they have like three different APIs for the same thing with different names for the same events.
03:57bitemyapptl;dr this is why I prefer backend.
03:58bitemyappI'll take my ivory tower of Clojure and Datomic over being in the trenches with JavaScript.
03:58bitemyappwith trench foot. and bad coffee. and cursing british soldiers.
03:58ddellacostabitemyapp: sadly, I can't avoid it...but CLJS definitely makes things nicer to deal with. Doesn't hide the horrors, but lets you ignore them until you can't avoid them any more.
03:58bitemyappddellacosta: don't forget, IE doesn't implement event capture!
03:58SegFaultAXThe ecmascript spec is more of what you might call a guideline.
03:58bitemyappso if you need capture...you're simply fucked!
03:58bitemyappSegFaultAX: said like a real pirate.
03:58ddellacostabitemyapp: NOT LISTENING NANANA CAN'T HEAR YOU
03:59bitemyappthis was a good night for going to bed with beer.
03:59bitemyappambrosebs: you should ask questions in here more often, this is fun.
03:59ddellacostahahaa
03:59ambrosebs:)
03:59ddellacostaman, I want a beer, but I got to do some work. In CLJS now that you mention it.
03:59bitemyappdouble-fist beer and a mug of coffee.
03:59bitemyappor tea. Best way to code.
04:00ddellacostanice. :-)
04:00bitemyappSegFaultAX: Clojure Dojo was fun tonight, you missed out.
04:00ddellacostaI'll consider it.
04:00SegFaultAXI was at Ansible Fest.
04:00bitemyappwe refactored the Gilded Rose problem
04:00ddellacostalucky bastards, with your so-called "community"
04:00bitemyappI'm going to finish debugging mine then move onto getting the RethinkDB client driver releasable.
04:00bitemyappyay server-side yay
04:01bitemyappddellacosta: I'm luckier still for doing mostly backend lately :P
04:01bitemyappI ran screaming from web when the data warehouse project popped onto my radar.
04:01ddellacostabitemyapp: yes, you are. Actually, I can't complain since I just spent a week writing a mini-query language using Instaparse and propositional logic. SUPER fun.
04:01bitemyappddellacosta: I AM SO JELLY
04:02ddellacostabitemyapp: it was pretty fucking awesome. I love Instaparse like, so much. :-D
04:02bitemyappddellacosta: I'm considering writing a mini-query language for wrapping Datalog for the data warehouse, but haven't gotten around to it. That sounds SO cool.
04:02bitemyappddellacosta: god I want to do something, anything, with Instaparse so badly.
04:02bitemyappyou know what I *could* do?
04:02ddellacostabitemyapp: yeah, I was stoked to have an excuse to use it.
04:02bitemyappI could be an asshole and write a SQL wrapper for RethinkDB. lol.
04:03bitemyappequally fun would be a datalog interface to RethinkDB.
04:03ddellacostabitemyapp: oh, that would be nifty.
04:03ddellacostanot that I know much about rethinkDB
04:03bitemyappI should just make datalog wrappers for everything on the planet.
04:03ddellacostahahaha
04:04bitemyappI'm only half joking.
04:04bitemyappddellacosta: RethinkDB is like MongoDB, except implemented by serious, honest, competent people.
04:04bitemyappalso, head of the company is a fellow ex-Common-Lisper.
04:04ddellacostabitemyapp: oh, wow, I will take a look then.
04:04bitemyappso, he's part of the Common Lisp illuminati we don't talk about among muggles.
04:04ddellacostahahaha
04:05ddellacostaalright, I hate to cut it short, but I really do have to get back to work...fixing CLJS front-ends.
04:05bitemyappddellacosta: rethinkdb, notably, has a real clustering stack with nice sharding and replication (sync and async).
04:05bitemyappddellacosta: cheers, good luck with the work. :)
04:05bitemyappSegFaultAX: how was the ansible stuff?
04:05ddellacostabitemyapp: talk soon. Cheers. :-)
04:05bitemyappSegFaultAX: anything exciting?
04:05ambrosebsthe most common feedback on nathanic's (awesome) core.typed post seems to be concern about the large ugly types for "second" and "map". Complicated semantics call for complicated types, plus you'd never write anything like that yourself.
04:07bitemyappambrosebs: the spec is partly that complicated because it's trying to be smart and break out the cases beyond the (Option x) anyway, right?
04:07bitemyappso it's being more specific/smart than what the equivalent Haskell type would be.
04:08ambrosebsright, a less useful type would be (All [x] [(NilableSeqable x) -> (U nil x)])
04:09bitemyappthe equivalent Haskell would be either [a] -> a or [a] -> Maybe a, but it's not being nearly as specific about what's going on is the latter type is isomorphic with (Seqable x) -> (Option x)
04:09bitemyappNot sure why the Seqable is wrapped in an Option.
04:09ambrosebs,(second nil)
04:09clojurebotnil
04:09bitemyappambrosebs: right. I think that aspect of the type system is missed by people that haven't used something nicer.
04:09ambrosebsperhaps
04:10bitemyappso, the Option around the Seqable is because you're not excluding anything Clojure generally allows.
04:10bitemyappthat makes sense, given how much people like to bounce nils off the wall.
04:10ambrosebswell, not excluding common idioms
04:10bitemyappto technomancy's eternal chagrin.
04:13ambrosebswhat's an example of something browser-dependent that wouldn't type check if I was just going by the DOM spec?
04:13ambrosebsa link would be appreciated also :)
04:15bitemyappambrosebs: addEventListener has different possible arities depending on what browser it is.
04:16bitemyappambrosebs: it supports a final argument "wantsUntrusted" if it's a gecko/firefox browser.
04:16bitemyapphttps://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener
04:16ambrosebsbitemyapp: thanks
04:17bitemyappambrosebs: this is why I asked if this would lead to a type spec that was roughly a "union" of what different vendors offer.
04:18ambrosebsbitemyapp: ah, I understand
04:18ambrosebsI wonder how TypeScript deals with this
04:19bitemyappambrosebs: http://typescript.codeplex.com/SourceControl/changeset/view/fe3bc0bfce1f#bin/lib.d.ts
04:19bitemyapphttps://github.com/borisyankov/DefinitelyTyped
04:20ambrosebsbitemyapp: thx!
04:20bitemyappattachEvent(event: string, listener: EventListener): bool;
04:20bitemyappdeclare function addEventListener(type: string, listener: EventListener, useCapture?: bool): void;
04:20bitemyappthey choose to ignore the existence of the Mozilla variant.
04:21bitemyappbut they recognize the existence of their bastard rendition of addEventListener.
04:21bitemyappthe point of Mozilla's fourth argument is so you can distinguish between events emitted by typical browser DOM events versus events that might've been faked or emitted by custom JS code.
04:21bitemyappIIRC
04:22bitemyappucb: hi!
04:22notofiHi, can somebody explain this: http://pastebin.com/3RQZGWGL
04:22ucbbitemyapp: hey!
04:22ambrosebsI'm starting to think I should follow the DOM spec, then invite people to turn the type checker off for uglier things
04:23bitemyappucb: I'm complaining at ambrosebs about javascript :)
04:23SegFaultAXI hate our current managed hosting provider. Fucking dreadful...
04:23bitemyappambrosebs: I would tend to agree.
04:23SegFaultAX"10 minute site upgrade" == 2 hours of downtime and counting.
04:23ucbI think most of the world would agree
04:23bitemyappwith the hope that entropy is moving people towards, rather than away from, the DOM spec.
04:23ucbSegFaultAX: /D:\
04:23ambrosebsnotofi: def is only for top levels
04:23bitemyappSegFaultAX: can you say who?
04:23ambrosebsnotofi: use let for locals
04:23notofiambrosebs: Can you explain why Z is def'd ?
04:24ucbSegFaultAX: was it you whom I spoke to about graphite and things?
04:24notofiambrosebs: I am aware that def is for top levels
04:24SegFaultAXucb: Probably.
04:24ambrosebsnotofi: it should only be used at the top level also
04:24SegFaultAXIn fact yes, definitely.
04:25ucbSegFaultAX: cool. Have you heard/considered kairosdb as a relacement for carbon?
04:25ambrosebsnotofi: the compiler does strange things otherwise
04:25ucbI'm currently pondering on that
04:25SegFaultAXNo, I haven't. What do you like about it?
04:25ambrosebsnotofi: basically the analyzer makes any vars during analysis
04:26ambrosebsnotofi: Z is created as an unbound var
04:26notofiambrosebs: thx
04:26ucbbitemyapp: not your cup of tea probably, but this is what right now in my headphones: http://www.youtube.com/watch?v=dw1K823RHoQ
04:26ucbSegFaultAX: the promise of scalability mostly as well as the greener grass
04:26SegFaultAXbitemyapp: Peer1
04:27bitemyappucb: http://www.youtube.com/watch?v=x8UcffWuDG4
04:27ucb"Conifer" <- how nordic
04:27ucbenqueued
04:28bitemyappucb: http://www.youtube.com/watch?v=8vpE9XvPSzE
04:28ucbenqueued
04:28bitemyappthis MoR isn't bad, this would be good for driving.
04:28bitemyappnice vocals.
04:28ucbMoR is awesome
04:29ucbthat particular album is A++++++
04:29bitemyappucb: what are your feelings on post-metal / post-punk / hardcorey stuff?
04:29ucbone of those rock bands where the mean age is ~50, they never "made it" despite being great, etc.
04:30ucbbitemyapp: I need examples to be able to comment. I stopped listening to "new music" in the 90s. I hate anything by metallica after their fourth album, same with Pantera and you can see where this is going.
04:30bitemyapppost-punk/hardcore isn't anything like the two bands you mentioned.
04:30ucbI know
04:31ucbI was just exemplifying how I hate new things
04:31bitemyappucb: most of the music I've sent you is after the 90s.
04:31bitemyappin particular, the blackgaze stuff I've been kicking over is usually quite new.
04:31ucbcounter-example detected. Brain melt sequence initiated.
04:31ucball beliefs challenged.
04:34ucbbitemyapp: in any case, give me a few band names as examples please?
04:35bitemyappho damn. post-punk and post-hardcore are both really hard to pin down. Shonen Knife, Gallows, Pallbearer, Letlive, Polar.
04:35bitemyappucb: to offset the utter devastation of the first two songs I sent, here's some hyper-indie happy post-metal: https://soundcloud.com/mynameisjonjo/a-weekend-at-the-end-of
04:36ucbI've listened to Gallows. They were ok.
04:36bitemyappk, Gallows is post-hardcore, to give you an idea of where they are in the rainbow.
04:36ucboh, in other rock-related news, I saw Mark Lanegan live 2 weeks ago
04:36bitemyappPost-punk is very eclectic though, anything from Joy Division to new-wave applies.
04:36ucbjoy division is good in my book
04:37ucbThe Editors were heading in the right direction before they cocked it up
04:37Morgawrsince we're talking about music, I'll just do my advertising job and link this http://www.youtube.com/watch?v=WfiX7PHYKo4 :P It's from my own band, just dropping it here in case anybody likes it
04:37Morgawrprobably not your genre but still worth a try haha
04:38bitemyappMorgawr: I love metal like this, thanks for sharing!
04:38bitemyappthis reminds me of Sabaton and Forefather.
04:38ucbMorgawr: sounds good so far
04:38Morgawrbitemyapp: check out the whole EP if you feel like it, we only released one so far (and I had to leave the band unfortunately because I'm studying abroad now :( )
04:38bitemyappMorgawr: what do you play?
04:38Morgawrlead guitar
04:39ucbbitemyapp: anyway, my comment about lanegan is that the support act were Sean&Zander. Had never heard of them before this gig, but they are pretty good: http://www.youtube.com/watch?v=DhxsTugRDVY
04:39ucbMorgawr: <3 this type of metal
04:39Morgawrucb: <3 :D
04:39ucbMorgawr: is this Italian?
04:40Morgawrucb: yeah, we're Italian
04:40ucbnice
04:40bitemyappMorgawr: so awesome :)
04:40Morgawrwe sing mostly in English with Italian parts in-between
04:40Morgawr(mostly for lyrical voice)
04:41ucbfor lyrical awesome you mean
04:41Morgawrhaha
04:41bitemyappI love #clojure so much.
04:41bitemyappI just want to hug it to death.
04:41bitemyappbut now I must sleep. G'night all :)
04:41Morgawrnight :)
04:42ucbnight bitemyapp
04:42ucbsorry I couldn't be more opinionated
04:43ambrosebsbitemyapp: night
05:07mindbender1why is ring.middleware.file-info/wrap-file-info and few others marked deprecated. What's next?
05:20clgvmindbender1: from the HISTORY.md I'd guess `file-response` might be the replacement mechanism
05:20logic_progis there a nice way to store an object that is simultaneously a sexp and a file? i.e. I have a symbolic clojure expression. HOwever, I also want to remember what line / what column each character came from (and the preserving of white space + newlines)
05:21clgvlogic_prog: from the second part I'd say just store clojure source. but the first question seems contradictory
06:54t_hashdn
08:46maku__Can anyone help me merge many vectors into one? (into [] []) works for two, but I would like to merge several.
08:48AimHereYou could use (vec (concat ...)) or wrap a series of (into [] ) calls with reduce, or loop
08:48AimHereIf concatenating vectors is something you're doing a lot of, I'd consider using just a list instead, for performance reasons
08:51maku__AimHere: Thanks!
08:51llasrammaku__: (reduce into [] other-vectors)
08:52Morgawrllasram: that only works if "other-vectors" is a sequence of vectors
08:52llasramOh, you did mention `reduce`, AimHere
08:52Morgawrbut yeah
08:52llasramMorgawr: That was the intended implication, yes :-)
08:52Morgawrjust clarifying it :P
08:52llasramkk
08:53Morgawralthough in that case you can just do
08:53Morgawr(flatten other-vectors)
08:53llasramNOOOOOOO
08:54Morgawr&(reduce into [] [[1 2 3] [4 5 6] [7 8 9]])
08:54lazybot⇒ [1 2 3 4 5 6 7 8 9]
08:54Morgawr&(flatten [[1 2 3] [4 5 6] [7 8 9]])
08:54lazybot⇒ (1 2 3 4 5 6 7 8 9)
08:54Morgawr:D
08:58hyPiRion~flatten
08:58clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
09:09clgvMorgawr: hyPiRion meant you should use apply concat instead of flatten there. or (apply into [] [[1 2 3] [4 5 6] [7 8 9]]) works good as well ;)
09:10hyPiRionI meant to say that you rarely need flatten
09:11hyPiRionIf you have a list of vector, why do you have said list? Could you use mapcat at some point to avoid the overhead?
09:31ngwhi *
09:31hyPiRionhi there
09:38ngwI'm trying to figure out pedestal and how to serve different content with something like the :format variable in rails
09:38ngwfor example a route like '/home.:format' will respond to /home.html putting html in the format parameter and home.json will put json in the format parameter
09:39ngwthis way I can serve different data through the same action/route
09:39ngwis this possible_
09:39ngw?
09:39daemianngw: https://github.com/ToBeReplaced/pedestal-content-negotiation served my purposes.
09:48mercwithamouthhrmm does anyone feel that emacs-live is 'too much'?
09:48tim__mercwithamouth: yes, it is
09:49tbaldrigesadly, I'm not versed enough in emacs to go and make my own config. Someday perhaps. Until then, I live with the bloat that is emacs live.
09:49tbaldrigeI wouldn't recommend it to anyone else, however.
09:50chronnotbaldrige: Of all the bloat, what bothers you most?
09:51tbaldrigechronno: it's just heavy in general. I have a 2012 MBP, and yet it still hiccups when doing symbol look-up for intelisense for instance.
09:53chronnochronno: yep, I tried if for a while and found it slow and hard to take apart. In the end I decided to start a clojure config from scratch.
09:54chronnochronno: I decided that when I found out it changed some of the standard bindings...
09:58mercwithamouthfunny i just set up sublime text and it's not bad AT ALL
09:59mercwithamouthi still think emacs-live is king ....i'll be give a more informed rant later most likely
10:01mikerodDoes anyone have any successful experience with using maven-shade-plugin for a Clojure (mixed with Java) project where you want the Clojure to be AOT compiled?
10:02mikerodI was experiencing slow load times and I noticed that all of the Clojure files were being compiled dynamically during JVM start up. I was confused for a while, then I realized that maven-shade-plugin alters the timestamps of all the files in the uber-jar.
10:02mikerodSo, the effect of this was, all of the clojure-ns.clj files were the same date as the clojure-ns.class files.
10:02mikerodWhen this happens, the Clojure compiler recompiles the .clj file.
10:03mikerodI know that lein uberjar doesn't cause this issue. Currently, we must use Maven for our uber-jarring though.
10:04chronnotbaldrige: btw, I just finished watching your macros/core.async videos. Very nice job :-)
10:08tbaldrigethanks!
10:09silasdavishow can I access values in my profiles.clj from a repl?
10:10clgvsilasdavis: you can't by default. you need to read or load that file to do that
10:11coventryIt'd be nice if there was a plugin/dependency which let the project jvm communicate out to the lein jvm.
10:15silasdavisI've got my aws credentials in there for lein beanstalk
10:15hyPiRioncoventry: We're trying to avoid that at all cost. Is there any reason you'd like to communicate BACK to the lein jvm?
10:15silasdavisand I'm using AmazonS3Client and I was looking for a way to hook them up so I don't have to repeat myself
10:16coventryhyPiRion: Just that a couple of people have asked similar questions to silasdavis's recently, and that seems like an obvious solution. What are the drawbacks?
10:17hyPiRioncoventry: Suddenly your project depends on a version of Leiningen to work correctly, and may crash if you attempt to run the project standalone. If there are tighter coupling, there would be dependency issues too.
10:17coventryhyPiRion: Makes sense.
10:18hyPiRionsilasdavis: you've got aws credentials in your project.clj?
10:20silasdavishyPiRion: yes..
10:20silasdavisas per https://github.com/weavejester/lein-beanstalk
10:21hyPiRionsilasdavis: ah, profiles.clj, not project.clj. I misread. I was wondering whether you checked out the aws credentials
10:22silasdavisoh sorry
10:24coventryhyPiRion: Would a middleware which dropped the project map into a lein-project-map namespace of the project jvm be a bad idea?
10:24hyPiRionsilasdavis: well, for what it's worth, you may make a plugin for that as it's only data from leiningen to the project jvm, not vice versa. But I'm not sure whether that's safe or not.
10:24xeqisilasdavis: most people have a config file that is loaded form the resource path, and then use profiles to choose the right one. Take a look at https://github.com/sonian/carica or https://github.com/weavejester/environ
10:25silasdavisxeqi: yeah I'm using carica, I just thought it might be nice to reuse the :aws {
10:25silasdavis :access-key ... } section I already hav
10:25silasdavisin profiles.clj
10:26hyPiRioncoventry: Not if it's well-written. But profiles are merged into the project map, and a poor implementation may leak personal data/setup.
10:27coventryHmm, I can see how that would be a bad idea when testing 3rd party projects out. Thanks.
10:30xeqicoventry: well, testing third part projects already runs arbitrary code :p
10:45arrdemclojurebot: ping
10:45clojurebotPONG!
10:50clgvlazybot: ping
10:50lazybotclgv: Ping completed in 0 seconds.
10:57jagajI was looking at this http://www.ohloh.net/p/clojure and I was wondering what caused the clojure codebase to be eviscerated around oct/nov 2007?
10:59technomancyprobably dropping CLR support
11:02silasdaviscan you set jvm-opts in profiles.clj?
11:13ddellacostaanyone, perchance, used stefon on heroku?
11:14ddellacostacannot figure out why it claims to be compiling assets, yet utterly fails to do so
11:24cmajor7never looked at it before, so I'll just ask: does clojurescript (maybe by gclosure proxy) does anything cool with a browser local storage (e.g. fall back for "supported storage" (e.g. sqllite for safary, indexeddb for …))?
11:24cmajor7*does clojurescript do
11:27dnolencmajor7: http://docs.closure-library.googlecode.com/git/namespace_goog_storage.html
11:31cmajor7dnolen: cool, so this: https://code.google.com/p/closure-library/source/browse/closure/goog/storage/mechanism/ defines all the supported mechanisms?
11:31dnolencmajor7: no iea
11:31dnolencmajor7: no idea
11:33cmajor7dnolen: just curious, but thanks for the right direction :)
12:01ToBeReplacedoh... the conj sold out? bummer
12:02xeqior really good news about the interest in clojure
12:02llasramOh, wow
12:03llasramI was feeling bad for getting a late reg ticket. Now I can just feel good for getting one at all :-)
12:10silasdavishow can I do (map .javaInstanceMethod java-object-list)
12:10silasdaviswithout having to do
12:10silasdavis(map (fn [x] (.javaInstanceMethod x)) java-object-list)?
12:10`cbpWell you can always use #() notation :P
12:11llasramsilasdavis: What `cbp said, or if you feel like being non-standard check out: https://github.com/llasram/method-fn
12:12tbaldrigesilasdavis: http://blog.jayfields.com/2011/08/clojure-memfn.html
12:12silasdavisthanks
12:12tbaldrigebut yeah, most people use #()
12:15bhenryhiredman: bitemyapp: coventry: if any of you are interested, i found out that the `lein ring server` command had a different classpath than the nrepl. for some reason, it was using clojure 1.2.1 instead of the 1.5.1 from the other dependency.
12:15bhenryi have no clue why that would be
12:36glosoliAnyone familiar with bouncer preconditions? I am wondering why would :pre (seq :country) fail, and :pre (comp seq country) wouldn't at the times when country returns nil
12:37justin_smithhow would :country be a seq?
12:38justin_smithit is a keyword
12:38glosolijustin_smith: it's from Bouncer, :country is invoked on a map
12:38justin_smithoh, sorry, I missed that, don't mind me
12:39glosolijustin_smith: the value it gets is (:country {})
12:39glosoliHmm thats seems to be the thing with Clojure pre-conditions, not bouncers explicitly
12:39llasramglosoli: Do you mean (comp seq :country) instead of (seq :country)
12:39llasram?
12:40llasramNot that either makes sense, actually
12:40glosolillasram: why wouldn't ? if I want to check if the string is empty, wouldn't (seq "") do the trick ?
12:41llasramglosoli: If we're talking normal Clojure :pre and :post conditions, they're *expressions*, not functions
12:41llasramso (comp seq :country) evaluates to a function, which is always truthy
12:41glosoliand seq ?
12:41glosoliaaaa
12:42glosolillasram: nvm thanks! :) I understand it now
12:44glosoliBouncers pre seems to work a bit different
12:44justin_smithglosoli: also:
12:44justin_smith,((fn [] {:pre (seq {})} 1))
12:44clojurebot1
12:44justin_smith,((fn [] {:pre (seq nil)} 1))
12:44clojurebot#<AssertionError java.lang.AssertionError: Assert failed: nil>
12:44justin_smithnotice that {} does not make that pre fail
12:45glosolijustin_smith: well it shouldn't hmm all I am doing it just looking for a proper way to check in pre-condition if the string is empty hmm
12:45justin_smithit could be I was the one confused - I thought you indicated above it would get {} as the value for :country
12:45llasramThat's because the :pre and :post values should be *collections* of condition expressions
12:45llasram((fn [] {:pre [(seq {})]} 1))
12:45llasram,((fn [] {:pre [(seq {})]} 1))
12:45clojurebot#<AssertionError java.lang.AssertionError: Assert failed: (seq {})>
12:46`cbpjustin_smith: isnt (seq {}) supposed to be surrounded by []?
12:46justin_smithllasram: oh! thanks
12:46llasram,((fn [] {:pre [(seq #{:whatever})]} 1))
12:46clojurebot1
12:46`cbpoh :P
12:46justin_smithso I thought it was checking (seq nil) but really it was checking seq, then nil
12:47glosoliOk, that's totally confusing, so what's the idiomatic way to check if string is empty
12:47glosoli?
12:47llasram`cbp: Better luck next, old timer
12:47justin_smithglosoli emty? or #(= "" %)
12:47rasmusto,(= "" "")
12:47clojurebottrue
12:47justin_smith*empty
12:47seangrove,((fn [s] {:pre [(not (empty? s))]} 1) "")
12:47clojurebot#<AssertionError java.lang.AssertionError: Assert failed: (not (empty? s))>
12:48justin_smith,(empty? "")
12:48clojurebottrue
12:48seangrove,((fn [s] {:pre [(not (empty? s))]} 1) "look")
12:48clojurebot1
12:48rasmusto ,((fn [s] {:pre [(not (empty? s))]} 1) [1 2 3])
12:48clojurebot1
12:48justin_smithbut (seq "") also returns nil, so it works in this case too
12:48rasmustodepends if you want it to fail on non-strings
12:49glosoli..
12:49glosolirasmusto: I want it to
12:49seangrove,((fn [s] {:pre [(not (empty? s)) (string? s]} 1) [1])
12:49clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>
12:49seangroveErm, you get the idea
12:50bordatouecould anyone please tell me how to specify java file with a package structure under lein , so that I can use compile it using lein javac. I have managed to get the classfiles compiled with out package structure, however with the package structure I am getting compilation errors
12:50rasmusto,((fn [s] {:pre [(string? s) (not= "" s)]} s) "abc")
12:50clojurebot"abc"
12:50justin_smithseangrove: why use (not (empty ...)) instead of (seq ...)?
12:50glosoliyeah why
12:51glosoli`(seq "")
12:51glosoli,(seq "")
12:51clojurebotnil
12:51seangrovejustin_smith: Actually, there was a point somewhere (maybe by hickey?) that people should always use (seq ...) insted of (not (empty? ...))
12:51dgrnbrgI'm having trouble using java.sql.Timestamp in clojure.java.jdbc 0.2.3 queries, in that when I pass the Timestamp into the ? slot in the query, I get a SQLServerException The conversion from UNKNOWN to UNKNOWN is unsupported. com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError (SQLServerException.java:190)
12:51technomancyseangrove: I don't buy that
12:51glosoliseangrove: yeah it's in sources docs :)
12:51seangroveSo, my bad!
12:51`cbpempty? is pretty much (not (seq ..))
12:51dgrnbrgdoes anyone know what's going on in jdbc
12:51dgrnbrg?
12:51rasmustowhy are you using seq instead of checking its equality w/ "" ?
12:51`cbpso not empty is (not (not (seq))) !
12:51glosoliseangrove: Part of the empty? documentation :) That's what made me confusing
12:51justin_smith,(doc empty?)
12:51clojurebot"([coll]); Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x))"
12:52glosolirasmusto: seems more clean
12:52technomancythe fact that you can call seq on something that's a seq and get something back that's not a seq is just bonkers
12:52`cbpis this about nil? :P
12:52rasmustoif you're constraining the input to be a string anyways, wouldn't an inequality check be more clear?
12:52technomancy`cpb: heh, no this is a weirdness specific t oclojure
12:54llasramIn ClojureScript, is the ISeq protocol implemented for `nil`?
12:54llasramBecause if so, then I think you could argue that `nil` is a seq :-)
12:54Morgawrllasram: I'm not sure but I know that (seq? nil) -> false
12:54Morgawr&(seq? nil)
12:54lazybot⇒ false
12:55llasramIn JVM Clojure, sure, because it's not an object which implements the JVM interface ISeq
12:56llasramBut the Clojure abstractions have never been entirely bounded by their JVM interfaces, and the ClojureScript re-expression of those abstractions in protocols goes a lot further
12:56llasramIf ClojureScript extends ISeq to nil, then I' would argue that nil is a seq, despite JVM Clojure's (seq? nil) => false
12:56xuserdgrnbrg: maybe its related: https://groups.google.com/forum/#!topic/clojure/H1gWA9CQ3S0
12:57Morgawrllasram: oh you said ClojureScript, sorry! I didn't see it
12:57bordatouehas anyone compiled java class using lein javac that has a package structure????
12:57llasrambordatoue: yes? if I understand your question.
12:57seangrovebordatoue: I have not.
12:58bordatouellasram: how did you specify package structure ,
12:58seangroveStack Overflow would probably be a good place to ask, if you can't find enough information on it - should help the next poor soul who comes along.
12:58dgrnbrgxuser: this isn't about timestamps, but appears to be that the `with-query-results` is setting every param to object, where my param is actually a Timestamp
12:59bordatouellasram: when I am adding .java files under my java directory if it has a package structure for example abc.efg.myclass then the compilation fails
12:59bordatouellasram: did you have to provide any additional entries in the project.clj file
12:59llasrambordatoue: Just create the same directory structure you would for Java. So if your :java-source-paths is ["src/java"], then
12:59llasramyou'd have src/java/abc/efg/MyClass.java
13:00bordatouellasram: ok, that makes sense . Thanks
13:03bordatouellasram: how do i specify libraries in the javac classpath , currently I have listed all my exteranl jars under resource-paths
13:04llasrambordatoue: Same way you do for any other dependency -- they should be in an artifact repository and listed under :dependencies
13:04xuserdgrnbrg: no idea sorry, was just watching the lists and saw that ;)
13:05bordatouellasram: why can I add my local jar to resource-paths, won't that work
13:05llasramIt'll "work", but you're left with a non-reproducible build
13:06bordatouellasram: the problem i'm having is that that it is not finding the reference to package that is specified under reource-paths
13:08llasramAre you listing each individual JAR in :resource-paths ?
13:10bordatoueyes
13:11llasramHmm. Then I don't know. Check for types? You can try `lein classpath` to see exactly how the classpath is ending up
13:11llasrams,types,typos, <- ha!
13:11bordatouethe classpath that lien show during lein classpath is it the one that will be used during javac
13:12llasramyes
13:12bordatouellasram: thanks very much for your help
13:13llasramnp, and good luck!
13:49TimMcIs Michael Klishin here?
13:49bitemyappTimMc: no, he's antares.
13:49bitemyappTimMc: what do you need help with?
13:49TimMcI started writing a URL library in Java ("johnny"), but now I wonder if I should be contributing to Urly.
13:50bitemyappdoes it do anything that Urly does not?
13:50TimMcUrly has some really nice design choices, but I don't like that it accepts sloppy inputs.
13:50bitemyappmaybe a "strict" mode?
13:50TimMcYeah.
13:50bitemyappNifty. You could ping him on Twatter
13:50TimMchttps://github.com/timmc/johnny is what I was writing for my employer's Hack Week.
13:51TimMcOK, I'll see if I have an intertwubs account...
13:58TimMcOK, I sent up a twitsignal.
14:03antares_TimMc: hey
14:04TimMcHey there.
14:04TimMcantares_: So I've slapped together this thing: https://github.com/timmc/johnny
14:05pandeirois lein 2.3.4 in the pipes?
14:05TimMcIt does successive parsing of URLs, querystrings, paths with path parameters... although I'm still working out the API.
14:05antares_TimMc: looks nice
14:06TimMcDo you think there's room in Urly for a strict mode? I agree wit the general philosophy of a fluent API using persistent data structures, but automatically fixing things like http://http:// gives me the willies. :-P
14:06antares_TimMc: we can drop some of that for Urly 2.0
14:07antares_TimMc: I'd be happy to base Urly 2.0 on a solid Java library
14:07pandeirolein repl :connect is broken for me on 2.3.3 and it seems like the issue was fixed already (issue 1344)
14:10TimMcantares_: johnny is mostly a thin wrapper around java.net and Google Guava classes, but I'm working to find the corner cases. E.g. IPv6 hosts that specify a zone ID need percent-encoding, which destroys the notion that the host component doesn't get decoded. :-/
14:11TimMcSo I'm trying to present a really structured view, where you can get either the raw string for each component or a parsed value.
14:12antares_TimMc: sounds good
14:12antares_TimMc: ping me when you flesh out at least some key API parts, I will be happy to see if I can contribute something from/for Urly
14:12TimMcI'm also trying to strike a balance between the way that *most* people use URLs and the full flexibility of the specs. One place that's tricky is querystrings; most apps only care about ordering of values per-key, at most, but some apps might care about total key-value pair order.
14:13antares_TimMc: right. Using sorted maps may be a good idea.
14:13TimMcantares_: Oh, just continnue working on johnny, then see where to go from there on either project? Sounds good.
14:13antares_TimMc: I think there should be a Java library that does what Urly wants to do
14:13TimMcantares_: https://github.com/timmc/johnny/blob/master/src/main/java/com/brightcove/johnny/parts/PersistentOrderedParams.java
14:14antares_and Urly should be based on it. Bonus points for making Johhny use immutable data structures (hm, maybe even Clojure's)
14:14TimMc^ Persistent multimap with total key-value ordering.
14:14antares_cool
14:14TimMcI'm actually kind of proud of that one.
14:14TimMc(Mind you, I haven't perf-tested *any* of this.)
14:15antares_poor Scala/Groovy people should not have to deal with URI parsing problems!
14:15TimMcYeah, that's why I'm bothering to write it in plain Java.
14:15TimMc(even though I'm sneaking some Clojure in for the query representations)
14:16`cbp:3
14:18bitemyappantares_: can I ask a favor of you?
14:18pandeirohm guess i will just switch to running lein snapshots
14:18technomancypandeiro: can you set LEIN_REPL_PORT with 2.3.3?
14:18nollidjanyone know if there's any way to make core.typed signatures available at runtime, so that i can reason about them? i'm interested in doing what amounts to function composition at runtime, and it would be great to use core.typed signatures to constrain the space of what can be composed and to validate composition before it happens
14:18pandeirotechnomancy: i had not tried that, want me to?
14:19pandeiroi'm content using snapshots
14:19pandeirounless you think that's a bad idea
14:19pandeirosince i would like to try to contribute something
14:19pandeiro(that :stop task we talked about the other day)
14:19nollidjdoing that is also contingent on the existence of predicates that operate over the types that core.typed produces...
14:19antares_bitemyapp: ?
14:20bitemyappantares_: please don't RT Twitter drama llamas :(
14:20bitemyappantares_: I like following your Twitter but I've had to axe a bunch of people on my following list because there was a huge wave of tears and caremad going around.
14:20technomancypandeiro: if the LEIN_REPL_PORT workaround doesn't work, that means we should consider 2.3.4 sooner rather than later
14:21antares_bitemyapp: do I usually participate in dramas?
14:21bitemyappantares_: no, but you RT some of them. Not a big deal, just figured I'd ask.
14:21bitemyappI also follow zedshaw, so, he's currently King on that Hill.
14:21antares_well, sometimes it's just wrong to stay completely silent
14:22edwAnyone get problems jacking in to lein from Emacs in Mavericks? I'm getting a security exception. Odd.
14:22gtrakwhere's a good place to eval this snippet on nrepl startup? Useful for threads not taken care of by binding-conveyor-fn. (alter-var-root #'*out* (constantly *out*))
14:24bitemyappedw: no problems here, but I don't use nrepl jack in, I use a proper lein repl instance.
14:24pandeirotechnomancy: that fix works with 2.3.3
14:25edwpandeiro: On invocation got a security exception just typing 'lein repl' from the command line from within *shell* in Cocoa Emacs.
14:25pandeiroedw: security exception from where?
14:26pandeiroi've never seen that but i'm guessing maybe lein was not installed properly
14:26dobry-denWhat would be a nice way to do something like (merge [0 0 0] [1]) -> [0 0 1]?
14:27edwConnection refused in Cocoa Emacs.
14:27edwWhen connecting to the port where I have `lein repl` running in a terminal window.
14:27llasramdobry-den: It's not clear quite what's happening in your example. Why is the last element the one being "merge"d into?
14:27dobry-denmore specifically, (merge (byte-array 4) [(byte 1)]) -> 00000001
14:28dobry-denllasram: i'm trying to pad an array
14:28pandeiroedw: my error was different; and i don't use OS X so no way to test that here, sorry
14:28edwAlso, got a security exception when running `lein repl` inside `M-x shell` in Coca Emacs. I'm installing Xcode 5.0.1 and will be re-building Homebrew Emacs as soon as that happens.
14:28edwSeems to be some sort of sandboxing.
14:31dobry-deni guess a naive solution would be (take-last padcount (concat (byte-array 4) [(byte 1)]))) -> 00000001.
14:31edwHmm, there's already a Java update for Mavericks. Yay?
14:32dobry-deni'm too scared to upgrade OS anymore
14:32dobry-denmy monkeyball daisychain of hacks might fall apart
14:33dobry-denit's a lot of yak shaving
14:34`cbpdobry-den: maybe you wanna use java.nio?
14:38pandeirois there a reply option for injecting forms?
14:38technomancypandeiro: you can put :injections in the :repl profile and they should get picked up
14:39pandeirotechnomancy: this would be in the context of the lein repl :stop task, so i'd basically want to do what :connect does, but inject (System/exit 0)
14:41technomancypandeiro: you can do that by running (eval-in-project (assoc project :eval-in :nrepl) '(System/exit 0))
14:41technomancyyou don't need injections
14:42technomancythough that has the port as being hard-coded in :target-path/repl-port so it might not be suitable
14:43pandeiroi suppose shelling out to echo and piping to lein repl :connect is not an option
14:43pandeiroi mean, for including in lein
14:44technomancyno, but rebinding *in* isn't out of the question
14:45pandeirodo you know the java class i'd need to use to rebind *in*?
14:46technomancyprobably a java.io.StringReader?
14:46technomancymight need to be wrapped in a pushback reader?
14:51amalloyyes, needs pbr of stringreader
14:52amalloyor, well, pbr of *any* reader
14:53pandeirothis is something that can't really be tested at the repl, the rebinding of *in*, yeah?
14:54pandeirobut i am wondering how i even can test other repl ns functions (client) from the repl, if possible... generating a project like the one the function sees
14:55bitemyappwho's up for a riddle? https://www.refheap.com/20104 https://www.refheap.com/20106 <- wtf is going on?
14:55bitemyappthe only deftrace that prints is for the top-level fn that gets invoked.
14:55coventryYou're running in the lein jvm, right? Why not connect the same way lein repl :connect does?
14:57llasrambitemyapp: Is this for a logic puzzle or the start of the best computer game ever?
14:57rasmustobitemyapp: Backstage passes to a TAFKAL80ETC concert
14:57pandeirocoventry: yes i wanted to just add another case clause that would do what connect does, and then eval the (System/exit 0) form
14:57bitemyappllasram: it was a refactoring thingy from Clojure Dojo last night
14:57bitemyappI'm pretty happy with my solution's design, but I have this weird bug that is baffling me.
14:58technomancypandeiro: you can test it from a repl inside lein itself
14:58amalloybitemyapp: looks like you're expecting map to be eager, but it's lazy?
14:59bitemyappamalloy: but where is the error coming from if things aren't getting evaluated?
14:59amalloyi don't know, because you have not yet said anything about an error
15:00bitemyappI pasted two links.
15:00bitemyappThe error is in the second.
15:00Raynesgf3: Am I insane or do you have two different snapchat usernames?
15:00bitemyappI can paste a more complete error + trace because I removed the laziness.
15:00amalloyugh. missed the second one, since it blended into the first. sorry
15:00pandeirotechnomancy: running a repl instead a lein repl? sorry for my density
15:00bitemyapphttps://www.refheap.com/20107
15:00coventrybitemyapp: stacktrace refers to line 89 core.clj, but the first refheap has only 62 lines. Can you post the complete thing?
15:01bitemyapphttps://www.refheap.com/20108
15:01bitemyappcoventry: 107 and 108 are the more complete error and the full code, respectively.
15:01bitemyapphttps://www.refheap.com/20107 https://www.refheap.com/20108
15:01technomancypandeiro: if you launch a repl inside the lein checkout and one inside a project you want to shut down, you can test your changes to the repl task in the first one
15:01gf3Raynes: You're insane
15:01gf3Raynes: I'm only LOLgianni
15:02Raynesgf3: Then who the shit is lolreduce?
15:02gf3Raynes: bitemyapp
15:02coventrybitemyapp: trace the binding to rule-fn
15:02bitemyappamalloy: coventry I think I found the error.
15:02gf3Raynes: (Chris)
15:02clojurebotPardon?
15:02bitemyappcoventry: It's trying to "get" a vector
15:02bitemyappinstead of the key
15:02bitemyappI need to destructure the key and the bool.
15:02Raynesgf3, bitemyapp: Which one of you sent me dancing snaps last night?
15:02gf3Raynes: We both did, but bitemyapp did ones later
15:03bitemyappgf3: sssshhh we should just confuse him
15:03RaynesThat was a hell of a confusing night.
15:03amalloyoh good. i thought it might be that, bitemyapp, but i convinced myself you were handling that correctly. prove me right/wrong!
15:03bitemyappamalloy: it was harder to debug because the laziness meant the traces weren't popping up
15:03bitemyappnow that my deftrace is behaving properly with the mapv's, I see what I did wrong now. :)
15:05bitemyappyeah, my code works now!
15:05bitemyappsweet.
15:05bitemyappnow I just need a juxt and reduce :)
15:08amalloybitemyapp: a little plug for useful: flatland.useful.debug/? is kinda like deftrace, but more focused (print particular expressions, not all args to each invocation of a function), and apparently more robust: if the thing you're printing throws an exception, it catches that, prints it, and rethrows
15:09RaynesMy life would be much better if I had more flatland.useful.debug in my life.
15:09pandeirotechnomancy: right sorry where i'm confused is how i construct the project argument in the lein checkout repl?
15:09RaynesNot that it'd help me much with the pool of Ruby I'm drowning in. :P
15:09technomancypandeiro: use leiningen.core.project/read
15:10amalloys/pool/ocean - when you metaphor, gotta go big
15:10pandeirotechnomancy: i promise i'll read leiningen core soon, thanks a lot for the patience :)
15:11coventryamalloy: Thanks, will try it next time.
15:12bitemyappamalloy: I already knew of flatland/useful, didn't know of that particular thing, thank you!
15:13bitemyappI'm a little mad that most of the errors I've had lately would've been caught by a type system.
15:13bitemyappmaybe even...caremad.
15:14amalloyman. i am in the middle of a big refactor that involves changing the type of a concept used all throughout the system
15:14amalloyand it's like...change one function, some other functions throw exceptions, dunno why. finally fix, change another function, more exceptions
15:14bitemyappamalloy: time for core.typed?
15:15amalloyif only i could flip a switch somewhere from `type Id String` to `type Id (Type Number)` and have every relevant piece of code light up like a christmas tree
15:15amalloybitemyapp: i doubt the ROI is high enough for that, but i suppose i could be wrong
15:16bitemyappamalloy: it's easier to pay the cost incrementally, but you can spread the core.typed-ness one namespace at a time.
15:16bitemyappamalloy: it *can* validate waht you want.
15:18bitemyappamalloy: if I were in the middle of a "change the type of this thing that is everywhere"-Hell, I would've started adding core.typed at that point to assist the refactor.
15:19coventryDoesn't that force you to specify types for a whole lot of stuff unrelated to the current problem, though?
15:21bitemyappcoventry: not necessarily, you can specify ^:no-check on external stuff you don't care about.
15:21MaFINaRHello Guys
15:21bitemyappMaFINaR: hi!
15:22coventryWould a tool to decorate everything in a module with catchall type make sense, if you wanted to bleed in type constraints gradually?
15:22seangrovecore.async is lovely.
15:22rhg135to whomever recomended hy to me: it has an unholy blend of python semantics with cl syntax and a dash of clojure
15:22MaFINaRHas anyone tried the Luminus web framework here ?
15:23rhg135i suppose eventually python gets as weird
15:23bitemyappcoventry: if you want to, sure. That's what Any is for.
15:23bitemyappMaFINaR: plenty of people. I'm one of the people that works with yogthos, do you need something?
15:24MaFINaRI was thinking, Luminus doesn't seem to be discussed about much in the net compared to others
15:24bitemyappLuminus isn't really a "thing in itself"
15:24MaFINaRis there anything wrong with it as a framework?
15:24bitemyappit's a best practices ready-to-go template for Ring based applications.
15:24bitemyappIt's not a framework in any real sense.
15:24bitemyappusing Luminus is just a way to learn how to use Ring, conceptually.
15:24MaFINaRokay. How's your experience with it?
15:25bitemyappthere aren't many actual frameworks in Clojure-land, they're anathema to most of us.
15:25bitemyappMaFINaR: well I designed some of it, so obviously I'm okay with how Luminus works.
15:25bitemyappyou should probably just start using it and poke around.
15:25MaFINaRhehe
15:25bitemyappit'll take less time to start using it than to ask vague questions on IRC :)
15:25MaFINaRYeah. I found it pretty accessible. Especially the documentation's pretty good
15:26seangrovebitemyapp: Sure, but pedestal seems pretty framework-y to me
15:27MaFINaRHmmm.. I'll start using it right away
15:27seangroveNot sure it could be any other way, and you get a lot out of it, but still has a lot of baked-in assumptions
15:27MaFINaRThanks
15:27bitemyappseangrove: I've promised the hard-working individuals that work on Pedestal that I would stop talking about Pedestal in public. :P
15:27bitemyappSuffice it to say, I would be quite happy if Pedestal got componentized.
15:28amalloybitemyapp, you sound like an awful street musician, being paid not to play. not a bad deal
15:29bitemyappamalloy: I like the clojure community, I don't want people to ever hesitate pushing out code just because they think some people might disagree with the design.
15:29llasram(inc bitemyapp)
15:29lazybot⇒ 4
15:30bitemyappA rising Github tide lifts all Clojure tugboats.
15:33TimMcbitemyapp: Oh good, now I don't feel bad about releasing 5 slightly differing HTML templating libraries!
15:33TimMcI will get on that. :-P
15:38yogthosTimMc: we definitely have no lack of those ;P
15:49technomancyno no no, we need more validation libs
15:50bitemyappTimMc: nice try, but now that Selmer exists, that wound in my soul was healed.
16:10edwUgh, after upgrading packages I get an 'Autoloading failed to define function nrepl-jack-in' error in Emacs; any thoughts?
16:21pandeiroedw: i think all the functions got renamed to cider-*?
16:22edwYeah, just noticed that. In upgrade hell right now.
16:24edwAfter doing a refresh of the package list, I see only cider-decompile and cider-tracing at melpa.
16:26pandeiroedw: what happens if you package-install nrepl?
16:26pandeiroi thought it automatically installs 'cider'
16:28edwAh. Let me check…
16:36pandeirotechnomancy: tried using a (binding ...) form with *in* bound to a (PushbackReader. (StringReader. "(System/exit 0)")) but to no effect... Where would that have to be done for the lein repl :connect functions to see it? or am i doing it wrong with the binding somehow?
16:38technomancypandeiro: that was just a guess; possibly reply is being too clever
16:38technomancyoh... it's probably accessing the underlying tty directly for jline
16:42edwIs some magic necessary to get an unsigned package installed?
16:42technomancypandeiro: probably :eval-in :nrepl is the easiest way to go
16:43technomancyedw: there's no signed packages in emacs yet, sadly
16:44edwtechnomancy: When I'm in the package list, typing 'i' doesn't select the package, nor can I M-x package-install it.
16:44edwtechnomancy: cider, that is.
16:44technomancyhm; I haven't tried cider yet. does nrepl.el work?
16:45edwnrepl is no longer in the package list.
16:45technomancywhaaaaat
16:45technomancyoh, you're using melpa?
16:45technomancyyeah, don't do that
16:46technomancymelpa is "just give me whatever's on git master; don't care if it works or whatever"
16:47llasramI've noticed a few packages which only host via melpa :-/
16:47bitemyappllasram: that is horrific.
16:47llasramEasy enough to manually download when there's no dependencies, but...
16:47llasramYes
16:47coventrymelpa has actually worked great for me, hasn't triggered a single yak shave. But I am staying away from cider for now. :-)
16:48technomancyI wouldn't mind melpa so much except it encourages package authors not to bother with proper stable releases, which is depressing.
16:49llasramOr does it encourage package authors to make sure everything which touches `master` is stable?
16:49llasramI guess if you're doing the `develop` is rubish, `master` is gold thing, it could work. Ish.
16:49technomancyllasram: that's just as annoying
16:50technomancyI don't want my dev workflow to be dictated by a third-party site
16:50llasramOh, agreed
16:55scizoIf I have a lazy seq of strings, is there a simple way to keep the laziness and pass it to java as a Reader?
16:55scizoAn iostream would work as well.
16:58llasramscizo: I don't know of anything off the top of my head. You could probably `proxy` `Reader` relatively easily though
16:58scizollasram: Alright, I'll look into it. Thanks.
17:00llasramActually, `ring` has something in it which translates from a seq of strings to an input stream consuming that seq
17:00edwtechnomancy: The answer seems to be to add melpa and marmalade to package-unsigned-archives and not package-archives.
17:00llasramI don't remember how it does, but if you poke around, you should at least have an existing example
17:00llasram:scizo
17:00technomancyedw: oh, I missed that you are on head emacs
17:01technomancythat's cool that they are working on signed packages, but incredibly crappy that they've broken the install instructions for 95% of all elisp packages out there
17:01scizoI'll poke around ring for some ideas.
17:01edwtechnomancy: Yes. This was a very new change. My last build was a week or so ago.
17:02amalloyllasram, scizo: for InputStream, there's a SequenceInputStream class, which takes a list of InputStreams and produces a concatenation of them. gallingly, no such thing seems to exist for Reader
17:02technomancyI guess I should catch up with emacs-devel
17:03edwtechnomancy: Problem solved-ish.
17:04scizoamalloy: Where can SequenceInputStream be found?
17:05coventry$google java SequenceInputStream
17:05lazybot[SequenceInputStream (Java Platform SE 7 ) - Oracle Documentation] http://docs.oracle.com/javase/7/docs/api/java/io/SequenceInputStream.html
17:05edwhttp://docs.oracle.com/javase/7/docs/api/java/io/SequenceInputStream.html
17:05edwDamn, beat me.
17:06scizoI was googling poorly
17:06bitemyappI need to start using that bot.
17:20TimMc&(= (java.net.URL. "http://brainonfire.net/&quot;) (java.net.URL. "http://geohash.info/&quot;))
17:20lazybot⇒ false
17:21TimMcOh, it won't demonstrate it here, I guess -- lazybot isn't allowed to make network calls.
17:21TimMcAnyhow, I have recently learned that java.net.URL apparently *dereferences the host name* to decide whether two URLs are equal, based on whether their IP addresses match.
17:22llasramTimMc: The old "java.net.URL resolves the URL host in it's hashCode() method" thing?
17:22TimMcYeah...
17:22TimMcSad panda.
17:22ToxicFroguser=> (= (java.net.URL. "http://brainonfire.net/&quot;) (java.net.URL. "http://geohash.info/&quot;))
17:22ToxicFrogtrue
17:22ToxicFrogWHAT
17:22llasramIt's pretty lolercopters
17:22ToxicFrogThat's insane
17:22ToxicFrogI mean, first of all, those aren't the same URL even if they're both served from the same machine, and secondly, THAT'S INSANE
17:23llasramTimMc: I too will one day write a URL! The libraries can go out for beers some evenings
17:23llasramer, URL library even
17:24TimMcWe can arrange playdates!
17:25TimMcand give them toys like http://[fe80::1%25eth0]/ to play with
17:26llasramAs long as they don't start cutting each other on edge cases...
17:26coventryTimMc: How do you parse that?
17:27TimMccoventry: With great care.
17:27TimMcIt's an IPv6 hostname with a scope identifier.
17:28TimMcThe link-local address fe80:0:0:0:0:0:0:1 with scope eth0
17:28coventryInteresting. Thanks.
17:28TimMcaka fe80::1%eth0, but of course % has to be encoded...
17:29TimMcllasram: Actually, a shared test file would be cool.
17:29coventryOh, yuck.
17:29llasramTimMc: Well, if I end up doing it, I'll steal yours :-) I do need an ultra-liberal-but-correct URL parser, but not as much as I need other things I'm working on
17:29TimMcI don't actually understand how scope IDs are supposed to be used, and there's poor support for them, but... they're there.
17:30bitemyappTimMc: have you tried Frak?
17:30TimMcllasram: Urly is pretty good, but make sure to feed it java.net.URL directly to avoid the fixups it does with Strings.
17:31TimMcbitemyapp: https://github.com/noprompt/frak ?
17:32TimMcIn any case, no.
17:39dobry-denWhat's a surrogate for the things Ruby's Eventmachine would be used for? Perhaps sockets + clojure.async?
17:39llasramI just call methods on `nil` all over my code
17:39llasramGives me pretty similar results
17:40amalloydobry-den: core.async, or lamina+aleph, as i understand what EM is
17:40TimMcllasram: Haha, ouch.
17:40llasramYeah, too mean and unhelpful. Apololgize
17:40llasram(inc amalloy)
17:40lazybot⇒ 74
17:41llasramMan, typing: apologies even
17:47pandeirohow do i turn a string into an InputStream ?
17:47patchworkHmm, in brepl (require …) is not defined?
17:47pandeiropatchwork: only the :require macro within an ns works
17:48bitemyappllasram: I enjoyed it anyway.
17:49patchworkpandeiro: So can I define a ns inside the repl, or just not require anything and refer to all symbols by their full path?
17:49amalloypandeiro: you can do it, but usually you shouldn't because converting from char[] -> byte[] makes it easy to use the wrong string encoding
17:52pandeiroreply/launch-repl has a special option called :input-stream, which lein repl :connect binds to System/in for example, but it doesn't accept my (PushbackReader. ...)
17:53pandeiropatchwork: yeah this is one of my pet peeves in the brepl too
17:53bitemyappllasram: shouldn't be too haughty about nil errors in Ruby, I get NPEs in Clojure too :)
17:53pandeiroyou are forced to think in ns
17:53technomancypandeiro: in this case a ByteInputStream on (.getBytes "(System/exit 0")) would be ok
17:53pandeirotechnomancy: ah great let me try that
17:53technomancynot something I'd recommend for general use, but it's OK here
17:53pandeirok
17:54llasrambitemyapp: Oh sure, I just had some bad experience with EventMachine :-)
17:57nooniani like null pointer exceptions in clojure; it usually just means i'm trying to get something from a map and using the wrong key
17:58TimMcamalloy: Eh, just assume everything's in UTF-8, because it *damn well should be*.
17:59brehautTimMc: my favorite recent mysql thing: which UTF-8 do you want http://mathiasbynens.be/notes/mysql-utf8mb4
18:00llasramwat
18:00bitemyappnoonian: sigh, usually what happens to me too ;_;
18:00jjttjjwhat's the current reccommeded way to use emacs from windows? cygwin or just emacs for windows
18:01bitemyappllasram: I assume that anybody that says EventMachine or Twisted are good/effective have stockholm syndrome.
18:01bitemyappjjttjj: format C:, install something else.
18:03jjttjjbitemyapp: :( I was using ubuntu for the longest time, then went to OSX which I loath worse than windows so I just got a new windows comp
18:03llasramjjttjj: Everything should* work just fine natively under windows
18:03llasram* Claims not verified
18:03turbofaili wouldn't say "everything," but back when i used emacs on windows, most stuff just worked
18:04bitemyappjjttjj: llasram is right, but you should find a way to make yourself happy on Linux just so you're using the same unix tooling as everybody else. (I'm on Mac OS X most of the time recently, but I've used Linux for a long time)
18:04bitemyappjjttjj: plus, package management!
18:04bitemyappapt is my happy place.
18:05bitemyappthis test-string might be a bit of a copout: (testing "Can call API" ...)
18:05bitemyappjjttjj: I've used Emacs on Windows before, albeit not for development. Seemed fine. I can't speak to how well nrepl will work.
18:05bitemyappI assume it works because nobody complains about it. But that also might mean nobody is trying it.
18:06jjttjjYeah linux is the best unfortunately I need postage printing software on my main OS
18:07TimMcbrehaut: Lovely.
18:08TimMcjjttjj: Does it run under Wine? :-)
18:08brehautTimMc: but who would ever use higher thingimy utf-9, lets sweep it under the rug. oh wait Emoji
18:08brehaut💩
18:08jjttjjTimMc: not really brave enough to try
18:08coventryIf that's the main reason, I would run windows in a VM and call into it for the postage printing.
18:09TimMccoventry: If it needs access to the printer, that could get ugly quickly.
18:09bitemyappTimMc: sssshhhh let him be brave
18:10coventryI guess I don't know what to compare against, since I don't know how ugly it is to develop on windows.
18:11coventryTIL there is a unicode character PILE OF POO.
18:12brehautcoventry: unicode also prefers cats over dogs
18:17bitemyapp0 failures, 0 errors. Yeaaaahhhhh baby.
18:19seangrovebitemyapp: This for a simonides update?
18:24ndpTimMc: I sometimes use a Windows VM to drive a small CNC mill via USB - it's not /that/ ugly in VirtualBox.
18:24bitemyappseangrove: 9-5 stuff. Just expanded my API tests.
18:25bitemyappseangrove: it's for a Datomic querying dashboard.
18:45TimMcndp: Oh right. USB makes everything better. :-)
19:18staaflok, total newbie here
19:19staafltrying to run a simple example that uses the prxml library
19:19staaflcan't get leiningen to find it
19:19technomancytanstaafl!
19:20znDuffstaafl: hmm; it's there in clojars. How are you declaring it?
19:20staaflznDuff, http://pastebin.com/gz7ZTUhE
19:20znDuffstaafl: not pastebin.com, please, it's full of ads.
19:20staafltechnomancy, of course not
19:20staaflznDuff, sorry
19:20staaflI'm using an adblocker and hadn't really noticed
19:21znDuff(we're somewhat fans of refheap.com, as it's written in Clojure, but anything that's ad-free is fine).
19:21staaflgist ok?
19:21znDuffsure.
19:21staaflhttps://gist.github.com/staafl/7128171
19:21staafli'll make a point to check refheap out
19:22znDuffstaafl: it's just [prxml "1.3.1"]
19:22znDuffstaafl: ...no weissjeffm namespace.
19:22staaflznDuff, I saw it from here: https://clojars.org/weissjeffm/clojure.prxml
19:23znDuffHmm. I found it at https://clojars.org/prxml
19:23znDuffAhh.
19:23znDuffThe weissjeffm version doesn't have a 1.3.1 yet.
19:23znDuff...it's quite literally _only_ published as 1.3.0-SNAPSHOT.
19:24staaflznDuff, ok, i've changed it to just prxml
19:25staaflbut "lein run" fails with FNF
19:25znDuffstaafl: ''lein try prxml 1.3.1'' works for me.
19:25amalloyprxml is like super duper old and deprecated. clojure.data.xml contains (afaik) all the prxml features
19:26staaflCaused by: java.io.FileNotFoundException: Could not locate clojure/contrib/prx ml__init.class or clojure/contrib/prxml.clj on classpath:
19:26staafli may be missing a step, but i don't know what it is
19:26znDuffAhh.
19:27znDuffNot so sure it's still clojure.contrib.
19:27znDuffIn fact, I'd be surprised if it were.
19:27znDuff...huh; I was wrong on that.
19:27znDuff(use 'clojure.contrib.prxml) works fine for me given that lein try command.
19:28znDuffI'll try with your exact project.clj.
19:28staaflznDuff, I appreciate that
19:28algalHello all. I'm wondering about authenticating a ring-based web API endpoint in Clojure. Is there any obvious choice besides cemerick.friend ?
19:29brehautlib-noir might have something
19:30nooniani use friend
19:30gtrak_friend's the most comprehensive thing
19:30znDuffstaafl: your src/test/core.clj needs fixing.
19:30znDuffstaafl: give it a ns declaration, create a foo fn in it, and it's fine.
19:31algalOkay, thanks. I'm finding friend a bit hard to dive into. I'm not sure if that's because I'm being thick, or friend is a bit unpolished at this point, or what.
19:31gtrak_algal: the examples demos are helpful
19:31gtrak_http://friend-demo.herokuapp.com/
19:31algalgtrak_: Yes, they are!
19:31noonianjust googling, theres clj-oauth for oauth and ring-basic-authentication which is a middleware i guess
19:31staaflznDuff, I seem to have that
19:32znDuffstaafl: it's not reflected in your gist, if so.
19:32staaflznDuff, https://www.refheap.com/20121
19:32noonianalgal: my biggest stumbling block using friend was actually a misunderstanding of how routing middleware works, if you use wrap-authorize around compojure GET macro's for instance it will lock down routes declared later, so you either need to use it in a compojure context or just use authorize instead
19:33staaflznDuff, am I missing something here? sorry for being such a noob right now, but it's getting late I just want to follow the damn tutorial
19:33staaflso any help is highly appreciated
19:34algalnoonian: Yes, this is part of what's confusing me. I want to apply the same authorization constraints to a set of routes, but evidently the way to do that is not to just wrap handler built from all those routes.
19:34znDuffstaafl: https://gist.github.com/charles-dyfis-net/7128287
19:35znDuffstaafl: it's forked from your own earlier gist, so you can ask for the diffs.
19:35gtrak_algal: I think it's likely that you're breaking the compojure routing contract, ie each route returns a value or nil.
19:36gtrak_if wrap-authorize builds responses that might be alright.
19:37gtrak_from the code, it looks like it throws an exception in the bad case.
19:37gtrak_something will need to catch it.
19:37staaflznDuff, that... worked
19:37staaflznDuff, thank you
19:38staaflznDuff, could you please explain what happened and where I can look to learn more about this configuration business?
19:39znDuffstaafl: well, your project.clj was asking to run a function "foo" inside of the tst.core namespace, but you weren't defining a tst.core namespace at all, and didn't have a function called "foo" inside of it either.
19:40staaflznDuff, hmm, makes sense
19:40staaflserves me right for cargo-culting
19:50bitemyappalgal: just write a function.
19:50bitemyappalgal: don't use Friend if it doesn't make sense to you.
19:51algalbitemyapp: I may end up doing that. It feels like overkill for just enforcing HTTP Basic, but maybe that's because the README.md is a bit unwieldy.
19:57algaldoes anyone happen to know what the largest (e.g., users, traffic, etc.) installation of clojure is to run a web app ?
20:01znDuffalgal: most of the big uses of Clojure I know of aren't web sites.
20:12muhooa while back i saw a post in one of the clojure blogs, about a clojure library for writing tests backed by phantomjs headless browser. now i can't find it.
20:14seangrovemuhoo: We use cljsbuild + cljs.test + a small phantom script
20:14bitemyappmuhoo: http://engineering.versal.com/testing/2013/03/07/shuttle-js-jvm-testing/ https://github.com/kumarshantanu/clip-test
20:15muhoobitemyapp: it wasn't those, but thanks
20:15muhooseangrove: thanks. it was a specific library, it was very straightforward too.
20:16bitemyappmuhoo: https://github.com/dustingetz/cljs-bootstrap
20:16bitemyappmuhoo: https://github.com/BirdseyeSoftware/buster-cljs
20:17muhoonaw, man. i'm pretty sure it was something i saw on planet.clojure.in. will to peruse its archives and see if i can find it now.
20:18solussdmuhoo: https://github.com/cemerick/clojurescript.test talks about using phantomjs
20:18muhooshit, stuff scrolls off of that blog :-/
20:19bitemyappImma bout to get mad. I usually win with the first two guesses.
20:19muhooi. will. find. this. .... and when i do i'll post it here
20:19bitemyappI never miss this hard.
20:19bitemyappI think muhoo is being too picky anyway.
20:19muhooheh, you're mad? i've been trying to remember this for a half hour, looked through my notes.
20:20bitemyappmuhoo: lawd. Well if you find it, let us know. Sounds nifty.
20:21muhoohttps://github.com/xeqi/kerodon
20:21muhoowasn't phantomjs, was ring :-/
20:22muhooso, your suggestions (clojure.test + cljs, shuttle, etc) are what i actually need.
20:22bitemyappway to trick me.
20:23TEttingerhttps://github.com/cemerick/clojurescript.test/ yses phantom
20:24muhoothe dsl of kerodon looked very sweet. but in this case, yeah, i'll go with cljs.test or similar, since i need headless browser
20:44seangrovednolen: dbasch and I are playing around with an implmentation of conway's game of life in cljs and canvas, and seeing a huge overhead from gc - curious how you track down these cases?
20:45seangrovednolen: And also, in your experience with chrome, if we're updating a 40x40 matrix every 50ms, should that cause ~7MB of GC every ~80ms? It seems unlikely
20:47coventryHow do you measure the GC rate? That sounds useful.
20:48seangrovecoventry: In the dev tools, you can profile over the timeline and see how long/often the GC is running in the frames section
20:48coventryseangrove: Thanks.
20:49seangroveNo worries!
20:49seangroveIf it gave you more details about *what* it was GC'ing, it'd be nice though
21:21`cbpbitemyapp: hello!
21:22bitemyapp`cbp: hai
21:23`cbpbitemyapp: I believe I can run 10 out of 10 now :-D, just giving it some finishing touches then ill push
21:29cldwalker__muhoo: https://github.com/semperos/clj-webdriver is quite nice for integration testing js apps
21:39bitemyapp`cbp: awesome. :)
21:39bitemyapp`cbp: I'll probably be looking to get a test harness together and then check for any release-ready finishing touches
21:40`cbpitll prolly need a refactoring
21:40bitemyapp`cbp: do you mind if I push it to clojars and inform the founder of RethinkDB to add Revise to their client drivers list?
21:40bitemyappwhen it's ready, that is.
21:40bitemyapp`cbp: undoubtedly. Particularly to make it nicely testable. The connection stuff looked messy.
21:40bitemyappNot a big deal though.
21:40`cbpthat's ok
21:40`cbpYeah i'll change the connection stuff to a deftype at least
21:41bitemyapp`cbp: awesome. You're a hero for just going ahead and writing the entire library :)
21:41`cbpheh it was not easy
21:41`cbpI was basing it on the python/ruby drivers and that was a mistake
21:41`cbphad to redesign a couple of times :P
21:42bitemyappheh. That means a lot of learning happened.
21:43bitemyapp`cbp: I don't think the connection needs to be a deftype though, couldn't it just be a map or a record?
21:43`cbpyeah im not very sure how to handle that
21:43bitemyapp`cbp: np, I'll take a look.
21:43`cbpand make it thread safe
21:44bitemyappI can help with that too.
21:45`cbpyeah 10 out of 10
21:45`cbpyou can basically just run all of the commands in there and it should work
21:45`cbp(pushed now)
21:46`cbphttps://github.com/bitemyapp/revise/blob/master/src/bitemyapp/revise/core.clj#L23
21:47bitemyapp`cbp: thooooose can be test cases :P
21:47bitemyappI like the way the API composes. Seems nice.
21:47`cbpyeah the only bad part is all the r/
21:47bitemyapp`cbp: macros >:)
21:48`cbpBut I guess we can always just add a helper macro or something
21:48bitemyappI'm waiting on that though. yeah.
21:48`cbpyeah
21:48bitemyapp`cbp: I'm heading home, I'll check in with you later.
21:48`cbpbye
21:52xeqimuhoo, bitemyapp: I think you can run clj-webdriver with a phantomjs browser backing
21:53xeqihttp://blog.zolotko.me/2012/12/clojure-selenium-webdriver-and-phantomjs.html
22:12lrennwhen using :refer, with refer, what's the difference between putting the symbols in a list vs a vector? I see both used. Have I been missing something?
22:12lrennwith require*
22:18coventrylrenn: It shouldn't make any difference.
22:18cespareI usually see a vector.
22:20dobry-denis there any drawback to this num->hex function that return hex-string for any number by using biginteger? https://www.refheap.com/20126
22:21dobry-denbesides being slow
22:25llasramdobry-den: Aside from there being a more obvious way to do it?
22:31dobry-denllasram: what's the obvious way
22:33dobry-denbring it on smartguy. got something to say?
22:33dobry-denjk
22:33llasramhaha
22:34llasramYou know, `bit-or` with 0xff, then `bit-shift-right` by 8. Rinse, repeate
22:34llasramrepeat even
22:34llasramer, bit-and even
22:35llasramI need to mix in some "odd"s, just for variety
22:35dobry-deni guess i should finally look up how bit shift works
22:35llasramYou know what, actually your way might be best
22:36llasramI just remembered that the `bit-`* operations are not (yet?) defined for BigInt{,eger}s
22:36llasramSo your way will actually work for any integral input
22:36llasramWhereas my way is in practice no better than just using (format "%x" number)
22:37llasramOh, which may also be an option for you: ##(format "%x" 123456)
22:37lazybot⇒ "1e240"
22:38dobry-dendang, this is easy
22:38dobry-denthat
22:39llasramOk :-) Keep in mind that it won't work for anything too big for a `long`, if that matters
22:39llasram,(format "%x" 123N)
22:39clojurebot#<IllegalFormatConversionException java.util.IllegalFormatConversionException: x != clojure.lang.BigInt>
22:40dobry-denseems to work for bigintegers though
22:40llasramreally?
22:40llasramHuh
22:40llasramYou're right
22:40llasramCool
22:40llasramYou learn something new every day!
22:59lrenncoventry: i've seen both used. Sometimes in the same project. Is there an "official" way?
23:05bitemyapparrdem: recover your damn computer.
23:05arrdemAnyone use literate programming beyond lein-marg?
23:05bitemyappmarginalia is the main one
23:05tbaldridgearrdem: my code is self-documenting
23:05bitemyappI think I prefer codox (less literate)
23:06tbaldridgearrdem: :-P
23:06bitemyappsays the author of the go macro. Right.
23:06arrdemthe sarcasm is string with this one (tbaldridge)
23:17pandeiromuhoo: casperjs?
23:22ToBeReplacedRaynes: feel free to PM if you have any questions re: my fs PR when you get around to it
23:35gfrederickshas anybody written a version of with-redefs for testing that does thread-local stuff, via tricks?
23:40gfredericks(to allow parallelized tests)