#clojure log - Nov 12 2011

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

2:36 halarnold2000: .

2:58 zakwilson: ClojureQL seems to support some extension mechanisms, but they're really poorly documented. I did a bit of googling, but couldn't find much on it. I would like to pre-process data sent to it and post-process data received from it - in particular, I want to convert dates to and from clj-time/jodatime. Is this doable?

3:15 wtfcoder: newb alert! http://ideone.com/cdKhn works fine using leiningen, lein run outputs 12, however if I run 'lein jar' i would of expect java -jar <filename-of-jar> to run main method due to gen-class, what simple/stupid thing am i missing?

3:15 however i get class not found error

3:24 tensorpudding: i assume you need to mention where the main method is in project.clj

3:25 wtfcoder: :main cljtest.core

3:26 tensorpudding: is that an uberjar?

3:32 wtfcoder: not sure, just a basic lein example i could find

3:32 tensorpudding: i mean

3:33 running java -jar <filename-of-jar> probably won't work, unless it knows where to find clojure

3:33 or the jar is an uberjar

3:33 meaning it contains all its dependencies

3:34 i'm not sure if it checks subdirectories of the working directory for classes, though

3:38 wtfcoder: ive upload my simple dumb experiment to wikisend. lein run works but java -jar file.jar doesnt (after lein jar). any idea would be immensly appreciated. http://wikisend.com/download/453590/cljtest.tar

3:47 ah uberjar works

3:51 tensorpudding: that just means that you can't run it without clojure, which is probably normal

3:57 wtfcoder: tensorpudding, figure out why the normal jar wasnt working, cant specifiy -cp with jar, so long way is java -cp myjar.jar:lib/cloj*.jar cljtest.core

3:57 tensorpudding: yes, that's what i mean

3:57 you need to add clojure to the classpath

3:59 wtfcoder: cool. are strings in clojure interined like in c# or does the keyword support negate such feature requirement

7:30 licenser: woooh I got the CLJS-100 :D

7:56 Borkdude: I am testing some function which gets a lot of json output from twitter in emacs

7:57 leo2007: folks, I want to use fuzzy completions in slime. for a fully-qualified symbol I can only complete to the namespace such as swank.core/ but not swank.core/break.

7:57 any ideas?

7:57 Borkdude: But somehow emacs gets into a slime debug thing by the output that gets printed

7:58 is there a better way to get the json in, without getting slime errors?

7:58 _ulises: Borkdude: coincidence, I was doing that 1hr ago! :-o

7:59 Borkdude: exact.same.thing.

7:59 Borkdude: _ulises: great, any solutions? ;)

7:59 _ulises: sadly, I have to fixes for this

