#clojure logs

2011-11-07

00:07leo2007Joy of Clojure says the expansion of '(-> 25 Math/sqrt int list)' is (list (int (Math/sqrt 25))), which is not the value of (macroexpand '(-> 25 Math/sqrt int list))
00:07leo2007ideas?
00:07leo2007(list (clojure.core/-> (clojure.core/-> 25 Math/sqrt) int))
00:08tomoj(doc macroexpand)
00:08clojurebot"([form]); Repeatedly calls macroexpand-1 on form until it no longer represents a macro form, then returns it. Note neither macroexpand-1 nor macroexpand expand macros in subforms."
00:09tomoj,(clojure.contrib.macro-utils/mexpand-all '(-> 25 Math/sqrt int list))
00:09clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.contrib.macro-utils>
00:10leo2007tomoj: OK
00:10tomojtools.macro now I think?
00:10tomoj,(do (require 'tools.macro) (tools.macro/mexpand-all '(-> 25 Math/sqrt int list)))
00:10clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: tools.macro>
00:12amalloyclojure.walk
00:12amalloythough tools.macro probably has it too
00:13amalloy&(use '[clojure.walk :only [macroexpand-all]])
00:13lazybot⇒ nil
00:13amalloy&(macroexpand-all '(-> 25 Math/sqrt int list))
00:13lazybot⇒ (list (int (. Math sqrt 25)))
01:18flognikrok, just in case someone is still listening and interested in the emacs24/swank challenges I was facing earlier: emacs (/Applications/Emacs.app/Contents/MacOS/Emacs in my case) needs to be run from within the project root -- it was my error to expect that opening a file within the project root (such as project.clj) would help … I know this is mentioned in the swank-clojure README that "From inside a project, invoke M-x clojure-jack-i
01:18flognikrbut for me it only works if I start emacs from within a clojure project...
01:19amalloyflognikr: that is not the expected behavior, sounds like a mac problem
01:20amalloysend technomancy a github issue or something?
01:20flognikramalloy: thanks -- I am just worried that I am making a rookie emacs setup mistake, sending technomancy on a wild goose chase.
01:21mindbender1I'm getting "java.lang.ClassNotFoundException: java.swing.JPanel" after using (ns foo.bar (import (java.swing Jpanel JFrame ...) and compiling with C-c C-k to repl user namespace
01:21amalloymindbender1: javax
01:21amalloyand also :import
01:21mindbender1ok thanks
01:22mindbender1also how do I refer to my other ns ?
01:22technomancyflognikr: that is very strange
01:22technomancyI have never heard of that being a requirement before
01:23flognikrtechnomancy: I am sure it is not a requirement, but it made it work for me :-)
01:23flognikrit's happily swanking now
01:23mindbender1I used (use foo.bar) is that right?
01:24technomancyclojurebot: ns?
01:24clojurebotns is unfortunately more complicated than it needs to be, but http://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns may be helpful.
01:24technomancymindbender1: ^^
01:24mindbender1ok thanks
01:28Raynesamalloy: That is hardly a mac problem.
01:28RaynesSounds more like an emacs problem.
01:28amalloyRaynes: "a problem related to your being on a mac", not "a problem that all macs have"
01:29RaynesI still don't think that's true. At least, I've never heard of this problem. Path problems, sure, but not Emacs not knowing where it is.
01:29RaynesSo, if it is a being-on-a-mac problem rather than a something-weird-going-on-with-emacs problem, then I guess not many people have had this problem.
01:30RaynesJust seems strange.
01:30amalloyRaynes: all problems are caused by being on a mac
01:32flognikramalloy: not quite
01:32RaynesI hate you, amalloy.
01:32flognikrraynes: yes, it is strange.
01:35mindbender1amalloy: I'm still getting java.lang.ClassNotFoundException: javax.swing.JFrame
01:39flognikrso my hopes are dashed once again. it is true that I now can use C-x C-e to veal expressions, the result appears in the mini buffer. However, when I C-c C-l the current buffer, it doesn't actually happen in the *slime-repl*
01:39flognikrthe footer of the slime-repl also shows *slime-repl nil*
01:40flognikrthis can't be good.
01:41amalloy,javax.swing.JFrame
01:41clojurebotjavax.swing.JFrame
01:41Raynes&javax.swing.JFrame
01:41lazybot⇒ javax.swing.JFrame
01:41amalloy,(seq (.getDeclaredMethods javax.swing.JFrame))
01:41clojurebot(#<Method public void javax.swing.JFrame.remove(java.awt.Component)> #<Method public void javax.swing.JFrame.setIconImage(java.awt.Image)> #<Method protected java.lang.String javax.swing.JFrame.paramString()> #<Method public javax.accessibility.AccessibleContext javax.swing.JFrame.getAccessibleContext()> #<Method protected void javax.swing.JFrame.processWindowEvent(java.awt.event.WindowEvent)> ......
01:41Raynesamalloy: ^ I never did blacklist that, since the package couldn't be found unless it had already been referenced in some way.
01:43flognikrI stand corrected -- the last experience was due to operating in the wrong namespace on the slime repl
01:47Raynesflognikr: Lies. I bet you're sitting down right now, not standing corrected.
01:48flognikrraynes: sort of.
02:33Iceland_jacktechnomancy: that's part of it
02:34Iceland_jackbah, sorry technomancy
04:02Blktgood morning everyone
04:31lnostdal (eval-after-load 'clojure-mode '(add-hook 'clojure-mode-hook ...)) ;; doesn't seem to get evaluated when clojure-mode is activated anymore
04:32lnostdalnot sure when this happened; i'm following clojure-mode via git
06:15kzarcouchDB lets you request a continuous feed of changes, http://wiki.apache.org/couchdb/HTTP_database_API#Changes it keeps the socket open to avoid polling and each new line is a new event. I want to turn that feed into a Clojure sequence that I can map over. I'm not sure how to do it in a way that keeps the socket open though, how should I go about it?
06:39luciankzar: doesn't clutch handle that?
06:46kzarlucian: don't think so
06:47lucianif there's a way to get to the stream, i think there are methods to read a line
06:49kzarlucian: Yea, I can use clojure.java.io/reader for example to open a connection and then line-seq to pull lines off. I'm just not sure how to do it in a way that keeps the connection open and blocks the sequence while we're waiting for new lines to come in
06:49cemerickkzar: clutch supports that very directly
06:51luciankzar: you could do it with a closure, i think. but if clutch supports that, us eit
06:51kzarcemerick: Oh, yea you're right. In fairness I did google around for the feature but I didn't check clutch.clj myself
06:52kzarcemerick: In hidsight find-doc would have found it I guess
06:52cemerickYeah, I hear you :-)
06:52cemerickOnce I'm done with the current refactoring, I'll put together some comprehensive docs.
06:56kzarcemerick: Cool :) it's great for me anyway, saves me a job. Does it give you access to the full doc of the change (include_docs=true option)?
07:34cemerickkzar: you need to specify that as an option, but yes
08:06leo2007,autodoc
08:07clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: autodoc in this context, compiling:(NO_SOURCE_PATH:0)>
08:18leo2007how to use slime autodoc as shown in this video http://www.youtube.com/watch?v=lf_xI3fZdIg ?
09:12dbushenkohi all!
09:12dbushenkohow to generate a class and override a method?
09:13Chousukegen-class, but it's often not what you want to do. Do you need to subclass a concrete class or are you working with interfaces
09:13Chousuke?
09:19Dranik_Chousuke, thanks!
09:19Dranik_probably, proxy will go there...
09:21mindbender1when I clojure-jack-in successfully to a project from emacs I always get errors trying to clojure-jack-in to another project after confirming no to emacs request to kill the existing swank buffer
09:33stuarthallowayofficial pronunciation of "leiningen", anyone?
09:33stuarthallowayhard or soft g?
09:33zerokarmalefti'd guess hard g
09:33stuarthallowayme too'
09:34zerokarmaleftit's inspired by a story that's germanic in origin isn't it? that's a clue for someone more well-versed in german phonics than me
09:34dakronestuarthalloway: it's on the FAQ for lein's readme
09:35stuarthallowaydakrone: indeed it is! thanks
09:36zerokarmaleftmy linguistic rabbit trail would've been more fun :P
09:38davidruppQ: How do you pronounce Leiningen?
09:38davidruppA: It's LINE-ing-en. ['laɪnɪŋən]
09:39davidrupp^ex https://github.com/technomancy/leiningen
09:42stuarthallowaydavidrupp: congrats on new job!
09:51fdaouddavidrupp? of "language war/trolling" fame?
09:54technomancythey actually got the pronounciation wrong in the movie ಠ_ಠ
09:54technomancybut it had charleton heston so I guess that kind of makes up for it?
10:01davidruppstuarthalloway: thanks, dude! having lots of fun!
10:01davidruppfdaoud: you remember that?!
10:01mdeboardlol
10:01TimMctechnomancy: There was a movie? o.o
10:01TimMcclojurebot: How do you pronounce Leiningen?
10:01clojurebotleiningen is a build tool designed not to set your hair on fire (http://github.com/technomancy/leiningen)
10:02zerokarmaleftleiningen delivers the dramatic action type of role that won him the Oscar for "Ben-Hur"!
10:02dakronetechnomancy: did you ever see the MacGuyver leiningen episode?
10:02cemerickdavidrupp: the internets never forget :-)
10:03technomancyTimMc: http://en.wikipedia.org/wiki/The_Naked_Jungle
10:03technomancydakrone: yeah... that was weird. I mean they are both great, but they, um, don't compose so well.
10:04dakronetechnomancy: yea, it was a really strange one-off for MacGuyver
10:04fdaouddarkrupp: of course! it was a blast! I did the Java web framework spinoff, it was an instant success :D
10:04cemerickdakrone: MacGuyver leiningen episode?!?
10:05davidruppfdaoud: i remember when you posted yours. sincerely flattered, i am.
10:05TimMcCould someone who has Unicode support give Clojurebot a factoid about Leiningen pronunciation?
10:05fdaouddavidrupp: you rock.
10:06TimMc(Unicode support in their client)
10:06raekstuarthalloway: neither hard not soft. the "ng" digraph should be pronounced like "ng" in "sing" (according to the German orthography resources I could find)
10:06dakronecemerick: https://secure.wikimedia.org/wikipedia/en/wiki/List_of_MacGyver_episodes_(season_1) episode 6: "Trumbo's World"
10:06TimMcpronounced like the letter eng
10:06zerokarmaleftraek: nice :D
10:07technomancyis there a metadata-emitting pr-str?
10:07TimMchttps://secure.wikimedia.org/wikipedia/en/wiki/Eng_%28letter%29
10:07raekthe only other plausible pronunciation would be Lein-ing-gen, that is, "ng" plus "hard g"
10:07raek(German does not have the "soft g" of English)
10:08raekTimMc: how do I add the factoid?
10:08cemerick,(binding [*print-meta* true] (pr-str ^:foo []))
10:08clojurebot"^{:foo true} []"
10:08cemericktechnomancy: ^^
10:08technomancycemerick: aha; very handy. thanks.
10:09raekclojurebot: Leiningen pronunciation is LINE-ing-en ['laɪnɪŋən]
10:09clojurebotIn Ordnung
10:09raekclojurebot: Leiningen pronunciation?
10:09clojurebotLeiningen pronunciation is LINE-ing-en ['laɪnɪŋən]
10:10TimMcI was thinking more like "How do you pronounce Leiningen?", which is likely to be triggered by the original inquirer.
10:10chouserclojurebot: Lein?
10:10clojurebotlein is http://github.com/technomancy/leiningen
10:10chouserclojurebot: Lein?
10:10clojurebotlein is http://github.com/technomancy/leiningen
10:10chouserclojurebot: Leiningen?
10:10clojurebothttp://github.com/technomancy/leiningen
10:11chouserheh
10:11TimMcMight be close enough...
10:11raekTimMc: yes, but I don't know how you make clojurebot react to that... :-)
10:11TimMcclojurebot: How do you pronounce Leiningen?
10:11clojurebotleiningen is a build tool designed not to set your hair on fire (http://github.com/technomancy/leiningen)
10:11TimMchrmf
10:11TimMcraek: How do you pronounce Leiningen? |is| <reply>etc.
10:11chouserclojurebot: pronounc Leiningen
10:11clojurebotthe leiningen screencast is on full disclojure: http://vimeo.com/8934942
10:11cemerickTimMc: you'll go mad trying to cover the variations.
10:12davidruppclojurebot: I am lying.
10:12clojurebotNo entiendo
10:12davidruppcurses!
10:12raekclojurebot: How do you pronounce Leiningen? |is| <reply>LINE-ing-en ['laɪnɪŋən]
10:12clojurebotAck. Ack.
10:12raekclojurebot: How do you pronounce Leiningen?
10:12clojurebothttp://github.com/technomancy/leiningen
10:12fdaouddoesn't everybody just say Lein anyway?
10:13cemerick…which also has multiple pronunciations :-P
10:13mdeboardnein
10:13TimMcclojurebot: botsmack
10:13mdeboardlein has ein pronunciation
10:13clojurebotclojurebot evades successfully!
10:14raekEnglish (especially American) really favours one-syllable words...
10:14TimMcIndubitably.
10:14fdaoud"line" or "lane"?
10:15mdeboardline
10:15raekline
10:15TimMcline
10:15TimMcdisco ball
10:15mdeboardlein, nein, ein
10:15mdeboardschwein
10:15mdeboardvein
10:15mdeboard:P
10:15TimMcfein(man)
10:15mdeboardfeign*
10:15TimMc(feyn)
10:15mdeboardrein
10:16mdeboardbut those aren't German like Leiningen is
10:16TimMcclojurebot: what have I done?
10:16clojurebotPardon?
10:16raekanyone in here who speaks German natively? (mdeboard?)
10:16mdeboardraek: nein
10:17fdaoudI thought it was "Lenin Jen". oh well.
10:21fronxraek: german here!
10:21fronxLie ning en
10:22TimMcbam, done
10:23fronxso ['laɪnɪŋən] was correct.
10:23raekfronx: terrific. thanks for confirming!
10:29fdaoudso like "silver lining 'n' so on.."
11:11kzarI found clojure.data.json/pprint-json doesn't give me very pretty JSON. Is there an alternative around?
11:23leo2007why sometimes `swank' is listed in `lein help'?
11:25leo2007is not*
11:26seancorfieldit depends which plugins are installed
11:28leo2007seancorfield: how to install my own copy of swank-clojure?
11:28seancorfieldif you have swank installed globally, it'll show up wherever you run lein help but if you only have it as a dev-dependency, it'll only show up when you run lein help in that project
11:28seancorfieldthis will install it globally (off the top of my head): lein plugin install swank-clojure 1.3.3
11:29churibhttp://clojure.org seems down from here (germany). Anyone else experienced this?
11:31redingerchurib: Yep, down for me too, I'll look into it. thanks for the heads up
11:31davidruppchurib: no response here either.
11:32fdaoudwhat is the conj? clojure conference, with a j as a play on clojure and conj function?
11:34redingerfdaoud: Yep, exactly right
11:34mdeboardI don't approve of that :(
11:34mdeboardMakes it hard to find information about the actuakl function conj :P
11:34redingermy repl knows nothing about the conference. :)
11:35flognikr,(doc conj)
11:35mdeboardgoogle does
11:35clojurebot"([coll x] [coll x & xs]); conj[oin]. Returns a new collection with the xs 'added'. (conj nil item) returns (item). The 'addition' may happen at different 'places' depending on the concrete type."
11:36fdaoudredinger: thanks. found it (http://clojure-conj.org/schedule) man, wish I could be there!
11:36redingerclojure.org is back again
11:37churibredinger: thanks!
11:37kzarcemerick: That watch-changes feature works great thanks, I was in a bit of a rush to get the "web-hook" gizmo working and in the end it came to 20 odd lines of code :)
11:37cemerickkzar: nice! :-)
11:38cemerickThat was all Tunde, actually.
11:41seancorfieldfdaoud: some of my friends (and one of my colleagues) are at the clojure training ... looking forward to their reports
11:41seancorfieldi fly out on wednesday (early - ugh!) so i can be there at a reasonable time in the evening
11:41seancorfieldthere's always http://clojurewest.org in march!
11:43fdaoudseancorfield: yeah, in my dreams!
11:44mdeboardAnyone know what rhickey's keynote is covering?
11:44mdeboardcemerick: Tunde?
11:45redingermdeboard: He hasn't shared the details yet.
11:45mdeboardBaratunde?
11:45mdeboardredinger: I see. It'll be hard to top Simple made easy
11:46tensorpuddingwhat's the best clojure tutorial
11:48mdeboardtensorpudding: This is just my opinion but I don't believe there is a really great one out there that you'll find labeled a "tutorial". I highly recommend 4clojure.com
11:48mdeboardIt will give you some direction to your reading and whatnot
11:48tensorpuddingi tried following it
11:48tensorpuddingit seems light on telling you things though
11:49mdeboardThere's no "Learn You a Clojure" or "Learn Clojure the Hard Way"
11:49jrgarciaCan any Paredit users help me out... This is driving me nuts. I have a function wrapped with future. (future (fn...)). How do I remove the opening paren before future, future and the paren that matches that opening paren?
11:49flognikr<ctrl -d>
11:49flognikrremoves one paren
11:49mdeboardtensorpudding: Well, you have to search for answers for sure. I also recommend picking up Joy of Clojure and/or Practical Clojure.
11:49yaziriani usually just C-u (or is it C-q, my fingers remember but i do not)
11:49jrgarciaWhenever I (C-d) it just goes past the opening paren.
11:50tensorpuddingdon't like books
11:50tensorpuddingthey get outdated
11:50mdeboardlol
11:50yazirianbut that's "breaking the rules"
11:50mdeboardwelp
11:50tensorpuddinglike every tutorial i find on the internet
11:50mdeboardEverything gets outdated...
11:50tensorpuddingunless they get updated regularly
11:50mdeboardOk
11:50mdeboardThen I don't know what to tell you
11:50tensorpudding4clojure is fine
11:50mdeboardif you don't want to read and can't research for yourself based on the problems from 4clojure.com then you might as well just give up
11:51tensorpuddingall i really need is structure
11:51tensorpuddingand api docs
11:51TimMctensorpudding: Pick a project. Start writing.
11:51yaziriantensorpudding: there's no real substitute for muddling through a first project. the project itself will give your research (googling, etc.) direction
11:51tensorpuddingi'm writing a blog webapp
11:51yaziriansounds like a great starting point
11:52raekthe menu on the left on clojure.org can serve as a map to what's included in the language
11:52tensorpuddingi had a half-working one but i was convinced to rewrite it using noir
11:52tensorpuddingbut right now i'm working on my model
11:52tensorpuddingi still haven't fixed that issue with dates
11:54jrgarciaOk, I fixed it... I just turned paredit-mode off and back on :)
11:55jrgarciaNot the best way, but the quickest until I understand paredit better.
11:56yazirianjrgarcia: it's C-u that lets you tell it "no really, i meant it, delete this next paren i try to delete"
11:58tensorpuddingugh
11:58tensorpuddingi hate being forced to write anonymous functions
11:59jrgarciayazirian: Oh... I get it. I was just trying C-u. I just realized I needed to add the C-d. (I'm new to emacs/Aquamacs, I'm a Vim guy)
11:59clojurebotHuh?
12:00yazirianyeah its like an escape code :)
12:01tensorpuddingyou can't use recursion in an anonymous function can you?
12:01tensorpuddingis there a way to refer to the calling function?
12:01TimMctensorpudding: recur
12:01tensorpuddingi thought that was a special form that only worked with loop
12:02TimMcIt works for tail recursion in functions as well.
12:02TimMcYou can also name your inline function: (fn foo [x] ...)
12:05tensorpuddingoh
12:05tensorpuddingdidn't know fn could do that
12:06TimMc,((fn foo [] (type foo)))
12:06clojurebotsandbox$eval137$foo__138
12:08aaelonyThe R statistical language (www.r-project.org) community has the R Journal (http://journal.r-project.org/current.html) that provides refereed articles about using R in practice. Has anyone considered whether a "Clojure Journal" might similarly be a good idea?
12:12mdeboardtensorpudding: There are several good books that describe in great detail and very lucidly exactly how that works.
12:16llasramReading through the Clojure source code, I noticed that there are a few reader macros I haven't seen documented anywhere: `#!' is a comment, exactly the same as same as `;'; and `#=(...)' does read-time evaluation of the enclosed form
12:17llasramAre these just lesser-known, or should they be avoided as undocumented features?
12:18sridamalloy_: with -Xmx80m, RSS went up to 200M (from 130M) over the course of 2 days.
12:20sridnot sure where the memory leak is. i do use `permanent-channel` (from lamina), which is not directly consumed but gets forked to handle websocket connections via aleph.
12:24cgrayhi, i just switched to using clojure-jack-in, and it's great, but the eldoc-like functionality seems to be gone... is there any way to get it back?
12:38TimMcllasram: #=() is not well-documented, but should be.
12:39TimMc,(binding [*print-dup* true] (pr-str (first {:a 1}))) ; llasram
12:39clojurebot"#=(clojure.lang.MapEntry/create [:a 1])"
12:47llasramTimMc: Cool. That is good to know, because that's the one I actually find myself needing right now :-)
12:55chouser,(read-string "#=(clojure.lang.MapEntry/create [:a 1])")
12:55clojurebot#<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>
12:55chouser#=() is sometimes useful, but can be a bit treacherous.
12:59bhenryif i want to make closurescript tell the browser to change window.location how can i do this?
13:00ibdknoxsomething like (set! (.location js/window) "some location")
13:01ibdknoxbhenry, ^
13:01bhenryibdknox: i'm trying it out
13:02ibdknoxthat's assuming that the new property syntax hasn't been merged into master
13:02bhenryis js default? i'm editing someone else's namespace and nothing is required as js
13:02ibdknoxjs/ means the global namespace
13:02ibdknoxin JS terms
13:02bhenryah
13:03bhenryso something that's new is going to make that moot soon anyway?
13:03llasramchouser: I'm trying to use `extend-protocol' to implement a protocol for native byte arrays, and the only thing I've been able to work is #=(java.lang.Class/forName "[B")
13:03ibdknoxbhenry, no, it would just change it to this (.-location js/window)
13:04bhenryokay
13:19jonasenI’m looking for a function like select-keys, but for vectors. (select-keys [:a :b :c :d] [1 3]) returns {1 :b 3 :d}
13:19jonasenIs (vec (vals (select-keys …))) the way to go or is there something more idiomatic?
13:20jonaseni.e., (select-indices [:a :b :c :d] [1 3]) -> [:b :d]
13:20jfieldsis there a way to provide a default implementation for a protocol, similar to providing a default defmethod for defmulti?
13:24devnAnyone have a place to crash Wed. night before the conj? I made an error when making my reservation and realized I have a room booked for the 10th and 11th, but not the 9th. I will buy you hearty libations and/or split the cost of the room if you have any extra space on your floor/couch/etc.
13:25raekjonasen: I think the closest you'll find in core is something like (vec (keep-indexed (fn [i e] (#{1 3} i)) [:a :b :c :d]))
13:25raekhm, sorry. that gives the wrong result
13:25bhenryjonasen: (defn select-indices [v vi]
13:25bhenry (map #(nth v %) vi))
13:26Squee-DWee thoroughly enjoyed hickey's talk on complecting.
13:26TimMcurgh
13:26TimMcstop using that word :-(
13:26Squee-Dwhy? its quite appropriate methinks
13:26fdaoudSquee-D: +1
13:27raek#(nth v %) can even be written as v
13:28Squee-DAbsolutely fascinating that anyone got hoity toity with rich and his guardrail comment. I don't think he drew an appropriate parrallel but man it's funny when the people who have to fight to get others to consider their ideas, then work so assiduously to protect their own in the same closed manner.
13:28bhenryraek: good point
13:28raek,(let [v [:a :b :c :d], indices [1 3]] (map v indices))
13:28clojurebot(:b :d)
13:28Raynesredinger: The white horse link in conj email is dead. Throws me at a Forbidden page.
13:29raekjonasen: in case you also have [:b :d], you could represent the collections as sets and use set/difference to pick out the elements
13:29fdaoudSquee-D: that knitted castle vs lego castle image is a nice reminder to think of while coding.
13:30raek,(clojure.set/intersection #{:a :b :c :d} #{:b :d})
13:30clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.set>
13:30TimMcSquee-D: Where is this talk?
13:30raek,(require 'clojure.set)
13:30clojurebotnil
13:30Squee-Dfdaoud agreed. But don't you think the guardrail's a bit of an oversimplification?
13:30raek,(clojure.set/intersection #{:a :b :c :d} #{:b :d})
13:30clojurebot#{:b :d}
13:30technomancySquee-D: well most people who got upset didn't hear the talk
13:30Squee-DTimMc http://www.infoq.com/presentations/Simple-Made-Easy
13:30TimMcAh, that.
13:30Squee-Dtechnomancy i'd believe it.
13:31technomancyall the drama predated the availability of the recording
13:31fdaoudSquee-D: well, TDD does give you a safety net (as he mentions later in the talk) but it shouldn't be what leads your design
13:31Squee-DI use integration and functional specs as roadmaps and speak-to-me gps's, not as guardrails :D
13:32technomancyspeaking of which, I just discovered that the British call GPSes "satnav" and am jealous.
13:32technomancyit's such a better word
13:32Squee-DNo it shouldn't, but in OO laguages i think Unit testing does help detangle inherent, transparent problems with OO design.
13:32Squee-Dtechnomancy true that :D
13:34Squee-DIf for no other reason than unit testing is less arduous the moment you reduce responisibility in a class. This gives a developer a more direct, concrete feeling of immediate accomplishement than "not hurting myself later"
13:34fdaoudagree
13:35Squee-DI think Rich is blazing a path that I like the look of, but i figure a lot of what he's talking about is akin to min-maxing.
13:35Squee-DSomething that not every person enjoys.
13:35fdaoudmin-maxing?
13:35redingerRaynes: Well that's kind of annoying
13:35Squee-Dits a game-theory term
13:36Squee-Dhttp://en.wikipedia.org/wiki/Min-maxing
13:36Raynesredinger: Also, are you sure Super Shuttle requires a reservation? I checked a few days ago, and the verbage didn't seem to indicate that.
13:36Squee-Dsort of like finding functional minimums and maximums
13:37redingerRaynes: Possibly true, the hotel indicated otherwise
13:38TimMcdevn: Sleep in the bushes. I'm sure they won't mind.
13:38Squee-DPut it another way, in his analogy of juggling, i don't _know_ that finding a way to juggle a single ball is necessarily enjoyable or a good roi... unless the tools for acheiving it become popular (which is where i think the path-blazing comes in)
13:39Squee-Dfdaoud i have small "classifiers" (modules, classes, interfaces) in my code and i consider them to be sufficient 'three ball juggling' solutions. make sense?
13:39fdaoudSquee-D: yes sir
13:39Raynesredinger: https://www.supershuttle.com/en/howitworks.aspx?Location=howitworks
13:40Squee-Dfdaoud all of this in response to feeling challenged by hickey to do better. I'm exhausted by doing better.. but i suspect i'll be happier if i keep digging deepr
13:41redingerRaynes: well there you go
13:43Squee-Dis this conj you boys are talking about?
13:43Raynes:)
13:43RaynesWell, not directly.
13:43RaynesWe're arguing over transportation to the hotel, I think.
13:43Squee-DHeh
13:43devnAnd groveling for lodging on the 9th
13:43Squee-Dim jelous
13:43devnin my case
13:44redingerMy transportation involves a car, that's what I get for trying to help others find transportation. :P
13:44RaynesHeh.
13:44Squee-DI want to be close to or in the US.. where conference and training attendance does not require me or my co to be filthy stinking rich
13:44RaynesI guess I'll take a SuperShuttle. Sounds like fun.
13:45RaynesMostly because I remember where the booth is.
13:45Raynes;)
14:12jonasenraek: bhenry: Thanks, I'm going with the (map ...) alternative which seems simple enough
14:14technomancyhow would you write something like (update-in x [2] conj :x) where x is a vector that could be empty?
14:14amalloyjrgarcia: ugh people are telling you to C-u C-d to turn (future (fn ...)) into (fn ...)? just put point in front of (fn), and press M-r
14:15jrgarciaamalloy: Thanks!
14:15amalloysrid: that's not necessarily a leak, really. in fact sounds like it isn't, because your app would crash in that case. a 200MB jvm with an 80MB heap is not unreasonable
14:16bhenrytechnomancy what about turning conj into another function that handles that
14:16technomancybhenry: I'm thinking of a pad-to function that extends the vector as necessary
14:16shadgregoryhideadd
14:16sridamalloy: so the extra memory was not allocated due to objects in my program (heap)? if so, where would that come from?
14:20amalloysrid: the jvm keeps a lot of stuff in memory. jars it memory-maps, maybe files you open to read, i dunno
14:21amalloyRSS for 4clojure is 150MB on an 80MB heap, virtual is 250. larger than i would like but not exorbitant
14:22sridi not totally sure what i'm going to replace clojure/aleph with (which was a pleasure to work with). perhaps python/gevent ....
14:24srid.. or nodeJS?
14:24sridor cljs->nodejs ;-)
14:27dnolensrid: why not, I have the beginnings of ClojureScript Node.js REPL.
14:34sriddnolen: i'm not confident. its seems very new, and not as common in use as cljs->js.
14:36dnolensrid: sure but, Node.js is just JS + using APIs via its require.
14:37amalloydnolen: nodejurescript?
14:38ibdknoxanecdotally node is pretty annoying.
14:39sridibdknox: because of callbacks?
14:39srid.on(function(... .on(function(..... .on(function(....
14:39djanatynWhat do you think is the best Clojure book for a programmer who has a small amount of experience with common lisp, and a little bit of experience with functional programming?
14:39djanatynI've been jumping from tutorial to book to tutorial.
14:39ibdknoxsrid, callbacks, the APIs that exist for it are often ill-conceived, and they have a serious problem with having 50 solutions for the same thing
14:40dnolenheh, it's a much nicer then working against Rhino - very snappy. Feels almost as zippy as the Clojure JVM REPL experience.
14:40djanatynThey Joy of Clojure seemed pretty cool, but I was a little bit intimidated by the amount of code they were throwing at me in the first few pages
14:40sriddjanatyn: joy of clojure, if you don't like verbose books
14:40djanatynlike an SQL macro before I even knew what a vector is >_>
14:40djanatynwas that just the first chapter, then? I felt kinda bad that I didn't understand everything that was going on
14:40sridwell, you can always come back to it after reading about vectors
14:40dnolenibdknox: heh, yeah I don't really give two hoots about the Node.js ecosystem. But damn V8 is fast, and having access to common system calls is sweet.
14:40davidruppdjanatyn: I like "The Joy of Clojure". You get rationale as well as code.
14:41djanatynah, true.
14:41pandeirodjanatyn: had the same problem, it sorts itself out eventually if you stick with it
14:41djanatynOkay, I'll keep reading "The Joy of Clojure"
14:41dnolenibdknox: also V8 start up time w/ even 14000 lines of JS is near instantaneous.
14:41djanatynvectors are weeeeeeeeeird.
14:41djanatynare they kind of like a substitute for (quote)?
14:42ibdknoxdnolen, V8 is definitely fast, but if the common libs necessary to do anything real with it aren't...
14:42djanatynI know a little bit about common lisp, and not very much about scheme
14:42amalloydjanatyn: definitely not a substitute for quote
14:42ibdknoxdnolen, the difference between sending 5k messages on a socket in nodejs vs 5k on Netty was 2 orders of magnitude
14:42jolydjanatyn: no, they still evaluate the values inside before constructing the vector
14:42gfredericksIs there an official term for function arguments and let-bindings?
14:42joly,[1 (+ 2 3)]
14:42clojurebot[1 5]
14:42ibdknoxdjanatyn, I'm not sure the JoC is a good book to start from scratch with
14:43djanatynI've read up to....I guess, chapter 6 of Practical Common Lisp
14:43ibdknoxdnolen, and didn't scale linearly
14:43amalloygfredericks: locals
14:43Squee-Dibdknox im a from-scratcher, i'm finding it pleasant. I'd rather start with a bookt hat takes the time to describe idioms as it goes.
14:43gfredericksamalloy: thanks
14:44pandeiroibdknox: do you recommend another in particular? i chose it because it was the most recent, and i still think it's not gonna cover protocols (maybe i'm wrong not there yet)
14:44davidruppdjanatyn: vectors are just a data structure, comparable to lists, but with different performance characteristics
14:44amalloy,(1 (+2 3))
14:44clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
14:44amalloy,'(1 (+2 3))
14:44clojurebot(1 (2 3))
14:44amalloyugh i give up. cannot type
14:44ibdknoxunfortunately it's the only one I've read
14:44djanatyndavidrupp: cool. so, they just make clojure faster...?
14:45ibdknoxbut I've done a lot of teaching and I know that for many JoC is not a good starting place
14:45dnolenibdknox: not surprising, on many operations, V8 is still 3-4X slower then JVM, still that's not exactly "horrible".
14:45Squee-Dsrid can i ask why you are replacing aleph?
14:45ibdknoxdnolen, I have less issue with V8 and more issues with node itself
14:46gfredericksdjanatyn: they make certain operations faster than if you did them on lists
14:46ibdknoxand the things that were subsequently built based on node's decisions
14:46davidruppdjanatyn: not "just", but yes, when you use them idiomatically they can give you faster access to items than lists.
14:46sridSquee-D: more like I have to rewrite my project from Clojure to something else that would take <100M of resident memory so that it can be put inside a VM of 1G mem. since this project uses lamina/aleph, I need to find an equivalent library/patten in that new language.
14:46djanatynokay, that makes sense
14:46srid(aleph is used for websocket)
14:46djanatynwhen I was reading about them, I thought "well, why not just use a list instead?"
14:47Squee-Dsrid it's purely a deployment environment limitation then?
14:47davidruppdjanatyn: @see http://clojure.org/data_structures#Data Structures for a discussion of the tradeoffs.
14:47djanatyncan a list be used in every situation a vector can be used?
14:47gfredericksdjanatyn: no
14:47clojurebotGabh mo leithscéal?
14:47sridSquee-D: hmm? clojure has only one deployment/runtime environment, and that is JVM. no?
14:47ibdknoxdjanatyn, lists are rarely used for data in Clojure
14:47Squee-Dsrid because i keep looking at clojure as a very good fit for my reactive programming needs. I don't have vm limitations.
14:48Squee-Dsrid it's also got a cil and javascript env no?
14:48ibdknoxdjanatyn, the idea was to make things have a single and straight forward purpose. When you see a list, it usually only means execution
14:48gfredericksdjanatyn: another distinction is that in code vectors are used for different things, which makes the code more readable
14:48ibdknoxdjanatyn, while vectors are meant to hold data
14:48sridSquee-D: yes, but regular clojure programs (using libraries like aleph) will not work on anything but JVM
14:48Squee-Dsrid but what i'm asking is, if you could pop it on a nice big infrastructure, you'd stay put?
14:48sridmaybe it will work on clr, but not cljs
14:48ibdknoxdjanatyn, this allows you to, at a glance, understand more of what is happening instead of parsing through all the different lists to establish which means which
14:50sridSquee-D: i don't understand your last question. we are limited to deploying to a 1G vm (which will be downloaded by users and run on their laptops/desktops). this VM is none another than http://www.activestate.com/cloud .. highest memory consuming process is a ruby program taking 90M RSS
14:51djanatynokay, thanks for the explanation :D
14:51amalloysrid: i think he's asking: if someone gave you a free 4GB machine for all your deploys would you stay
14:51sriddnolen: i intend to play with cljs->node for sometime to get a feel for it; are you going to clojure/conj as well?
14:52Squee-DSo my question is, is the memory limit of your infrastructure requirements the _only_ reason for you to be seeking alternatives? I'm asking because i do not have those limitations and would like to know your anecdotal views on aleph and clojure for reactive programming :D
14:52ibdknoxsrid, he's presenting :p
14:52sridibdknox: nice :)
14:55sridSquee-D: the _only_, yes. amalloy: "all your deploys" = all the users downloading the VM from that site.
14:56sridi think the VM is currently configured for 2G memory. about 1G is to be used for the apps to be deployed by the user. the VM is running plethora of services already that running a >200M clojure app would start swapping lot
14:56srid... sooner than later.
14:57carki'm coming in late in the discussion, but did you try limiting the memory used by your jvm ?
14:59sridcark: tried passing -Xmx80m to JVM; started with 130M RSS but over 2 days, it went up to 200M.
14:59brehaut"running a >200M clojure app would start swapping lot" is that based on evidence or hypothesis?
14:59Squee-Dsrid i'm replacing a pointlessly complex reactive architecture written in ruby. I'm thinking of using either a less complicated architecture in ruby, or perhaps something in clojure because of it's elegance and simplicity with thread handling.
14:59sridi was thinking if the app was unnecessary accumulating data (lamina queue?), but amalloy suggested it could be the JVM requring more memory (with 80M heap limit still being respected)
15:00carksrid: but do you need 80m for your application heap ? that's quite a lot
15:00carkyou could go as low as 16
15:01Squee-Dbrehaut you attending 'the exceptional conference' ?
15:01brehautSquee-D: if you mean the conj, no
15:02Squee-Dno the auckland conf with that name
15:02brehauti have never heard of it
15:02carkthen you have tyhe permgen size which can be tweaked a bit too
15:02sridSquee-D: i'm not too familiar with reactive programming, though I have some idea of it (eg: callback based on variable value change?)
15:03Squee-Dbrehaut sorry i've got the wrong conf name
15:03Squee-Dtoo many posts in our internal wiki
15:03brehautcodemania?
15:03sridbrehaut: shoudln't have mentioned swapping. >200M was found (by the team) to be "too much" for a operations dashboard app when the process with highest memory was just consuming 90M. it was argued that it would leave less memory for the users to deploy their apps too.
15:03Squee-Dyeah
15:03Squee-Dthat one :D
15:03brehautSquee-D: thought about it. not sure yet.
15:04Squee-Dsrid "responding to events" in a short form
15:04sridcark: but I don't understand what caused the process consume 200M when 80M was the configured heap limit
15:05carkthose 80Mb are only your personal heap
15:05Squee-Dsrid in essence what linq Reactive extensions, node, eventmachine, etc all try to do, which is come at the problem of evented programming from a non-blocking perspective.
15:05carkthere is the permgen, then you need space for the copying garbage collector
15:05carkthough i'm not quite sure about the internals of the gc
15:05sridSquee-D: i come from python background, and i found atom/agent/future (and lamina/aleph) to me much pleasant and easier to work with.
15:05carkit includes an overhead
15:06carkthe overhead will be proportional to your heap
15:06cark(in some cases)
15:07dnolensrid: I will be at the Conj. Seems like you could build something like Aleph on top of ClojureScript Node.js.
15:07nickmbaileyk
15:08sriddnolen: sounds interesting. i hope to meet you there. :-)
15:08bhenrydoes anyone know of problems using (format) in clojurescript?
15:08sridbhenry: like this? http://cemerick.com/2009/12/04/string-interpolation-in-clojure/
15:08sridbhenry: oh, nvm. you were referring to its use in cljs
15:09Squee-Dsrid i don't think the implementation precedes the concept. an agent to me is 'reactive'
15:09Squee-Dinfact page-serach "reactive" http://clojure.org/agents
15:10carksrid: also there's the stack space for each thread... which can be tweaked, maybe you're leaking threads too
15:10sridok. not very different from event-based programming ala python twisted?
15:10Squee-Dsrid yeah i could have included twisted before
15:10sridcark: "leaking threads" as in *number* of threads being out of control?
15:10Squee-Dtwisted inspired eventmachine afaik
15:10amalloycark: i would have guessed that thread stacks are allocated from the heap
15:10carksrid: yes
15:11carkamalloy: i don't think so, tho i might be mistaken
15:11sridafaict, i create threads only on program startup ... unless lamina/aleph does something weird under the hood?
15:12carksrid: only a shot in the dark, it just seems crazy that you can't keep your process under 100mb
15:13sridamalloy: cark - silly me! does the ":jvm-opts" in project.clj get passed *only* in "lein run"?
15:13ibdknoxyes
15:13sridI run the app using "java -jar" on a uberjar. and I'm not passing this explicitly
15:13srid.. thinking this :jvm-opts would have become effective
15:13amalloy*chuckle*
15:14sridperils of being a noob java programmer
15:14carki only recently started using lein, so i wouldn't know
15:15carkthis jvm-opts thing looks interesting =D
15:15amalloythe jvm options have to get passed to the java process somehow
15:15amalloyeither by lein/cake when you run, or by you when you do it manually
15:16sridrestarted the process with "java -Xmx80m -jar ..." and it started with 175M RSS.
15:16carkwhy don't you try something more drastic, like -Xmx16m ?
15:16technomancyit's pretty ridiculous that there's no way on the JVM to distribute a self-contained executable file that contains its own -X arguments
15:17adamhtechnomancy: why is the ridiculous?
15:17adamhmemory requires are a per-computer thing
15:17bhenrysrid: looks like format isn't even a part of cljs
15:17ibdknoxtechnomancy, http://skife.org/java/unix/2011/06/20/really_executable_jars.html
15:18sridcark: amalloy using 64m ... I get 130M RSS; using 32m ... I get 123M RSS. I'll leave it running with -Xmx32m for a couple of days.
15:19amalloy-X is also technically non-standard, right?
15:19carkok now you may start tweaking permgen size, i believe it defaults to 64Mb
15:19technomancymemory is not the only thing -X sets
15:20technomancyibdknox: spectacular hack, but honestly did the JVM engineers never think people would want to do this?
15:21ibdknoxtechnomancy, oh yeah, it's retarded, no question there. Just thought you might find that useful :)
15:21technomancynah, just griping today
15:21sridafter some lamina/aleph activity, memory went up to 135M
15:23cgrayis it possible to do (let [foo (fn [x y z] ...) bar (partial foo 0)] ...) ? or must i use letfn?
15:24Apage43i think that works
15:24brehautcgray: yes that should be fine.
15:24brehautcgray: i dont think you couldnt do that with partial using letfn either
15:24amalloy&(let [foo (fn [x y z] (+ 1 x y z)) bar (partial foo 0)] (bar 6 9))
15:24lazybot⇒ 16
15:27cgraythe problem was between the keyboard and monitor :(
15:27sridafter much lamina/aleph activity, RSS went up to 173M. i need to inspect the lamina queues.
15:29TimMccgray: keyboard and chair
15:29cgrayTimMc: that too :)
15:29TimMcunless you use your computer in a really weird position
15:29ibdknoxI put my keyboard behind me
15:30sridwith -XX:MaxPermSize=32m, initial RSS is 108M. but I see "xception in thread "pool-5-thread-1" java.lang.OutOfMemoryError: PermGen space"
15:30Squee-Di watch my monitor in a mirror
15:30cgrayi just lean forward really far
15:31gtrakpermgen
15:32Squee-DMe, my monitor and keyboard are all energy levels and hide behind Plancks
15:32carksrid : allright, one last thing, are you sure that java won't reduce its memory footprint under pressure ?
15:32adamhsrid - if your permgen is filling up you might want to try CMSClassUnloadingEnabled
15:32adamh-XX:+CMSClassUnloadingEnabled
15:32Squee-D(Plancks make it har dfor you to observe our position and vector)
15:35sridadamh: that lead OutOfMem... error as well.
15:35sridright now, I have "Xmx32m -XX:MaxPermSize=64m -XX:+CMSClassUnloadingEnabled" with 111M as initial RSS that is gradually growing up
15:36adamhhere's my memory line... haven't run into any memory problems with it yet:
15:36adamh-Xmx5000M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m
15:36carkadamh: the goal here is to have a low footprint
15:37srid<100M would be optimal
15:37adamhah
15:40carksrid: maybe you can play with the amount of free heap size to maintain
15:40cark-XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20
15:42adamhthat isn't going to help if you're having permgen issues though
15:43carkpermgen issues were created while trying to reduce its size
15:43sridI notice memory usage for the app to be growing from 111M (minutes ago) to currently 139M.
15:45amalloyhah, i love the suggestion to give it 5GB just in case
15:46sridcark: those two arguments caused the app to start at 180M RSS
15:47carkhaha ok =)
15:47sridspecifically: java -Xmx32m -XX:MaxPermSize=64m -XX:+CMSClassUnloadingEnabled -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20
15:47adamhamalloy: just in case I have to fire up SBT to do scala dev. you can never have enough memory :/
15:47amalloyMinHeapFreeRatio doesn't seem like it's doing much good here
15:48amalloybut if you give your app 96MB of heap+perm, there's no way you'll get under 100MB
15:48carkyes 32Mb is still a lot of heap
15:49carkhave you tried playing with -XX:ThreadStackSize=256 ?
15:49amalloyFWIW lazybot's resident-set size is just 76MB, so it should be possible
15:49carkdefault is 1024 i think
15:50sridi'm trying 16m heap now; started with 107M ... seems to stay close to that now.
15:50brehautsrid: are you running a 32bit or 64bit jvm ?
15:50carklazybot is too lazy to use more memory, gc is exhausting
15:50sridbrehaut: how do I find out? :-) i'm running openjdk on a 64-bit ubuntu 10.04 vm
15:50amalloyjava -version
15:50amalloyi think
15:51srid1.6 --- Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
15:54sridinteresting. mem usage hasn't fluctuated much yet. will give it some more time.
15:54brehautsrid: try putting -d32 in your args
15:55Squee-Dtheres a really good free tool for this kind of tweaking isn't there?
15:55amalloyyeah, that could help quite a bit if he has a lot of small objects
15:55Squee-Dvisualvm?
15:55amalloySquee-D: last i checked irc is free
15:56Squee-Din addition to
15:56Squee-Dhttp://visualvm.java.net/features.html
15:56ibdknoxthat will be $0.25 per question
15:56amalloyibdknox: who does the money go to?
15:56amalloyare there any subsidies?
15:57brehautthats the value of irc, you ask one 25 cent question and get 100 different answers
15:57amalloyer those don't count as questions, do they?
15:57ibdknoxamalloy, money goes to the let Chris work on Clojure all day fund.
15:57Squee-Dthat'll be 75cents please amalloy
15:57ibdknoxamalloy, I will collect at the end of the month.
15:57brehautSquee-D: make sure he pays in US cents
15:57amalloynoooo, now i can't afford the conj
15:58Squee-Dbrehaut aud cents
15:59ibdknoxPayment must be made in wampum
15:59ibdknoxbased on the average calculated exchange rate for the month :D
16:00amalloyman, even though i know what git reset does, i get nervous every time i type it in. what if it throws away some changes?
16:01ibdknoxrhetorical questions are discounted to $0.15
16:01amalloyi'm glad you've got my back
16:01ibdknoxamalloy, :D
16:01arkhDoes anyone know of any clojure-y ways to sanity check the syntax of an email address?
16:01brehautlol
16:01amalloyarkh: (.contains % "@")
16:01ibdknoxlol
16:01ibdknoxregex!
16:01sridcark: amalloy: switching from "-Xmx32m" to "-Xmx16m" made the difference as in RSS stays constant at 108M. i will now give it more than a day of time.
16:02arkhamalloy: hoping for something a little more ; )
16:02brehautibdknox: (inc lol)
16:02sridthough i don't understand why this is so.
16:02amalloyarkh: you should probably not bother for much more
16:02ibdknoxarkh, https://github.com/ibdknox/noir/blob/master/src/noir/validation.clj#L37
16:02amalloyyou could check for . too, but email addresses are insanely hard to validate without being over-aggressive
16:02amalloyeasiest way is to send an email to the address and see if it bounces
16:03brehautarkh: alternatively if you know a parser lib (such as fnparse or what have you) the spec should only talk maybe half a day to port to a simple validator
16:03arohneramalloy: no . is legal if you're sending to a local server
16:03amalloy$google email rfc regular expression validate
16:03lazybot[How to Find or Validate an Email Address - Regular-Expressions.info] http://www.regular-expressions.info/email.html
16:03arohnerbut the spec isn't really relevant, because nothing that matters follows the spec precisely
16:03amalloyarohner: nice. i didn't think of that
16:04arkhthanks all
16:04amalloyarohner: so what? if my mail server follows the spec, and your webapp refuses to send me mail, that's a broken webapp
16:04amalloy#"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]"
16:04arohneramalloy: yes, but the calculation is different if my webapp is say, gmail or hotmail
16:04amalloyis apparently the RFC-compliant regex
16:05cemerickand a shirt with </opinion> at the conj. :)"
16:05brehautamalloy: i presume that means that it accepts everything the RFC does
16:05brehautamalloy: plus some more
16:06amalloybrehaut: i think the claim is that it's a bijection, but i don't really know
16:06amalloyman. bijection is the wrong word there, but it's such a good word
16:11zerokarmaleftdevn, Raynes: ping
16:11zerokarmaleftwhere are you guys staying the 9th?
16:13TimMczerokarmaleft: devn is sleeping in the lobby
16:14TimMc(he's still looking for a room to share for that night)
16:19Rayneszerokarmaleft: I'M
16:20RaynesI'm staying at the Sheraton.
16:20RaynesI'm also experiencing great difficulty typing on my phone. ;)
16:20zerokarmaleftah ok, so the shuttle talk was simply from the airport to the sheraton
16:21RaynesYeah. The Hilton that the conference was at last year had a complementary shuttle service.
16:22RaynesNot so much with this one. But it is understandable. The airport is like 15 miles away.
16:24zerokarmaleftdoh, ~$12 for parking each day
16:26sridmanning clojure folks here?
17:28tensorpuddingi wish i could figure out the source of this korma psql date issue
17:29tensorpuddingi suppose some conversion is necessary but i surely don't know which layer is involved, or how to do it
17:41tensorpuddingERROR: column "time" is of type time without time zone but expression is of type character varying
17:42brehautim guessing here, but are you passing strings ?
17:42tensorpuddingyes, i am
17:42tensorpuddingbut i was told that worked with mysql
17:42brehautits telling you not to do that
17:42tensorpuddingmdeboard showed me code, which i tried and didn't work
17:42tensorpuddingin any case, i don't know what type it ought to be
17:43carktry passing a java.sql.Date ?
17:43mdeboardtensorpudding: No, I used type timestamp
17:43brehauthave you tried creating a java.sql.Date or java.sql.Time ?
17:43tensorpuddingi'm not using jdbc directly
17:43mdeboardtensorpudding: and passed a regular string
17:43tensorpuddingmdeboard, huh?
17:43mdeboardthe type ofthe column I showed you was timestamp
17:43mdeboardand I passed a regular string
17:44mdeboardIt works in MySQL, didn't test in pg
17:44tensorpuddingyou showed me a function which produces a string, i replicated the code
17:44tensorpuddingand passed korma the results of the function
17:44brehauttensorpudding: korma uses JDBC under the hood; its a thin layer on top
17:44tensorpuddingyes, that's what i said
17:45tensorpuddingyou showed me code which you said worked in mysql which doesn't work for me
17:45tensorpuddingit's still strings
17:45tensorpuddingi assume that jdbc turns time format strings into java.sql.Date/Time junk
17:45tensorpuddingi wonder why it isn't working
17:45brehauttensorpudding: perhaps you should stop assuming
17:46tensorpuddingis there something special i have to do in the defentity to let it know this field is a time field?
17:46amalloy(inc brehaut)
17:46lazybot⇒ 6
17:46carkwhy wouldn't you pass a java.sql.Date ?
17:47brehauttensorpudding: pass in a time object. stop bashing strings together and hoping to start a fire
17:47tensorpuddingi don't know what a time object is
17:47tensorpuddingwell
17:47brehauttensorpudding: its a java.sql.Time instance
17:47brehautor alternatively a java.sql.Date instance
17:47tensorpuddingtechnically i have timestamp columns
17:47tensorpuddingwhich are both
17:48tensorpuddingwhat jdbc class corresponds to that
17:48brehautthen use a java.sql.Timestamp
17:48brehautperhaps you could try googling jdbc timestamp and see what comes up
17:48tensorpuddingi don't know what you mean by "use" that
17:48tensorpuddingi did
17:48tensorpuddingit didn't make sense to me because i don't know java
17:48brehaut(java.sql.Timestamp. year month date hour minute second nano)
17:48brehautor
17:48tensorpuddingyech
17:48brehaut(java.sql.Timestamp. long)
17:49tensorpuddingare some of those fields optional?
17:49brehautno
17:49tensorpuddingi don't think clj-time can produce times with nanoseconds
17:49brehautinfact, javadoc tells me that that constructor is deprecated
17:49brehautand that you should use the milliseconds constructor
17:50tensorpuddingwhat do i have to do to be able to use that
17:51tensorpuddingdoes just having the jdbc driver in my project give me java.sql.Timestamp.
17:51brehaut(java.sql.Timestamp. ^long (clj-time.coerce/to-long jodatime))
17:52brehauthttp://download.oracle.com/javase/6/docs/api/java/sql/Timestamp.html it appears to be part of the standard library
17:52tensorpuddingis that the one with or without timezones
17:52brehautim going to leave that as an exercise for the reader
17:53tensorpuddingah man
17:53tensorpuddinghaving to read javadoc?
17:53tensorpuddingthat's a bummer
17:53tensorpuddingwhat is that syntax by the way
17:53tensorpudding^long
17:53tensorpuddingis that for specifying a java type
17:57tensorpuddinghooray
17:57tensorpuddingit works now
17:57tensorpuddingthanks brehaut
18:00brehautdoes anyone have a decent java2d quickstart link? there seems to be a lot of crap on the tubes
18:00choffsteinIf I want to create a sequence of calling a function (that has side-effects) n times, is there a more clojure-esque way than: (map #(fn) (range 1 n))
18:01brehaut(doc repeatedly)
18:01clojurebot"([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"
18:01brehautstill lazy though, so not ideal
18:01cark(doc dotimes)
18:01clojurebot"([bindings & body]); bindings => name n Repeatedly executes body (presumably for side-effects) with name bound to integers from 0 through n-1."
18:02brehautdotimes doesnt create a sequence though :/
18:02carkah indeed
18:03brehautperhaps doall repeatedly ?
18:03carki guess that's the way
18:04choffsteinrepeatedly might work...
18:05choffsteinthanks
18:05amalloychoffstein: #(f) is just f
18:05choffsteinamalloy -- it won't call f?
18:05amalloy#(f) is a function that, when called, calls f
18:05amalloyand f is...a function that, when called, calls f
18:06cark,(repeatedly 3 #(println 2))
18:06clojurebot(2
18:06clojurebot2
18:06clojurebotnil 2
18:06clojurebotnil nil)
18:06carklooks like it's the one =)
18:06brehautamalloy: but it calls it with no arguments
18:07amalloybrehaut: i guess it's not a useful point to make, because (map #(f) foo) is incorrect for any value of f. thus he must have been eliding some details
18:07choffsteinRight, yeah, I meant just (map f (range 1 n))
18:07brehautamalloy: fair point
18:08brehautchoffstein: its probably good form to wrap it in doall so that your side effects occur predictably
18:08choffsteinbrehaut: ah, right. I'll keep that in mind.
18:08choffsteingotta jet. thanks for the quick tips. I'll probably be back to ask more when I have more time :) Thanks!
18:18moogatronicAnyone flying in to Raleigh Wednesday evening, and looking for Food / Beer?
18:21danlarkinthere'll be lots
18:21moogatronicunfortunately, i had to book at an alternate hotel...
18:22zerokarmaleftmoogatronic: same :-/
18:22moogatroniczero: where you staying?
18:22zerokarmaleftmoogatronic: by the airport, everywhere else downtown was full too
18:22moogatronicOh wow. that's farther than me!
18:23moogatronicI'm right near NC State at a holiday inn.
18:23moogatronicthe 100 bus runs every hour from RDU to downtown though.
18:23moogatronicso you should be set as far as to and from goes.
18:24moogatronici'm currently plotting my google maps points of interest for food options. =)
18:25technomancywow, JSR 310 accepts pull requests.
18:25moogatronicfor the specification itself?
18:25technomancyfor the reference implementation
18:25zerokarmaleftmoogatronic: i'll be able to get around with a rental
18:26moogatronicvery modern of JSR310. =)
18:26technomancyibdknox: so are there any restaurants near the Conj hotel that serve Korma?
18:26moogatroniczerokarmaleft: ah, good call. too poor for rental, so i'm rollin' large with the $2 bus rides. =)
18:27ibdknoxtechnomancy, haha unfortunately, despite going to UNC, I don't know downtown raleigh very well :p
18:28moogatronici'm trying to find the good non-chain places...
18:28moogatronicpriority #1: good microbrew
18:28technomancyI'm actually not sure if I've had Korma; I have had lots of Indian food but have been fairly lax at identifying it
18:29danlarkintechnomancy: so far we've found sandwiches and shish kabob
18:29moogatronictechnomancy: i spotted an indian place right up the street from me.
18:29technomancydanlarkin: I expect a full report. =)
18:29moogatronic"India Mahal" but it's pretty far from Sheraton
18:29zerokarmalefttechnomancy: http://bukuraleigh.com/buku/
18:29moogatronicfor some defintions of far
18:30zerokarmaleftthat's only a couple blocks away
18:30technomancysounds expensive
18:30moogatroniceveryone names their menu Dinner.pdf
18:30zerokarmaleftand they don't have korma
18:31moogatronicLooks both tasty and expensive.
18:31moogatronicEthiopian Lentil Wat potato, swiss chard, carrot, red onion, berberé spice, injera flatbread $18
18:31moogatronicther are about $3 worth of ingredients in that.
18:31moogatronicBut i love that stuff.
18:31technomancymoogatronic: http://en.wiktionary.org/wiki/mahal
18:31moogatroniclol.
18:32moogatronicmakes the name even worse than I thought.
18:36moogatronicThe Pit has a menu item labeled "Barbecue & Booze"...
18:37ibdknoxwelcome to the south.
18:37cemerickThe pit is good
18:37moogatronicibdknox: Lol. I'm in Indiana...
18:37moogatronicYeah, i meant that in a good way.
18:37moogatronic(the menu item thing)
18:37cemerickIt's the man v. food tour. :-P
18:37moogatronicIsn't NC bbq a specific sytle of BBQ?
18:38ibdknoxdepends on which part of NC you're in :)
18:38moogatronicwhat is time out?
18:38moogatronicibdknox: Are you a NC 'native' ?
18:38cemerickfried chicken sandwich dive near either UNC or Duke (can't remember)
18:39ibdknoxmoogatronic, I lived most of my life in Charlotte
18:39ibdknoxthe moved to Seattle
18:39ibdknoxnow in San Francisco
18:39moogatroniccemerick: looks like chapel hill
18:42technomancyibdknox: east side seattle?
18:43ibdknoxtechnomancy, yeah
18:43ibdknoxtechnomancy, downtown redmond
18:44moogatronicI have always loved the PacNW>
18:44moogatronicall of the geographic features are there… (for the most part) ocean, mountains, forest...
18:46ibdknoxmoogatronic, Seattle has been by far my favorite place to live
18:46moogatronicI've not been to Seattle, but i've been to Vancouver.
18:46moogatronicIt was really nice.
18:48chewbrancaibdknox: same here, I've been up and down the west coast and settled in seattle
18:48tolstoyNot Portland?
18:48ibdknoxyeah, Ive been wondering about Portland
18:48moogatronicEveryone seems to love Portland as well.
18:48tolstoyI'd say it's really great, but I don't have much to compare it to. It's nicer than Dallas! ;)
18:49chewbrancaI prefer the feel of seattle to portland, portland is more industrial, whereas seattle has more of a forest feel to it, and I absolutely love the seattle waterfront, the different communities on the hills that you can see from any side of the lake are pretty stunning
18:49moogatronicDoesn't seem like your bar is very high tolstoy, though, I've never been to texas at all, except as an airport stop-over
18:50chewbrancaI definitely like portland, and portland has a number of pros, including the much much better transit system than seattle
18:50tolstoyPortland feels (to me) like it's a really big town, instead of a city.
18:50chewbrancaand portland is a very progressive city, I've actually personally talked to the mayor of portland about open data, as opposed to seattle where I've had little progress in getting data from the city
18:51chewbrancaie compare http://pdxapi.com/ to my port to seattle: http://seaapi.com/
18:51moogatronici've pretty much only lived in college towns as an adult.
18:51moogatronicthey all feel like small towns with a proportionately large number of things to do given the population
18:52seancorfieldthe docs seems to say that (require 'something :reload-all) will reload the something namespace _and all the namespaces it uses_ (transitively) but that doesn't seem to happen (clojure 1.3.0)... anyone seen anything like that? or am i doing something dumb?
18:52amalloy'[something :reload-all]
18:55seancorfieldreally? doh!
18:56ibdknox,(doc require)
18:56clojurebot"([& args]); Loads libs, skipping any that are already loaded. Each argument is either a libspec that identifies a lib, a prefix list that identifies multiple libs whose names share a common prefix, or a flag that modifies how all the identified libs are loaded. Use :require in the ns macro in preference to calling this directly. Libs A 'lib' is a named set of resources in classpath whose contents...
18:57ibdknoxamalloy, how is one supposed to know that?
18:57amalloy&(doc require)
18:57lazybot⇒ "([& args]); Loads libs, skipping any that are already loaded. Each argument is either a libspec that identifies a lib, a prefix list that identifies multiple libs whose names share a common prefix, or a flag that modifies how all the identified libs are loaded. Us... https://gist.github.com/1346590
18:58ibdknoxit doesn't include the brackets bit
18:58ibdknoxat least not from my reading
18:58ibdknoxand (require 'blah :reload) works fine
18:58seancorfielda libspec has [ ] but i wasn't sure whether :reload was an option or part of a libspec
18:58amalloywell, i could well be wrong here
18:58seancorfieldyeah, that was where i'd got to (require 'blah :reload)
18:59seancorfieldand that works
18:59seancorfield,(require '[example.controllers.user :reload])
18:59clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: true>
18:59ibdknoxyeah
18:59ibdknoxfails
18:59seancorfieldso, nope, ain't that
19:00seancorfieldbut :reload-all does not seem to work transitively :(
19:00ibdknoxit does in 1.2
19:00seancorfieldthat maybe...
19:00ibdknox(require 'something :reload-all :verbose)
19:00seancorfieldi'll try that, thanx
19:01ibdknoxI actually didn't know about reload-all lol
19:02ibdknoxI've wanted that many times
19:02seancorfieldinteresting... it shows the full transitive calls to load... but doesn't seem to actually reload / pick up changes...
19:04seancorfieldi have a println in each of my files and that runs when each is loaded for the first time but not when the require :reload-all is invoked...
19:04ibdknoxeven in 1.2?
19:06seancorfieldmy code won't run on 1.2... but a bit of println debugging suggests a possible issue...
19:07seancorfieldso if i have a (def foo (atom {})) and i reload the namespace that's in, should i expect foo to be reset? or do i need an explicit (reset! foo {}) in the file?
19:07ibdknoxfoo should be reset
19:07amalloyseancorfield: you should expect a reset
19:08seancorfieldthat's what i would have thought...
19:08cemerickseancorfield: :reload-all worksforme?
19:08cemerick(require 'com.foo.ns :reload-all)
19:09seancorfieldok, bizarreness... now it's working for me too... *sigh*
19:09ibdknoxif there's a compile error, it possible the reload is failing
19:10seancorfieldthat may have been the problem... i had a reference to an unbound variable... it had been declared (and bound) but then i moved it to another ns and reloaded and got an error and fixed the error but things wouldn't reload properly...
19:11seancorfielddagnabbit! now it won't transitively reload :(
19:13seancorfieldwell, it seems i _do_ need the reset! in that namespace for some reason
19:14seancorfieldi'm dynamically creating the symbol in the (require .. :reload-all) call
19:15amalloyseancorfield: shouldn't matter
19:15alexbaranoskyis there some community place to throw utility functions?
19:16alexbaranoskyI know amalloy has his repo for 'useful' functions
19:17alexbaranoskyI find myself wanting to share functions across projects
19:18seancorfieldamalloy: i know but...
19:19ibdknoxalexbaranosky, create your own util
19:19ibdknoxamalloy has an article about that somewhere
19:20brehauthttp://amalloy.hubpages.com/hub/Build-your-own-Clojure-toolkit
19:21seancorfieldhmm, if i modify the file, load will really reload it... but if i haven't modified it, load seems to do nothing... *puzzled*
19:21seancorfieldit certainly isn't behaving how i expect...
19:22alexbaranoskyibdknox: seems more productive to have a community util though, otherwise everyones stuff is spread all over the place
19:22alexbaranoskyand there'll be a lot of duplication as everyone reinvents the wheel in their own personal util libraries
19:23ibdknoxI think part of the point is to use it as a learning function
19:23ibdknoxthe common util is essentially clojure contrib in its new form
19:24alexbaranoskyibdknox: were you talking to me?
19:24ibdknoxalexbaranosky, yeah
19:24alexbaranoskyI'm trying to get stuff done though, not LEARN ;)
19:24ibdknoxhaha srsly
19:25ibdknoxlearning is for noobs.
19:25ibdknox:-p
19:25alexbaranoskyfor example I'm lookingat noir, and playing with refactoring some of it... A function I wrote to use on MIdje, would be usefl in one spot
19:25alexbaranoskybut I have no easy way to share that dependency between both projects
19:25alexbaranoskyI could make my own project, lik eyou said....
19:26alexbaranoskyf it, maybe I'll just create the worlds most massive compendium of Clojure util functions
19:26ibdknoxthat's what useful basically is :)
19:27alexbaranoskyyeah I wonder if the function I'm using is hiding in there
19:28alexbaranoskyibdknox: you seem to have a knack for color schemes.
19:28ibdknoxalexbaranosky, years of pretending I can design things ;)
19:29alexbaranoskyfake it til you make it
19:30alexbaranoskyI have lack of knack for color schemes it seems
19:33ibdknoxI worked at a world class design firm for a while, so I cheated
19:33alexbaranoskyamalloy: does useful have a function to return the first truthy function from a sequence such that (find-first-truthy [?string ?odd] 5) ]) ;;=> odd?
19:34alexbaranoskyibdknox: best way to cheat is to work with awesomely skilled people
19:34ibdknox,(filter #(% 5) [string? odd?])
19:34clojurebot(#<core$odd_QMARK_ clojure.core$odd_QMARK_@5bfb7d>)
19:35ibdknox,(some #(% 5) [string? odd?])
19:35clojurebottrue
19:35ibdknoxhm
19:35alexbaranoskysecond one
19:35ibdknoxstupid some
19:35alexbaranoskyfirst one, but wrapped in first
19:35chouser((some-fn string? odd?) 5)
19:35chouser,((some-fn string? odd?) 5)
19:35clojurebottrue
19:36chouseryeah, I guess if you want it to return the function, you need something more like filter
19:38ibdknoxI thought there was a some that returned the first true element
19:39ibdknoxa some-like function that is
19:39gfrederickslike (partial some identity)?
19:40gfredericks$findfn [nil false false 42 :false] 42
19:40lazybot[clojure.core/rand-nth]
19:40gfrederickspfft
19:40ibdknoxlol
19:40gfredericks(inc lazybot)
19:40lazybot⇒ 0
19:40gfrederickshe has a sense of humor
19:40gfredericksalso acceptable would have been clojure.core/fourth
20:02brehauthow awesome would findfn be if it ran the queries through the every fun, (map #(apply comp %) (cross every-fn every-fn)) and (map #(apply partial %) (cross every-fn every-fn))
20:09amalloybrehaut: wth is cross
20:09brehaut(defn cross [A B] (for [a A b B] [a b]))
20:10tensorpuddinggetting null pointer exceptions in a functional language is the height of my day
20:10seancorfieldif i have a library and a bunch of example code showing how to use it, is it considered "good practice" to publish it as part of the project JAR or not? (to clojars)
20:10tensorpuddingnoir conveniently gives me a backtrace, but i can't really figure out why it's failing
20:10brehautseancorfield: i would say or not?
20:10seancorfieldright now the example code has no external dependencies but that might change as i expand the examples...
20:11brehautseancorfield: theres always dev-dependancies for that sort of thing too
20:11seancorfieldyeah, i was wondering about that... are dev-dependencies pulled in for lein run?
20:11tensorpuddingthe function works fine when i call it from slime
20:12brehautseancorfield: i *think* so, but only for the specific project (not when its a dependancy itself) [caveat: guessing based on experience]
20:12tensorpuddingwhat does a null pointer exception mean anyway?
20:12brehautit means a nil has found its way into your program when your program didnt expect it
20:13seancorfieldbrehaut: thanx... i'll experiment...
20:13amalloyalexbaranosky: i used to have around a function (defn validator [f] (fn [x] (when (f x) x)))
20:13technomancyseancorfield: dev-deps are included in lein run
20:13technomancyunless you set the LEIN_NO_DEV environment variable
20:14tensorpuddinghuh
20:14amalloyand then you could use (some #(% 5) (map validator [string? odd?]))
20:14tensorpuddingi don't know how that's possible
20:14technomancyseancorfield: it's pretty common to just plop an "examples" dir in the project root
20:14brehaut,({:a 1} :b) ; tensor pudding - numerous expressions can evaluate to nil
20:15clojurebotnil
20:15seancorfieldtechnomancy: perfect! thanx for the confirmation!
20:15seancorfieldand that examples folder would be a full lein project too?
20:15seancorfieldjust trying to get a sense of how best to develop / publish FW/1
20:16technomancythat's less common, but it makes sense
20:16technomancyespecially if you need more than a single file to demo functionality
20:16alexbaranoskywhat's wrong with my second implementation of first-truthy-fn ? https://gist.github.com/1346666
20:16seancorfieldright now I do lein run -m example.main to fire up the example app
20:16tensorpuddingthe error is supposedly in a let statement
20:16tensorpuddingwhere i run a SELECT query
20:16seancorfieldso src/example/main.clj is that file
20:16tensorpuddingbut this function works fine in the repl
20:17brehauttensorpudding: due to the magic of referential transparency it shouldnt be hard to isolate it
20:17tensorpuddingi think it's due to the input
20:17brehaut(and by magic i mean no magic at all)
20:17amalloyalexbaranosky: you left out the &
20:17alexbaranoskywhere?
20:17clojurebotwhere is your source code
20:17amalloyie, you were relying on destructuring in the loop, to pull apart the predicate list one by one
20:17seancorfieldbut i'd want to pull the examples out of the JAR for publishing so... move it to the root of the project? and then... lein run -m example.main wouldn't work directly, right?
20:18tensorpuddingsending the function nil doesn't give a null pointer exception
20:18amalloyyour second version destructures in the function args, but only recurs to the loop head
20:18tensorpuddingit gives an index out of bounds exception
20:18alexbaranoskywait, I think I left out 'args'
20:18amalloyno
20:19alexbaranoskyamalloy: ahh i see
20:19technomancyseancorfield: you could set :test-resources "examples"
20:19technomancytiny bit of a hack, but it shouldn't be bad
20:19amalloyalexbaranosky: https://gist.github.com/1346739 is a simple change, but untested
20:20ibdknoxwhat was wrong with the version I did with filter?
20:20seancorfieldtechnomancy: thanx!
20:21amalloyibdknox: he's not here to get things done, he wants to LEARN
20:21ibdknoxamalloy, hahaha... well done :D
20:21tensorpuddinghere's my code https://gist.github.com/1346742
20:21tensorpuddingthe error is seemingly in get-post
20:21alexbaranoskyhehe
20:22amalloyseriously though this is just a special-cased re-implementation of filter
20:22ibdknoxtensorpudding, you're executing the result of the query
20:22alexbaranoskyamalloy: yes, because it has to be lazy
20:22tensorpuddinghuh?
20:22ibdknoxtensorpudding, if that result is nil
20:22ibdknoxkaboom
20:23alexbaranoskyamalloy: got it fixed it without looking your solution!... now time to see what you did :)
20:23brehautalexbaranosky, amalloy: if you are going to do that, you should at least start from (defn cons [h t] (fn [accessor] (accessor h t)))
20:23tensorpuddingokay
20:23tensorpuddingbut that doesn't change the fact that it shouldn't be nil
20:23ibdknoxtensorpudding, btw it's idiomatic to put the first line of your code on its own line, instead of after the args vector
20:24ibdknoxtensorpudding, you can also just do (where {:pid pid}), you don't need the vector
20:24amalloyalexbaranosky: filter is already lazy...?
20:24tensorpuddingoh
20:24seancorfieldtechnomancy: that would be dev-resources-path i presume? :)
20:24alexbaranoskyhmmm, wonder what I was doing wrong then. My filter version was failing my "lazy" test
20:25amalloyalexbaranosky: chunked seqs, probably
20:25tensorpuddingbut why is it nil?
20:25amalloyyou'd do better to use a generic un-chunk-ifier and then filter that, than to reinvent every lazy sequence to make them explicity skip chunking
20:26ibdknoxtensorpudding, I'm not sure that it is, I'm just looking at places that will blow up
20:26ibdknoxif you put the stacktrace up I can probably tell you
20:28tensorpuddingokay
20:28tensorpuddinghandling the nil now brings up the correct 404 page
20:28alexbaranoskyamalloy: chunking, ey?
20:28technomancyseancorfield: oh, right
20:28tensorpuddingbut i can't figure out why it's coming up nil
20:28ibdknoxtensorpudding, because that pid doesn't exist in your db
20:28tensorpuddingbut it does
20:29amalloy&(first (map prn (range))) ;; prints 32 in a big chunk for efficiency
20:29lazybot⇒ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 nil
20:29alexbaranoskyamalloy: ah yes I've heard of this
20:29tensorpuddingrunning get-post in the repl brings it up
20:29ibdknoxcall it with a string of pid
20:30alexbaranoskyso you if I instead came up with a generic way to unchunk things, it'd be applicable to any function that evaluated to a lazy seq
20:30ibdknoxtensorpudding, "13" vs 13
20:30tensorpuddingugh
20:30alexbaranoskyamalloy: any code to point me to?
20:30tensorpuddingyou seriously need to pass it as a string, even though the data type is an int in the table?
20:30ibdknoxtensorpudding, no
20:30tensorpuddingoh wait
20:30ibdknoxtensorpudding, I was saying that you're passing it a string
20:30tensorpuddingoh right
20:30ibdknoxtensorpudding, not an int
20:30tensorpuddingthe route matched it as a string
20:30tensorpuddingdang
20:31tensorpuddingexcept when pid is string when i call the function i don't get a null pointer exception
20:31tensorpuddingwait, nevermind, i do
20:31amalloy(defn unchunk [s] (lazy-seq (when-let [s (seq s)] (cons (first s) (unchunk (rest s))))))
20:32alexbaranoskyis that in 'useful' ?
20:32tensorpuddingokay so what's the coercion function
20:32ibdknoxtensorpudding, you should use (first) instead of (coll 0)
20:32tensorpuddingi changed that already
20:32leo2007what exactly is reference type?
20:32ibdknoxtensorpudding, also (:time result) instead of (result :time) will help prevent nil explosions
20:34gfredericksleo2007: kinda like a mutable pointer?
20:34amalloyalexbaranosky: no, i just slapped it together
20:35amalloyi've never really had to care about chunking, so it's not in useful
20:35leo2007gfredericks: I know no java but some C. I haven't heard of mutable pointer.
20:35gfredericksleo2007: I think it normally comes up when you want to distinguish references from values, which functional programmers like to do
20:35tensorpuddinghow can i turn the string into an int?
20:35tensorpuddingis it a read function or something
20:36ibdknoxtensorpudding, (Integer. my-str)
20:36ibdknox,(Integer. "12")
20:36brehautleo2007: ##(let [v 1, r (atom 2)] (prn v) (prn (deref r)))
20:36lazybot⇒ 1 2 nil
20:36clojurebot12
20:36gfredericksleo2007: then maybe just saying "pointer" is a simpler way to explain it
20:36amalloy(inc lazybot) ; supa-fast
20:36lazybot⇒ 1
20:36tensorpuddingah, no wonder i didn't guess it
20:36tensorpuddingjava...
20:37gfredericksleo2007: probably "value" would be the more foreign concept for you
20:37brehautleo2007: above, r is an atom, thus a reference type, and v is just a plain value. you have to dereference r to get at the value it holds
20:37gfredericksleo2007: "reference types" aren't all that special unless your language emphasizes values
20:37tensorpuddingit didn't work
20:38tensorpuddingNo matching field found: Integer for class java.lang.String
20:38alexbaranosky(defn first-truthy-fn [preds & args]
20:38alexbaranosky (first (filter #(apply % args) (unchunk preds))))
20:38ibdknoxlol
20:38tensorpuddingoh wait
20:38tensorpuddingi totally did .Integer
20:38ibdknoxtensorpudding, Integer. not .Integer
20:41tensorpuddingnow it works, i guess
20:42alexbaranoskychunking is a weird feature of Clojure; I bet it bites a lot f people in the rear
20:43brehautalexbaranosky: only once per person ;)
20:44amalloyalexbaranosky: everyone (including me) says that, but i don't think it has ever been an actual issue for me
20:45amalloywait, i tell a lie. it has
20:45amalloybut since i knew about chunking it was pretty easy to find/fix
20:46aperiodicchunking?
20:46technomancythe fact that you notice chunking is usually a sign you're mixing side-effects and laziness in a sloppy way
20:46alexbaranoskyit just means that if you need laziness in the micro, you'll need to unchunk
20:46technomancyin my experience
20:46tensorpuddinghooray, i have a webapp that can display pages
20:46goodieboyanyone here have experience setting up tomcat for a clojure web app?
20:49alexbaranoskyamalloy: any chance I could pull request a `first-truthy-fn` and a `unchunk into useful?`
20:49amalloyyou can get unchunk in if you want, but i don't want first-truthy
20:49alexbaranoskyamalloy: correction -> `unchunk` into useful :)
20:50gfredericksgoodieboy: if by "setup" you mean "deploy a warfile", then "maybe, I can't remember actually"
20:50alexbaranoskyhmmmmm... you're driving a hard bargain
20:50goodieboygfredericks: ha ha, well I'm going to be fronting it with nginx, so I'm curious about proxying and "connectors"
20:51gfredericksgoodieboy: alright let's pretend I never said anything then
20:51goodieboy:)
20:51amalloyalexbaranosky: if it'll encourage you to start your own utils lib, i could reject unchunk as well
20:55tolstoy,(doc partition)
20:55clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
20:56alexbaranoskyI like `first-truthy-fn` for cases like this: (when-not (some true? (map #(% cur) [vector? map? symbol?]))
20:56tolstoyHm. Doc doesn't work in slime?
20:56tolstoyEh, no matter.
20:56alexbaranoskyInstead you'd have: (when-not (first-truthy-fn [vector? map? symbol?] cur)
20:57alexbaranoskywhich seems to come up fairly often
20:58amalloywww.clojars.org/alexbaranosky/my-awesome-utils <= dooooo it
20:59alexbaranoskyamalloy: it does have a nice ring to it
21:00brehautalexbaranosky: ring is a seperate library
21:00amalloyalexbaranosky: before the Borg sucked me up i had amalloy/utils. it builds character
21:01alexbaranoskyamalloy: ok you got me, I'm calling it Utilize, and it is going to rock
21:01amalloysweet
21:02alexbaranoskymy character's going to be a level 20 wizard
21:02brehautalexbaranosky: no epic tier ?
21:02alexbaranoskynot a high enough level?
21:03brehautalexbaranosky: depends on the edition i guess :P
21:03amalloyseancorfield: sounds kinda like formula-one. intentional?
21:03gfredericksokay from now on all new libraries must have names that pass (partial re-matches #"lib-\d{4,8}")
21:05seancorfieldFW/1 (Framework One) has been this framework's name since the middle of 2009...
21:05alexbaranoskybrehaut: when I was a kid (the 80s) I remember level 20 being pretty dang high
21:05amalloygfredericks: how about sha-1 hashes?
21:05brehautalexbaranosky: that would have been the case in the 80s
21:06amalloythen i can brute-force it until i get lib-DEADBEEF
21:06gfredericksamalloy: if they're truncated to be short enough to memorize, that's fine
21:06gfredericksamalloy: what would they be hashes of?
21:06amalloyanything
21:07amalloythe projects' real names, which everyone but you uses
21:07gfredericksme as the author or me as gfredericks?
21:07amalloyyou as gfredericks, the library-name complainer
21:08gfredericksgotta have _some_ super power
21:08brehautgfredericks: i need a name for an image thumbnail library
21:08gfredericksbrehaut: imudge
21:08brehauthmm
21:08gfredericksnevermind that looks like apple
21:09gfredericksI pronounced it different in my head
21:09amalloyclimj-magic
21:09brehautamalloy: *groan*
21:09seancorfieldlein has me puzzled... i have a project that depends on a library, let's call it X... lein deps pulls it in, lein repl finds it - i can do (use 'X) just fine, but if i have src/some/file.clj that tries to require or use X, when try to pull in some.file, it complains that it can't find X...
21:09amalloybrehaut: couldn't think of anything worse in a hurry, sorry
21:09gfredericksbrehaut: clumbnail
21:10seancorfieldi assume i'm doing something dumb with leiningen but...
21:10amalloyYOUR_NAME_HERE_FOR_500$
21:10brehautgfredericks: you arent even adhering to your own rules‽
21:10gfredericksbrehaut: ##(str "lib-" (rand-int 100000))
21:10lazybot⇒ "lib-28012"
21:11brehautdone
21:11gfrederickshas a nice ring to it
21:11amalloyreminds me of a passage in REAMDE
21:11brehautreminds me of THX-1138
21:11amalloyroll a D100, call that the name of your company. then you can stop arguing about the stupid shit and get to work
21:12brehaut1d100
21:13clojurebot15
21:13amalloyD10000, i guess. the company wound up being called Corporation 9592
21:13brehautthats not a very exciting library or company name
21:13brehauthaha
21:14amalloy&(apply str "lib" (repeatedly 2 #(format "%02d" (rand-int 100))))
21:14lazybot⇒ "lib4787"
21:15goodieboyi'm using noir for a web app, anyone know if there is a way to execute a function when the app initializes?
21:15gfredericksgoodieboy: does running it at the top level of your ns not work?
21:16amalloygfredericks: it probably wouldn't work if you AOT-compiled, for example
21:16gfredericksgoodieboy: tomcat has some hooks for that, if you don't find any better way
21:16hiredmangoodieboy: depending on what you are doing there are a number of ways
21:17leo2007brehaut and gfredericks: many thanks for the explanation.
21:18goodieboygfredericks hiredman good to know. the problem now is that when I try to run "lein ring uberwar", the code I have executing in my server.clj file makes the process hang (starting up an embedded solr instance)
21:18goodieboysince solr doesn't need to be running when i build the war, i need a way to prevent that from happening
21:19amalloygoodieboy: it's a good practice, in general, to make loading-a-namespace not cause side effects
21:19goodieboyexactly
21:19amalloyaside from, obviously, def-ing some functions
21:19amalloya simple way to do this is to add a level of indirection
21:20amalloyinstead of (def server (start-server)), you can (def server (memoize #(start-server)))
21:20amalloyand then code that needs to actually use the server can use (server) instead of server
21:20leo2007I am trying to build a website using noir. when I run 'lein swank' in the project root, nothing from the project seems to be loaded.
21:20leo2007ideas?
21:21goodieboyamalloy: yeah i see, i'll give that a shot
21:21goodieboyamalloy: is memoize built in?
21:22amalloyyes. though it may not be the best tool for the job, it's the simplest
21:22amalloyprobably better would be (def server (delay (start-server))), and then use @server instead of (server)
21:22allhands55bye
21:22allhands55exit
21:22amalloyallhands55: /quit
21:23allhands55sorry
21:23brehautamalloy: what about defonce ?
21:23amalloybrehaut: not a solution to his problem
21:24amalloyhis concern is to avoid def-ing anything side-effecty at compiletime
21:24brehautah, i missed the compile time part
21:24gfredericksgoodieboy: if you're going the way of amalloy's delay, you can confine it to one location with (def real-app (delay ...)) (def app #(@real-app %))
21:25gfredericksalthough I suppose you probably don't end up referring to the app more than once anyhow, so that's probably not very helpful
21:26goodieboyok good, thanks! i'l try that too.
21:26spoon16possible to use byte-array-type as a type hint (def byte-array-type (class (make-array Byte/TYPE 0)))?
21:26amalloygfredericks: makes the assumption that his app is a function of one argument, which is pretty limiting
21:27hiredmanthe default noir skeleton uses a -main, I believe, so you can just put init code in there, or if you are generating a war using lein ring, it has some options you can set in project.clj
21:27amalloyspoon16: no
21:27amalloynot doing it that way
21:27spoon16thanks
21:33gfredericksamalloy: I assumed it was ring, since he said noir.
21:34amalloygfredericks: he mentioned that what he was starting up (unintentionally) was an embedded solr instance
21:35gfredericksah ha
21:35gfredericksso he did
21:50ieureIs there a formal name for a function f such that ((f n) g) -> (g n) ?
21:50ieureI guess this would be the thing in Clojure: (defn f [&rest n] (fn [g] (apply g n)))
21:51ieureEr, [& n]
21:51ieure(defn f [& n] (fn [g] (apply g n)))
21:51cemerickit's so strange to me that you can conj and map into a map
21:51cemerick,(conj {:a 5} {:b 6 :c 7})
21:51clojurebot{:b 6, :c 7, :a 5}
21:51amalloycemerick: i know, right? similarly for a seq of pairs
21:52amalloy&(conj {:a 5} (seq {:b 6 :c 7}))
21:52lazybot⇒ {:b 6, :c 7, :a 5}
21:52cemerickamalloy: no, *not* just a seq of pairs
21:52cemerickmust be a seq of map entries
21:52cemerick,(conj m '([:c 7] [:k 6] [:z 0]))
21:52clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: m in this context, compiling:(NO_SOURCE_PATH:0)>
21:52cemerick(conj m m2) implies (seq m2)
21:53amalloycemerick: that's definitely untrue
21:53amalloy&(conj {} [1 2])
21:53lazybot⇒ {1 2}
21:53amalloy&(conj {} (seq [1 2]))
21:53lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry
21:53cemerickamalloy: implies (seq m2) only if m2 is a map
21:54amalloythat i can beliece
21:56cemerickit's even stated as intentional in the docs http://clojure.org/data_structures#Data%20Structures-Maps%20%28IPersistentMap%29
21:56cemerickamalloy: have you ever seen any rationale for that?
21:56amalloynothing explicit
21:56cemerick(actually, this particular behaviour is implemented in APersistentMap)
22:08hiredman,(contains? (supers (class [1 2])) java.util.Map$Entry)
22:09clojurebotfalse
22:09hiredmanah
22:09hiredmanright
22:25tensorpuddingdoes clojure have a compose function?
22:25gfrederickscomp
22:27spoon16what is the best way to include an external clojure project in my own via LEIN? I have cloned https://github.com/alexott/clj-tika locally, but am not sure how to reference it from my lein project.
22:38amalloydon't bother cloning, just declare it as a dependency in project.clj
22:47tensorpuddingugh
22:47tensorpuddingcomp isn't working
22:48tensorpuddingi don't know how to combine two of these things
22:48alexbaranoskyyou may have the backwards order
22:48tensorpuddingwell
22:48tensorpuddingit's doing the first one
22:48tensorpuddingbut not the last
22:49tensorpuddingnone of the examples have them using more than one transformation at once
22:49tensorpuddingthey're functions, according to the repl
22:49brehaut(comp f g) ; g is called first whith whatever arguments are passed to it. the result of g is passed to f, the result of f is returned
22:50brehaut,((comp inc {:a 1 :b 2}) :b)
22:50clojurebot3
22:50tensorpuddingmeh, nevermind
22:50tensorpuddingi passed a map intead of a list of maps
23:33alexbaranoskyamalloy: thanks for the push. Started my util library, with yours as the base I forked off.
23:34alexbaranoskyhttps://clojars.org/utilize
23:34amalloyalexbaranosky: cool! just want to be sure you're aware most of the good stuff in amalloy/utils has been folded into useful now
23:36amalloyoh, yes. i see you forked useful, not amalloy-utils. good good
23:37cemerickAnyone know of a "rich irc" (not campfire!) that doesn't suck?
23:37seancorfield_does clojars only allow you to push up from one machine?
23:37amalloyseancorfield_: if your ssh key matches, you can do whatever you want
23:38tensorpuddingswank-clojure is sure confusing the heck out of emacs
23:38seancorfield_hmm, i didn't realize you could just copy ssh keys around like that... when you generate one on a machine, it includes the machine name...?
23:38technomancyI think I'm almost ready for a 1.0 of https://github.com/technomancy/die-roboter, but I don't really like how its `send-off' makes you think of agents
23:39cemerickseancorfield_: that's just a convenient comment
23:39cemerickcan be any text AFAIK
23:39technomancycemerick: isn't the richness a function of the client? there are clients that embed images, gists, &c.
23:39tensorpuddingtechnomancy, gave you a new bug
23:39technomancytensorpudding: bring it on =)
23:39tensorpuddingnow swank-clojure really doesn't start at all
23:39cemericktechnomancy: That's interesting. Example(s)?
23:40tensorpuddingslime-face-inheritance-possible-p is void
23:40seancorfield_cemerick: ok, well then, i'll update my local file to match what's already on clojars :)
23:41cemerickHaving everything archived serverside for later access anywhere (i.e. avoiding link-rot for many things) is the only killer feature of campfire AFAICT.
23:41technomancycemerick: don't know of any specifics, outside emacs but I've heard a couple people mention tweaks to mac clients that could do it
23:41technomancymaybe limechat? it's been a few years.
23:41cemerickYeah, I keep meaning to give that a serious try again.
23:41hiredmanhttps://github.com/danlarkin/subrosa
23:41technomancycemerick: yeah, at sonian we used subrosa which could catch you up on what you missed like campfire
23:42seancorfield_cemerick: ah, i need to copy the id_rsa folder as well as the .pub right?
23:42cemerickhrm
23:42technomancytensorpudding: very strange; I'm not sure how that could happen nondeterministically
23:42hiredmanmeh, the real solution is never disconnect
23:42technomancynaturally
23:42tensorpuddingi'd do an emacs -Q but i don't know how i'd get clojure-mode working since it's a package
23:42cemerickseancorfield_: Yes, you need your private key around. Sounds like you might want to read up on key management before you do something that compromises you though.
23:43technomancytensorpudding: you can just M-x eval-buffer on the file inside ~/.emacs.d/elpa
23:43technomancyhiredman: well IIUC the use case with campfire is mostly for communicating with muggles who can't be expected to know how tmux works
23:43cemerickmaybe I should see where the open-sourcing of wave has gone…though I hate having stuff like irc/chat in browser windows.
23:44tensorpuddingslime-connect is void now
23:44technomancytensorpudding: right; it should be bootstrapped when you do a jack-in
23:44tensorpuddingi guess i have to eval all the slime packages
23:45tensorpuddingit didn't start though
23:46tensorpuddingmaybe it's still trying
23:46tensorpuddingi can't tell
23:46technomancyso, any suggestions for a function name to replace die.roboter/send-off? basically "go eval this form remotely for side-effects"
23:46seancorfield_cemerick: don't worry, my hamfisted attempt to simply copy the key stuff around didn't work so i haven't done myself any harm
23:47technomancypreferably one that has a matching "go eval this form remotely for the return value" name
23:47technomancytensorpudding: jack-in should load the slime packages for you
23:47technomancythere shouldn't be any need to load any elisp apart from clojure-mode
23:47seancorfield_the only reason i created a key was for github... i'd never needed one before then
23:47tensorpuddingwell it didn't
23:47cemericksend-for / send-do!
23:47cemerick?
23:48cemerickseancorfield_: I smell windows. ;-)
23:48technomancysend-for isn't bad
23:48technomancyas long as it doesn't make people think of clojure.core/for
23:49cemericksend-eval, then
23:49technomancyyeah, that's probably best
23:49technomancydo makes me think of progn
23:49cemerickseancorfield_: in short, if you copy your entire ~/.ssh dir to the other machine, you'll be right (assuming there's nothing interesting in the other machine's .ssh
23:49tensorpuddinggrr
23:49technomancywhich is related to side-effects, but not quite in the way I want
23:49tensorpuddinglein run doesn't work either
23:50tensorpuddingi do not understand why it refuses to believe i have this namespace
23:50cemericktechnomancy: don't set up a bikeshed and then be sad about the colors you get. ;-)
23:50tensorpuddingi've compiled this file a dozen times
23:50technomancycemerick: heh =)
23:50technomancywhat if I just make it a require-only namespace and use die.roboter/eval and die.roboter/exec?
23:51technomancyexec makes me think of shelling out
23:51cemerickif that's the semantics you want to evoke
23:51tensorpuddingwhat would cause java to think that a namespace doesn't exist, even though there's a file for it
23:51technomancybut I think since it's not in clojure.core it's less of an issue
23:51cemerickhardly require-only; there's :refer-clojure
23:51technomancycemerick: true, but I rarely use that outside of namespaces designed to be consumed via require
23:52technomancymaybe that's just me
23:52tensorpuddingjava.lang.Exception: namespace 'blog.views.user' not found after loading '/blog/views/user'
23:53tensorpuddingwait, i'm dyslexic
23:53technomancytensorpudding: typo in the ns form?
23:53cemericktechnomancy: I agree, I rarely use :refer-clojure. I don't think the library author is making that determination for the user though.
23:53tensorpuddingi wrote blob
23:53technomancytensorpudding: clearly it should be blaugh
23:53cemerickClojure should be smart enough to figure that out. ;-)
23:54tensorpuddingokay, getting blank pages for my user screen, that's a bit weird
23:54seancorfield_cemerick: cheeky git! i don't use windows! :)
23:55cemerickNo windows, but you've managed to avoid ssh keys all this time? Talent, that.
23:55seancorfield_i'd just never needed ssh keys until recently... and my solution was simply to ssh from my ubuntu netbook to my imac desktop and push the library from there without getting out of my chair!
23:55cemerickHere I thought I was on the pinnacle of terminal avoidance. :-)
23:56cemerickhah
23:57tensorpuddingis there a built-in length function for collections...
23:57brehaut(doc count)
23:57clojurebot"([coll]); Returns the number of items in the collection. (count nil) returns 0. Also works on strings, arrays, and Java Collections and Maps"