#clojure logs

2010-11-18

00:40sandGorgoni have a 3rd party jar that i want to use in my leiningen project - I cannot bundle it to clojars. how do i use it ? because copying it in the "lib" folder causes it to be deleted whenever i do "lein clean"
00:41amalloysandGorgon: i'm not an expert here, but if you can build their jar with maven i can help
00:42LauJensen"im no expert here, so if you drink my poison I may be of some assistance" :)
00:42amalloyLauJensen: more or less
00:42_atosandGorgon: one way is to install it to your local maven repository (~/.m2). Leiningen will look for a jar there before it goes searching clojars etc
00:42sandGorgonamalloy, well i have the jar itself lying with me
00:43sandGorgon_ato, let me try that... kinda inconvenient though
00:43amalloysandGorgon: that's basically my suggestion too :P
00:43_atosomething like this, I think: mvn install:install-file -Dfile=foo-1.0.jar -DgroupId=org.some.group -DartifactId=foo -Dversion=1.0
00:43LauJensensandGorgon: That would be my suggestion too, 'cake install jarfile.jar'
00:48_atomight be able to stick it in ~/.lein/plugins too
00:48_atoI'm not sure if that gets appended to the project's classpath or only lein itself's classpath
00:49_atowon't get bundled with uberjar though
00:54sandGorgonhmm.. there is :native-path
01:06sandGorgonahh... copy the 3'rd party libs to the "lib" folder itself. Just set ":disable-implicit-clean true" . lein wont delete-recreate the lib folder
01:56joshua__I have a vector of vectors. How can I insert two vectors into the middle of this vector of vectors. Like [stuff stuff (create-two-vectors) more-stuff] would produce [stuff stuff created created more-stuff]?
01:59joshua__Sorry if this isn't even possible. From what I've read it is suppose to very easy to do whatever you want in lisp by typing (turn-off-gravity). Actually that was python, but still.
02:02amalloyjoshua__: it's possible, but usually you shouldn't
02:02amalloyvectors have fast random access, and fast append, but slow insert
02:03amalloy(that's one of the reasons there's no easy way to do it)
02:03joshua__kk
02:04joshua__So how about good documentation for hiccup?
02:04amalloybut concat would be the way to go, if you wanted to (i think)
02:06joshua__I was just trying to write more dryly with hiccup, I'm pretty sure there has to be a more dry way to add labels to these form input fields. =(
02:06amalloydon't know anything about hiccup, i'm afraid
02:09amalloybut here's a really gross way to do what you asked: ##(let [vs [[1 2] [3 4] [5 6]] [before after] (split-at 1 vs)] (apply conj (vec before) [7 8] [9 10] after))
02:09sexpbot⟹ [[1 2] [7 8] [9 10] [3 4] [5 6]]
02:09joshua__Bad pun 1: Don't worry I won't hold my breath. Bad pun 2: You don't know it, I'm scared now! What templating library should I use!?! Look you scared away the hiccups.
02:11amalloyi'm sure LauJensen will come by any moment to tell me how dreadful my answer is...
02:11joshua__Yea, I'll pass on that. Don't sweat this one I can make it through without fixing it, it is no problem at all.
02:12joshua__You already made me dance for joy, your doing great! ;P
02:12amalloymy life's work is complete
02:12amalloytherefore: i will go to bed. enjoy clojure, joshua__
02:12joshua__Thanks, have a good night sleep!
02:18LauJensenjoshua__: hiccup is php for clojure, try Enlive
02:19joshua__Thank you so much! I was really not enjoying hiccup, but was going to keep trecking on.
02:20LauJensenjoshua__: Enlive gives you 100% code/presentation separation, bestinclass.dk is totally enlive generated and opensource
02:30joshua__Oh your that guy! Some of your articles got me interested in clojure! You also helped me set up emacs. =)
02:32joshua__I'm going to head to bed, thanks for the advice. Going to dive into enlive tomorrow.
02:48LauJensenGreat, see you tomorrow :)
02:49bobo_naw, dont call hiccup php, nothing deserves to be compared to php :-/
02:49bobo_but i see your point =)
02:49LauJensenbobo_: right...except hiccup :)
02:50bobo_i showed a frontend guy how enlive works at work... he didnt belive me it could work
02:50bobo_he thought his jquery templates was as good as it gets
02:58kotrinjquery templates?
03:01bobo_its a plugin to jquery
03:01bobo_it has for loops and craps in the html
03:01bobo_and it puts html in your javascript
03:02LauJensenbobo_: Its essentially the same as Pure in that regard. Its a proven technique :)
03:05bobo_Pure?
03:06LauJensenPure is a javascript lib which has similar capabilities, just without the awesomeness
03:06raekjk_: pong!
03:09bobo_Pure looks 10 times cleaner then the crap he used. why did he use that crap *sigh*
03:15raekbobo_: btw, did you see the "guestbook" ampleyfly and I did for the last Linköping Clojure User Group meeting?
03:16raekring + moustache + enlive + 90's HTML
03:17raekhttp://services.raek.se/guestbook/
03:17raekif you look at it for too long time, you will go blind
03:17LauJensenraek: Man you could patent ugly
03:18raek:)
03:18bobo_raek: no i didnt!
03:18bobo_omg!
03:19kotrinholy batmans this is an awesome website
03:24_atoit needs a frameset, blink tag and a marquee
03:24_atoI like the mouse following cat thing
03:42raekhttps://github.com/raek/lcug-guestbook
03:54hiredman*cough*
03:54hiredmanpardon me
05:00TordmorHi! Any idea on how to rephrase that? http://pastie.org/1307987
05:03raekif you use refs, you don't need the exceptions
05:05raek(defn new-player [players name] (if (contains? players name) false (alter players assoc name (ref (make-player name)))))
05:07raeksorry. ...(contains? @players name)...
05:07raekand (do (alter ...) true)
05:07raekbut with atoms, I think throwing an exception is the only way to abort the change
05:09Tordmorok, thanks. How is the performance/memory with refs as opposed to atoms?
05:09raekyou could perhaps factor out the function you pass to swap!
05:10raekand call it something like non-replacing-assoc
05:10raekatoms are more lightweight, but limited
05:11Tordmor:)
05:11Tordmorwrong window, sorry
07:03blubberHi, any emacs guru around that can tell me how to change the color of parenthesis in clojure-mode?
07:16hsuhfirst time i needed mutable state and i'm having trouble... is there a better way to express those forever-running loops (code doesnt work because swap! takes a function): http://pastie.org/1308193
07:19AWizzArdhsuh: there is also reset!
07:19AWizzArdWhich takes no function.
07:20AWizzArdYour defn example is best be (reset! your-atom 10)
07:20AWizzArdif there were not reset! you would say (swap! yout-atom (constantly 10))
07:20hsuhow! thanks a lot man
07:20hsuhhow should a beginner find about that? i was looking at http://clojure.org/atoms
07:21Tordmorhsuh: by asking on irc :)
07:22AWizzArdhsuh: you could search all docstrings for "atom" and see where it shows up.
07:22AWizzArd(find-doc "atom")
07:22hsuhhm, right...
07:22AWizzArdIt also lists reset!.
07:23hsuhooops, also forgot to deref
07:54jk_raek: u there?
07:54raekyes
07:54jk_raek: http://tinypic.com/r/11iha34/7
07:55jk_raek: that's how you run a snippet in the current repl in ccw
07:55jk_raek: you were asking about it last night but i wasn't at a computer
07:56raekah, I got the answer from someone else
07:56jk_that was me :)
07:56jk_i was on my phone last night
07:56raekneat that it has the same keyboard binding as in emacs...
07:57jk_raek: i don't know if it's a conflicting binding with another pluging or what but the kb shortcut doesn't work. i actually have to click it, which is mildly annoying
07:57jk_raek: i have a ton of plugins loaded so i'll need to look at that a bit closer
08:02AWizzArdJFYI, interesting: http://www.infoq.com/interviews/functional-langs
09:20edwAny Incanter users here?
09:20blubberHi, any emacs guru around that can tell me how to change the color of parenthesis in clojure-mode?
09:24aan4ndHello folks. Is anyone able to either link me to, or walk me through, the most basic possible set of steps for getting a REPL running in vimclojure? I feel I have exhausted Google's usefulness.
09:40@rhickey,(.. Runtime getRuntime totalMemory)
09:40clojurebot28307456
09:40@rhickeytake that, -> :)
09:41chouseroh, fine.
09:41stuartsierra:)
09:42chouserrhickey: btw, thanks for sticking up for ... well, whatever you're sticking up for in LtU. Seriously out of my depth.
09:42stuartsierrachouser: I'm watching your Strange Loop talk right now.
09:43chouserstuartsierra: you won't learn anything about Clojure there, but I hope you enjoy it anyway. :-)
09:44stuartsierraDoing an article on the same topic, wanted to check out other explanations.
09:46@rhickeychouser: I liked your talk and wished more of the LtU commenters had watched it, just to see the modesty of the argument. There's such a cult of novelty and precedence there, and Clojure doesn't really play that, being mostly unoriginal
09:47chouserI probably should have read a few more papers than I did before claiming to talk about a subject like that.
09:47chouserrhickey: hm, interesting point.
09:47stuartsierrachouser: nah, you got it :)
09:47@rhickeychouser: I do think you undersold protocols a bit, saying the only advantage was perf
09:48chouserrhickey: thanks for saying you liked it. That means a lot to me.
09:48chouserrhickey: compared to multimethods? what else do you get?
09:48@rhickeyadvantages are also - grouping of related functions, good bridge to host, concrete mixin and implementation composition
09:48fogus`rhickey: Whoops. I was certain there would be a more thoughtful discussion. :-(
09:49chouserMmm, bridge to host is indeed a bigger deal than I made of it.
09:49@rhickeyfogus`: no worries, I think they are coming around :)
09:49chouserthe grouping of related functions I intentionally dropped, as it wouldn't be hard to build something for that ad-hoc on top of multimethods
09:50@rhickeychouser: really? I wonder
09:51@rhickeywithout circumscribing the dispatch, what do you hang the grouping on?
09:52@rhickeywhat is the equivalent of satisfies?
09:52fogus`chouser: I thought it was a very nice talk. I rarely post on LtU, but thought your talk was a nice reason to break my silence.
09:54chouserthe grouping with protocols is mainly useful from the host perspective, and sure "satisfies"
09:54chousersince name resolution is still at the namespace level
09:54@rhickeyand documentation
09:55chouseryes
09:55@rhickeyand mixin composition
09:55stuartsierraIs "disj" suitable as "remove from generic unordered collection"?
09:56@rhickeystuartsierra: that's not a set?
09:56stuartsierranot a set per se
09:56@rhickeyif it has dupes what does disj do?
09:57stuartsierrano dups
09:57stuartsierraabedra and I wrote a consistent hashing impl
09:57@rhickeyso a collection of unique items that's not a set? hrm
09:57stuartsierraI made it implement conj, disj, and ILookup
09:58@rhickeyhow is it not a set?
09:58stuartsierrastu halloway thought we were abusing deftype by calling it an IPersistentSet
09:59@rhickeyin what way was it not?
09:59stuartsierraIf you call "get" or IFn.invoke, it acts like a map. If you call conj or disj, it acts like a set.
10:00@rhickeymaybe you're abusing get and IFn
10:00stuartsierrahrm
10:01@rhickeyor, it's really a map
10:01stuartsierraI think it's both map-like and set-like.
10:01stuartsierraYou want set-like behavior when you add or remove nodes.
10:02stuartsierraAnd map-like behavior when you look up the node for a given input key.
10:02@rhickeyyou're pushing it with the latter
10:03@rhickeyin that sense all functions are map-like
10:03@rhickeyjust use a named function
10:03stuartsierrahmm, ok.
10:04tonylmorning
10:04stuartsierraIt was just really convenient to say (map my-consistent-hash bunch-of-inputs)
10:07@rhickeystuartsierra: well, the IFn thing is less bad than get
10:09@rhickeyIFn doesn't break IPersistentSet
10:09stuartsierraAnd "get" does?
10:10@rhickeyyes, you break with the semantics of get
10:10@rhickeyfor sets
10:10stuartsierraah, ok, that makes sense
10:17raekblubber: I only know of this: http://dishevelled.net/elisp/rainbow-parens.el
10:27mattmitchell_i'm trying to find a way to test that a string is not empty, is there something like ruby's blank? string method?
10:28stuartsierra,(empty? "")
10:28clojurebottrue
10:28stuartsierra,(clojure.string/blank? " ")
10:28clojurebotjava.lang.ClassNotFoundException: clojure.string
10:28stuartsierra(require 'clojure.string)
10:29mattmitchell_stuartsierra: awesome thanks.
10:30mattmitchell_ok cool, looking at the string api now :)
11:04Tordmorblank? doesn't seem to know unicode whitespace
11:04Tordmor,(let [s (str \uFEFF \uFEFF)] (prn s (count s) (clojure.string/blank? s)))
11:04clojurebotjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.string
11:05stuartsierraIt's going by java.lang.Character/isWhitespace
11:10TordmorAh, as opposed to isSpaceChar
11:11Tordmormakes sense
11:22rata_hi
11:23rata_is there any difference between (merge-with into ...) and (merge-with merge ...)?
11:23rata_(besides into being more general, as it also works with any kind of seq, not just maps)
11:26chouserrata_: in general, into can be used anywhere you use merge, except that into take exactly 2 args where merge can take more
11:32rata_chouser: ok, thanks
11:33rata_in the case of merge-with, that's not a problem, because into will always receive two args
11:33chouserright
11:33rata_and is there any difference on performance between them?
11:36chouserinto currently uses transients, while merge does not. Hm, but merge uses .reduce on the seq chunks.
11:36chouserrata_: I guess I'd use 'into' unless you have a specific need for merge, or measure if you care enough to see which is faster in your use cases.
12:09AWizzArd,(quote ?[]) ; ==> ?[]
12:09clojurebot?
12:11hiredmanAWizzArd: what are you doing?
12:12hiredman?[] is a symbol followed by an empty vector and quote quotes one thing
12:17AWizzArdhiredman: can ?[] not be a symbol?
12:18amalloyAWizzArd: [] are not legal symbol characters
12:18AWizzArdI see.
12:18amalloy&(symbol "?[]")
12:18sexpbot⟹ ?[]
12:18amalloyer
12:18amalloywow
12:18AWizzArdNot legal when the reader is doing it.
12:19hiredmanright, the reader's dispatch table sees [ and starts a vector
12:21chouserwell, I think it's correct to say they're not legal and that 'symbol' doesn't check for legality.
12:22chouserchances are eventually either that will become legal and get a reader syntax (perhaps |?[]|), or 'symbol' will check and reject it.
12:23amalloychouser: good point. now that i think of it, you can get all kinds of actually-illegal symbols and keywords that way
12:23amalloy&(keyword "this has spaces in it")
12:23sexpbot⟹ :this has spaces in it
12:28Lajlachouser, is (symbol "true") a legal symbol?
12:29Lajla->(symbol "true")
12:29Lajla&(symbol "true")
12:29sexpbot⟹ true
12:29amalloyLajla: true is certainly a legal symbol
12:29chouserLajla: sure
12:30chouser,(= true 'true)
12:30clojurebottrue
12:30chouseroh
12:30LajlaThat still doesn't prove its symbolhood
12:30Lajla&(symbol? true)
12:30sexpbot⟹ false
12:30LajlaThat disproves it though
12:30chouser&(symbol? 'true)
12:30sexpbot⟹ false
12:30amalloyLajla: no it doesn't
12:30LajlaTrue is a self evaluating boolean
12:30LajlaSeems to me.
12:30LajlaNot a symbol
12:31amalloy&(let [x 1] (symbol? x))
12:31sexpbot⟹ false
12:31amalloyx is obviously a symbol here
12:31LajlaYes
12:31Lajlabut that's not my issue
12:31LajlaThe point if is true is a symbol.
12:31LajlaLike nil and T are in CL.
12:31chouserLajla: your examples were not what you meant, but I see your point.
12:31chouserit is a good point
12:31LajlaAnd if a symbol composed of the chars t, r, u, and e, is a legal symbol.
12:32LajlaWhat I mean is, that the reader has a praecidence of the boolean over the symbol doesn't per se mean that such a symbol cannot exis.t
12:32LajlaOr be created by other means.
12:32LajlaLike (symbol "true")
12:32Lajla&(= (symbol "true") true)
12:32sexpbot⟹ false
12:33amalloy&(symbol? (symbol "true"))
12:33sexpbot⟹ true
12:41Lajlaamalloy, so yeah, the reader basically gives praecidence to the boolean over the symbol.
12:41LajlaNot sure if a symbol like that is legal.
12:41Lajlawell, it is.
12:41Lajla&(symbol? (symbol "Ich liebe dich, und I worship your shadow {][[]p][]."))
12:41sexpbot⟹ true
12:42LajlaSeems clear to me that it's a possible symbol, there's just no reader syntax for it.
12:42LajlaNot too unusual.
12:42Lajla&(= #(+ 1 %) '#(+ 1 %))
12:42sexpbot⟹ false
12:42LajlaHmm
12:43LajlaMemory location maybe
12:43Lajla&('#(+ 1 %) 2)
12:43sexpbotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn
12:43amalloyLajla: they're different classes
12:43LajlaHmm
12:43Lajlalist eh
12:43Lajla&'#(+ 1 %)
12:43sexpbot⟹ (fn* [p1__6287#] (+ 1 p1__6287#))
12:43LajlaAhaa
12:44raekthat is what the evaluator gets
12:44Lajla&(conj 3 '#(+ 1 %))
12:44sexpbotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IPersistentCollection
12:44LajlaWhoops
12:44Lajlawrong order
12:44Lajla&(conj '#(+ 1 %) 3)
12:44sexpbot⟹ (3 fn* [p1__6303#] (+ 1 p1__6303#))
12:52alexykI'm trying to use incanter after already using io, get: java.lang.IllegalStateException: copy already refers to: #'clojure.contrib.io/copy in namespace: user (NO_SOURCE_FILE:0)... how do I hide copy again?
12:54amalloy(use '[clojure.contrib.io :exclude [copy]])?
12:55amalloyalexyk: there's also ns-unmap: ##(doc ns-unmap)
12:55sexpbot⟹ "([ns sym]); Removes the mappings for the symbol from the namespace."
12:55alexykamalloy: yes, the copy is already in scope and need to be purged
12:55amalloyright. so ns-unmap once (or restart the repl), and after that :exclude
12:55alexykthis is really annoying as IllegalState prevents Incanter to be loaded
12:56amalloyalexyk: nonsense
12:56alexykin some cases we get a warning, so I didn't expect an f-up
12:56amalloy(require) instead of (use)
12:56hiredmanuse clojure.java.io instead of the clojure.contrib.io
12:56alexykhiredman: ah ok
12:57amalloywhich is a good habit anyway, so that you and/or people reading your code can tell where the functions came from: (:require [foo.bar.io :as io])
12:57hiredmanhmm, actually, that is loopy
12:57hiredmanincanter is bringing in it's own copy when you :use it?
12:57alexykhiredman: yep
12:58hiredmanwell then you need to require
12:58hiredmanI would recommend :require incanter and :use clojure.java.io
13:02alexykincanter is very fragmented, everything is in a different namespace... have to use all with an :as I guess
13:04hiredmanyou might look at nstools, it's googleable
13:48imphasingI'm attempting to format a number with google refine, so that commas are inserted every 3 digits, as per US custom. Does anyone know if there's an easy way to do this with clojure?
13:51LauJensenGentlemen, after 2.5 hard years Im excited to announce ClojureQL is now released in 1.0.0 beta! Screencast + Blogpost showing the basics here: http://bestinclass.dk/index.clj/2010/11/clojureql--1.0.0-now-in-beta.html - Feedback is encouraged :) There's also a #clojureql for those who need support
13:54chouser& (.format (java.text.NumberFormat/getInstance) 12345678)
13:54sexpbot⟹ "12,345,678"
13:54chouserimphasing: but I think that's locale-dependant
13:55imphasingchouser: Ah, ok. I decided to just make a dirty webservice in PHP to interface with refine
13:56chouser& (.format (java.text.DecimalFormat. "##,##.00") 12345678)
13:56sexpbot, java.lang.Exception: EOF while reading
13:56clojurebotInvalid token: java.lang.Exception:
13:56sexpbot.00") 12345678) java.lang.Exception: Unable to resolve symbol: .00 in this context
13:56chouser,(.format (java.text.DecimalFormat. "##,##.00") 12345678)
13:56sexpbot, java.lang.Exception: EOF while reading
13:56sexpbot.00") 12345678) java.lang.Exception: Unable to resolve symbol: .00 in this context
13:56clojurebot"12,34,56,78.00"
13:56clojurebotInvalid token: java.lang.Exception:
13:57chouserweird
13:57chouserhm probably want ##,###.00 instead
13:57sexpbot, java.lang.Exception: EOF while reading
13:57sexpbot#.00 instead java.lang.Exception: No dispatch macro for: .
13:57clojurebotInvalid token: java.lang.Exception:
13:58chouseroh, I see. I'm making sexpbot start it's message with a , which triggers clojurebot to fail. hooray.
13:59mroessler@LauJensen: Have you thought about windowing in ClojureQL? For example, from you aggregate example that is the equivalent of "SELECT corr(x+y) from users", how about implementing "SELECT corr(x+y) over (partition by something order by somethingelse) from users"?
14:01LauJensenmroessler: I haven't thought about that yet
14:16ninjuddmroessler: that would be a great feature to add in clojureql 1.1
14:19stuartsierraanybody have the link for Stu Halloway's Protocol slides from JAOO?
14:21LauJensenstuartsierra: http://tinyurl.com/2cpm5gb
14:22stuartsierrayeah, eventually that got me there
14:22stuartsierrabut not the particular slides I wanted
14:22stuartsierraHere's what I was looking for: http://gotocon.com/dl/jaoo-aarhus-2010/slides/StuartHalloway_ClojureProtocolsArenotInterfaces.pdf
14:22LauJensenstuartsierra: http://cloud.github.com/downloads/stuarthalloway/clojure-presentations/ClojureProtocolsJAOO.pdf not that one?
14:23stuartsierraah!
14:25mroessler@ninjudd My suspicion is that it is quite difficult to implement. I'm trying to figure out how to do windowing type analysis in just Clojure code. For example, given a sequence or a structmap like apply an aggregate (corr,min,max,etc.) over partitions within it. This enables analysis of moving averages for example to data that includes >1 grouping.
14:27hiredmanmroessler: please stop @'ing at people
14:27hiredmanirc is not twitter
14:27ninjuddmroessler: how standard is WINDOW and OVER in sql? i know postresql supports it
14:28mroesslerhiredman: is the proper way using name: I don't know I'm new to IRC.
14:29hiredmannick: or nick,
14:29hiredman: requires shift, but , doesn't
14:29ninjuddwho's nick?
14:30hiredmanninjudd: http://tools.ietf.org/html/rfc2812#section-3.1.2
14:30mroesslerninjudd: windowing became part of sql in SQL:1999 and was expanded in SQL:2003. Yes, it is very well supported by Postgresql in the open source area. Greenplum SNE and Greenplum also support it excellently. Then to my knowledge all the standard proprietary db like Oracle, MSQL also support it. Just not in mysql.
14:31Chousukeneither : or , require the shift key if you use tab completion :P
14:31mroesslerhiredman: thanks to you and nick, I now how to use IRC.
14:34ninjuddmroessler: if you're interested in helping add it to 1.1, let me know, and we can discuss syntax ideas and details in #clojureql
14:35KirinDaveI am having a Bad Clojure Day™
14:36mroesslerninjudd: yes. I'll look for you in #clojureql in near future.
14:37KirinDaveCan anyone recommend a better way to go about doing this: https://gist.github.com/705478
14:37KirinDaveI didn't see a way to magically do this in clj-time
14:37LauJensenClojureQL now in HN: http://news.ycombinator.com/item?id=1918954 :)
14:38KirinDaveBut it's weird to me that both clj-time and JodaTime seem to have problems trying to fuzzy-match.
14:38amalloychouser: man, i step away for an hour, and i come back to see you've started the robot wars
14:38KirinDaveAny advice on how to make it clearer and easier?
14:39KirinDaveI feel like it's ugly code.
14:39KirinDaveLauJensen: Oh damn man, this is relevant to my interests.
14:39hiredmanjodatime just plain refuses to parse human readable timezones like PST, it surprises me that people continue to sing it's praises
14:39chouseramalloy: :-)
14:40KirinDavehiredman: codahale was saying that people love it because of things like its interval handling that actually has all kinds of little details (like offsets and leap years and older calendars). But I too am surprised.
14:40KirinDavehiredman: Any advice on how to make that code less terrible?
14:42hiredmanI have no advice
14:44KirinDaveAt least I didn't have to say class DateParsingStrategy ... :P
14:44hiredmanbesides watch out for the bug on ubuntu where if you use a 32bit jvm on a 64bit system if you call getResource before trying to use SimpleDateParser (from the jre) it will parse all timezones as GMT
14:44KirinDaveGod I hate code like that.
14:44KirinDavehiredman: For HTTP 1.1 it is the clients error if they send me timestamps that are not UTC
14:44hiredmanand since clojure code is loading via getResource …
14:44KirinDavehiredman: So I think i will be okay in that regard. but I didn't know that, thanks for the warning.
14:45hiredmanKirinDave: right, well, sticking to the rfc doesn't often survive contact with reality
14:46KirinDavehiredman: Hopefully someone will submit a patch for it then. I'm just trying to get the remaining logic and states into some semblance of order before I drop a point release and put clothesline up on clojars.
14:46hiredmansure
14:47KirinDaveAre you guys at all interested in clothesline? I know it's sorta pre-mature for real use
14:48hiredmanwe don't do any webstuff in clojure
14:49hiredmanwe have some rest apis we expose built on ring, but nothing very complex, all internal
14:49mroesslerhiredman: what else to use that has something like getFirstDayOfWeek(); if not joda?
14:49dnolenLauJensen: congrats!
14:50LauJensendnolen: thanks buddy :)
14:50hiredmanmroessler: I don't care about the first day of the week, I just want to be able to parse dates
14:51mroesslerhiredman: that makes a good argument to stick with joda.
14:51hiredmanno
14:51hiredmanjoda cannot parse timezones
14:51hiredmannon-starter
14:52hiredmanour data parser is a list of about 10 functions and growing, each one gets tried in turn to parse the date
14:53hiredmanI swear to you, I have seen date headers that have the timezone as {5}, curly braces and all
14:54dnolenLauJensen: ClojureQL looks real sweet now. Makes writing SQL look positively fun. Whodda thunk?!
14:54stuartsierraA theoretical question:
14:54LauJensenhehe, thats right! Like Chris said, bringing Relational Algebra back to Relational Databases. I have high hopes for this project :)
14:55stuartsierraAre static methods overloaded on argument type a solution to the Expression Problem?
14:55stuartsierra(in Java)
14:57hiredmanstuartsierra: you cannot add a new static method for a new set of argument types later
14:57stuartsierrayes
14:58mjg123hello folks. What is the fn for adding an item to the _end_ of a list?
14:58LauJensenmjg123: doesnt exist
14:58amalloymjg123: use a vector instead
14:58mjg123:)
14:58mjg123fair enough.
14:58LauJensenamalloy: you should be busy reading my blogpost, arent you following bestinclass.dk yet?!
14:58stuartsierra(concat the-list (list the-item))
14:59amalloy&(map #(conj % 10) [1 2 3] '(1 2 3))
14:59sexpbotjava.lang.IllegalArgumentException: Wrong number of args (2) passed to: sandbox4381$eval6376$fn
14:59amalloy&(map #(conj % 10) [[1 2 3] '(1 2 3)])
14:59sexpbot⟹ ([1 2 3 10] (10 1 2 3))
14:59hiredmanstuartsierra: that adds lazy-seq overhead everytime you do it and you will blow the stack when you try to read it
14:59amalloyLauJensen: i actually did read (some of) it!
14:59amalloybut then i got to the screencast and it was like, blah, not gonna watch that at work
15:00LauJensenIts very work related though
15:00mjg123OK - I've been using stuartsierra's technique but I wondered why there wasn't a core fn for doing that
15:00hiredman,(first (nth (iterate #(concat % [1]) []) 20000))
15:00clojurebotjava.lang.StackOverflowError
15:00dprohi
15:00amalloyLauJensen: sadly not, at the moment. i'm working with cassandra, not sql
15:00mjg123cheers
15:01amalloymjg123: because you shouldn't add to the end of an immutable linked list
15:01amalloyit's super-inefficient
15:01dproI'm playing around with labrepl, what do I need to import from compojure so I get the (html ...) function ?
15:01tomojLauJensen: coincidentally I was just thinking "hmm.. wonder how clojureql is coming along" while staring at c.c.sql nasty
15:01tomojlooks awesome
15:01tomojclojureql punts on table creation, right?
15:01LauJensenpunts?
15:01amalloyLauJensen: gives up
15:02tomojI mean, there's nothing in there for creating tables, is there?
15:02tomoji.e. "it's not my problem"
15:02LauJensencontrib.sql is imported in clojureql.core, so use those functions
15:02hiredmandpro: html was split out into a seperate project, check weajester's github repos, I forget what it is called
15:02LauJensenOne of the ways to get this done in 2 weeks was to piggy back a little on contrib
15:02tomojLauJensen: thanks
15:02LauJensennp
15:04dprohiredman: thx
15:04dprohiredman: it's "hiccup"
15:05LauJensenhiccup, aka. PHP for Clojure :)
15:07dproLauJensen: why ? I guess (html :foo "bar") is still more idiomatic than (str "<tag> " "text" ...)
15:07dproLauJensen: the latter really looks like echo "...."
15:07LauJensendpro: The common complaint about PHP is that it mixes code and presentation, and then most people turn around and do the exact same thing in Clojure. Use Enlive templates instead, 100% separation
15:08dproLauJensen: I might eventually, I'm not planning a webapp, just wanted to get through with the laprepl chapters
15:08LauJensenah ok
15:09chouserwe have whole files full of PHP without any HTML in site. No mixing of presentation with code. It's still not a good language.
15:09LauJensenchouser: How does it feel to be boasting about the architecture of your PHP code? :D
15:10amalloyLauJensen: it's like kosher hot dogs at a hot-dog-eating competition
15:10tonyli like the language
15:10dprochouser: php is an abomination, but usually it's chosen by the less gifted, and then the bright people get the calls to "fix it by tomorrow"
15:11lrennLauJensen: I'd prefer to have the full power of my language available. I'll enforce the no code/presentation seperation myself thank you.
15:11LauJensentonyl: You like PHP?
15:11LauJensenlrenn: How does that comment fit in the context?
15:11tonylyeah, I don't really hate any language though
15:11lrennLauJensen: that hiccup is somehow ad.
15:12chouserMmmmm PHP architecture. This isn't just code, it's form-following-function. It's design elegance and practical delivery coupled loosely into the height of reliability and maintainability.
15:12lrennLauJensen: bad*
15:12LauJensenhehe
15:12LauJensenchouser: When did you get into marketing? :)
15:12tonylthe only thing that bothers me is the functions don't follow a naming scheme, but that is not a big hurdle to climb
15:13LauJensenlrenn: I must admit I dont see the point in using hiccup if you enforce separation yourself
15:13dprotonyl: nevermind they also randomly operate on your data in place and returning results at other times
15:13chouserWe have really learned how to generate customer drive and to enhance end to end reliability as our main focus.
15:14tonylyup
15:15amalloychouser: all very nice, but are your core values future-compatible?
15:15rickmodeMonad question: I'm trying to use state-m and m-seq together.. anyone up on monads?
15:16amalloyrickmode: don't you want to use a monad transformer?
15:16rickmodeamalloy: doesn't seem to fit
15:16lrennLauJensen: because I'd rather use clojure than http://enlive.cgrand.net/syntax.html. I'm not saying enlive is bad, I'm just saying hiccup isn't evil.
15:17LauJensenlrenn: Are you sure you understand Enlive? It doesnt sound like it
15:17chouseramalloy: Maybe not yet, but I'm not worried, because first we have to gain business drive.
15:17mroesslerLauJensen: Excellent video presentation on ClojureQL
15:17LauJensenmroessler: Thanks a lot
15:19rickmodeamalloy: I have a list of state-m monad functions that take a map and return a [value and the map (possibly in a new state)]. In one situation I want the to run the map through the entire list, so using state-m and m-seq works fine.
15:19tonylchouser: where do you work at? if you don't mind me asking
15:19rickmodeamalloy: now I want to run the map through the list of function until a particular value arises
15:19amalloyrickmode: i don't actually have much practical experience with monads; it just sounded like you were trying to transform things based on my reading of the tutorials
15:21rickmodeamalloy: ah... i've read the tutorials, read the source, read the group. The use of monads in clojure isn't widely discussed. I suspect I'd have to learn me some haskell to master monads.
15:21lrennLauJensen: probably not. Reading up now.
15:21chousertonyl: http://www.sentryds.com/ We actually have a really great team of smart, effective developers. But like most places, we also have old design decisions that need to be addressed.
15:22dnolenlrenn: I'm sneaking in some Clojure into the New York Times w/ Enlive :D It rules. I have a lengthy tutorial on it if you want to dig in. cgrand's documentation is ... spare.
15:22tonylchouser: no way, that company was in my list to apply for a job this past summer. what a coincidence.
15:22hiredmanchouser: you guys should totally use php.lisp
15:23tonyloh yeah, I've heard about php.lisp. gotta take a look at it. hopefully it is not just another abstraction level
15:23rickmodednolen: would you recommend enlive over only hiccup even for a smallish site?
15:24hiredmanwell, uh, there was some stupid php in parens thing, that really had nothing to do with lisp except adding extra parens
15:24hiredmanwhich made the frontpage in progreddit
15:24dnolenrickmode: having editing markup mixed with logic for years - hiccup and templating languages now drive me insane.
15:24hiredmanthen there is php.lisp which is my lisp interpreter written in php
15:25hiredmanI started work on a compiler but got side tracked
15:25lrenndnolen: actually reading your tutorial now.
15:25tonylhiredman: is it this one https://github.com/lunant/lisphp ?
15:25hiredmanno
15:26chousertonyl: you should. we're hiring, and it's a great team to work with.
15:26chousertonyl: oh, was it just for a summer internship?
15:26hiredmantonyl: that may be the pile of garbage I mentioned that made the reddit frontpage, but I don't recall
15:26lrenndnolen: but for example, look at the size of your looping section :) I'd rather just use for :)
15:26rickmodednolen: I don't mean mixed use. I've had a dream of entirely code generated markup and am having a stab at it. Seems good (ideal) situation when developer has full control of design. I can totally see how this would break down if I was working with a graphic designer.
15:27dnolenrickmode: something to consider is that you often need to style things based on first and last or even odd and it needs to work in ever browser - putting that into your markup (whether HTML or Clojure) stinks. Enlive makes it way cleaner and you get CSS3 and crazier matching control.
15:27hiredmanhttps://github.com/hiredman/php.lisp is php.lisp, and I was of course, joking when I suggested that chouser use it
15:27dnolenlrenn: I don't mention that Enlive has a for already. in anycase for non-trivial things it's cleaner. Cuz you ending up having for everywhere in a real page.
15:27lrenndnolen: I don't maintain a giant site, so my needs are different. i can obviously see the need for something like this.
15:28dnolenlrenn: yes, if other browsers don't matter much to, hiccup is simpler.
15:28rickmodednolen: why doesn't a separate CSS class work in that case? can the rules not all be expressed in CSS?
15:28tomojLauJensen: clobbering the transient fns in clojureql.core seems unfortunate
15:28rickmodeer.. those cases, I mean
15:28dnolenrickmode: not in CSS that works in every browser no.
15:28LauJensentomoj: (use [clojureql.core :as cql]) if you need them
15:29LauJensenI just had never seen a namespace which both worked on transients and databases before :)
15:29rickmodednolen: gotcha... well.. enlive is now on my TODO list ;)
15:29tomojrequire, rather?
15:29LauJensenright
15:29tomojhmm
15:29lrenndnolen: yeah, i love the scrapping stuff. thanks for the tutorial.
15:29LauJensentomoj: If its a problem I can let them drop to clojure.core if they get passed something other than a table, like sort/take/drop
15:29dnolenlrenn: np.
15:31tonylchouser: no, I was actually looking for a full-time job. I think I might apply to it when my contract is over here
15:32tonylhiredman: thanks I'll check it out
15:32tomojLauJensen: wow, hadn't noticed those
15:32LauJensentomoj: You didnt watch the screencast yet?
15:32rickmodednolen: i did notice some of the tutorials do indeed use hiccup with enlive. Anyway... is there a newer version of enlive? the "master" on github still uses clojure 1.1 (perhaps this doesn't matter?)
15:32tomojnope
15:32LauJensentomoj: okay well.. go watch :)
15:32tomojjust read the README
15:33hiredmantonyl: if you want, it's a "my first interpreter" kind of project
15:33chousertonyl: you should. And don't forget to mention you know me. :-)
15:37tonylhiredman: I was actually thinking of doing a lisp interpreter in php :P this would be a good exploration
15:38KirinDaveWe might have another opening for a dev @ banksimple. This is a clojure+scala friendly environment.
15:38tonylchouser: great! I will. This was random
15:41Raynesneotyk: ping
15:42neotykRaynes: pong
15:42Raynesneotyk: Did you ever get a moment to read that? raek rewrote a paragraph in the Leiningen section.
15:42RaynesIt's not all that important though. Mostly a correction.
15:43RaynesJust wondering if you've got any feedback before I publish it in a little while.
15:43mroesslerKirinDave: Go banksimple! I like hearing about you guys.
15:43neotykRaynes: yes, I've send you my notes in priv chat
15:44KirinDavemroessler: Heh.
15:44RaynesYou did, or are going to? I haven't received anything yet.
15:44neotykI did
15:45RaynesDo it again, please. :p
15:45dnolenrickmode: doesn't really matter, I'm using Enlive with 1.2.0.
15:47rickmodednolen: cool. I guess lein / cake won't pull in an older version of a dependency than the main project
15:50neotykdoes any other build tool than Maven support multi module builds?
15:51LauJensenneotyk: Clojuresque
15:51neotyk$google Clojuresque
15:51sexpbotFirst out of 159 results is: kotarak / clojuresque / overview – Bitbucket
15:51sexpbothttp://bitbucket.org/kotarak/clojuresque
15:51LauJensenthats the one
15:52neotykLauJensen: thank you
15:52LauJensennp
15:53dnolenrickmode: I would assume not.
15:54neotykI don't find Groovy so groovy :(
15:55LauJensenyea me either neotyk
16:00bobo_hm, does enlive remove the xmlns attribute from the html tag?
16:08LauJensenbobo_: no
16:14bobo_it sure seems to remove it for me, maybe im just tired. il do a testproject tomorow.
16:14tonylhiredman:ping
16:15hiredmanpong
16:15tonylwhere do you start your php.lisp? the vm.php file?
16:16hiredmanlisp.php is the interpreter, it just interprets php.lisp
16:17hiredmanno repl or anything, I was running this from mod_php
16:19hiredmanthe vm stuff was something I was fiddling with but never wnet anywhere
16:20tonylalright, so how do you feed php.lisp (or any *.lisp file) to the interpreter?
16:20tonylnvm
16:20hiredman:)
16:20tonyli see it at the end of lisp.php
16:20tonylthis is cool, it uses a clojurish implementation on the host (php)
16:21hiredmancompiler.php you can feed abitrary files into, but I don't think I ever finished the compiler
16:21hiredmanthe sample input to the compiler was a.lisp
16:22hiredmanand it is actually a different lisp from the interpreter
16:22tonylso as of now lisp.php does it
16:22hiredmandoes it?
16:23tonyltransforms the lisp syntax to php
16:23hiredmanlisp.php doesn't
16:24hiredmanit is actually an interpreter
16:24hiredmanthe compiler is what turns lisp in to php
16:24tonylok, yeah my bad. that is what I meant.
16:24tonylnice work
16:25hiredmanyou are, too kind
16:25hiredmanhuh, interesting comma there
16:25tonylprobably but I am still learning lisp
16:27hiredmanwriting one is a good way to get a feel for the design space
16:28tonylyeah, I am thinking about it, probably in C or C++ to resharpen those dull knifes
16:29hiredmanan interpreter in C was my next target, I got as far as starting to write an object system...
16:30tonylthat might be a hurdle, but maybe a not full-blown object system would be necessary ...
16:31hiredmanwell it was just structs with pointer to a table of function pointers
16:32hiredmanthe table was a linked list and method looks up were O(n) :(
16:33tonyloh
16:34tonylmaybe a implementing a hash array
16:34hiredmantalk about yak shaving...
16:34chouserstep 3, write garbage collector...
16:35ChousukeLauJensen: wow, quick response to my little issue report on cql :P
16:35LauJensenChousuke: Yea we're a pretty intense team. But your comment was 100% correct and chouser had also made it a few hours ago, so its in the pipe
16:35hiredmanchouser: I just used boehm
16:36ChousukeLauJensen: I didn't even have time to navigate away from the page :)
16:36LauJensenChousuke: Well, we dont want to keep the community waiting. Now its bedtime for me though, good night to you all
16:36chouserhiredman: psh. why didn't you just use CL?
16:37hiredmanuh, well, cl is digusting the code makes my skin itch
16:37chouserheh
16:38tonylwonder how a no-garbage-collected lisp will look
16:38hiredmanthere was an mit ai memo about it
16:38hiredman"lets just pretend we have infinite ram and crash when it runs out"
16:38ChousukeThere is one that's used for game development, right?
16:39hiredman"crashing is faster than gc anyway"
16:39Chousukeor at least was.
16:39tonyllol or maybe just add a function that garbage collects anything
16:39Chousukelike free()? :P
16:40tonylan on-called gc
16:40tonylyeah
16:40tonyl:P
16:40hiredmanyetch
16:40hiredmanany way, using boehm is really easy, just link in and use
16:41cemerickrhickey: "I'm not a Lisp expert. Helpful suggestions are always welcome." – Rich Hickey http://dotlisp.sourceforge.net/dotlisp.htm :-D
16:41Chousukeoh right, this one http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp
16:41hiredmanthank god he ignores so many suggestions
16:43cemerickI remember tinkering with jFli and jFoil years ago. Amazing how things change.
16:48pdlogantonyl: "wonder how a no-garbage-collected lisp will look"...
16:49pdloganway back in the days of the lisp machine, we'd often run as long as possible w/out GC then just reboot.
16:50hiredmanI was reading a paper about an os written in ml, and apparently ml, or at least the ml they used is stackless
16:50hiredmaneverything is in the heap
16:51pdloganseveral near-real-time lisp and smalltalk systems I am familiar with would pre-allocate a lot of stuff into pools, turn off GC, and "manually" allocate and free.
17:04hsuhanyone knows if you can use a connection pool with ClojureQL?
17:06dnolenhsuh: you can
17:09lancepantzhsuh: you can either imbed c3p0 or use a jndi resource
17:09lancepantz*embed :)
17:13belunhi what exactly does derefing mean ?
17:14cemerickbelun: obtaining a value from a reference type (atoms, refs, futures, etc) using @ or deref
17:14hiredman,(macroexpand '@foo)
17:14clojurebot(clojure.core/deref foo)
17:14belunthere is no other way ?
17:15hiredman^- what deref'ing means
17:15hiredmandepends on the reference type
17:15belunwhy are those data types called reference types\
17:15hiredmanderef is just a function that calls the .deref method of something that implements the IDeref interface
17:16belun(i only know they are used for concurrency)
17:16belunok what is the purpose of that interface ?
17:17cemerickbelun: This might help explain the higher-order objective: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
17:19belunwill watch for that
17:19belunthx for help
17:19cemerickwhew, that was a low-bandwidth connection
17:49lancepantzKirinDave: you guys are using both scala and clojure at banksimple, correct?
17:49KirinDaveYes.
17:50lancepantzboth backend?
17:50KirinDaveyes, although some of both will likely make it into the frontend
17:50KirinDaveBecause it's most likely gonna be jruby up in there
17:51KirinDavePadrino + jruby, I think they're suggesting
17:51lancepantzinteresting, haven't heard of it
17:51headiusjruby up in there?
17:52headiusjruby all up in my sh*t
17:53KirinDaveheadius: We'd like to.
17:53KirinDaveheadius: I have come around from that time where I was skeptical @ Powerset. :D
17:53headiusjruby in the front with something else in the back is a popular JVM combination these days
17:53headiuslinkedin's another big one very happy with that combination
17:56KirinDaveheadius: Well, the ability to share code between langs is really exciting to me
17:56KirinDaveheadius: I can write some clojure that talks to jruby and is also seating scala modules. That's wild.
17:56headiuswe've started to use that as a selling point of JRuby over other Ruby impls in fact
17:57headiusaccepting that Ruby's not the only kid on the block and showing how easy it is to use the right tool for the right tier
17:57KirinDaveYeah
17:59SgeoSo
17:59SgeoHeard about the O(log_32 n) != O(log n) debacle, or at least part of it
18:00hiredmanonce you start writing business logic on top of your crud being polygot is a pain if you cannot share the business logic
18:02quizmehttps://github.com/thirdreplicator/levenshtein/blob/master/src/levenshtein/core.clj <-- is there a better way to parallelize this?
18:06SgeoJust to be sure, everyone is aware that log_32 x = log_b x * a_constant (I think a_constant = 1/log_b 32)
18:12ChousukeSgeo: There was no "debacle". Just people being more or less rigorous with their notation :P
19:08rata_hi
19:12RaynesHas the getting started stuff on assembla been moved to confluence yet? I need to link to it, but I don't know where *to* link.
20:25mattmitchell_aye, could someone tell me why this isn't printing? I'm guessing it has to do with lazy seqs? (map #(prn ( * 2 %)) [1 2 3 4])
20:25amalloymattmitchell_: got it in one. lazy seqs
20:25amalloywrap the whole thing in a (dorun)
20:25mattmitchell_amalloy: i have so much to learn :)
20:26mattmitchell_amalloy: ha yeah that works, i need to read up on lazy seqs
20:26mattmitchell_thanks!
20:38joshua__Hi! I'm using Compojure, Enlive, and Appengine Magic. I was wondering what the best way of getting from a change to the code to a refresh of the browser is. Like is there a way to avoid having to restart the server and recompile after every typo?
20:40tomojdoes swank-clojure work on app engine? :)
20:42tomojI suppose not
20:42joshua__I think that it does, not sure.
20:43joshua__The appengine magic package mentioned you could use some datastore services within swank at least.
20:44_atoaccording to the appengine magic README the normal development workflow is develop locally against jetty
20:44tomojwait, are you talking about seeing the changes on GAE?
20:44tomojor on your local jetty?
20:45joshua__local jetty
20:45tomojand do you use swank already?
20:45joshua__Yea.
20:46tomojsounds like a problem with the magic package to me..
20:46joshua__I've been using lein repl since I woke up though...
20:46tomojit's easy to make it so that when you C-c C-k the handler you passed to jetty, the changes are automatically in effect
20:46joshua__So I guess I should use swank?
20:46joshua__Alright.
20:46tomojah, I'd give it a try, yeah
20:47tomojwhen you def-appengine-app, you might have to pass #'handler instead of handler
20:47tomojnot sure, never used it
20:48hiredmanright, you do the same thing in ring if you want to pick up changes
20:48amalloytomoj: i read the middle of this conversation first, and "sounds like a problem with the magic package" sounded like when someone wants the computer to just do what you want instead of what you said
20:48tomojI misread their readme and thought they did this part
20:49tomoj(and also thought swank was already in use)
21:12joshua__Thanks guys! I understand it now and it is working.
21:25rata_technomancy: I was wondering if a (defn-debug ...) that puts a (swank.core/break) at the end of the function (i.e., that lets you see all the locals of the fn) but also lets you see the result of the function would be of interest for the general swank-clojure user
21:26rata_(result in the sense of returned value)
21:55quizmehow do you determin how much memory a variable is using in the JVM ? like for example how much memory is (def x {:a 1}) taking up?
21:56amalloyquizme: that's a hard thing to define, let alone ask the computer to tell you
21:57amalloyfor example, it had to create objects for the :a keyword and the x symbol in order to make that definition. but those will still be around when it leaves, and they're not really part of the data from your POV
21:57amalloydoes it count them, or just the 4-byte reference to them?
21:58quizmeok
21:59quizmethere isn't anything like (size-of x) ?
21:59amalloyquizme: see above. what would it return?
22:02quizmei guess the before and after difference of the memory used.
22:04quizmebut including the data structures it relies on
22:04rata_quizme: short answer: there isn't
22:05quizmehow about a way to determine the amount of memory used by the JVM currently.
22:06rata_quizme: visualvm
22:06quizmerata_ ok cool thanks i'll check it out
22:06rata_it let's you profile memory also... maybe that's what you want
22:07quizmerata_ yeah thanks. I have been wanting profiling tools.
22:08rata_visualvm is the most amazing profiler I've come to know
22:08rata_but for a reason I don't understand, it doesn't work with swank for me
22:09rata_I must compile a clojure program to do the profiling
22:09rata_coming from c++, that's not really an issue =P
22:10dnolenrata_: that's weird, visualvm + swank works just fine for me.
22:10rata_also, it's probably just something I haven't figure out yet
22:10rata_yes... I should be doing something wrong
22:12rata_it was just a quick attempt... I didn't sit down to think what could be causing the problem
23:10tonylgood night
23:14technomancyrata_: I don't like the idea of changing the code for debugging purposes. you could do something less invasive using the same strategy as stubbs: http://technomancy.us/141
23:14technomancybasically just alter-var-root for all defns that have :break metadata or something.
23:14technomancyor add-hook rather
23:15KirinDavetechnomancy: Hey man, I was hoping to get your advice on something. A piece of code I wrote has been bugging me.
23:15KirinDavetechnomancy: Got a sec?
23:16technomancysure
23:16KirinDavetechnomancy: This seems liek a lot of code for a fairly simple task of parsing HTTP 1.1 compliant dates. Any advice?
23:16KirinDavehttps://gist.github.com/705478
23:19technomancyI would use for rather than keep with a fn literal
23:19KirinDavetechnomancy: Oh?
23:20technomancyI wouldn't say that's particularly a lot of code to perform that task
23:20KirinDavetechnomancy: How about for the strategies?
23:20KirinDaveIs there a more elegant way to do that, you think?
23:20technomancyI mean, it depends on how forgiving you want to be, but the JDK doesn't give you much to work with
23:20rata_technomancy: I like the idea of the :break in the metadata... it's that part what really matters... btw, is there a leiningen plugin that does just that?
23:21KirinDavetechnomancy: Well this is using Joda, which is also kinda tedious for fuzzy date matching
23:21technomancywe use something fairly similar for our date parsing
23:21technomancyjust run through a list of strategies, sanest first
23:22technomancyoh actually for may not be quite right to replace keep there
23:22Licensertechnomancy: the curl thing is solved the rlwrap and user thing are still present in the master/stable branch
23:22technomancyKirinDave: but I'd use filter rather than keep. I would save keep for when you are calling out the fact that you want a false/nil distinction, which is very rare
23:23technomancyLicenser: cool; I'm looking at that ticket now =)
23:23KirinDavetechnomancy: Would using for make the code shorter?
23:23Licenserkk
23:24LicenserIt contains are required fixes already - I realize that I am probably the only clown using clojure on solaris so I try to only report when I know how to fix it :P
23:24technomancyKirinDave: not really; you can use a :when clause, but you still have to make the body of the "for" include the value itself so it's not really much of a win.
23:25technomancyfor is more of a win when people use filter and map on the same seq
23:25technomancyLicenser: well it's nice to have people submit bug reports rather than just complaining like the Windows users sometimes do =)
23:25Licenser:P
23:26Licenserthat is since we are all developpers here - windows people excluded *runs to hide*
23:26KirinDavetechnomancy: Thanks for the input.
23:27technomancyKirinDave: sure.
23:27technomancyis clj-time a pretty literal wrapper around joda, or would it make sense to add some timezone-savviness there?
23:28KirinDavetechnomancy: I'm not trying to be the best at dates. The HTTP 1.1 spec says I can demand GMT/UTC.
23:29LicenserSee you later peope!
23:29KirinDavetechnomancy: But I do think that clj-time could really stand for some of that. JodaTime has a lot of shortcomings
23:29technomancyKirinDave: aren't you lucky =)
23:29KirinDavetechnomancy: Ha.
23:29KirinDaveEvidently a lot of webservers ignore that and allow arbitrary timestamps. I say "eff that"
23:30technomancywe have seen such wacky nonsense as: Sat, 1 Sep 2007 00:01:09 +{0}{1}
23:30technomancyI do appreciate how the JDK is relatively sane with things like "the 35th of November" rolling over into December
23:32tomojI had wacky nonsense like 2-00-00
23:33tomojyear 2
23:33KirinDaveHa
23:33KirinDaveI will just throw your shit out if you send that to me on an if-modified-since header.
23:33KirinDave"Screw you and the date unparser you rode in on."
23:33tomojoh, that was squirreled away somewhere
23:34tomojoriginal source -> clojure -> php -> solr :(
23:34tomojphp is the culprit of course
23:34Licenser*look clj-time up since he exactly nees things like the current day now*
23:34technomancy406 not acceptable!
23:34technomancy406 This Simply Will Not Do
23:35technomancyin case anyone hasn't seen it yet: http://lizrevision.com/sms-shorthand-for-geeks-using-server-response-codes.html
23:39KirinDave406 Screw You (And The Horse You Rode In On)
23:43technomancyUser-Agent: Horse (Mozilla 5.0/compatible)
23:52technomancyrata_: oh sorry, yeah the stubbs plugin in the link there shows an example of how you'd do that in a lein plugin
23:57rata_technomancy: yes, but it seems a little complicated for a newbie, thus I was wondering if there already exists a plugin for doing what I said using somethink like :break in metadata