7:59 :(

8:01 Borkdude: if it is of any help, this is the *Backtrace*: https://gist.github.com/1360489

8:03 _ulises: *no

8:03 Borkdude: Someone able to help me out where it goes wrong?

8:03 _ulises: no fixes

8:04 * _ulises would be interested in a solution as well

8:04 Borkdude: _ulises: we're on the same team then ;-)

8:04 _ulises: what are you working on?

8:04 _ulises: nothing serious, just learning the twitter api

8:05 Borkdude: _ulises: what library are you using for it?

8:05 _ulises: did you try the streaming api? I came across ashafa's noozzle but that didn't work

8:05 Borkdude: _ulises: I'm only doing some restful stuff for now

8:05 _ulises: Borkdude: none. using clj-http client straight

8:05 Borkdude: there are plenty clients but I don't know which one to choose, so I just use an http client

8:07 Borkdude: _ulises: I am using this one https://github.com/adamwynne/twitter-api

8:07 _ulises: nice!

8:07 * _ulises hadn't seen that one before

8:07 _ulises: seems to be pretty active too

8:12 Borkdude: _ulises: hmm, https://github.com/technomancy/swank-clojure/issues/57

8:14 _ulises: Borkdude: nice!

8:15 Borkdude: hmm

8:16 my whole emacs was fucked up by setting this slime-net-coding-system variable

8:17 How do I know what coding system to use?

8:20 _ulises: ah now it works

8:21 disconnect from your 'lein swank', set the variable, restart lein swank en reconnect

8:21 _ulises: set the variable: (setq slime-net-coding-system 'utf-8-unix)

8:47 licenser: _ulises Borkdude I think it is some kind of evaluation the slime does not like

8:48 for the sake of laughing I was having the exact same problem with my own json a week ago - was driving me nuts

9:18 Borkdude: licenser: it's fixed now though, by settings this encoding variable

9:18 licenser: tricky

10:26 kephale: in 1.3 is there a way to do a defn that attaches all the metadata that used to be present by default in 1.2?

10:31 Borkdude: Hmm, I merged a branch and now I want to undo it. https://gist.github.com/1360680 Please help ! :)

11:01 tomoj: is clojure-cake.org moving or something?

11:14 klauern: ? http://stackoverflow.com/questions/2389361/git-undo-a-merge

11:18 cgray: are the projects that were in clojure-contrib not all on clojars?

11:18 tomoj: at least some of them are in maven central

11:18 cgray: i'm looking specifically for algo.monads ...

11:19 technomancy: clojurebot: what happened to contrib?

11:19 clojurebot: Gabh mo leithscéal?

11:19 technomancy: clojurebot: I mean where did contrib go?

11:19 clojurebot: http://clojure.org/contributing

11:20 technomancy: clojurebot: botsmack

11:20 clojurebot: Owww!

11:20 * technomancy cackles

11:20 technomancy: cgray: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

11:23 cgray: technomancy: ok... i was trying to depend on the wrong version... algo.monads has a pom that says 0.1.1-SNAPSHOT on github, but it's only 0.1.0 on maven central

11:26 technomancy: cgray: see also: lein search algo.monads

11:27 cgray: technomancy: cool, learn something new every day :)

11:27 that'll save a lot of time

11:46 ericmoritz\0: is there a better way to express this... is smells bad, (apply hash-set (keys map))

11:47 gtrak: is there a good summary of the numerics difference from 1.3 and 1.2? I can't seem to find it by searching

11:48 _ulises: ericmoritz\0: maybe (into #{} (keys some-map)) ?

11:48 ericmoritz\0: Thanks

11:49 _ulises: ,(into #{} (keys {1 2 2 3})

11:49 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

11:49 technomancy: ,(set (keys {1 2 3 4 5 6}))

11:49 clojurebot: #{1 3 5}

11:49 _ulises: or that

11:49 technomancy: I read that as apply hash-map at first and was briefly horrified

11:49 anyway

11:49 is anyone able to repro the bug I'm seeing where github uploads result in this? http://p.hagelb.org/github-download-bug.xml

11:52 ericmoritz\0: Thanks, (set ...) is the most explicit

11:56 scottj: gtrak: http://dev.clojure.org/display/doc/Enhanced+Primitive+Support and http://dev.clojure.org/display/doc/Documentation+for+1.3+Numerics

11:57 gtrak: thanks

12:02 scottj: they were both mentioned in the changes.txt that outlines 1.3 changes

12:04 k9quaint: technomancy: I think I found a bug in the 1.6.2-snapshot of lein jar

12:05 technomancy: k9quaint: in the jar file?

12:05 k9quaint: no, the command

12:05 technomancy: oh, what's up?

12:05 k9quaint: it was whacking the classes directory after compile, but before jarring

12:06 technomancy: are you seeing that on the latest from git?

12:06 k9quaint: this was in combination with appengine-magic that i noticed it, rolling leiningen back to 1.6.1.1 fixed it

12:07 I am checking the latest now

12:22 technomancy: ok, I wiped everything clean and regrabbed all the latest and it works

12:24 technomancy: great

12:24 now if only github would fix their upload process, I could release

12:24 k9quaint: I have found that my users experience far fewer bugs if I don't upload things

12:27 technomancy: actually in the past two days I have had three or four people ask me questions at the conj where the answer was "it's a bug, but it's fixed in git!"

12:28 k9quaint: unfortunately, I am on the bleeding edge of the appengine + clojure stuff, so I get some ephemeral glitches

12:28 plus, I am a clojure novice

12:35 devn: technomancy: best way to (use 'clojure.repl) when connecting to the swank server?

12:35 technomancy: (automatically) :repl-init?

12:35 technomancy: devn: for the doc macro?

12:36 devn: technomancy: *nod* and source, etc.

12:36 technomancy: just use C-c C-c d and M-.

12:37 devn: technomancy: hm, not sure we're talking about the same thing

12:38 technomancy: I want to, by default, have clojure.repl available

12:38 technomancy: sure, but IIUC doc and source are really only useful outside slime

12:39 devn: fair enough -- just trying to have some sensible defaults in project.clj for people who aren't familiar with clojure

12:39 technomancy: yeah, I think :repl-init is your best bet there

12:39 grrrr... github is still broken

12:39 devn: does repl-init assume that sample-project is under my src/ dir, or can I just pull in my user.clj or something?

12:40 from ~/.m2 or something

12:40 technomancy: :repl-init just does require and in-ns, as long as it's on your classpath you should be good

12:41 devn: technomancy: cool, thanks

12:56 klauern: I'm getting an error when I start up a REPL, and I don't know what I did wrong in the file it's barking about: IllegalArgumentException Parameter declaration core/http-proxy should be a vector clojure.core/assert-valid-fdecl

12:56 I have an http proxy, so I created a simple function to set the Java system properties for it

12:56 (defn http-proxy [host port] (do (System/setProperty "http.proxyHost" host) .... etc)

13:03 ah, nevermind,

13:03 I goofed on a separate (defn) in that I didn't pass in the empty [] args

13:04 Part of the problem was that it didn't tell me anything about where the error was occurring. I assumed it was in the defn itself, but instead it was in a completely different one that happened to use that

13:05 (defn no-proxy (core/http-proxy "" ""))

13:05 threw the error

13:26 antares_: technomancy: is it just me or github leiningen downloads are broken?

13:26 technomancy: I tried to upgrade travis-ci.org cookbook to provide 1.6.2 ;)

13:50 scottj: antares_zzzz: 12:35 technoma : now if only github would fix their upload process, I could release

13:52 ollim: maybe a stupid question, but here goes: is there a ready-made way to sort sequences of sequences? google didn't help me much. basically i need to do an "interleave-by" (by the next largest element)

13:53 to add: i'm building a sorted-set-by of the sequences

13:57 technomancy: antares_zzzz: yep, it's broken

13:57 github bug

13:59 gtrak: is there a node.js repl?

13:59 for cljs?

14:00 scottj: gtrak: "Currently there are implementations for two environments: Rhino and the browser."

14:01 gtrak: ah, thanks

14:02 scottj: gtrak: although maybe there's a 3rd party one see mailing list thread subject "NodeJS REPL"

14:03 gtrak: ah neat

14:04 arguing with someone of the virtues of clojurescript for shell scripting over python :-)

14:08 scottj: cljs compilation phase and no special functionality for shell scripting would annoy me

14:22 licenser: gtrak: why would you do clojurescript for shell scripting? clojure would be the right pick there

14:22 gtrak: licenser, startup cost

14:23 licenser: cljs has a worst one

14:23 you need java for the compiler + whatever you run your js code on

14:23 gtrak: not on v8

14:23 pre-compile the js, run it on v8

14:23 licenser: -.-

14:24 gtrak: or set-up some sort of cache

14:24 you know, like python has .pyc

14:24 licenser: a persistant jvm?

14:24 kephale: gtrak: nailgun?

14:25 gtrak: i suppose if you have a persistent jvm, you don't need to run it on node :-)

14:25 licenser: I find adding so many layers is a bad idea

14:25 the error handling get exponentially worst with every layer

14:25 gtrak: however, if you want to run-as user, jvm can't help you there, right?

14:25 licenser: and even clojure does not shine here

14:26 gtrak: of cause look at cake

14:26 gtrak: what about cake?

14:27 licenser: it runs a persistent jvm on a user level

14:27 gtrak: licenser, i'm talking like a cron job

14:28 licenser: why is startup a problem then?

14:29 gtrak: because it takes longer to start the jvm than to do the task? it won't scale

14:29 licenser: scale?

14:29 gtrak: scale

14:29 licenser: scale?

14:30 especially for scaling one time fixed costs are neglectable

14:31 it is not like they get worst as your data grows, only execution time is affected there

14:31 gtrak: it's not a one-time fixed cost, unelss you have a persistent jvm

14:32 licenser: it is unless you want to run it more frequently with more data in which case I think you have a conceptual problem

14:32 gtrak: maybe there exists a scenario where that's not an option

14:32 in that case I'll use python? there's a use-case for this

14:32 licenser: what is your crontab doing?

14:33 gtrak: purely hypothetical

14:33 licenser: wait we are discussing a purely hypothetical problem where it won't scale?

14:34 gtrak: scalability and reality are orthogonal :-)

14:34 licenser: to answer that: yes if you have a purely hypothetical problem designed to target the 'week points' of jvm/clojure jvm/clojure is a bad choice :P

14:35 what I mean:

14:36 If you have a task that runs so frequently that the startup time of jvm is a problem then running it in a crontab is the first bad choice made

14:36 gtrak: well yea, if you're committed to the jvm, you'd use quartz

14:36 licenser: or just do the scheduling within your task

14:37 that is what I mean with en problem engineered to break jvm/clojure

14:37 so if you design a system to not work - it won't :P

14:37 on the other hand if a task runs so frequently that 500ms startup time are a problem it simply does not belong in a crontab

14:38 gtrak: well, you're putting those words in my mouth. actually hickey suggested using clojurescript for shell scripting, and I was just exploring the idea

14:38 i wasn't designing something to show a clojure weakness, in fact, I'm arguing with someone else in clojure's favor for this use-case :-)

14:38 licenser: gtrak: I just analyze your problem, not put them in your mouth ;)

14:39 gtrak: what exactly is the use case?

14:39 gtrak: 'i want to write little shell scripts in clojure'

14:39 basically, stuff i'd use python for normally

14:40 * licenser would use bash but ok

14:40 licenser: so you want to hand run it not put it in a crontab?

14:40 jacortinas: you would have to leverage node and v8 with clojurescript

14:40 gtrak: i prefer clojure, but i know how to do python and haven't bothered with java for that sort of stuff, plus the jvm start-up cost is high

14:40 jacortinas, yea

14:40 licenser, perhaps?

14:40 licenser: then a persistent jvm/nailgun would be the way to go

14:41 technomancy: the JVM's attitude towards posix is to stick its fingers in its ears, go in the corner, and hum loudly to itself.

14:41 gtrak: licenser, perhaps taking up a ton of memory is not an option

14:41 licenser: then closjure is really not the right tool

14:42 gtrak: that's a cop-out, what if i'm willing to make miinimal infrastructure changes to clojure to make it so?

14:42 Ober: ?

14:43 gtrak: just saying, x is not the right tool for y is bad, there's no design decision of the 'language' that makes it true

14:43 TimMc: duck1123: I reduced my Foo cannot be cast to Foo test case way down: https://gist.github.com/899696

14:43 gtrak: unlike say with python and concurrency

14:43 licenser: gtrak: the design decision is to run on the jvm

14:43 gtrak: have you heard of clojurescript?

14:43 licenser: so if your constrains are: low memory footprint, fast startup jvm is bad

14:44 gtrak: agreed

14:44 licenser: gtrak: have you written a clojurescript something?

14:44 gtrak: tried to :-)

