#clojure logs

2012-03-12

00:01uvtcantares_, is there supposed to be a newline at the end of your public key?
00:01antares_uvtc: no
00:02antares_I think it will be ignored but typically public keys don't have newlines
00:02uvtcantares_, Thank you. Though, it's still not working for me, there was a newline (maybe I mistakenly put it there at some point) and I removed it.
00:03antares_uvtc: did you check your key permissions?
00:03uvtcantares_, No.
00:03antares_uvtc: ssh will only use them if key files are 600
00:03antares_not readable by anyone but the owner
00:03uvtcPublic key as well?
00:04uvtcMy pub key is 644. Changing and trying again.
00:04antares_uvtc: no, public key permissions can be anything
00:04antares_it is public, after all
00:05uvtcantares_, Ah, *ehem*, of course. :) Hm. Yeah, the private one is 600.
00:05uvtcTried updating my pub key in the clojars "profile" page. No change.
00:12uvtcWhen I created my Clojars account, was it supposed to send me some sort of confirmation email?
00:13technomancyemails are only sent on password resets IIRC
00:19franks42trying again this reworded Q: is there any available function that returns a ns-form-like statement that includes all the requires/imports/refers/aliases that would give me the current context in the REPL?
00:19uvtctechnomancy, thanks.
00:19arohnerfranks42: no, but you could write one
00:20franks42arohner: (I knew that answer already ;-))
00:21franks42does swank allow you to eval a single function in a file? if so, how does it eval in the right context?
00:23arohnerfranks42: yes, C-x C-e. I think it reads the ns declaration at the top of the file, not sure
00:25uvtcantares_, Thanks for all the help. Will probably try again tomorrow.
00:26uvtc$mail antares_ Thanks for all the help. Will probably try again tomorrow.
00:26lazybotMessage saved.
00:27franks42arohner: I do understand that you can write such a function from the all-ns, ns-refers, ns-aliases, ns-imports... just have the feeling that I'm not the first who stumbled upon that requirement
00:28arohnerfranks42: I haven't heard of anyone wanting to write that before, and I've been here for almost 4 years
00:28franks42...and when you're only working inside the repl, there is no ns-declaration to parse
00:29arohnerI typically work in a file, and use swank to eval the file as I'm working
00:29arohnerno need to determine an ns declaration from the repl context
00:31franks42arohner: understood - my requirement comes from executing clojure statements independently in new repl sessions where the second invocation has to eval in the same context as the one before
01:41cliffordHi, how would I setup slime to work with datomic?
02:57aperiodic$mail uvtc after a few hours of being afk, i tried again, and both of my keys (one for my original account, another for a new one i made to try to get around this) are still rejected. thanks for the suggestion, though
02:57lazybotMessage saved.
02:59wmealingaperiodic, this is your ssh keys ?
03:00wmealingsomeone else was having problems too, so its not just you
03:00wmealingantares_, iirc.
03:01aperiodici thought it was uvtc
03:03aperiodicyeah, looks like it from skimming the logs... and it appears to be resolved for him
03:04aperiodici still have one thing left to try before i start setting up a local clojars instance
03:19aperiodicwell, i just created a new clojars.org user account, and a new user account on my linux vm with a fresh rsa identity. i still can't ssh into clojars
03:20wmealingimho file a bug
03:20wmealingdont know with who
03:24aperiodici'll open an issue on the gh project
03:27justicefriesso what's the advantage of using say, SLIME with noir?
03:27justicefriesI have SLIME up and running
03:28justicefrieswith swank-clojure.
03:32gunsjusticefries: why with noir in particular? SLIME is useful in of itself
03:33justicefriesthat's what I'm jumping into - what I'm trying to figure out, I suppose, is how SLIME fits into the workflow.
03:33justicefriesi'm modifying/injecting code at runtime directly, but I have to edit files separately, correct? so it's a faster feedback/debugging tool
03:36gunsjusticefries: I am building a site with noir and I've been able to use an atom instead of a database for storing data, which I can then access from my editor
03:36gunsThat's a first time experience for me with a web app
03:37justicefriesoh, nice.
03:39uvtc$mail aperiodic The scp/ssh problem still exists for me as well. I'll ask again here tomorrow about it. I've also tried creating new keys, but that didn't help. Incidentally, looks like we're both on Ubuntu. Looking at the gist you posted in your bug report, we may be having the same problem.
03:39lazybotMessage saved.
03:44aperiodic$mail uvtc you should comment on the issue! so technomancy doesn't think i'm crazy :). i'm gonna stop bashing my head against this issue now, and hopefully there'll be a response in the morning.
03:44clojurebotCool story bro.
03:44lazybotMessage saved.
03:44aperiodicthanks, clojurebot
03:45gunsthat was cool
05:01justicefriesokay, suddenly I get SLIME/Swank
05:16justicefriesis anyone about for a quick swank-clojure question?
05:17bsteuberjusticefries: just ask ans we#ll see ^^
05:17bsteuber*and
05:17justicefriesgreat. trying to use it to start up a vanilla noir server, and I try to hit the localhost:8080
05:17justicefriesand there's no server starting,a nd I'm not sure why.
05:17justicefriesI opened the file, and then C-x C-e on the -main function.
05:17justicefriesoh, I probably have to call -main, huh?
05:17justicefriesthat did it.
05:26bsteuber^^
05:26justicefriesthe benefit seems less pronounced in noir, where files update on save anyway.
05:27bsteuberyes that's really nice for dev
05:28justicefriesbut I suppose it's not a bad idea to be able to jack into a swank session on prod. :)
05:30bsteuberindeed
05:30justicefriesI understand!
05:31justicefriesnow I just need to figure out the best way to minify/concat CSS/JS in Clojure, or just use Uglifier. :D
05:33justicefriesdoesn't seem to be a reality.
05:33bsteuberclojurescript with advanced mode is great for js
05:33bsteubernot sure about css
05:33justicefriesthat makes sense.
05:33justicefriesyeah, from what clojure-toolbox says everything available hasn't been updated in ever.
05:34justicefrieswhich is fine.
05:34bsteuberwe are using conpass to generate css, but this is from ruby land
05:34bsteubercompass
05:34justicefriesman, compass drives me insane.
05:34justicefriesscss + bourbon is good.
05:34justicefriesor jade + nib.
05:35justicefriesa combo like that in clojure would rule.
05:35bsteuberwhat's the difference between bourbon and compass?
05:36justicefriesI can actually get bourbon to work, and it handles cross-browser polyfills
05:36justicefriescompass requires structural changes to the app
05:36justicefriesunless it's changed recently.
05:37bsteuberI see
05:37bsteuberbut yes, I'd also wish to have a great pure clojure solution
05:38justicefriesgithub.com:paraseba/cssgen seems to come close.
05:38justicefriesunfortunately, GitHub is vomiting on it.
05:38bsteuberI think I tried that but stopped for some reason
05:38bsteuberbut it's been a while, so maybe it improved in the meantime
05:38justicefrieslast commit 3 months ago...
05:38justicefriesI'unno, maybe I'll take a crack at an initial version this weekend.
05:39justicefriesI like how Jade renders out CSS.
05:41justicefriesah and cssgen doesn't seem like it's runtime.
05:42justicefriesseems like there needs to be a ring middleware for this.
05:43bsteuberyou want to gen css at runtime?
05:43justicefriesinitially. I think it's a good start, and then focus on making it more asset-pipeliney later.
05:43justicefriesespecially in dev mode.
05:43bsteuberwell I have compass watch the scss
05:44bsteubersave the file and refreshing the browser is not so much work
05:44justicefriestrue, it's nice that both express.js and rails and sinatra can all have that baked right in though.
05:48bsteuberso you actually do write js?
05:48bsteuberinstead of cljs, I mean
05:48justicefriesas of right now yeah. I'll probably switch over.
05:49bsteuberyes you should, it's so nice to have clj in the browser
05:49justicefriesI do a lot of workshops with canvas and such, which should really be in pure JS or coffeescript at worst.
05:49justicefriesthe engine I'm building I'd like to move over to cljs though
05:50bsteubercljs still has some childhood issue like even less readable error messages
05:50justicefriessure.
05:50bsteuberbut once you get the hang of it it's far more productive
05:50justicefriescoffeescript has that problem too
05:50bsteuberof course, being clj :)
05:51justicefriesi'm still getting the clojure epiphanies.
05:51justicefriesthey're coming more and more though.
05:51justicefriescoming over from ruby with a bit of erlang.
05:51bsteuberthe thing bothering most are no errors or anything when using unbound variables
05:51luciani find CS's errors ok, given how close it is to JS
05:52luciansourcemap will help, though
05:52bsteubersourcemap?
05:54justicefriesalso re: the CSS, bsteuber, you could probably make the same argument re: cljs, unless you're precompiling that.
05:54justicefriesguard/compass/etc is nice and all.
05:55bsteuberjusticefries: which argument do you mean?
05:55justicefriesdoing it as a middleware in dev.
05:55justicefriesyou probably don't want to be compiling CLJS on the fly.
05:56bsteuberah
05:56bsteuberyes, that's why lein cljsbuild replaced noir-cljs I guess
05:56bsteuberbecause doing the recompiling with your build tool is more flexible
05:58justicefriesyeah I'm trying to figure out how much I fully agree with that...I mean, I really love what asset pipeline and friends did.
05:58justicefriesit's buggy, it can be weird.
05:58justicefriesbut for the 90% case it's great, and in production you pre-compile with a task.
05:59Licensermoin
05:59justicefriesto have a namespace with all of your cljs (or mixed in with JS, too) in it and a namespace for all of your <insert CSS template type here>.
05:59bsteubertach
05:59justicefriesmaybe?
05:59justicefriesi'unno we'll see what I can cook up this week.
06:00bsteuberwhy do you need these namespaces?
06:00justicefriesprobably don't, just trying to think of organization patterns and it's 4AM here. :D
06:00lucianbsteuber: https://wiki.mozilla.org/DevTools/Features/SourceMap
06:02bsteuberthanks, that might be useful
06:52wmealinguser=> (ns-public 'clojure.string) <- a few tutorials talk about something similar, clojure 1.3.0
06:53wmealingthis form outputs nothing
06:53wmealingCompilerException java.lang.RuntimeException: Unable to resolve symbol: ns-public in this context, compiling:(NO_SOURCE_PATH:1)
06:53wmealingwell, not nothing, a runtime exception, see above.
06:54ordnungswidrigwmealing: ,(ns-publics 'clojure.string)
06:54ordnungswidrig,(ns-publics 'clojure.string)
06:54clojurebot{trim #'clojure.string/trim, lower-case #'clojure.string/lower-case, split #'clojure.string/split, join #'clojure.string/join, upper-case #'clojure.string/upper-case, ...}
06:54wmealingok, so it doesn't work for me, what did i do wrong ?
06:55ordnungswidrigwmealing: ns-publics not ns-public
07:01wmealingdifferent error, but i'lls ee if i can figure it out.
07:50y3dihas anyone checked out riemann? http://aphyr.github.com/riemann/
08:26wmealingis the use of eval considered bad practice ?
08:27LajlaI never got how that can be implemented
08:27gtuckerkellogghi wade
08:27LajlaDoesn't that mean that every program that uses that basically includes a clojure compiler in it?
08:27wmealinghey hey gtk :)
08:27LajlaHow does eval work with scope anyway?
08:28LajlaLike, if you eval something with def in it, does that affect the global scope?
08:28wmealingi guess it evals it, in the current scope ?
08:30LajlaSurely that violates lexial scope if def and other stuff is allowed?
08:31Lajla(eval (if some-runtime-data '(def x 3) '(def y 4)))
08:32wmealingwhy dont you try it ? see what happens
08:32LajlaDon't have clojure installed, don't know clojure, I just come here to worship shadows it seems.
08:32LajlaI am actually a hated schizophrene here who usually just sprouts word salads you know.
08:34wmealingah
08:34wmealingwhats stopping you ?
08:34Lajlalack of TCO I guess.
08:35wmealingnot following how that relates.
08:35wmealingbits on your disk are that precious ?
08:35LajlaDunno, there's a reason many lispers don't really like Clojure, I'm one of them. I checked it out, didn't like what I got, left and the channel never got from autojoin and they never banned me for my mental insanity.
08:35LajlaOhhh
08:35LajlaI thought stopping me from learning clojure well.
08:35LajlaEhhh
08:36LajlaI geuss I could install it
08:36LajlaI guess just laziness, had it on my old computer never re-installed.
08:36wmealingyou can't bash something properly, till you really know it.
08:36wmealingotherwise you're not doing justice to the bashing
08:36LajlaTrue
08:36adamspghLajla: I highly recommend leiningen for getting Clojure.
08:36Lajlabut I'm not bashing
08:36Lajlaleiningen?
08:36clojurebothttp://github.com/technomancy/leiningen
08:37adamspghJust grab the "lein" script and run it "lein repl" and you are in clojure.
08:37wmealingif you know erlang, its the rebar of clojure
08:37LajlaI'm not one of those people that enjoys bashing fo rth esake of elitism, I just read the start, wasn't a fan and didn't continue
08:37Lajlawmealing, rebar?
08:37LajlaI'm not a fan of Erlang either honestly.
08:37wmealingproject manager, test runner, etc
08:37wmealingeverything has its suck points
08:37LajlaTrue
08:38LajlaI actually dislike every language I would say, I just dislike some more than others, issue is, I see no reason to use clojure when scheme exists.
08:38wmealingthe trick is to find something where the points dont bother you
08:38LajlaClojure has some advantages though.
08:38wmealingjava interop
08:38LajlaSomething about clojure I really really really like is the fact that nil and the empty list are destinct
08:38wmealingi dont know the lispy languages well enough to say what is crap, and what isnt
08:38LajlaHaving them as the same object is just an historic artifact, as well as the fact that lists are a proper datatype.
08:39wmealingcan you modify scheme to do that ?
08:39wmealingmacro it up ?
08:39LajlaWell, lists in scheme are not a native type
08:39lucianLajla: http://tryclj.com/
08:39Lajlayou have pairs and you have the empty list, and you make them from that
08:39wmealingpairs like (1,2) ?
08:39LajlaLike (1 . 2)
08:39Lajlathat's how you write it there
08:40wmealingso you'd compose it like (1 . 2 ) . 3) ?
08:40lucianwhich is (cons 1 (cons 2 '()))
08:40Lajla(1 . (2 . (3 . ())))
08:40wmealingah
08:40lucianscheme is by far the cleanest lisp, but clojure has some clear advantages
08:40LajlaNo, (1 . 2) is a pair of two numbers, the list (1 2) is identical to the pair of 1 and the pair of 2 and ()
08:40lucianthe data type literals are really useful
08:40Lajla(1 . (2 . ()))
08:41wmealingok
08:41Lajlalucian, I agree that some things about clojure are superior, a lot of things about scheme are just historical artefacts
08:41LajlaLike, you can feed any pair structure to map in scheme
08:41Lajlaif it's not a well formed list, the behaviour is not defined per se on a conforming implementation
08:41LajlaThe scheme standard does not mandate that it verifies it is a conforming list
08:41LajlaThough, most implementations of scheme test list? in constant type
08:42Lajlatime*
08:42LajlaWell, not always of course
08:42lucianthe only things i dislike about clojure are jvm and non-hygienic macros
08:43lucianbut they're also partly things i like
08:43wmealingdo you guys get paid to write lisps in your day job ?
08:43Lajlalucian, not the lack of TCO?
08:43luciani get paid (extremely little) to write python (which i quite like)
08:43LajlaI think that's even a problem for the author itself, the lack of TCO.
08:43LajlaHmm, Python is also a language I find very hard to work with.
08:44lucianLajla: nah, that's not a big deal i think. i even like that recur is an explicit tail call
08:44LajlaWell, mutual recursion is still an issue.
08:44LajlaI use mutual recursion quite often in my scheme.
08:44lucianfor which you have trampolines
08:44lucianyou do? you may be unusual
08:44dan_bI view 'recur' as a signal that perhaps I should be using map or soemthing instead
08:44LajlaWhat if your mutually recursive function wants to return a function?
08:45LajlaIn a lot of cases when imperative programmers think they need to use tail recursion, they actually need to use map yeah
08:48Lajlalucian, hmm, what do you think of mutually recursive parsers for context-free languages?
08:48lucianLajla: i think they're uncommon enough that explicit trampolines aren't a great cost
08:49Lajlalucian, well, I mean, as a general design philosophy.
08:49LajlaIt seems like the most straight-forward way to make them namely.
08:50luciani've never written one, so my opinion isn't very relevant
08:50lucianone could write it with multimethods perhaps more simply
08:51LajlaI don't know, this seems like the simplest and most intuitive way for me to write one.
08:51LajlaMost of my functional code is mutually recursive, I can't see how it's that uncommon
08:51lucianwe probably have different enough backgrounds to disagree
08:51LajlaEspecially in code which deals with physical stuff
08:51LajlaBecause you're defining physical formulae into each other anyway.
08:51LajlaI guess.
08:51lucianfunctional code is uncommon in the first place
08:51LajlaHmm
08:52LajlaSo you don really have a functional background outside of clojure?
08:53luciannot really, and i'm only slowly learning clojure
08:53luciani do use vaguely functional concepts in python a lot, but i'm used to relying on side-effects
08:54vijaykiraneh
08:55LajlaAhhh, I guess.
08:55LajlaWell, it's not that common in functional code I guess if not a necessicity in some ways
08:56luciansure, but i started with pascal/c
08:56luciani still hate that shit
08:56stirfoonot to go off topic too far, but is anyone looking into clojure-py?
08:56lucianstirfoo: i'm curious of doing it on PyPy properly
08:57stirfoolucian: it looks like a interesting project. Lisp with batteries included.
08:58LajlaDoesn't CL pretty much have enough batteries to power las vegas?
08:58stirfoono
08:58lucianstirfoo: it couldn't call into python automatically
08:58lucianstirfoo: what you'd need is either more work into PyPy, or to generate python source code instead, like cljs
08:58stirfooneither does scheme, or clojure, Python has the batteries.
08:58LajlaScheme has batteries depending on what scheme standard you work with
08:58lucianwith clojure, you have tons of batteries, but they're in very hard to open packaging and many sharp edges :)
08:59Lajlathere are layers and layers upon standards
08:59lucianLajla: that's different orders of magnitude of batteries
08:59Lajlathe smallest core has about enough batteries to power a watch.
08:59lucianlike opening files vs html parsing
08:59lucianscheme tends to have more of the former and few of the latter
09:00LajlaThe further SFRI's all include that stuff.
09:00Lajlaopening files is part of R5RS
09:00LajlaPeople often read R5RS, conclude 'Hey, 40 page document, this language is very small', while most implementations support standards which reac way beyond R5
09:01luciannowhere near the ecosystem python/ruby/java have
09:02LajlaI'm pretty sure it is because everyone can just add an SRFI
09:02LajlaTHere is some pretty silly and specific stuff in there
09:03lucianagain, doesn't compare in breadth with anything else out there
09:03luciannot even racket's planet comes close
09:03LajlaHow would you know?
09:03luciani thought it was obvious
09:03lucianit's orders of magnitude difference
09:05LajlaWe're still talking about the batteries of standard python versus all the SRFI's out there right?
09:05wmealing [org.clojure.contrib/complete "1.3.0-SNAPSHOT"] <-- what is the correct syntax for 1.3 ?
09:05wmealingfor the project.clj ?
09:05lucianLajla: no, i meant stdlib+pypi vs srfi+racket's planet
09:06lucianLajla: what the language ships with is almost irrelevant
09:06tsdhwmealing: See http://dev.clojure.org/display/doc/Clojure+Contrib
09:06tsdhwmealing: It seems, complete hasn't been ported to clojure 1.3...
09:06Lajlastdlib? as in, C?
09:06lucianLajla: the python standard library
09:07lucianpypi is the python package index
09:07wmealingso i'd need to import each one.. ok
09:07LajlaAh, oki.
09:08h0x5f3759dfHi, I'm writing breadth first search, Is it a good idea to use meta data for the intermittent data like "color of node", parent of node, distance from root?
09:12stirfoodoesn't the zip code use meta data in a similar fashion?
10:02beffbernardI have a question regarding slime. Is there a way to have C-x C-e direct it's output to the slime buffer instead of the minibuffer?
10:02justicefriesmorning.
10:03beffbernardMorning
10:05dgrnbrgSo, I have a clojure program and a python program that I want to chill together, and make RPC calls from the python program to the clojure program. What's the easiest way to do this? I'm thinking of printing clojure data structures, and writing a simple server w/ java io libs in clojure
10:10wmealingwhy not json ?
10:10dgrnbrgThat'd work too
10:10dgrnbrgdid server-socket die in clojure 1.3?
10:13stirfoobeffbernard: C-u C-x C-e will output in the active buffer. Don't know if that will help.
10:19stirfoo,(namespace 'fu///b:a:r///baaz)
10:19clojurebot"fu///b:a:r//"
10:20stirfootrying to put into words what constitutes a valid lisp symbol is nigh on impossible
10:21llasramstirfoo: There's been some discussion on the mailing list about this. I think the consensus is that "what the functions happen to accept" is *not* the definition of what is valid
10:22stirfoosure as hell isn't as easy as [_a-zA-Z][a-zA-Z0-9_] ;)
10:23stirfoollasram: I've been looking at the reader, line by line. It's a process of subtraction. If nothing else matches it *may* be a symbol. But then it has three more functions that try to determine if it's a symbol.
10:24llasramI think it's hard because rhickey is being intentionally liberal to allow for future extensions
10:25llasramhttp://clojure.org/reader has a fairly tight definition of what constitutes a valid symbol
10:25TimMcs/liberal/conservative/ depending on how you look at it
10:25stirfoocommon lisp is far more liberal
10:25TimMcBe liberal in what you accept, conservative in what you produce.
10:25llasrambut includes the text "other characters will be allowed eventually, but not all macro characters have been determined"
10:25llasramTimMc: right
10:25TimMcWhat's-his'face's Law
10:26TimMcSo it depends on whether you're writing a syntax consumer (reader, highlighter) or producer (macros, regular code...)
10:27TimMcstirfoo: The synbol '/ is amusing. It's special-cased.
10:28llasramI was just noticing that -- need ([/]|...) to match symbols :-)
10:28TimMc&`/
10:28lazybot⇒ clojure.core//
10:34stirfooTimMc: yes, it's pulled out early because it would complicate matchSymbol()
10:35stirfooIt's really interesting code to read. Rich has a mind that operates on a level that I just can't comprehend.
10:39dgrnbrgHow do I get cheshire? It doesn't have a prefix, and [cheshire "3.0.0"] doesn't seem to work for me
10:40dgrnbrgah, I can't speel
10:40TimMcstirfoo: You might think that about me, too -- if I failed to document my code. :-P
10:41stirfooTimMc: haha, yes, the docs are a bit, ummm sparse, in the clojure source.
10:42stirfooEvery now and then he'll toss a bone
10:56stirfoo% is another weird one. %foo is perfectly fine as a symbol as long as it's not found within an anonymous function. But fo%o is actually parsed as two symbols because % is a terminating macro character.
10:57stirfoosuch is the land of lisp ;)
11:18Lajlastirfoo, more like such is the land of clojure which is pretty ambiguous of what it conisders symbols
11:19Lajla,(symbol? (symbol "can I haz spaces?"))
11:19clojurebotLajla: Excuse me?
11:19LajlaOh you again
11:19Lajla$(symbol? (symbol "can I haz spaces?"))
11:19LajlaWhat was the other bot again
11:19LajlaOh well
11:19LajlaYou get the idea
11:23lakeHow can I reference the file (by full path) that clojure is running. My goal is to print the source file when the file is executed.
11:23lakeevaluated, i mean. :p
11:23TimMclake: Just write a quine! :-P
11:23dgrnbrgis there a way to pass lein run a supplemental classpath?
11:23lakeTimMc: ah, yes, good idea!
11:24lakeTimMc: those things are awesome
11:24TimMclake: There's some sort of var you can grab during compilation that has path info.
11:25lakeTimMc: thanks, looking for it
11:30dgrnbrgtechnomancy: is there a way to add a colon-separated list of hundreds of jars to lein from the command line?
11:30dgrnbrg(I have a script that dynamically generates this list)
11:30lakeTimMc: yes, so *file* is what I wanted.
11:36rvidWhat version of leiningen should I be using? I think homebrew gives me 1.6.2. Is that the latest?
11:38TimMcrvid: Latest is 1.7.something
11:38TimMcand 2.0 is coming out soonish
11:39rvidahh. alright
11:41uvtcHi #clojure. I've been working on a brief beginner's guide to Clojure lately, and have a first draft up: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/
11:42uvtcPlease let me know what you think. Either here, or via email (address is on that front page). Corrections would be most appreciated. The last chapter (chp 11, on creating libs) still probably needs some details, but I'm stuck at the moment as I'm unable to upload to Clojars.
11:42TimMcOh hey, now I get your IRC nick.
11:43uvtcTimMc, :)
11:44gfredericksI just upgraded to the newest version of lein-ring (0.6.0) and now lein-ring crashes saying it can't find leiningen/core/eval.clj
11:44gfredericks`lein ring server-headless` crashes rather
11:45TimMcgfredericks: What lein version?
11:45gfredericks0.7
11:45gfrederickser
11:45gfrederickswhatever is latest
11:45TimMc1.7
11:45TimMcpoint something
11:45gfrederickspoint something
11:46gfredericksmaybe I need ring instead of ring-core
11:46gfredericksnope same thing
11:47gfredericksI upgraded lein-ring because it had an incompatibility with my never version of hiccup
11:47gfrederickswhy it needs hiccup I'm not sure
11:49tmciveruvtc: I haven't actually read any of your guide but one quick and minor criticism: consider narrowing the content area; maybe it's just me but I find it difficult to read text that spans the entire browser window.
11:51TimMcuvtc: "3. Installing Clojure" should really start with "You don't!" or something.
11:54uvtctmciver, Thanks. I think that a narrower format is definitely the way to go for shorter articles. However, I think the full-width format works ok for longer docs where users will resize their window how they like it.
11:55si14hi, #clojure. Can you tell me how to improve this function? https://gist.github.com/d387a930cf1cba1f023a :)
11:57gfredericks(map #(update-in % [:y] (partial - height)) tiles) is...a different way to do it
11:57gfredericksI don't know if that'd be an improvement or not :/
12:02uvtcTimMc, re. installing: Though I think that would be humorous, coming from Perl/Python/Ruby, I think that new users are scratching their heads at first re. installation, so I wanted to be plain vanilla clear here.
12:08uvtcTimMc, (but added that it's taken care of automatically)
12:09TimMcSince it is a common sticking point for newcomers, I think it would be good to shake them out of that notion as quickly as possible.
12:14TimMcuvtc: Have you played with lein-oneoff?
12:14uvtcTimMc, no.
12:15uvtcTimMc, (reading about it...)
12:19uvtcAre all lein plugins installed thusly: `lein plugin install plugin-name plugin-version`?
12:21TimMcI believe so.
12:21tmciveruvtc: yes, with plugin-version in quotes, I believe.
12:21TimMcDunno about in lein 2
12:21uvtcTimMc, tmciver, thanks.
12:21uvtcTimMc, lein-oneoff looks simpler than my advice of putting the clojure jar somewhere and creating that tiny script.
12:22TimMcyep
12:22uvtcUsing it would also allow me to put your quip about not installing Clojure on the installing page. Will try it out! Thanks!
12:22TimMc:-)
12:28uvtcOne thing that gets me about lein ... when it can't find a jar in the first place it looks (or finds that it's missing and needed), it says "Unable to find resource ...". I keep thinking there's a problem, but there isn't.
12:29raekuvtc: as other probably has said, the "fiddle with the clojure jar manually" approach is _not_ the way most peoplr use clojure
12:29TimMcThat's Maven, really.
12:29raekit might be relevant to some people with more advanced setups
12:30gfredericksdoes anybody have experience with tmux conflicting with emacs bindings, specifically e.g. C-right from paredit?
12:30raekbut does not belong in a beginner's guide at all, IMHO
12:30uvtcraek, thanks.
12:30raeka beginner's guide should show the "least friction" way of doing things
12:31raekwhich is: use Leinginen. seriously.
12:31technomancyuvtc: yeah, leiningen doesn't have much control over the output of the maven libraries for dependency fetching
12:31raek*Leiningen
12:31technomancygfredericks: I have the slurp stuff rebound
12:31TimMcuvtc: "Emacs shares a number of keyboard combinations with the Bash shell, which makes it easy to move back and forth between the two." <-- Did you know you can do `shopt -o vi`?
12:32technomancygfredericks: I recommend M-)
12:32gfrederickstechnomancy: is there a simple characterization of which bindings conflict with tmux that you know of?
12:32uvtcTimMc, Do not try to entrance me with your sorcerers vimly ways.
12:32uvtcTimMc, ;)
12:32TimMcOh, I'm more of a notepadder. :-P
12:32technomancygfredericks: anything fancy on a control character is unlikely to get conveyed correctly, and from a terminal's perspective, arrow keys are just control sequences
12:32uvtcTimMc, No, I didn't know that.
12:33gfrederickstechnomancy: okay, thanks
12:33gfrederickstechnomancy: do you know why lein-ring would crash trying to load leiningen.eval?
12:33raekseeing "~/opt" makes me think of all the trouble the riddell.us tutorials have caused to clojure beginners...
12:33lazybotThe riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.beginners...
12:34technomancygfredericks: leiningen.core.eval is new in lein2
12:34gfrederickstechnomancy: so it has an undocumented dependency on lein2?
12:35technomancysounds like it =\
12:35technomancyweave jester!
12:35technomancyis this in a release or a snapshot?
12:35gfredericksrelease; 0.6.0
12:36gfredericksI haven't tried reproducing on a bare project yet
12:37TimMcThat sounds uncomfortable.
12:37gfredericksindeed
12:37justicefriestechnomancy, question about your emacs-starterkit-js. is it not supposed to do auto-indent?
12:38technomancyjusticefries: that part of the starter kit isn't really maintained
12:38justicefriesooh okay.
12:39justicefriesgood to know.
12:39justicefriesI will go find a javascript mode!
12:40technomancygfredericks: I'll fix lein-ring for backwards-compatibility
12:40uvtcraek: Will get rid of most (or all) of the references to ~/opt.
12:41technomancyI actually already have a patch for it; I just wasn't quite ready to PR it
12:43gfrederickstechnomancy: w00h00!
12:44technomancygfredericks: you can do "lein install" from my fork in the mean time
12:44technomancythough actually you should just try lein2 =P
12:45gfrederickstechnomancy: I installed lein2; I guess to get it to work I have to upgrade the project.clj
12:45technomancygood thing lein-precate does that for you automatically =D
12:46Bronsawhy is (let [] (deftype A []) (A.)) failing=
12:46Bronsa?
12:47gfredericksI think hiccup hates me
12:47TimMcBronsa: Does it work if you use do instead of let?
12:47Bronsayeah
12:47dnolen_anybody played around with lein-cljsbuild's REPL support?
12:47Bronsais it a bug or an expected behaviour?
12:48TimMcBronsa: I'd say the latter.
12:48technomancyclojurebot: gilardi scenario?
12:48clojurebotHuh?
12:49Bronsafound your blog post
12:49gfrederickshow can I view a mvn dependency tree for my dev deps?
12:49gfredericksoh nevermind
12:49technomancyclojurebot: The Gilardi Scenario is where you can't compile a form because the form contains definitions needed to compile itself: http://technomancy.us/143
12:49clojurebotYou don't have to tell me twice.
12:50TimMcgfredericks: lein pom && mvn dependency:tree
12:50gfredericksTimMc: the pom has dev-deps?
12:50TimMcOh! Hm.
12:50TimMcIt should, actually.
12:52gfredericksI forgot there were jars hiding in .lein-plugins
12:54gfredericksokay so my `lein2 ring server-headless` is failing because someone is trying to use old hiccup (the page-helpers ns in particular)
12:55gfrederickshowever grepping lib for 'page_helpers' and 'page-helpers' gives nothing
12:56ibdknoxgfredericks: is it a noir app?
12:56gfredericksno; compojure I think
12:56gfredericksthe app itself is actually part of a dep
12:56ibdknoxoh
12:57ibdknoxdunno then
12:57uvtcTimMc, raek, Ok, got rid of ~/opt.
12:58TimMcyay
12:58uvtcTimMc, updated install doc too.
12:59zamateriangfredericks, TimMc dev-deps is scoped as test in lein 1.x (disclaimer my only patch to lein :)
13:02TimMcuvtc: ~/elisp, is that like ~/.emacs.d?
13:03uvtcTimMc, Yes. I've always used ~/elisp. I guess some people use ~/.emacs.d? Seems to make more sense to have the directory visible...
13:04gtrak`visible? why? you know it's there
13:04dnolen_anyone had trouble with lein-cljsbuild browser repl features?
13:05ibdknoxdnolen_: are you doing lein trampoline cljsbuild ...
13:06ibdknox?
13:06dnolen_ibdknox: yeah
13:06ibdknoxI've only ever tried the listen one
13:06ibdknoxbut that seemed to work
13:06dnolen_ibdknox: yeah listen isn't working for me, if I start the browser repl by hand it works ok
13:07jonasenanyone familiar with custom dispatch functions in clojure.pprint?
13:07dnolen_ibdknox: I did install cljsbuild 0.1.2 from source ...
13:08ibdknoxdnolen_: I wouldn't think that would make a difference, though if the cljs compiler got AOT'd when you installed, all sorts of terrible things would happen
13:09dnolen_ibdknox: hmm, would lien install have triggered AOT?
13:09ibdknoxdnolen_: not sure, lein run does
13:09uvtcgtrak, I'll use whatever's more customary in the Emacs world. Which is more common? ~/elisp or ~/.emacs.d?
13:10joegallothe latter, imho
13:10dnolen_ibdknox: did emezeske put cljsbuild up somewhere?
13:10ibdknoxit's on clojars
13:12gfredericksso `lein-deps` dumps an old hiccup into my lib/dev, and I'm not sure how to figure out how it got there
13:13gfredericksthe dependency:tree ignores the dev deps I think
13:15TimMcDoes the pom have the dev-deps?
13:15gfredericksI've tracked it down to the lein-ring plugin
13:16rvidIs lein-swank and swank-clojure the same thing?
13:16technomancyrvid: lein-swank runs in leiningen; swank-clojure runs in your project
13:16technomancytwo parts of the same project
13:16gfredericksTimMc: yeah the pom.xml has them, but based on the docs it seems that dependency:tree is broken for specifying alternate scopes
13:17gfredericksso I'm hopping around github following the dependencies around
13:17rvidtechnomancy: i'm running into this problem https://github.com/technomancy/swank-clojure/issues/104
13:17dnolen_ibdknox: huh, got it from clojars, same thing, REPL starts but it doesn't seem to be connected to browser
13:18rvidI have [lein-swank "1.4.3"] in my .lein/profiles.clj. and i'm using leiningen 2
13:18rvidam i missing something?
13:18gfredericksah yes that is it.
13:18technomancyrvid: that may not have made it into a release yet
13:18ibdknoxdnolen_: weird. I'm not sure, it worked for me so long as I had the (repl/start ..) thing in my cljs
13:18rvidahh. alright. thanks
13:19gfredericksthe culprit is lein-ring depending on ring-devel 1.0.2
13:19dnolen_ibdknox: you mean repl/connect ?
13:19ibdknoxdnolen_: ah, yeah that
13:20ibdknoxdnolen_: trying it now
13:22ibdknoxdnolen_: worked for me on os x
13:22ibdknoxlein 1.7
13:22uvtcgtrak, joegallo: changed ~/elisp to ~/.emacs.d. Thanks.
13:22dnolen_ibdknox: k, perhaps an issue with cljsbuild + lein2
13:22ibdknoxah, prehaps
13:23Iceland_jackHow would you convert a string encoded in hex to ascii?
13:23Iceland_jacksimilar to Python's <str>.decode('hex')
13:31dnolen_ibdknox: thx for trying that, definitely a lein-cljsbuild + lein2 issue, work fines with lein 1.7
13:32Iceland_jack(map char (map (fn [[a b]] (Integer/parseInt (str a b) 16)) (partition 2 cipher))) works fine I suppose
13:34uvtcOh shoot. I was hoping to get more feedback on the Brief Beginner's Guide before it was linked to from r/clojure or HN, but it seems that's already happened.
13:35ibdknoxuvtc: link?
13:35uvtchttp://news.ycombinator.com/item?id=3694003
13:35uvtchttp://www.reddit.com/r/clojure
13:38TimMcuvtc: Better comment to let people know it's a WIP
13:39TimMc(patches accepted, etc.)
13:39TimMcs/accepted/welcome/, that's the phrase
13:40ibdknoxuvtc: I think the one thing you could do that shouldn't be too hard and would provide instant benefit is syntax highlighting
13:41dnolen_ibdknox: so when you work with lein-cljsbuild, are cljs files inside jars picked up?
13:41ibdknoxdnolen_: yes
13:41uvtcibdknox, Argh! That's right --- I'd made a note for myself last night to update my version of Pandoc that syntax highlights Clojure ... will get on that.
13:41uvtcAlso, anyone have a graphic I could use on the main front page? It needs something.
13:47TimMcuvtc: Big, fat Clojure symbol.
13:47uvtcTimMc, Can I just swipe it like that?
13:47TimMcLike, 2000px tall.
13:47TimMcNO idea. I think other people have?
13:48ibdknoxno you can't
13:48technomancyit's trademarked
13:48ibdknoxnot without permission
13:48uvtcWell, if there's any graphic designers out there, you'd better save me from myself before I break out the colored pencils and my digital camera. :)
13:56TimMcCopyrighted *and* trademarked, I'm sure.
13:58TimMcand maybe a patent for "Mechanism for showing both a yin-yang and a lambda at the same time"
13:59uvtcTimMc, Right. Won't try to copy it.
14:00uvtcDoes Clojure have any unofficial logos? Hm.
14:00TimMcMaybe if you can combine some other functional programming and philosophical/religious symbology?
14:01amalloyit almost seems like "a photo of rich hickey" answers both of the last two questions here
14:01TimMcsnrk
14:01uvtchahahaha.
14:09bitrotuvtc: Why not a glider? (http://www.catb.org/hacker-emblem/). It also looks like a form from a Go board.
14:12TimMc+1
14:13uvtcbitrot, I like to think of the beginner's guide as a sort of "here's your helmet, off you go!" sort of document...
14:17TimMcAs long as no one thinks of Google's Go language.
14:17gf3hey ibdknox, did you see my issue/question on fetch re: security?
14:18rvidhey, anybody know how i can force leiningen to use swank-clojure 1.5.0-SNAPSHOT?
14:19ibdknoxgf3: remotes are just specialized routes, basically, so you'd use what you do for web pages in general :)
14:19gf3ibdknox: so let's say I'd like to handle it generally, I'd use a pre-route with the specialised /pinotwhatever route?
14:20rvidI have it under dev-dependencies but it downloads 1.4.0 every time I launch swank :(
14:20ibdknoxgf3: yeah
14:20ibdknoxactually
14:20ibdknoxthat won't currently work
14:20ibdknoxhm
14:21zamaterianIn clojure 1.4 is there any changes to the ns macro regarding :use vs :require ?
14:21ibdknoxgf3: using a pre-route would require a change to fetch
14:21ibdknoxprobably a good one
14:21amalloyrequire now has a refer option in 1.4, i think
14:21gf3ibdknox: mmm
14:21ibdknoxsuch that remotes are no longer middleware, but just a normal route themselves
14:22gf3ibdknox: that sounds like a good change
14:22gf3ibdknox: also, I'd love to chat with you sometime about noir-cljs
14:22ibdknoxgf3: what about it? :)
14:23gf3ibdknox: just about some strategies, for example requiring/watching an entire directory causes some dependency resolution issues
14:24ibdknoxhm, I haven't run into anything
14:25gf3ibdknox: one solution might be to do as lein does, and define a :main
14:25ibdknoxwait, what?
14:26ibdknoxnoir-cljs is a lib, defining a main would suggest you're using it outside of a project?
14:27gf3ibdknox: no i mean as a config option to noir-cljs
14:27gf3ibdknox: it seems that closure compiler doesn't re-arrange things when you just sic it on a directory, so sometimes your (:require)s are out of order
14:28ibdknoxgf3: woah, do you have a repro case?
14:28ibdknoxgf3: I've certainly never seen that and I've been doing basically everything you can in terms of dependencies in CLJS
14:28gf3ibdknox: sure
14:29gf3ibdknox: btw, this is what I was proposing → http://cloud.gf3.ca/EwOr
14:29ibdknoxand that would tell CLJS what exactly?
14:29ibdknoxthat'd have to make its way into the compiler, wouldn't it?
14:32gf3ibdknox: well it would compile that file, instead of all of src-dir
14:32gf3ibdknox: these are the kinds of errors: http://cloud.gf3.ca/EwJD
14:33ibdknoxare you absolutely certain you have everything right? Those errors usually indicate something got typo'd in an ns decl
14:33ibdknoxin this case, scm-js.common
14:34gf3ibdknox: 100%, check this out
14:34gf3ibdknox: so I comment out my requires to [scm-js.common :as common]
14:34gf3ibdknox: and this is the very end of my bootstrap.js → http://cloud.gf3.ca/Ew3u
14:35ibdknoxinteresting
14:35ibdknoxif you put up something I can run that does this, I'll gladly take a look
14:36gf3ibdknox: sure thing, I'll see if I can make a reduced test case
14:36gf3ibdknox: but in the meantime, what would you recommend to secure my remotes?
14:37ibdknoxyou'd have to do the check inline and just return nil. You could wrap that in a macro easily
14:37ibdknoxI'll fix fetch tonight
14:38ibdknoxto enable the pre-route
14:38gf3ibdknox: wow thanks, no rush though, just wanted your thoughts
14:39ibdknoxno worries, it's an easy fix and the right thing to do
14:39ibdknoxoriginally I didn't do that so that others outside of Noir could use it
14:39ibdknoxbut it's probably not worth that
14:44technomancyaperiodic: ping
14:47uvtctechnomancy, thanks for the help last night. I noticed that aperiodic filed a bug at ato/clojars-web, and since I also wasn't able to connect, I commented on the bug.
14:48technomancyuvtc: I think I may have found the bug
14:49uvtctechnomancy, yay! If you've got anything you'd like me to try, please fire away.
14:50technomancyuvtc: can you try again?
14:50dnolen_ibdknox: k got everything working. lein-cljsbuild really solves a lot of problems.
14:51uvtctechnomancy, Seems to have worked!
14:51uvtctechnomancy, Thank you! What was the bug?
14:52technomancycool
14:52technomancythere were two authorized_keys files in the data dir; clojars was configured to write updates to the wrong one
14:52ibdknoxdnolen_: yeah :) I started building a noir template the other day for cljs projects. lein new cljstemplate cool & lein run = working clojurescript project
14:52technomancyI'm not sure why they are both there
14:52ibdknoxusing noir-cljs it handles all the watching and such automatically
14:53technomancymaybe _ato can comment on that when he comes online later
14:53dnolen_ibdknox: what is cljstemplate?
14:53ibdknoxdnolen_: it'll be a lein-newnew (or lein 2 new) project template later tonight :)
14:53ibdknoxdnolen_: basically the same as lein noir new some-proj
14:54uvtctechnomancy, As I previously mentioned, yesterday I was trying to give clojars my key. It failed to accept the key multiple times, but then later in the day it mysteriously accepted my key.
14:54ibdknoxdnolen_: except it includes all the cljs trimmings
14:54ibdknoxno one will be able to complain about not having a starting point for a new project anymore ;)
14:55dnolen_ibdknox: excellent!
14:55uvtcibdknox, wheee! :)
14:55ibdknoxdnolen_: as a side note, I started on a neat little thing yesterday, extrapolating from bret victor's ideas on code and came up with a visual way to write programs
14:56dnolen_ibdknox: another screencast forthcoming?
14:56ibdknoxdnolen_: with the idea that code is simply the serialization mechanism for programs
14:56ibdknoxdnolen_: hopefully
14:58gtrak`on a related note, I heard labview just recently got refs, ibdknox ever use labview?
15:00gfredericksis it plausible that the latest lein-ring fails when you specify a port?
15:00gfredericks(in particular fails for never converting the string-arg to an int)
15:01gtrak`kind of a messy gui programming language: http://drivex.com/software/1280/labview.jpg
15:07y3diis clojure generally faster than python and ruby
15:07gtrak`yes
15:08gtrak`one advantage is you can easily work at any point up and down the abstraction stack, which is much harder in python imo, so it's as fast as java if you want it to be
15:09y3diis it easier to write fast code (on the first attempt) in clojure or java?
15:09y3dithis is obviously probably subjective
15:10TimMcDepends what you are writing.
15:10gtrak`i mean... if you're using immutable data structures, I'd argue your programs are doing different things, I think you/others have got it framed wrong
15:11gtrak`clojure itself doesn't have a lot of dynamicity in its runtime, there isn't any overhead like that
15:11y3dihmmm, you're probably right. I've only grasped the tip of the clojure language
15:11y3diwhat do you mean dynamicity?
15:11pjstadig,*clojure-version*
15:11clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}
15:11gfredericksinterim;
15:11pjstadig,(bigdec (inc (bigint Long/MAX_VALUE)))
15:11clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Value out of range for long: 9223372036854775808>
15:12pjstadig:(
15:12gfredericksis that some alternative to SNAPSHOT?
15:12gtrak`y3di, well, I mean, when you write python, you have all this object layer __call__ stuff, but clojure just has normal java function calls, and vars are a slight overhead in the dynamic case, multi-methods counts as a dynamicity, though you only pay for it if you use it
15:12TimMc,(clojure-version)
15:12clojurebot"1.4.0-master-SNAPSHOT"
15:13gfrederickshuh
15:13pjstadigbigdec is broken on 1.3/1.4
15:13pjstadigit doesn't handle clojure.lang.BigInt
15:14hiredman,(bigdec (bigint 1))
15:14gtrak`y3di, I guess I really mean run-time indirection
15:14clojurebot1M
15:14TimMc,(inc (bigint Long/MAX_VALUE))
15:14clojurebot9223372036854775808N
15:14pjstadighiredman: it coerces a Number to long
15:14TimMcew
15:15pjstadigwhich causes the error i just got
15:15teasuppliesInux
15:15pjstadigit handles java.math.BigInteger
15:15pjstadigbut not clojure.lang.BigInt, which is what you get now in 1.4
15:15TimMc&(bigdec (inc (bigint Long/MAX_VALUE)))
15:15lazybotjava.lang.IllegalArgumentException: Value out of range for long: 9223372036854775808
15:15TimMcand 1.3
15:16pjstadigsure
15:16amalloyfile a jira ticket? should be handled by 1.5 :P
15:17gtrak`y3di, a clojure fn-call is just calling an IFn method on an instance of a class generated by the compiler, quite fast
15:23pjstadighttp://dev.clojure.org/jira/browse/CLJ-952
15:23emezeske[5~q
15:23emezeskeoops!
15:26pjstadig,(bigdec (inc (biginteger Long/MAX_VALUE)))
15:26clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Value out of range for long: 9223372036854775808>
15:26pjstadigeh
15:27pjstadig,(bigdec (biginteger (inc (bigint Long/MAX_VALUE))))
15:27clojurebot9223372036854775808M
15:27pjstadignow isn't that much nicer?
15:28yoklovis there any way I can def multiple vars at once using destructuring?
15:28yoklovi'm writing a small data processing script and i currently have something like (def foo (first a-seq)) (def bar (rest a-seq))
15:30joegallojust my immediate thought -- it seems a bit odd that you're doing defs there. is this in a .clj file or hacking at the repl?
15:30yokloveh, mostly at the repl
15:30joegallok
15:31joegalloyou know about let's destructuring, right? you could use that at the call site
15:31joegallothat is, rather than (some-other-thing foo bar) ; where foo and bar come from your defs
15:31joegalloyou could (let [[foo & bar] a-seq] (some-other-thing foo bar))
15:32joegalloso foo and bar only exist inside the let, and you don't have to def them at all
15:32yoklovright, i'm aware
15:32joegallookay, then i have no suggestion
15:33yoklovlol, thats okay, it's certainly bad form to def so many things like this, its largely for convenience so that if i acciedentally cause the repl to start printing out this enormous vector i can halt it and restart without losing what i've done so far
15:33yoklovso two defs is fine, just was curious if i could do something shorter there
15:34TimMcyoklov: repl-y can Ctrl-C without losing the repl
15:34TimMcso I hear
15:34yoklovrepl-y? i've been using lein repl which… sort of stinks
15:35brehautrepl-y is the new lein 2 repl (as well as stand alone), its much better
15:35yoklovhm.
15:35brehauthttp://github.com/trptcolin/reply/
15:46ibdknoxgtrak`: never heard of labview
15:48ibdknoxgtrak`: ah, yeah that seems way messier than what I was thinking
15:50gtrak`we did a lot of work in it for EE stuff, sensors and such, they have really cool DACS and ADCs actually, but the software sucks :-)
16:06ewok-lordhello clojureites
16:07AimHereYou sure it's not clojurists?
16:07ewok-lordPedantic Semantics. I'm in the right place :) anyways I'm writing my first proper clojure prog
16:08uvtcclojurians?
16:08AimHereclodjers
16:08ewok-lordTo automate the creation of little projects because I often find myself making a folder inside my dev folder and making a project folder and adding a file and making it executable and only then writing it
16:09ewok-lordA CLI utility and I'm using this project to learn clojure
16:09ewok-lordAnd become a proficient clojurista
16:10gfredericksclojoids
16:11ewok-lordAlways be clojing (GGR reference)
16:12dan_bafter all, "lemonodor-fame"? lemonodor was last updated ~ 2008
16:13llasramHasn't technomancy effectively forked SLIME at this point?
16:13dnolenllasram: no
16:13TimMcgfredericks: conjurers
16:13dnolenllasram: we're stuck on a version from 2010
16:13llasramdnolen: Ok, fair enough then
16:13gfredericksclojerms
16:14yoklovso, i'm dealing with some dates (in unix time). when i do (Date. 1254089974) i get #<Date Thu Jan 15 07:21:29 EST 1970>. This is wrong, it should be something like #<Date Sun Sep 27 10:19:34 EST 2009>. Am I doing something obviously wrong?
16:14dan_bI wonder if I still have a commit bit for the original
16:14dan_byoklov: multiply by 1000?
16:14dan_byoklov: eitehr java or js counts in milliseconds, I can't remember which
16:14amalloyjava
16:14yoklovyeah that fixed it
16:14yoklovthanks a ton
16:15mdeboard16:10 <ewok-lord> Always be clojing (GGR reference)
16:15mdeboardlol
16:16TimMchhe
16:18uvtcgfredericks, "always be closing" , famous movie scene
16:19technomancyyoklov: java.util.Date is the worst class in the entire JDK
16:19gfredericksoh this must be one of those times when people ten years older than me talk about movies from when I was six.
16:19technomancyarguably the very act of using it counts as "doing something wrong"
16:19uvtcgfredericks, hahahaha
16:20gfredericksthose people always have such high opinions of the movies from that time period
16:20AimHereEither that or low opinions of modern movies
16:20llasramLike /The Artist/? I mean, Best Actor for a one line part?
16:21gfrederickssuch an odd coincidence that as your taste improves everything seems to get worse
16:21technomancygfredericks: alternate explanation: http://www.smbc-comics.com/index.php?db=comics&amp;id=2253#comic
16:21pjstadighttp://www.urbandictionary.com/define.php?term=always%20be%20closing
16:21mdeboardp sure "always be closing" and "coffee's for closers" is one of those lines like "frankly whoever, i don't give a hoot, don't pollute" or "number 5 alive" that stands apart from its movie
16:21gfrederickstechnomancy: yeah I was thinking along those lines :)
16:25yoklovtechnomancy: yeah, that seems about right. theres no alternative though, is there?
16:26technomancyyoklov: if you have to do date calculations you need to use joda-time. clj-time is supposedly a pretty good wrapper for it.
16:27yoklovi see, thanks.
16:29TimMcgfredericks: Glengarry Glen Ross
16:29TimMcif I have the spelling right
16:29TimMc(probably not)
16:29aperiodictechnomancy: both of my keys work now. thanks!
16:30aperiodiclol
16:30aperiodici'm pretty into chording
16:30TimMcrhythm-based keybindings
16:30mdeboardlol
16:31amalloywith ten modifier keys, you only need two character keys
16:31mdeboardleiningen-DDR
16:31TimMcnice
16:32yoklovi'd definitely be happier if i had footpedals for M and C
16:35llasramyoklov: http://www.kinesis-ergo.com/fs-savant-elite.htm
16:35jsabeaudryllasram, Ah you beat me to it!
16:35jsabeaudryDamn!
16:35llasramheh
16:36amalloyi have M/C footpedals, but mostly forget to use them
16:36jsabeaudryllasram, Are you using a kinesis keyboard?
16:36TimMcamalloy: !
16:36llasramjsabeaudry: I am. I've never tried the pedals though. Switched to a standing workspace at about the same time, and seemed like it would be too awkward
16:36technomancyyeah, I wish foot pedals could work with standing desks
16:36TimMcOof, yeah.
16:36llasramamalloy: I guess they aren't all that useful?
16:37amalloyand unless you have piano training (i don't), it's impossible to be as fast as you could with regular modifier keys; the footpedals are really just for if a finger gets tired
16:38llasramMaybe you cloud drill at it? Seems like it wouldn't be any harder than just learning a new keyboard / layout
16:38llasrams,cloud,could,
16:38llasram(not you == amalloy, but just someone inclined to try foot pedals)
16:38yoklovyour foot has to travel further than your finger though
16:39amalloyllasram: the difference is that it's easier to coordinate between two (three) fingers than between fingers and feet
16:39gfredericksI can imagine that due to the much longer nerve-distance between foot and hand that it might be a whole nother matter to coordinate them
16:39llasramFair enough. What we need are toe pedals
16:39emezeskeI think speedwise the biggest problem with footpedals would be the coordination
16:39TimMcI have a standing workstation, but I work barefoot.
16:39technomancytoe pedals
16:39TimMcI could see having a pressure pad for each big toe.
16:39Raynesamalloy: Yeah, your feet are surprisingly detached from your body.
16:39amalloywut. that's news to me. did you cut off my feet?
16:39TimMcEh, it's all about training.
16:39ibdknoxI have a solution for all of this. Just use vim ;) No more modifiers necessary!
16:39yoklovstanding sounds really nice. i sit for way too much of my day
16:39emezeskeibdknox: Problem solved.
16:39TimMcibdknox: Don't mode me in. ;-)
16:40Raynesamalloy: I could.
16:40amalloyNOMODES
16:40TimMc(bro)
16:40ibdknoxlol
16:40Raynesibdknox: Or evil-mode.
16:40mdeboardCannot evaluate symbol "bro" in this context
16:40RaynesModifier keys not always necessary.
16:40TimMcYou could use sticky-keys.
16:40ibdknoxhttp://i.imgur.com/04937.png
16:42llasramMaybe attach electrodes to one's facial muscles
16:43llasramFor input, that is
16:43llasramLeft ear twitch == hyper+super
16:48TimMcEEG-based keyboard.
16:48arohnerw/ emacs package manager, how do I upgrade an installed package?
16:49metajackarohner: I just do it the same way as I install them.
16:49jaenokay, I thought the thing about emacs being an operating system was mostly in jest
16:49jaennot so sure now ; d
16:49arohnerjaen: a significant chunk of the users in this channel are *in* IRC emacs, and send email from emacs
16:50arohnerI would make emacs my web browser if I could
16:50amalloyw3-mode?
16:50TimMcjaen: Package manager, mail client, file manager, window manager...
16:50amalloyor www-mode or whatever it's called
16:50technomancyamalloy: deprecated for like seven years
16:50amalloy:(
16:50TimMcalso you can apparently program in it?
16:50jaenI can't get past all this escape-meta-alt-control-shift stuff to be honest
16:50gfredericksemacs is the ultimate complection
16:51arohneramalloy: I want a modern browser, like webkit
16:51jaenThough say org-mode looks really awesome
16:51technomancyxembed is probably the way forward there
16:51jaenTimMc: wait, window manager? : D
16:51TimMcsure
16:51gfredericks\forall X,Y \in things (emacs complects X and Y)
16:51TimMciling, of course
16:51arohnermetajack: I try to install magit-1.1.1, and it says 1.0.0 is already installed
16:51jaenI thought they'd use screen for that or somesuch ; d
16:51TimMcin the same sense that screen and tmux and window managers :-P
16:52jaenyeah, what I thought ; d
16:52jaenstill, funny
16:52TimMcjaen: It's not much worse than learning the standard keyboard shortcuts for an OS.
16:52arohnertechnomancy: would that allow emacs to control my web browsing keys?
16:53TheStrokerlist
16:53technomancyarohner: I think so
16:56mefesto_workwhen running clojure ring apps is deploying as war files the typical approach or are they usually ran as individual processes with the ring-jetty-adapter?
16:57mefesto_workdeploying to production
16:57technomancydepends on your background
16:57technomancyusually people who are used to war files go on making war files and people comfortable managing server processes keep doing that =)
16:58mefesto_workIMHO, managing them as individual processes seems easier
16:58ibdknoxit's way easier ;)
16:58mefesto_workwe've been using jboss for a long time
16:59mefesto_workbut lately more and more of our internal apps are clojure and i've just been hosting them as individual processes and it's been soo much nicer :)
16:59mefesto_workok, how about running these things directly from leiningen? good/bad why?
16:59ibdknoxlein trampoline run
16:59ibdknoxftw
16:59technomancymefesto_work: in lein 1.x you can set LEIN_NO_DEV=y and use lein trampoline run
16:59mefesto_worki've been using lein uberjar and running the self contained jar so far...
17:00technomancyif you don't set LEIN_NO_DEV then you get dev-deps and dev-resources on the classpath, which is a no no
17:00mefesto_worktechnomancy: you say lein 1.x ... so 2.0 you just setup the profile you want?
17:00aperiodictrampoline quarantines lein's jvm from the server processes's?
17:00technomancyyeah
17:01mefesto_worksomething like lein prod run ?
17:01technomancyaperiodic: it exits leiningen's jvm
17:01technomancymefesto_work: right
17:01aperiodicis that just for safety, or are there performance benefits to that?
17:01mefesto_workvery nice
17:01ibdknoxmefesto_work: fwiw, I just run all my sites with lein and put nginx in front of it
17:01technomancyaperiodic: memory savings mostly
17:01technomancythere aren't really any safety issues
17:01technomancyalso access to stdin
17:01mefesto_workibdknox: precisely what i was wanting to do
17:02hhutchibdknox: for auto deploying to servers (with pallet), wouldn't you rather have a bundled uberjar and not have to depend on lein getting deps ?
17:02technomancyhhutch: it's important to freeze everything you need for your project at build time, yeah
17:02technomancywhether that's an uberjar or tarring up the project along with the corresponding .m2 is up to you
17:02ibdknoxhhutch: it depends on what matters to you
17:03ibdknoxI don't really care if lein gets the deps for me
17:03technomancyclojurebot: repeatability?
17:03clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
17:04hhutchi get nervous about clojars/external maven repos
17:04ibdknoxwell, I also don't change deps enough to encounter issues there
17:04hhutchit's fine when i'm in front of the keyboard, but for automated deployments .. ?
17:05technomancyhhutch: lein2 allows you to set the local repo on a per-profile basis
17:05technomancyso your prod profile can have :local-repo ".m2/repository"
17:05technomancythen you can have "lein with-profile prod tar" just tar up the project dir and you're set
17:06hhutchright, but is there something about jar you don't like that using that method solves?
17:06hhutchs/jar/uberjar
17:06technomancyhhutch: sometimes it can be nice to have the ability to run other tasks from a deployed checkout
17:06technomancybut there's nothing wrong with uberjar; that's probably the most straightforward way to do it
17:07hhutchtechnomancy: well, seeing i already have a pallet interface to lein, you're probably right, it would probably be pretty useful to be able to run plugin commands from the shell
17:08technomancyon the other hand having lein in production means you're more likely to screw around when you really shouldn't =)
17:08hhutch:)
17:08ibdknoxtechnomancy: that's the way to win ;)
17:09ibdknoxhttp://img2.moonbuggy.org/imgstore/fuck-it-ill-do-it-live.jpg
17:09ibdknoxhaha
17:09technomancyas if I have any
17:09ibdknoxin my "younger years" I did it once or twice
17:10ibdknoxit was so nerve wracking I decided it wasn't worth whatever perceived benefits there were
17:10technomancyI was always tempted to push out hotfixes over our AMQP repl
17:11ibdknox"Oh I'll just ssh into prod and modify the config ..."
17:11ibdknoxlol
17:11TimMcPHP, the king of hotfixes.
17:12ibdknoxoh yes, it was PHP
17:13TimMcEdit on the server until it works, occasionally take a backup to local disk.
17:13TimMcThat's how the big companies do it, I am sure.
17:13pastjeanTimMc: i can tell you yes
17:14emezeskeI have a buddy that does PHP on FTP sites. I love his common pattern of "hmm, I need to run a script. I will write in in PHP, upload it as a CGI, and then hit it via HTTP to run it"
17:14mefesto_workibdknox: for your nginx/lein setup; how do you minimize downtime when deploying a new version of an app?
17:14ibdknoxTimMc: I was working on newbalance at the time... so
17:14TimMcemezeske: Been there.
17:14ibdknoxmefesto_work: depends on how you want to do it
17:14technomancyibdknox: how much faster is nginx vs jetty for static files?
17:15emezeskeTimMc: I'm glad that's in the past tense!
17:15TimMcNow I have a local site and a production site, with a Makefile that does deployment. :-)
17:15TimMcI'm comfortable there for personal projects.
17:15ibdknoxtechnomancy: anecdotally, a lot
17:16ibdknoxmefesto_work: I've used two methods, one is crazier than the other
17:16technomancyibdknox: enough that you do it because you found you needed it, or just out of habit?
17:16ibdknoxtechnomancy: jetty is "fast enough" for anything most people are building
17:16ibdknoxso mostly habbit
17:16ibdknoxI also just like reverse proxying so I can run multiple on one box
17:17mefesto_workibdknox: i was thinking of placing a new version on a different set of ports and gracefully reloading nginx and when all traffic is off the old versions, shutting those processes down but that seems teadious :)
17:17bsteuberdid someone already build a clj-data->html formatter?
17:17hiredmanjetty runner!
17:17mefesto_workibdknox: but that's just for simple changes (no db updates)
17:17ibdknoxmefesto_work: that's the easy way and I do that most of the time. I was working on a project called sherpa that was going to do that automagically, but got sidetracked
17:18ibdknoxmefesto_work: the other way to do it is with start and shutdown signals from the servers
17:18ibdknoxI have them talk using unix pipes :)
17:19mefesto_workibdknox: not sure i follow, the new versions are listening for signals for the old version processes?
17:20mefesto_workapp v2 waits to receive a shutdown signal from app v1 process?
17:23ibdknoxyep
17:41sjlis there a standard way to implement a "stand-alone ring app", similar to Django's apps?
17:41sjli.e. install this library and say what URL to use as a base
17:42weavejestersjl: If I'm understanding you right, you pretty much get that for free...
17:42hiredmanI don't think there is a standard way, but I think you would it as a middleware
17:42sjlweavejester: I don't think I'm explaining it well enough
17:42weavejestersjl: Could you explain a little more? Maybe I'm misunderstanding.
17:43sjlweavejester: here's an example: http://metrics-clojure.readthedocs.org/en/latest/ring.html#exposing-metrics-as-json
17:43sjlweavejester: basically I added a ring middleware to my metrics-clojure library that will expose your metrics as JSON at /metrics
17:43ibdknoxso routes as a library?
17:43hiredmanlike, if you were to want to take3rd party ring handler and root it under url X, and that rin handler used the Location: header, it is kind of painful
17:44hiredmantake a 3rd
17:44hiredmanand then that
17:44sjlweavejester: In this case it's just one URL, so I can just parse the URI, see if it equals the URI, and if not pass it through to the orig handler
17:44weavejestersjl: Do you have a handler that the middleware wraps?
17:45sjlweavejester: sure. I guess the thing I'm wondering is how to do routing "right" inside of a middleware
17:45weavejesterIn Compojure, you can just write: (context "/foo" [] your-handler)
17:45sjlshould I just use Compojure to create a "sub-handler" that I can pass the req map to if it matches the base URL?
17:45sjlor Moustache or whatever
17:46weavejestersjl: In Compojure, context will do that for you.
17:46weavejestere.g if you have (defroutes handler (GET "/" [] "Hello World") (route/not-found "Not Found"))
17:47sjlweavejester: yeah, but I'd want the app to be usable with Noir, etc. Basically any ring app, which means it needs to be "invoked" through middleware
17:47weavejesterThen (context "/foo" [] handler) will mean that "/" becomes "/foo"
17:47weavejesterI'm not sure if Noir has a mechanism for doing it.
17:48ibdknoxweavejester: you can drop compojure routes in directly
17:48ibdknox:)
17:48weavejesterI would be inclined to expose it as a handler, and as some middleware.
17:48weavejesteribdknox: But is there an equivalent to the context macro?
17:48ibdknoxyou can just use the context macro in the the thing you give me
17:49ibdknoxit will add it to my call to (defroutes ..)
17:49sjlweavejester: does that context thing strip off the /foo before passing it along?
17:49weavejesteribdknox: Like… (defpage "/foo" [] (context "/foo" blah))
17:49ibdknoxyou use a different thing instead of defpage
17:49weavejestersjl: Yes. It actually keeps the :uri the same, but adds :context and :path-info keys
17:49sjlah, ok
17:50weavejestersjl: Compojure (and Noir) check :path-info first, then :uri
17:50weavejesteribdknox: Ooh, which different thing?
17:50sjlI see
17:50ibdknoxweavejester: it's actually called compojure-route haha
17:50ibdknox(had to look it up)
17:50weavejesteribdknox: Ohhh - hah
17:50ibdknoxhttps://refheap.com/paste/1046
17:50ibdknoxadded for this very purpose :)
17:51weavejesterMaybe ring should have a "wrap-context" in 1.2. So far :context and :path-info are de-facto standards, rather than officially part of Ring.
17:52weavejesterAlthough, I guess they don't need to be part of the Ring SPEC
17:53weavejesterAs :cookies and :session aren't part of the SPEC either, but just added by middleware
17:53ibdknoxit would be nice to have a standard though
17:53weavejesterWell, the SPEC is just for the basic HTTP request that comes out of the adapter, or whatever.
17:54ibdknoxyea
17:54ibdknoxh
17:54ibdknoxI guess I was more agreeing with your original statement, that having a wrap-context would be nice :)
17:54weavejesterThere's currently a private wrap-context in Compojure.
17:55weavejesterAdding wrap-context to Ring 1.2 would make Compojure even smaller.
17:55ibdknoxsoon it'll disappear :p
17:55ibdknoxand then there will just be ring haha
17:55ibdknoxthe inverse of how things started
17:55ibdknoxeverything was compojure before, right?
17:55weavejesteribdknox: Haha
17:56ibdknoxit's like an hour glass ;)
17:56weavejesteribdknox: Yeah. Compojure started out without any abstraction
17:56weavejesteribdknox: Then Mark came up with the Ring SPEC
17:56weavejesteribdknox: I couldn't see the point at first, until I tried it and discovered how much better it worked.
17:57ibdknoxhaha :)
17:57ibdknoxweavejester: it's the little things
17:58weavejesterRing is by far the best web abstraction layer I know of
17:58weavejesterBut I'm a little biased ;)
17:58ibdknoxagreed
17:58ibdknoxit's so damn cool to be able to say, I want NIO now
17:58ibdknoxlet me just run netty
17:58ibdknoxdone
17:58ibdknoxI can't think of many other platforms that make a webapp so damn portable
17:59jcrossley3ibdknox: wasn't ring inspired by rack?
18:00emezeskejcrossley3: which in turn was inspired by WSGI :)
18:00weavejesterRing is inspired a lot by Rack
18:00ibdknoxdefinitely
18:00weavejesterIt's kinda weird that Rack seems almost functional, rather than OOP.
18:00weavejesterAs the Rack apps are effectively Procs.
18:01sjlweavejester: ibdknox: does something like this look like roughly what I'd need? http://cljbin.com/paste/4f5e7202e4b004260b29166c
18:01jcrossley3ibdknox: so by "many other platforms" you meant "more than 2"? ;)
18:01ibdknoxjcrossley3: I didn't think there was a good NIO for rack?
18:02ibdknoxsjl: looks like it
18:02weavejestercontext takes a binding vector/map
18:02weavejesterThe idea being that contexts can have parameters
18:03weavejestere.g. (context "/user/:id" [id] …)
18:03sjlibdknox: hmm... how would I avoid making the user import from three different places without coupling the lib to Noir?
18:03jcrossley3ibdknox: here's one: http://kevwil.github.com/aspen/
18:04ibdknoxjcrossley3: pretty new :p
18:04ibdknoxjcrossley3: my point still stands though
18:04ibdknoxthere's far more than just ruby in this world
18:05ibdknoxand most platforms haven't enabled that :)
18:05jcrossley3ibdknox: understood
18:05ibdknoxhaha trying to do that on .net?
18:06ibdknoxeither way though, it's just cool :D
18:06weavejestersjl: Why would you need to couple the lib to Noir?
18:06sjlweavejester: so I could deal with the compojure-route call in my own app
18:06sjlwithout making them import it
18:06arohnerdid swank clojure recently add support for clearing the NS when doing C-c C-k, or am I imagining things?
18:06ibdknoxsjl: I don't think it's so bad to include compojure-route
18:06ibdknoxsjl: you can hide the context call
18:06technomancyarohner: I don't think so
18:07arohnertechnomancy: would you like a patch that does that?
18:07weavejestersjl: Sorry, I still don't understand why...
18:07technomancyarohner: if it did it on C-c C-l that would be cool
18:07technomancyC-c C-l already forces a reload of all namespaces the current one requires
18:08sjlweavejester: hang on, let me make another example
18:08arohnertechnomancy: is that the only difference between C-c C-k and C-c C-l ?
18:08weavejestersjl: If you *just* expose the route/handler, then people using Noir or Compojure can use it anyway they choose.
18:08technomancyarohner: it's the only difference I know of
18:08weavejestersjl: If you want some middleware to make it a little easier, you can, but the handler on its own is sufficient.
18:08technomancyoh, C-c C-l prompts for a filename
18:09ibdknoxweavejester: I think he just wanted to limit the number of things a person has to include in the noir case
18:09ibdknoxweavejester: they'll need to use compojure-route and his thing and context
18:09ibdknoxweavejester: he could hide the context call easy enough, bringing it down to two
18:09weavejesteribdknox: Ohh
18:10weavejesterI'd be tempted to make a metrics-clojure/noir library for that...
18:10ibdknoxI wouldn't even worry about it, adding that extra use doesn't seem bad at all :)
18:11weavejesteribdknox: I was thinking that maybe a user of some random framework wouldn't want Noir arbitrarily added to the classpath :)
18:12sjlibdknox: weavejester: this version should work for Ring in general, even with Noir/Compojure, right? http://cljbin.com/paste/4f5e7486e4b004260b29166d
18:12weavejesteribdknox: It seems a little off for a generic Ring library to depend on Noir directly.
18:12sjls/with/without/
18:12ibdknoxweavejester: oh no no, not in the lib, just on the noir user's side
18:12weavejesteribdknox: Ohhhh
18:12ibdknoxweavejester: I, as chris, use (compojure-route ..) and we're good to go
18:12weavejesteribdknox: Oh, that's completely fine!
18:13ibdknoxyeah
18:13ibdknoxit's easy all around
18:13weavejestersjl: If you're using Compojure already, you can do something like...
18:13sjlyeah, I don't want to make my users import from three kind-of-related libraries to use the app
18:15sjl(that paste would require compojure be on the classpath, but the end users don't need to care about compojure if they're using something else)
18:15sjlthe more I think about this the more I think that middleware is the only way to go, because it's the only extension point you really have in generic ring.
18:15sjlright?
18:16weavejestersjl: http://cljbin.com/paste/4f5e7583e4b004260b29166e
18:16weavejestersjl: Handlers are also generic Ring
18:16weavejesterI also wouldn't wrap around handler/site prematurely. Frameworks like Noir already do that.
18:17sjlah, so (routes) takes a generic ring handler as a "fallback" at the end?
18:17weavejestersjl: No, no. *All* Compojure routes are generic ring handlers.
18:18weavejestersjl: The only difference is that routes can optionally return nil, which means "go onto the next route"
18:18sjlso "route" is just a synonym for "handler"
18:19weavejestersjl: A route is a handler that can return nil.
18:19weavejestersjl: So all handlers are routes, but not all routes are handlers (technically)
18:19weavejestersjl: As Ring will throw an error if a handler returns nil.
18:20sjlok, I think I mostly understand, at least enough for what I need
18:20sjlthanks
18:20zzachIs there an equivalent for the Common Lisp function position (index of a list element) in Clojure? In CL: (position 7 '(5 6 7 8)) -> 2
18:21hiredman:(
18:25jjidozzach: don't remember right now, try indexOf. did you search the doc?
18:27jsabeaudryzzach, Are you working on improving hyperpolyglot?
18:29jsabeaudryzzach, (.indexOf (into [] '(5 6 7 8)) 7) is what I can come up with
18:29hiredmanjsabeaudry: :(
18:29jsabeaudry&(.indexOf (into [] '(5 6 7 8)) 7)
18:29lazybot⇒ 2
18:29zzachjjido, jsabeaudry: thanks, http://stackoverflow.com/questions/4830900/how-do-i-find-the-index-of-an-item-in-a-vector also seems to contain several solutions.
18:29TimMcThat's funny, I don't think I've ever needed to do that.
18:29hiredmana list is a collection and supports indexOf just as
18:29jsabeaudryhiredman, oh whoops
18:30hiredmanbut just don't do linear time operations like that
18:30jsabeaudryhiredman, We should add that to hyperpolyglot
18:31jsabeaudryhttp://hyperpolyglot.org/lisp
18:31technomancythat list is... really misleading
18:32technomancythere's so much stuff there that's just plain wrong
18:32hiredmanyep
18:34ibdknoxwow, yeah that list is terrible
18:34hiredmanthe conflation of property lists and metadata on symbols is just horrible
18:35ibdknoxeven simple things are wrong lol like .length instead of count
18:35hiredmanmaybe its a really old list?
18:35ibdknoxit says clojure 1.2
18:36TimMclol @ atom
18:36hiredmanusing String/format instead of format
18:37TimMcThis comparison page is overall kind of neat, but there should be a lot fewer forced comparisons.
18:37sjlweavejester: hrm, I tried something like your paste and get a traceback on all URLs: http://pastebin.com/btU6XPbN
18:40weavejestersjl: Is base-uri nil?
18:40sjlweavejester: nope, println confirms too
18:41weavejestersjl: Odd...
18:42weavejestersjl: Let me get back to you on that one. I don't see anything obviously wrong.
18:42ibdknoxif it turns out to be my fault
18:42ibdknoxjust let me know
18:42sjlibdknox: the only noir-specific thing is add-middleware... that shouldn't cause a problem
18:43ibdknoxah, probably not then
18:43jsabeaudryTimMc, I found it really useful coming from a background of common lisp
18:43weavejesterIt might be that context doesn't work with symbols or something.
18:44sjlweavejester: yeah, just tried that, that's the problem
18:44sjlreplacing base-uri with a string literal works
18:46sjlweavejester: so I need to define the context URL at compile time? :\
18:46weavejestersjl: That sounds like a bug. Put an issue on the Compojure repo and I'll try and fix it.
18:47jodarough
18:49sjlweavejester: thanks, done
19:36blendie(*)
19:37blendie!(*)
19:37blendieAny clojure bot here? :o)
19:37qbg&(*)
19:37lazybot⇒ 1
19:38blendie&(+ *1)
19:38lazybotjava.lang.ClassCastException: Cannot cast clojure.lang.Var$Unbound to java.lang.Number
19:38hiredman,(*)
19:38clojurebot1
19:39blendie&(+ 1 2)
19:39lazybot⇒ 3
19:43tolstoyUsing lein 2, I have src/leiningen/dist.clj as a nice custom task. Doesn't work. Has something changed to discourage project-only plugins?
19:45tolstoyAdding it to the :plugins doesn't seem an option. It's not deployed anywhere.
19:47sorenmacbethwhat's the recommended way to import Java classes programmically? i.e. I have some class that stores other classes I want to import (Thrift)
19:48sorenmacbethjust use (import)
19:48sorenmacbeth?
19:49tolstoysorenmacbeth: I've been able to import interactively, if that helps.
19:49tolstoylein repl
19:50tmciverHi Soren. Yup, IIRC
19:50tolstoy(import '[java.util Date])
19:50sorenmacbethyeah, I can do that fine. Specifically, I'm trying to walk the metadata of a Thrift object and import those classes
19:51amalloywhy would you import them?
19:52tolstoyIs there a mailing list for leiningen?
19:52sorenmacbethamalloy: I'm trying to write some macros to pull apart the objects
19:52amalloy$google leiningen google group
19:52lazybot[leiningen | Google Groups] http://groups.google.com/group/leiningen
19:53hiredmansorenmacbeth: why are you doing thrift stuff in a macro?
19:54sorenmacbethhiredman: I want to programmatically create a bunch of functions to access the objects and fields from my schema
19:55amalloyyou don't need to import anything to do that
19:55sorenmacbethso if I update the schema, functions to access those new objects will be created automatically
19:55sorenmacbethamalloy: yes, I suppose not. I could just us the fully qualified namespace
19:55amalloyjust use the fully-qualified classnames, if you're doing it programmatically
19:56sorenmacbethamalloy: cheers. overlooked the obvious answer
19:56francislhello, is read-json from clojure.data.json the right function to parse url-encode-form from a post?
19:56technomancytolstoy: Leiningen 2 enforces isolation between itself and your project much better now. you should spin tasks out into plugins if you can.
19:57technomancyif you have to keep it in your project dir for whatever reason you can add something like lein-src to .lein-classpath
19:57tolstoytechnomancy: Ah, I was just composing a mailing list question about this.
19:57hiredmanfrancisl: absolutely not
19:58tolstoytechnomancy: Where's the info about .lein-classpath? Is that auto-generated?
19:59technomancytolstoy: the docs may not be up to snuff on that; it's just a file in the project root that gets appended to Leiningen's own classpath
19:59technomancyyou write it yourself
19:59tolstoytechnomancy: Ah, okay. I'll give the that a try.
19:59technomancytolstoy: I can't think of a good use case for bundling a task with a project though apart from "we don't have time to do it properly right now"
20:00tolstoytechnomancy: This is just a simple task to help with our deployment scenario. I want to avoid asking others to run various things to "set up their environment". Esp. since I'm leaving the company and no one else does Clojure.
20:01tolstoytechnomancy: I'll probably just stick with the older lein, but now I'm just curious. ;)
20:02tolstoytechnomancy: I have a bash script that checks out the project, calls "lein dist" and thus knows where to get artifacts. I could actually make that script do what "dist" did easily enough.
20:03technomancysure; it's pretty common to ship scripts with the project to handle things that are outside the scope of the JVM
20:04francislhiredman: any cluewhere should I look?
20:04tolstoytechnomancy: Well, this is in addition to the run.sh. ;) Calls uberjar, moves the script into place…. blah blah. I'm sure there's a better way, if I'd found the right research path at the time. ;)
20:05technomancysure; just wanted to make sure I wasn't missing any solid use cases
20:06tolstoytechnomancy: With "ant" and other sorts of tools, you can add interesting targets pretty much ad-hoc. That seems to be missing.
20:06tolstoytechnomancy: Or not?
20:06technomancytolstoy: yes, that's intentional
20:07hiredman:/
20:07tolstoytechnomancy: Part of the hair-not-on-fire bit? ;)
20:07technomancyin my experience one-off tasks are always the result of not thinking through a generalized approach
20:07technomancybut I understand sometimes you don't have time to DTRT, so .lein-classpath is there for that
20:08hiredmanfrancisl: I don't know where to start, I'd suggest doing some research on what json is and what url encoding is
20:08hiredmantechnomancy: but in many cases a generalized approach is not required
20:09francislI just want something that parse the json, it works perfectly fine with my python and node version
20:10technomancyhiredman: I'd be willing to reverse my position given a solid counterexample
20:10technomancyI just haven't found any yet
20:10hiredmantechnomancy: because who wants to trot out their one off tasks as an example?
20:11hiredmanthat is kind of the point, you just need a little hack, you write it and forget it
20:12hiredmanforcing people to publish there little hacks seems like either lein will be less useful, or clojars will end up with a lot more noise (little jars no one uses)
20:12hiredmantheir
20:12technomancyhiredman: that's why it's possible but not encouraged to use one-offs
20:13hiredmanhow useful would shell scripting being if you always had to consider the general case?
20:14technomancyshell scripting is kind of gross, just like writing a classpath by hand is kind of gross.
20:15technomancybut there are times when it's the best thing for the time, sure
20:16tolstoyMy one-off just created a "dist" directory, moved the uberjar artifact to it, and a run.sh script, then set the executable on the run.sh script. I can make the thing that called "lein dist" do that work, I guess. But that was my use case.
20:16hiredmantechnomancy: the other thing to keep in mind, is how many lein plugins started as one offs? and if it is harder to start a one off, how many existing plugins wouldn't exist?
20:18technomancyif the extra overhead is "echo lein-src > .lein-classpath && mkdir -p lein-src/leiningen" then probably not many
20:18bsteuberanyone knows if there's already some nice cljs test library around?
20:18technomancygranted documentation is an issue
20:18hiredmanI am trying to pin point what my exact objection is
20:18hiredmanand I think it is a lack of separation of mechanism and policy
20:18technomancymixing the project and leiningen classpath is nasty
20:19technomancybasic stuff like "lein compile :all" doesn't work
20:19hiredmansure
20:20tolstoyI suppose you could symbolic link .lein-classpath so other devs could have a hope of finding the additional source.
20:20hiredmanbut it could be a flag in project.clj (defaulting to the good behaviour) or use an additional classpath key or something
20:21technomancy:plugins [[lein-tar "1.0.0"] "lein-src/leiningen/dist.clj" [...]] <- something like that?
20:22tolstoytechnomancy: Actually, that's what I tried (or similar) after reading the new Plugins.md.
20:22hiredmanthat is interesting, maybe specify a directory instead of a clj file
20:23technomancyyeah, I was thinking of using load-file, but that's bogus given that require would be called later.
20:23technomancya dir in :plugins wouldn't be bad
20:24technomancyactually that could also cover the fact that checkout deps don't work with :eval-in-leiningen
20:24technomancyhmm
20:38ivanI guess I'm late to the party, but live-cljs is really cool
20:44bsteuberivan: it can't be said enough times :)
20:49muhooi still haven't written a major project in clj yet, but i'm really enjoying using it as my go-to language whenever i need calculations or, with incanter, now visualizations.
20:50muhooand for data munging, hands down, it's my new favorite, displacing python. even for some sysadmin tasks, though i find bash faster for a lot of those
20:51tmcivermuhoo: I've never used incanter but can it be used to generate pure image files to be generated on a server and sent back to a client or does it only display data in Swing?
20:51hiredmanyes, you can generate images
20:51muhoothe cool thing about incanter is the "live" capability
20:51tmciverhiredman: cool. I'll be using that in the near future.
20:51muhoosliders
20:52muhoothat's what got me hooked
20:52tmcivermuhoo: yes, I was playing around with some of your code you refheap'd the other night; very cool.
20:52muhoothis: https://refheap.com/paste/1048
20:52tmciveryes
20:52technomancytmciver: I used incanter to live-generate the images in http://lein-survey.herokuapp.com/results
20:52muhoo(see, i learned how to use letfn :-)
20:53tmcivertechnomancy: is that why it's taking so long to load? ;)
20:53technomancyhah
20:53tmciverdone. Very cool.
20:54technomancycoming out of idling state
20:59gfredericksdo ^ and $ not specify the beginning/end of line in a java/clojure regex?
20:59gfredericks(in a multiline context)
21:01hiredmangfredericks: java regexs don't do multilines unless you specify a flag to turn them on
21:01gfrederickshiredman: okay, so I'll have to drop down to interop to create the regex?
21:01hiredmanno
21:02hiredmanyou can pass flags to java regexs
21:02hiredman,(re-find #"(?i)foo" "FOO")
21:02clojurebot"FOO"
21:03gfredericksoh that kind of flag
21:03hiredman,(re-find #"foo" "FOO")
21:03clojurebotnil
21:03gfredericksvery good
21:03hiredmanmultiline might be m
21:03drewryou want Pattern.DOTALL (?s)
21:03gfredericks,(re-find "(?s)^\w+$" "foo\nbar\nbaz")
21:03clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unsupported escape character: \w>
21:03gfredericks,(re-find #"(?s)^\w+$" "foo\nbar\nbaz")
21:03clojurebotnil
21:04gfredericks,(re-find #"(?m)^\w+$" "foo\nbar\nbaz")
21:04clojurebot"foo"
21:04gfredericksdrewr: you sure?
21:04gfrederickshmm, but this is curious: ##(re-seq #"(?m)^\w+$" "foo\nbar\baz")
21:04lazybot⇒ ("foo")
21:04drewr,(re-find #"(?s).*" "foo\nbar\nbaz")
21:04clojurebot"foo\nbar\nbaz"
21:04gfredericksoh ha
21:05gfrederickshmm, but this is curious: ##(re-seq #"(?m)^\w+$" "foo\nbar\nbaz")
21:05lazybot⇒ ("foo" "bar" "baz")
21:05gfredericksthere it is
21:05gfrederickshiredman: thanks!
21:06drewrgfredericks: sorry, yes, with ^ and $ you want multiline
21:06drewrI always need dotall and assumed that's what you were after
21:06drewrbut didn't scroll up
21:15FrozenlockIs there a way to make a jar file which contains only the functions I use? Multiple MOs for a single hello world seems excessive...
21:19hiredmanFrozenlock: do you expect the size of programs in bytes to scale linearly to functionality?
21:20hiredmanin which case a large hello world program would be a problem, because it would show that you have almost infinite overhead
21:21hiredmanbut in what other case would a large (in bytes) hello world progrem be a problem?
21:21hiredman(maybe if you are a vendor selling "hello world" on mobild devices?)
21:21hiredmanmobile
21:23FrozenlockI was expecting its size to be proportional to the number of libraries and function I was using.
21:23gfredericks1) Clojure
21:31arohnerwhat is the convention for where to put cljs files in a noir project?
21:31jweiss,(some (complement #{1 2}) [1 2 3])
21:31clojurebottrue
21:31gfredericksjweiss: didn't it?
21:31gfredericks3 is not #{1 2}
21:33jweissgfredericks: right, silly me, i was expecting it to reverse the final result, which is obviously wrong :)
21:33gfredericks:)
21:33gfredericksjweiss: that's what we use (not) for :P
21:36jweissgfredericks: yeah, i was using a list of one item, so i thought that would work... still a little confused why it didn't
21:36gfrederickssounds like it would
21:36jweiss,(some (complement #{1 2}) [1])
21:36clojurebotnil
21:37jweisshm, yeah must be something else going on then
21:37jweissbut i'll just use 'not' anyway
21:54gfrederickspeople deploy their eulers to clojars?
22:12TimMcMultiple times, apparently.
22:29netrealmDEPLOY ALL THE THINGS!!!
22:32alex_baranoskyhas github gone nuts to anyone else?
22:32TimMcCheck their status site.
22:32RaynesPartial service outage.
22:42alex_baranoskygithub looks good now
23:11technomancyFrozenlock: there are tree-shakers for the jvm like proguard, but they can't get you any smaller than clojure.jar itself, which is ~3MB for Clojure 1.3
23:20devnalek_b: howdy
23:20devnalek_b: have time to chat?
23:20sorenmacbethis there a quick way to go from [1 2 [3 4] 5] => ["1" "2" ["3" "4"] "5"]
23:21sorenmacbethlike apply, expect it would applied to inner sequences as well?
23:22Frozenlocktechnomancy: thanks! I'll look into that.
23:22aperiodicsorenmacbeth: seems like a good use-case for clojure.walk
23:22aperiodicsorenmacbeth: http://clojure.github.com/clojure/clojure.walk-api.html#clojure.walk/walk
23:28sorenmacbethaperiodic: can't get walk to work for me
23:30sorenmacbeth#(walk str identity [1 2 3 [4 5] 6])
23:30sorenmacbeth["1" "2" "3" "[4 5]" "6"]
23:30devn&(walk str #(map str %) [1 2 [3 4] 5])
23:30lazybotjava.lang.RuntimeException: Unable to resolve symbol: walk in this context
23:31devn&(use 'clojure.walk)
23:31lazybot⇒ nil
23:31devn&(walk str #(map str %) [1 2 [3 4] 5])
23:31lazybot⇒ ("1" "2" "[3 4]" "5")
23:31devnd'oh
23:34jkkramer,(postwalk #(if (number? %) (str %) %) [1 2 3 [4 5 6] 7])
23:34devn(prewalk #(if (number? %) (str %) %) [1 2 [3 4] 5])
23:34devnlol damnit.
23:34devnbeat me to it
23:34clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: postwalk in this context, compiling:(NO_SOURCE_PATH:0)>
23:34jkkramer:)
23:34devn&(prewalk #(if (number? %) (str %) %) [1 2 [3 4] 5])
23:34lazybot⇒ ["1" "2" ["3" "4"] "5"]
23:35devnjkkramer: should it be pre or post?
23:35sorenmacbethcheers!
23:36devnsorenmacbeth: check out postwalk-demo and prewalk-demo
23:36devnthey will print you the transformations so you can decide which you want
23:36jkkramerdevn: I don't think it matters for this case
23:36devnjkkramer: yeah i think you're right
23:36devnbut perhaps his example is contrived and he has a reason to choose pre-order traversal or vice versa
23:37sorenmacbethit's contrived, but only slightly. my data structure is a method call on a java objects that returns a short
23:38sorenmacbethI want to turn those shorts into strings, so I don't think pre or post matters
23:46devnsorenmacbeth: fwiw (walk #(if (number? %) (str %) (map str %)) identity [1 2 [3 4] 5]) seems faster
23:47devn&(walk #(if (number? %) (str %) (map str %)) identity [1 2 [3 4] 5])
23:47lazybot⇒ ["1" "2" ("3" "4") "5"]
23:47devnbut you don't preserve the inner vector
23:49sorenmacbethah, I see
23:50aperiodici think that only works one level deep, though
23:50devnaperiodic: yeah you're right
23:50devnit's a different of ~0.02ms between the two
23:50devnnot a whole lot, and that is not a full benchmark by any stretch
23:50aperiodicprematurely optimize much? ;)