14:44 licenser: exactly

14:44 duck1123: TimMc: I haven't seen it since then, but that's still an odd one

14:44 gtrak: licenser, have you decided that it will never be useful?

14:44 licenser: I would not trust clojurescript with a sysadmin task

14:44 gtrak: i haven't

14:44 licenser: no I use it happily right now

14:44 just not for that

14:45 TimMc: duck1123: gonna post it to reddit

14:45 duck1123: I'm still trying to figure out what causes this: https://gist.github.com/1349315

14:45 licenser: see the problem cljs give you is you have: cljs compiler, clojure, jvm, closure, the js vm as problem positions

14:45 that is a lot

14:46 what I mean is if there is a error in your script trail and error is one of the only ways to find it

14:46 gtrak: indeed, it needs some help

14:46 licenser: and in that case I think using python is the better choice

14:46 gtrak: well if you have like a nodejs cljs repl, its' not that big a deal

14:46 if the script dev requires a running jvm, that's fine

14:47 though not optimal

14:47 licenser: well compiling for simple programs take like 10s

14:47 which I find way too much

14:47 gtrak: licenser, from the api call or the command-line?

14:47 it doesn't take that long for me

14:48 licenser: command line

14:48 gtrak: yea, that sucks

14:48 you would use a running jvm for repl compilation with the way it exists now

14:48 licenser: that means, the startup time for jam is really fast :P

14:54 TimMc: duck1123: More imports required?

14:56 licenser: on another topic: had anyone tried macros in clojurescript?

14:56 duck1123: TimMc: I get that I need to put in the import, and that fixed it. But I don't understand why. (.getBody (get-foo)) works just fine

14:56 TimMc: duck1123: Is basic/get a macro?

14:57 wait, that doesn't make sense.

14:57 duck1123: TimMc: no. https://github.com/michaelklishin/langohr/blob/master/src/langohr/basic.clj#L132

14:58 TimMc: OK, so there's got to be something weird about the hinting.

14:58 duck1123: I also couldn't assign it in a let block

14:58 TimMc: fascinating

15:00 duck1123: I think it might have something to do with the fact that the args are hinted, but not the var

15:13 TimMc: duck1123: Is there any way to see what the Clojure compiler is generating there?

15:14 duck1123: TimMc: Not that I know of... other than decompiling the classes

15:14 TimMc: duck1123: Try (.getBody (#(basic/get channel "foo")))

15:18 duck1123: That appears to work

15:23 Ok, fixing the type hinting on that fn made it all go away. So I'm going to submit a pull request

15:34 TimMc: duck1123: What's wrong with the hinting?

15:36 duck1123: correct me if I'm wrong, but you're supposed to hint a fns return type like (defn ^String foo [] "") and not (defn foo ^String [] "")

15:36 TimMc: aha

15:36 There are a couple of those in that file.

15:37 duck1123: Yeah, I'm going to correct them all and send in the pull request

15:37 TimMc: I actually don't know much about how hinting is supposed to be done.

15:37 but it seems like this is also a Clojure compiler problem.

16:07 gtrak: licenser, dnolen is presenting a node repl as we speak :-)

16:13 licenser: neta

16:52 mindbender1: how can I add multiple entry to :dev-resources-path

17:00 duck1123: try separating with a colon ?

17:05 TimMc: That should work, looking at lein's source.

17:11 mindbender1: duck1123: when I seperate with ":" like this :dev-resources-path "foo":"bar" I get Exception: Invalid token: : (project.clj)

17:12 TimMc: mindbender1: Put it in the string: "foo:bar"

17:13 It has to be valid Clojure. Leiningen is just going to take all the relevant path strings and concatenate them with java.io.File/pathSeparator, which is probably ":" on your machine.

17:14 mindbender1: It works!

17:15 Thanks.. I've been trying out different things for ages

17:32 arohner: did c.c.shell make it into new contrib?

17:33 oh, it went into core 1.3

17:37 gfredericks: if I want a data structure to throw some elements into one at a time and then read off when I'm done (i.e., reading from it once after writing is completed), is a list going to perform better than a vector?

17:40 duck1123: gfredericks: there's always ConcurrentLinkedQueue

17:41 also, lamina

17:41 TimMc: gfredericks: In what order will you read?

17:41 gfredericks: TimMc: doesn't matter

17:42 I was going with an atom+list, but was curious because I didn't know for sure that a vector would be worse

17:42 I think I saw somebody once insinuate that lists are not linked lists

17:42 I don't know what else they would be though

17:42 TimMc: There are different kinds.

17:43 err... maybe not with lists

17:43 PersistentList only knows about first and rest

17:44 rest could be a non-linked list

17:45 gfredericks: okay

17:45 duck1123: I think using anything I haven't heard of would be overkill for this particular problem

17:46 it's not even performance sensitive. I was just curious.

17:46 duck1123: For the first one, I just searched on java queues and clicked the one that looked threadsafe.

17:47 as for lamina... learn to love lamina, it's pretty awesome

17:48 TimMc: gfredericks: Then don't worry about it.

17:48 gfredericks: duck1123: a queue would be weird. The reading is being done by the same thread that wrote to it.

17:48 TimMc: but I like knowing how things work :/

17:48 TimMc: heh

17:48 Abstraction-breaker!

17:48 ~guards

17:48 clojurebot: SEIZE HIM!

17:49 duck1123: conj should do the right thing no matter what, so if order doesn't matter... use vectors, less typing

17:49 gfredericks: duck1123: (= (count "[]") (count "()"))

17:50 TimMc: gfredericks: vs. Java class names

17:50 mindbender1: As I read and research on TDD and how it's done in clojure.. It continually looks to me like clojure programmers don't bother much about mocking.. is right to think of it like this?

17:50 bhenry: gfredericks: that only works for an empty list.

17:50 duck1123: ,(= (count "[]") (count "'()"))

17:50 clojurebot: false

17:50 TimMc: ,()

17:50 clojurebot: ()

17:50 gfredericks: duck1123: you don't have to quote empty lists

17:51 TimMc: mindbender1: TDD is a contentious topic, I hear.

17:51 ,(cons \a "bcd")

17:51 clojurebot: (\a \b \c \d)

17:51 duck1123: mindbender1: if you want to mock, check out midje

17:52 You can get away with a lot more things in clojure without resorting to mocking, so it's not as big of an issue

17:53 mindbender1: duck1123: I wish there was a resource that will show me how to do that

17:55 gfredericks: duck1123: I was thinking something similar but wasn't sure how to defend it

17:56 daaku: i'm using lobos to write my schema and korma to access it with the h2 db in embedded mode, but seems like there's some conflict about quoting table names. in the h2 console gui, i see the table names quoted which works, and the queries from korma used unquoted table names which dont work. anyone run into this?

17:58 duck1123: Well, in a traditional OO program, all the state you need is locked up in the objects, since a good functional function is going to get everything it needs via the arguments, it's easier to get everything you need for a good test

17:59 but do check out Midje. https://github.com/marick/Midje/wiki

18:11 TimMc: daaku: I think someone else was complaining about that recently -- something about korma not quoting table names, that's all I know.

18:12 daaku: TimMc: yeah, looks like one quotes the other doesnt, and h2 treats them differently :/

18:15 leo2007: technomancy: I tried to use fuzzy completion in slime but it can only completes to, for example, swank.core/ but not swank.core/break. Ideas?

18:20 archaic: how do i go about putting a java library on clojars that i need access to, it's not on maven central (jgraphx), i have downloaded the jar file, is it a matter of placing this in a new project and running lein push?

18:45 TimMc: archaic: You may have to hand-craft a pom.xml file according to clojars' expectations. It doesn't have to be very fancy.

18:47 archaic: thanks, ill start reading about them

18:54 cgray: archaic: I think you can also just install the library locally with maven and then lein will be able to see it

19:07 TimMc: When do we get lazy macros?

19:09 aperiodic: what would be a motivating use-case for lazy macros?

19:10 TimMc: I don't even know what I mean by that.

19:10 I was hoping someone else would. :-)

19:10 aperiodic: (delay (macroexpand ...))?

19:11 TimMc: Perhaps some kind of late code generation. I've been reading "Why Are Black Boxes So Hard to Reuse?", which talks about that, and "lazy macro" popped into my head.

19:12 aperiodic: I interpreted it as being able to get the compiler to wrap macroexpands in a delay

19:13 dunno what good that would do, though

20:20 archaic: so i screwed up a pom file uploading to clojars how can i get the clojar/jar removed? (jgraphx 1.8.0.3)

20:28 tolstoy: When using clj-http, is there a way to see the full response when you get, say, a 400 error?

20:28 cgray: is count a constant-time operation on vectors?

20:28 duck1123: cgray: IIRC, it's something like O(log 32 n) ie damn near 1

20:29 cgray: duck1123: it adds the counts in all the subtrees or something? that makes sense...

20:30 duck1123: don't quite me on that. I just know that some of the things that are supposed to be O(1) are only really close to 1

20:30 quote

20:31 cgray: yeah, O(\log_32 n) is close enough for me... i just want it to not be O(n)

20:32 duck1123: Rich knows better than that

20:32 cgray: true

20:34 arohner: cgray: actually, count is O(1) on vectors

20:34 cgray: arohner: nice

20:34 arohner: cgray: http://blogs.innoq.com/st/2010/04/clojure_performance_guarantees/

20:34 there might be an updated version of that somewhere on the internet...

20:36 cgray: anything that implements clojure.lang.Counted is O(1)

20:36 cgray: arohner: I suppose nth on vector is near-constant

20:36 arohner: cgray: yes, O(log_32 n)

20:37 taufiq: processing binary files 3-6mb each, i'm using java classes and byte arrays a lot. is that generally how it's done?

20:39 sorry, i realise that's not a lot of info to go on, happy to explain what i'm trying to do

20:43 duck1123: taufiq: Don't be afraid to go deep into the java classes for stuff like that

20:45 taufiq: thanks, duck1123. learning as I go, just checking I hadn't missed something

20:58 klauern: How do you kill the REPL from leiningen? Ctrl+C doesn't seem to be working at all

20:59 I'm in WinXP FWIW

21:13 duck1123: klauern: C-d ?

21:14 klauern: That detaches the Command from the process, but it continues to run

21:14 so my command-line will look like the REPL killed, but I can still see the process running

21:17 I've also found that the (exit) command does essentially the same as C-d, but it doesn't work at all if you're in a Leiningen project

21:35 gfredericks: barfbag2273

21:51 wlabelle: Anyone working on swank support for clojurescript?

21:57 duck1123: How do I test is something is a byte array?

22:01 usiegj00: heya--any clojure users working on web apps w/Jetty within emacs / swank?

22:02 I've a question about realtime updating the actions...

22:02 can't seem to overwrite the functions linked to routes without restarting the jetty server

22:02 duck1123: pass your routes to the start function as a var

22:03 usiegj00: gotcha… trying

22:03 and if I update the function connected to a route

22:03 like

22:03 duck1123: https://github.com/mmcgrana/ring/wiki/Interactive-Development

22:03 usiegj00: (GET "/hello" [] hello-world)

22:03 if I change hello-world and send the buffer to my bound clojure process

22:03 it doesn't update

22:03 since

22:04 the route grabs the previous function def?

22:04 this is different to my allegro lisp memories (10 years ago now...)

22:05 duck1123: if you give the arg to run-jetty as a symbol, then those routes are stored, if you pass it as a var, then when you update the routes, it'll pick that up

22:07 usiegj00: gotcha

22:07 thank you!

22:10 gfredericks: duck1123: (= (type maybe-a-byte-array) (type (byte-array [])))

22:10 that's how I did it anyways.

22:12 duck1123: that's a lot of writing for a simple midje test. Perhaps I should make a custom checker

22:59 tolstoy: Is there a multi-line string sort of literal in Clojure?

23:00 Oh, I see. Just regular quotes.

23:02 aperiodic: duck1123: check the class?

23:05 hm, that's seems to be the same as type for byte arrays

23:06 but if you wanted it to be shorter, then it'd be (

23:06 (= (class testee) "[B")

23:07 duck1123: that should work

23:10 but it didn't

23:11 ,(class (byte-array []))

23:11 clojurebot: [B

23:12 duck1123: ,(= (class (byte-array [])) "[B")

23:12 clojurebot: false

23:23 wtfcoder: adding clojure-rabbitmq "0.3.2" to my project.clj and doing lein deps results in several errors "unable to locate resource in repo..".. answering my own question.. it looks like lein deps isnt searching mvnrepository.com - how to configure lein to do this?

23:24 antares_: wtfcoder: it should use maven central by default

23:24 duck1123: wtfcoder: also, you might want to check out https://github.com/michaelklishin/langohr

23:24 antares_: wtfcoder: if you need clojure-rabbitmq, i recommend you to take a look at Langohr

23:25 wtfcoder: it is on clojars

23:25 and I can tell you what repo to add to get RabbitMQ java client :)

23:26 wtfcoder: so if that resource is RabbitMQ Java client (which is usually pushed to Sonatype first), add it like this: https://gist.github.com/1361590

23:28 wtfcoder: thanks. so ive added [langohr 1.0.0] to my :dependencies vector and ran lein deps but still immediately results unable to locate resource in repo

23:29 antares_ so I have to add that :respositories to my project.clj?

23:30 antares_: wtfcoder: Langohr is 1.0.0-SNAPSHOT

23:30 wtfcoder: yes, you need to add Sonatype repo to your project.clj

23:31 and same for clojure-rabbitmq, actually

23:31 wtfcoder: okay a few erros in my project.clj, fixed and now downloading.. thanks

23:32 antares_: wtfcoder: could you gist the error message? we cannot really know what artifact leiningen cannot locate

23:32 ok

23:32 wtfcoder: I am the author of Langohr and maintain a couple more AMQP clients so if you have questions, feel free to ask. We are working on the docs site and it is not yet ready :(

23:32 duck1123: antares_: did you see the discussion about the strange issue I was having earlier

23:33 wtfcoder: with regarding to versioning does lein deps support defining dependencies like [ns/app "0.3.x"] which will get the latest in the 0.3.x ala npm/package.json

23:33 duck1123: it looks like the functions are type-hinted incorrectly

23:34 wtfcoder: antares_ thanks will give it a try porting a node.js consumer across

23:34 antares_: duck1123: sorry, I haven't

23:35 wtfcoder: do you use node-amqp? I am not very familiar with that but since it is Ruby amqp gem's port originally, I think understand the difference between them well enough :)

23:35 wtfcoder: also, maybe http://bit.ly/amqp-model-explained will help with understanding client lib differences

23:35 duck1123: Here's the gist https://gist.github.com/1349315 It turns out that some of the functions put type hints on the arg lists and it causes odd errors

23:36 I was working on a pull request, but then I got distracted

23:36 antares_: duck1123: I think it is missing an import

23:36 duck1123: thanks for the script, I will look into it a bit later

23:39 leo2007: duck1123: do you fuzzy completion with slime for clojure?

23:40 duck1123: leo2007: I've never gotten the fuzzy completion package to work

23:40 antares_: pull request sent

23:41 leo2007: duck1123: same here.

23:42 duck1123: the default completion works well enough for me

23:43 antares_: duck1123: hm, good catch. I was switching to the "per form" hinting and messed up in the process. Sorry about that.

23:44 duck1123: no problem. I finally got around to swapping out wabbitmq the other day, and that had my head scratching

23:44 antares_: duck1123: cutting a new snapshot already

23:44 duck1123: putting the import in there made it work though

23:44 wtfcoder: antares_ is publish async in https://github.com/michaelklishin/langohr/blob/master/src/langohr/examples/basic_publish.clj

23:45 technomancy: dakrone: nice; connection pooling on the https

23:45 antares_: wtfcoder: publish is always async in AMQP so yes

23:45 wtfcoder: those examples are from very early days, check out tests

23:46 we just use Java client's Channel#basicPublish

23:46 nothing on top of that

23:49 wtfcoder: I just pushed a new Langohr snapshot, please run lein deps

23:58 dakrone: technomancy: thanks!

23:58 technomancy: have you been using it a lot? does it help you at all?

23:59 I'm anxious for feedback about it

23:59 technomancy: I haven't tried it yet

Logging service provided by n01se.net