#clojure log - Jan 09 2010

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

1:10 mebaran151: hiredman, what deps do I need for your compojure package (as it does claim it is "better")

3:40 LauJensen: Good weekend all

3:44 grantmichaels: LauJensen: setting up arch s per 'cast =)

3:49 LauJensen: Sweet :)

3:50 grantmichaels: never have played w/ arch before ... slackware, gentoo, ubuntu, mint, debian, suse, puppy ... but never arch =)

3:50 LauJensen: Ok, I think I've almost played with all there is, though Gentoo least of all, and Arch is a very strong distribution - lean and mean

3:51 And Pacman greatly outperforms apt-get

3:52 grantmichaels: seems pretty fast

4:57 LauJensen: Any paredit fans in here?

4:59 grantmichaels: planning to be using that in the rig i'm setting up

5:00 LauJensen: If I hook paredit on Clojure-mode and Slime-repl-mode on Clojure-mode, then paredit makes slime blow-up, I'm wondering if there's a nice way to get around that

5:09 esj: LauJensen: I've got the basic paredit, clojure-mode going with a slime repl alongside

5:10 LauJensen: ejs: So Repl with paredit and clojure-highlighting? I'm guessing you're running a more recent version than me

5:10 esj: but no slime-repl-mode (googling now to find out what that is)

5:11 ok, maybe.

5:11 I followed this magic recipe http://learnclojure.blogspot.com/2009/11/installing-clojure-on-ubuntu-910-karmic.html

5:12 LauJensen: ah ok

5:12 We're not using the same Slime

5:13 grantmichaels: 5:15am, Hadoop ready for next episode, Yogurt in the maker while I sleep to rainy & cold weather ... figure out what the differences are between maven/leiningen/clojars tomorrow ...

5:13 esj: yeah, i don't think my slime does clojure highlighting

5:13 in the repl

6:36 esbena: how do I add items to a _set_? is '(set (cons :A #{:A :B :C}))' really the way to do it?

6:37 Chousuke: esbena: conj is the polymorphic add operator.

6:37 esbena: works for any clojure data structure.

6:39 ,[(conj #{} 'a) (conj {} '[k v])]; like this

6:39 clojurebot: [#{a} {k v}]

6:41 hiredman: (let [a #{1 2} a’ (conj a 3)] a’)

6:41 ,(let [a #{1 2} a’ (conj a 3)] a’)

6:41 clojurebot: #{1 2 3}

6:41 Chousuke: :P

6:42 hiredman: ,(int "′")

6:42 clojurebot: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character

6:42 hiredman: ,(-> "′" .getBytes vec)

6:42 clojurebot: [-30 -128 -78]

6:42 hiredman: ,(-> "’" .getBytes vec)

6:42 clojurebot: [-30 -128 -103]

6:42 Chousuke: ,(int \’)

6:42 clojurebot: 8217

6:43 hiredman: ′ is the unicode prime glyph

6:44 but I don't seem to have a set of keys that will generate it

6:52 esbena: Chousuke: thanks, you have helped me many times now :)

7:39 hipertracker: how to simple introspect clojure object? Is there anything similiar to dir(x) in Python or x.methods in Ruby ?

8:11 chouser: hipertracker: to get useful info, it depends on the type of object.

8:12 hipertracker: are you wanting to look at a Clojure data structure, a namespace, a java object, or... ?

8:14 clojure.contrib.repl-utils/show will print the Java object's methods, but Clojure isn't particularly object oriented, so that may not be the most useful.

8:25 bagucode: Hello all

8:29 chouser: bagucode: good morning

8:30 bagucode: chouser: thank you, it's 2:30 pm here though ;)

8:30 chouser: :-)

8:30 you can save that up and use it tomorrow morning then.

8:32 bagucode: I need a little help testing a library I'm writing for using C libs from clojure, if anyone is interested. I have only tested it using standard C libs and a single OS and computer so any help to iron out bugs that are platform dependent (or just regular bugs) would be appreciated. It's at http://github.com/bagucode/clj-native

8:33 chouser: bagucode: what platform have you teseted?

8:33 bagucode: OS X 10.6, 64 bit intel. A macbook pro

8:36 chouser: I've tried to make sure that word-size dependent stuff such as the size of long is handled only at runtime so that a function specification like (my-c-fn "blah blah" my-clojure-fn [long int long] void*) should Just Work(tm) without having to think about such things when writing the interface spec.

8:36 chouser: ah, good.

8:39 bagucode: Oh, right. The docs don't currently say anything about what types are available for use. Just look in core.clj, there is a big table there mapping symbols of native types to java types. Any native type symbol used as a key there can be used in a function specification.

8:43 chouser: I'm a little bummed that jna direct mapping can't support varargs. I asked about it on their mailing list and they told me it would require introspection which would defeat the purpose of direct mapping which is performance. Still, I can't think of any function off the top of my head that uses it except printf and that's no major loss since you probably don't want to use it from clojure anyway :)

8:44 chouser: have you tried it out for your original use case yet?

8:46 bagucode: Nope. I put that project on ice for a bit. Was planning on resurrecting it when clj-native got to some sort of version 1. But I want to look into structs and unions and test it a lot more before calling it 1.0.

8:48 * chouser nods

9:16 quizme: what is CLOJURE_EXT supposed to point to? ... the example is /Users/mb/Library/Clojure <--- is that where the jar files are?

9:22 fliebel: Is there something like transient strings and numbers?

9:25 chouser: not sure how a transient number would be useful, but there's a StringBuilder that is a bit like a transient in some ways.

9:25 bagucode: fliebel: Strings and numbers are the immutable underlying java types so I would guess the answer is no

9:26 yeah ofc, there are the java classes StringBuilder and StringWriter :)

9:26 fliebel: I to would have guessed that, but I was thinking in an Ruby way for a moment...

9:26 bagucode: the str function uses stringbuilder internally right?

9:27 fliebel: http://github.com/richhickey/clojure/blob/f4c58e3500b3668a0941ca21f9aa4f444de2c652/src/clj/clojure/core.clj#L356

9:28 It does

9:28 bagucode: Right, so it should be pretty efficient at concatenating stuff

9:30 fliebel: If you do all the concatenation in one blow...

9:31 bagucode: Yeah. Or you could use StringBuilder manually, just don't let it escape the function and it will be just like a transient.

9:32 fliebel: Sounds good… I'll have to look up replaceAll, if that is mutual… That would be evil Ruby style string processing.

9:34 bagucode: StringBuilder still just does concatenation. If you really want to modify things in place then get the characters from the string as an array

9:34 fliebel: It seems to offer a few basic get, set, insert, replace, etc. functions

9:35 bagucode: Oh, I thought it just did concatenation :D my bad

9:35 fliebel: lol, first there is a screen full of append and insert functions, then a few others.

9:36 bagucode: Still if you are just doing a single replaceAll or something like that it will probably be faster to just call that on the string and get a modified copy because you would have to copy the string into a StringBuilder or array before modifying it in place anyway.

9:36 fliebel: I know...

9:38 I'm off, playing a silly card game with my brothers, and maybe build a silly function to accomplish a trivial task real fast and complicated.

9:39 bagucode: bye

9:46 quizme: anybody here use vimclojure ?

9:46 the-kenny: quizme: Yeah, some people do it

9:47 quizme: i just got my nailgun server up

9:47 the-kenny: The author is here sometimes too.

9:47 quizme: not sure what to do next

9:49 bagucode: chouser: I just did a microbench comparing the .invoke vs. the direct mapping approach to calling a C function from JNA. I was happy to see that the difference was quite noticable. Hadn't really tested it before since I was still trying to get my lib usable. After doing 10k calls with each of the versions to warm up hotspot I made 10M calls with each and the direct mapping version finished in one third of the time of the .invoke call.

9:50 quizme: the-kenny do you know how to use vimclojure ?

9:50 the-kenny: quizme: No, sorry. I'm on Emacs

9:50 quizme: the-kenny k

9:51 bagucode: Anyone here using anything other than emacs or vim?

9:51 the-kenny: bagucode: There's a netbeans and/or eclipse plugin

9:52 bagucode: the-kenny: Yeah I know, I'm curios as to how many are using them because almost everyone seems to be using emacs with a few who prefer vim

9:52 the-kenny: bagucode: Emacs is perfect for lisp-programming by default

9:54 bagucode: the-kenny: It should be since it's mostly written in lisp :P

9:54 the-kenny: bagucode: That's what I'm refering to :p

9:55 quizme: i think you need a phd to get these editors to work...

9:56 the-kenny: quizme: Not really. The installation of slime and clojure with the help of elpa in emacs is really easy

9:56 bagucode: I'm an emacs user as well, since I learned lisp. But I'm a bit of a java head by vocation though so I have tried the NetBeans plugin. While it's not bad it doesn't come close to the combination of clojure-mode, slime and paredit.

9:56 the-kenny: I recommend everyone to try both editors

9:57 bagucode: the elpa auto install is broken on emacs 22

9:57 quizme: i'm gonna try slime again...

9:57 bagucode: eh

9:57 I mean the swank-clojure auto install of clojure

9:58 elpa works, but then it breaks when starting slime the first time and swank tries to get clojure

9:58 So use emacs 23 if you can

9:58 the-kenny: bagucode: hm.. Never used the auto-install for clojure. I use leiningen for everything

9:59 bagucode: the-kenny: Yeah I use lein swank for most things as well. But if you want to start a repl for just trying stuff out and don't have a project handy it's nice to have it work stand alone too

9:59 the-kenny: bagucode: I have a project for that ;)

9:59 bagucode: haha

10:24 quizme: yeah slime was easy

10:24 you only need a master's degree for that

10:42 bagucode: quizme: did you get it working?

10:42 quizme: bagucode yeah i got slime working

10:42 bagucode: quizme: Take a look at this http://www.bestinclass.dk/index.php/2009/12/clojure-101-getting-clojure-slime-installed/

10:43 quizme: bagucode but not vimclojure

10:43 bagucode thanks, yeah it worked for me.

10:43 bagucode: quizme: Can't help you with vimclojure, never used vim much. Just use it when there is no emacs on a system :)

10:44 quizme: bagucode: i used to like emacs more. now i like vim more...

10:44 bagucode: anyway, it's 7:45 a.m. here. Time for bed... hehe

10:44 bagucode: quizme: :)

11:04 esbena: I'm getting a StackOverflowError due to heavy use of recursion (labyrinth-like game solver) - I'm using 'recur' when possible - do I really have to make imperative loops?

11:07 arohner: esbena: are you doing any mutual recursion?

11:07 esbena: yes

11:08 arohner: you'll have to use a trampoline to avoid blowing the stack there

11:08 let me see if I can dig up the doc

11:08 http://groups.google.com/group/clojure/msg/3addf875319c5c10

11:09 esbena: thx - I'll take a look at it

11:13 mebaran151: how does one do transaction in clojureql

11:21 LauJensen: mebaran151: (in-transaction (make-con.... ...) (body)) where body returns the result of your sql-statement

11:21 mebaran151: in-transaction

11:21 cool

11:21 and currently the best way for indexes is just raw-sql right?

11:21 I have to admit, getting query to return results was a little hairy

11:22 maybe provide two forms, one that doall's the result before returning it while the other allows you to pass a function that can work with the lazy-seq before it closes

11:24 after this project, I'll try to hit the wiki and record the pitfalls of ClojureQL, slay some dragons etc

11:26 LauJensen: Cool - I have a patch lying in my inbox to get the index back from the resultset-seq, but have yet found an optimal way to merge it with the current implementation

11:26 I fail to see how getting query results is difficult?

11:27 mebaran151: I didn't realize that run required a binding form

11:27 here were my two macros

11:28 https://gist.github.com/4e36f245662acaa7c6ce

11:29 that way if you need the laziness you can just use the apply-sql macro to the result set

11:29 I thought it seemed like a nice idiom

11:29 while dosql will just return the sql as is

11:32 http://gist.github.com/272977 << public version

11:32 LauJensen: mebaran151: You don't like doc-strings? :)

11:32 mebaran151: hmmm?

11:33 oh you mean with usage and such

11:33 LauJensen: The doc-tring for run is pretty explanatory

11:33 Same for let-query

11:33 mebaran151: oh

11:33 I've was just working from the wiki

11:34 LauJensen: Ok - I really need to dedicate some time to set up a proper Wiki

11:34 Apologize for any misunderstandings

11:34 mebaran151: and the error I was getting didn't indicate I'd called the function wrong

11:35 it just said the result set was closed

11:36 I personally think my macros are slightly more natural :)

11:39 fliebel: harumph, Java ugliness all the way… Is there something in contrib to copy files? The Java way seems to be using 2 buffered streams writing one to the other.

11:40 It's almost like the fastest way is to execute the cp command...

11:43 mebaran151: jdk7 has supposedly fixed this

11:44 fliebel: Where do I get that? I'm on 1.6 I think… But that is just a guess

11:44 mebaran151: it's not out yet :(

11:44 the new Path stuff in java is actually kind of nice

11:44 fliebel: I thought so… So what do I do until that time arrives?

11:45 mebaran151: http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html

11:45 fliebel, I think apache-commons usually has some good stuff for this sort of thing

11:46 yep commons-io has a static copyFile function

11:46 fliebel: But that is not something laying around on every jvm, is it? I'm not going to include that, I'd rather write some java myself...

11:47 mebaran151: http://commons.apache.org/io/api-release/index.html

11:47 a lot of java projects rely on apache-commons, bundling shouldn't be an issue if you include it in your jar

11:48 fliebel: meh… If there is nothing in contrib I think it is better to write a few lines than to include another dependency.

11:53 the-kenny: How should the tests for "lein test" be defined?

11:54 fliebel: Hm, I'd like to know that as well.

11:58 karmazilla: the-kenny: I have a folder called "test" with a structure that mirrors the one in "src" where the .clj files contain test-is tests

11:58 the-kenny: karmazilla: Ah.. that's how clojure-couchdb does it. But when I run "lein test", it looks loke clojure-couchdb isn't in the classpath

11:59 karmazilla: odd.. makes me wonder if the lein installation is messed up. :-/

12:00 fliebel: Write meta-tests :D

12:00 the-kenny: ah, I think I found the problem

12:08 edbond: what means '(def triangles (lazy-cons 0 (map + triangles (iterate inc 1))))'? I found it in solution of euler12

12:10 mebaran151: well I think lazy-cons is officially deprecated

12:11 bagucode: Yeah, it should look like this now: (def triangles (lazy-seq (cons 0 (map + triangles (iterate inc 1)))))

12:12 edbond: bagucode: thanks

12:12 how it works?

12:12 mebaran151: I wish lazy-seqs could be annotated with an optional close method

12:12 so I could represent more db stuff in terms of lazy-seqs

12:13 maybe the closer could be stored in the metadata

12:14 bagucode: Yeah you could do that and it's also possible to make the function that produces the sequence close it's source when it has consumed the last element or reached eof or whatever

12:14 edbond: how its possible to use triangles when it's not defined yet?

12:14 bagucode: Just make it close over the connection/stream etc.

12:16 mebaran151: well but what if I wanted to represent say an sql table as a paginated list select blah from table limit statements

12:16 and you might not consume the whole thing

12:16 bagucode: edbond: It's not used before it is defined. lazy-seq and map are lazy, which means that nothing happens until you start to take items from the sequence and by then triangles is defined.

12:17 mebaran151: So you want to be able to say (close my-seq)? Then you could do like you said and store a close function in the metadata that (close ) looks up and calls.

12:18 edbond: I should take a break and will try to get it. I saw similar in haskell fib defined using zip.

12:18 bagucode: The close function in the metadata could close over the source of the sequence (like a db conn or a stream) and close that

12:19 wow, many close in that sentence :D

12:19 mebaran151: that's how I do it currently

12:19 bagucode: Not good enough?

12:19 mebaran151: I just think maybe clojure should have an official protocol for that

12:19 I'd like something like the pre post conditions

12:20 except on close

12:21 bagucode: Yeah I've thought about a general way of doing scoped resource handling too. A more general version of with- that could take "destructors" or "closers" as some sort of argument so that you can scope anything without resorting to making a with- macro for each type, not just java-closeable stuff

12:22 mebaran151: yeah

12:22 hiredman has one actually

12:22 all sufficiently smart clojure is included in ClojureBot

12:24 bagucode: mebaran151: Like you say it would be nice to have an official implementation of such a thing since it's a pretty small thing but also very useful

12:25 mebaran151: yeah

12:25 it could probably replace try and finally if done correctly

12:28 feels like with metadata you have most of what you need

12:29 everything that would ever need closing could be described by a hash-map

12:29 or seq

12:50 the-kenny: Is there a simpler way for something like (= mymap (select-keys myothermap (keys mymap)))

13:21 fliebel: Clojure is driving me mad again… If I print a piece of code the output is as expected a file-seq, but doing a for over it does not run a single time :(

13:21 arohner: fliebel: can you paste it?

13:21 {newbie}: lazyness attack?

13:22 fliebel: maybe...

13:22 http://gist.github.com/273028

13:23 the-kenny: fliebel: Looks like lazyness

13:23 add a doall around the for

13:23 fliebel: Is it that stupid… I love and hate laziness...

13:24 arohner: in clojure, you usually only use laziness for pure functions

13:24 if you have side effects, use doseq

13:24 the-kenny: arohner: I once got data through some stream and modifies it with map to use it some minutes later.

13:24 arohner: you can use just doseq instead of for + doall

13:25 the-kenny: But because of map was lazy, the streams were dead and my data too :)

13:25 fliebel: But doseq does not have the :when, does it?

13:25 arohner: it has all of the options for has

13:25 ,(doc doseq)

13:25 clojurebot: "([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil."

13:26 fliebel: cool

13:27 works!

13:28 Everytime I think "I'm not going to be bitten by laziness ever again, I know how it works now", but I keep doing the same thing...

13:43 defn: Anyone here ever do midi with clojure? Specifically on OSX 10.6 after the JVM update--

13:43 I'm not sure how to go about getting it setup. Apparently there is support for core midi now in the JVM update so you don't technically need mmj

13:43 fliebel: Hey, defn, how are you doing?

13:44 defn: hiya fliebel

13:44 sorry i still haven't touched utterson

13:44 * defn feels bad

13:44 * defn opens the source and starts reading

13:44 fliebel: Don't worry about me, I was more like feeling sorry for you I did so much :)

13:45 defn: haha it's okay -- it's fun to read other people's source

13:45 (assuming they're not evil morons)

13:45 which i dont believe you are :)

13:46 fliebel: I removed the worst spageti a few revisions ago ;)

13:46 defn: fliebel: ive been all focused on cljex lately, just trying to get it setup to the point where i feel comfortable letting it simmer

13:47 fliebel: defn: I've been all focused on Uterson lately, just trying to get it setup to the point where i feel comfortable running my website wiht it.

13:48 defn: :)

13:48 fliebel: I've already started a design :)

13:48 xkcd.com is slowing me down though...

13:50 *opens up cljex*

13:51 defn: whoa, it's not showing "it's working" anymore

13:53 defn: who what?

13:53 oh, lol yes

13:53 fliebel: defn: but I don't see any examples either :(

13:53 defn: i decided to just write the README and figure out how to make it work like the README describes as an afterthought

13:54 fliebel: yeah, sort of a bummer, but *shrug*, they'll come eventually

13:54 i have permission from some bloggers to use their examples

13:54 fliebel: defn: cool

13:54 defn: i just want to fix the organization because i reall hate the layout right now

13:54 it should be organized by namespace, and with a scrolling frame

13:55 plus im getting rid of the pygments/python requirement and am going to switch to something like showdown

13:55 fliebel: Is there any possibility that functions are going to reference other functions? PHP style...

13:55 How do you use a Python project in Clojure?

13:56 {newbie}: fliebel: jyton

13:56 i guess

13:56 jython*

13:57 fliebel: Nah, I alsoe found it in a Ruby project, there must be some magic to that, it was not a Jython project.

13:57 nor jruby

13:58 defn: fliebel: i just call it with shell-out

13:58 fliebel: ah...

13:58 LauJensen: Besides Twitter, what are some interesting websites with open APIs ?

13:58 defn: which is ugly, but python's markdown + codehilite extension was an all in one solution

13:59 LauJensen: doesn't the government data site have an API?

13:59 fliebel: I see...

13:59 LauJensen: defn: Not that I know of

13:59 defn: hmmm, i know they have downloadable data sets

13:59 fwiw

13:59 headius: defn: I was using midi on OS X without any tweaks on java 5 and 6 on 10.5

13:59 I don't know what mmj is

14:00 pjackson: LauJensen: http://www.programmableweb.com/api/transport-for-london

14:00 defn: headius: hmm, got any code hanging around?

14:00 headius: sure, for jruby

14:00 LauJensen: pjackson: Looks sweet, thanks

14:00 defn: that'll work

14:00 headius: appears to work just as well on 10.6

14:00 fliebel: LauJensen: How about Wordpress?

14:00 LauJensen: fliebel: Not interesting enough

14:01 headius: defn: http://github.com/jruby/jruby-demos

14:01 in the midi subdir

14:01 fliebel: LauJensen: why is microblogging more interesting than blogging?

14:01 defn: thanks headius

14:01 LauJensen: fliebel: It isn't

14:02 defn: it sort of is, in a way

14:03 (import javax.sound.midi)

14:03 exception... hmm

14:03 fliebel: defn: http://www.google.com/search?q=java+midi+tutorial

14:04 defn: fliebel: thanks buddy

14:06 i wonder if lein works with the resources dir yet

14:07 fliebel: defn: as soon as I start a synth I get a java application running :)

14:11 bagucode: Is swank-clojure usable with clojureclr?

14:11 hiredman: I doubt it

14:12 bagucode: Yeah me too. Would be sweet though. I want to try clojureclr cause I'm doing some XNA development and C# sucks. But it's a dealbreaker if I can't use emacs in a good way :)

14:13 Unless someone can pull a complete and feature packed visual studio plugin for clojure out of a hat

14:14 Does anyone know what the people dabbling with clojureclr use?

14:14 Just "offline" editing with clojure mode or such?

14:19 fliebel: defn: have you succeeded yet with midi? I can't figure it out. :(

14:20 LauJensen: This made my day: (set-default-font "-unknown-Liberation Mono-bold-normal-normal-*-12-*-*-*-m-0-iso10646-1")

14:21 fliebel: what does that do?

14:22 LauJensen: If you're running Emacs its sets your default font to an extremely nice on :)

14:22 +e

14:23 fliebel: I'm not…

14:23 odrzut: hellow

14:24 hiredman: ugh

14:24 how horrible, ttf please

14:35 LauJensen: Is it just me, or is Json really really painful to work with ?

14:36 defn`: im in agreement

14:41 hiredman: really?

14:41 seems nice and simple to me

14:42 clojure-json++

14:44 defn`: newb question: i added [autodoc "0.3.0-SNAPSHOT"] to my project -- how do i find out what name to (use) it as?

14:56 LauJensen: hiredman: clojure-json++ ?

14:56 hiredman: ~google clojure-json

14:56 clojurebot: First, out of 12900 results is:

14:56 danlarkin&#39;s clojure-json at master - GitHub

14:56 http://github.com/danlarkin/clojure-json

14:56 hiredman: can encode or decode clojure datastructures in json

14:57 defn`: How do you turn on paredit-mode by default when you run swank-clojure-project?

15:00 bagucode: defn`: put this in your .emacs to get paredit always with clojure (defun enable-paredit-hook () (paredit-mode 1)) (add-hook 'clojure-mode-hook 'lisp-enable-paredit-hook)

15:00 esj: defn: (autoload 'paredit-mode "paredit"

15:00 "Minor mode for pseudo-structurally editing Lisp code." t)

15:00 (add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode +1)))

15:00 (add-hook 'clojure-mode-hook (lambda () (paredit-mode +1)))

15:00 (add-hook 'lisp-mode-hook (lambda () (paredit-mode +1)))

15:00 (add-hook 'lisp-interaction-mode-hook (lambda () (paredit-mode +1)))

15:00 bagucode: oops

15:01 esj: loads it up for all the lispy stuff i have

15:01 bagucode: should be (add-hook 'clojure-mode-hook 'enable-paredit-hook)

15:01 esj: Think I stole the code from Lau :)

15:01 defn`: :)

15:01 thanks

15:02 bagucode: yeah the line esj had there with clojure-mode-hook is the same as what I suggested but as a oneliner

16:04 mebaran151: anyway to set default values in ClojureQL?

16:09 LauJensen: Is there a slurp-variant somewhere in contrib which loots a java.net.URL ?

16:18 mebaran151: what kind of URL?

16:19 also Lau, how about deletes and updates in ClojureQL?

16:19 LauJensen: (defn download-url [url] (let [s (.openStream (java.net.URL. url))] (apply str (map #(char %) (take-while pos? (repeatedly #(.read s)))))))

16:20 mebaran151: Did you read my blogpost RE ClojureQL?

16:20 mebaran151: LauJensen, that was what I would recommend

16:21 though duck-streams might make it a little nicer to read from the stream

16:22 thanks for pointing me to your blogpost!

16:22 has everything I should need

16:22 the-kenny: chouser: Is or was "raised?" a function in error-kit?

16:23 chouser: Oh, forget it.

16:25 {newbie}: I don't get the difference between a doseq and a let + a dorun

16:26 the-kenny: {newbie}: It's shorter :)

16:27 {newbie}: plus why the first arg to doseq are seq-exprs and not bindings like the let

16:39 defn: agh -- (System/getProperty "user.dir") is getting set to the wrong directory in swank

16:39 i have no idea why -- this wasn't the case before

16:40 M-x swank-clojure-project /my/proj

16:40 (System/getProperty "user.dir") => /my/proj/src/dir/

16:41 Is there any way to force swank to set its path

16:42 ah-ha: ,cd<CR>

18:02 esbena: I have a stackOverflow problem: I don't see how I can transform my code to use trampolining for my mutual recursions. Can I change the allowed stack-height - or do I have to redesign completely?

18:04 {newbie}: changing the stack size is not really a solution unless it grows sublinearly

18:05 < than O(n)

18:06 esbena: {newbie}: I know, but it is a fixed-size problem I have to solve..

18:06 Chousuke: esbena: I thought using trampolne meant just returning a function from your mutually recursive thingy?

18:07 ie (defn a [x] #(b (inc x))) (defn b [x] #(a (inc x))) (trampoline a)

18:08 trampoline stops bouncing once you return something that's not a function

18:08 so that's an infinite loop. but I suppose you could adapt it

18:08 hm

18:08 (doc trampoline)

18:08 clojurebot: "([f] [f & args]); trampoline can be used to convert algorithms requiring mutual recursion without stack consumption. Calls f with supplied args, if any. If f returns a fn, calls that fn with no arguments, and continues to repeat, until the return value is not a fn, then returns that non-fn value. Note that if you want to return a fn as a final value, you must wrap it in some data structure and unpack it after trampoline

18:10 esbena: Chousuke: yes, I've read it. But I just think I saw the light with respect to how I should use it!! It really helps trying to formulate the problem

18:10 :)

18:29 hiredman: urgh I think every single "issue" in the google code issue tracker has a comment that says "please stop posting me too comments, just start the issue"

18:29 star

18:29 I know this so I starred an issue about getting the appengine sdk into maven central. now I am subscribed to all comments on that issue

18:30 and in the last few days there have been at least a hundred "me too" comments

18:30 grrrrrr

18:30 gregh: it's like aol never went away

18:31 chouser: issue tracker for what project? not clojure, surely.

18:31 hiredman: no, but for many other projects

18:31 this particular issue is for google projects

18:41 mebaran151: hiredman, does googlebigtable have any transaction support?

18:41 hiredman: uh, no idea

18:41 the appengine datastore is not 'bigtable'

18:42 and even for datastore I am not sure, I think it does, but I haven't had to use it yet

18:55 the-kenny: Is there a way to read *all* objects from a string? Like (read-string "(foo bat) (baz)") -> [(foo bat) (baz)]

18:55 Oh.. sorry. It's trivial with read

18:57 mebaran151: I have an app I'd love to write to big table, but it has one major part that would definitely need to be transactional

18:57 hiredman: well, call up google and see if they will give you bigtable

18:58 timothypratley: ,(def a 1)

18:58 clojurebot: DENIED

19:01 mebaran151: haha, I thought it came with the GAE?

19:01 you wrote to the BigTable

19:01 oh it's not BigTable

19:02 they said it's built on Big Table

19:04 the-kenny: I'm a bit scared of using clojure on GAE because you can't use for example agents on it :/

19:04 hiredman: *shrug*

19:10 the-kenny: hiredman: I like the description of org.clojars.hiredman/compojure: "BETTER"

19:11 hiredman: :P

19:12 the-kenny: I'll use that version :p

19:12 hiredman: I ripped out the part that stops it from working on appengine

19:12 which, is, if I recall, the multipart bit

19:12 I also took the liberty of gutting the compojure namespace

19:13 I should have just removed it entirely

19:13 chouser: are libs on clojars discoverable in any way?

19:16 the-kenny: hiredman: It seems like it doesn't pull the dependencies. I just got compojure.jar

19:16 hiredman: I dunno, I just stole the pom from someother compojure jar

19:17 the-kenny: that's strange

19:17 ato's version doesn't work either :/

19:17 hiredman: ato's may have been the one I got the pom from

19:18 the-kenny: ato's tries to pull the dependencies, but dies while trying to pull clojure-master-bla

19:18 liebke's is working :)

19:39 hiredman: Any thoughts about writing a leiningen plugin for appengine? I'm not very experienced there, but it would be cool.

19:45 hiredman: the-kenny: yes, I started on one

19:46 the-kenny: hiredman: Oh, is it working? :)

19:46 hiredman: uh

19:46 no

19:46 I didn't get that far, and it apears the sdk is not in maven

19:47 I do have an ant based appengine skeleton thing I was working on

19:47 technomancy: chouser: search is a bit quirky now

19:47 hiredman: which I have used to create an app or two

19:47 technomancy: unfortunately _ato's been offline for quite some time

19:49 the-kenny: hiredman: hm.. the important thing for me would be an easy option for publishing

19:49 like "lein appengine-push"

19:50 hiredman: sure

19:50 I only got as far as appengine-setup

19:50 well, starting on it

19:50 the-kenny: hm ok

19:50 hiredman: generate the directories, alter project.clj

19:52 I did push what I had to clojars

19:52 I should push the source to github

19:52 lein-gae

19:54 http://github.com/hiredman/lein-gae/

19:55 it's not much

19:55 it's very ugly, infact

20:01 the-kenny: Wahoo: http://ulrich-moritz-test.appspot.com/

20:03 hiredman: yay!

20:04 the-kenny: hiredman: I'll pull lein-gae and try to do some work on it

20:05 hiredman: that would be very cool of you

20:06 the-kenny: Maybe the script should just wrap appcfg.sh [update,....]

20:06 s/script/plugin/

20:06 hiredman: sure

20:06 well, I would rather it used the java directly

20:06 appcfg just calls java

20:08 technomancy: sounds awesome

20:09 the-kenny: Oh, that's even better

20:11 hiredman: did you see my appengine helper thing?

20:11 http://github.com/hiredman/appengine-helper

20:12 the-kenny: not yet

20:13 hiredman: it is essentially a pre-lein attempt at this using ant

20:15 seths: technomancy: I am presenting Leiningen to the Wash. DC metro area Clojure meetup next Thurs

20:15 about 40 minutes, some slides and some demo

20:16 anything on the horizon that might be of interest? I am subscribed to the google group for lein

20:17 technomancy: seths: next up is support for native code dependencies and not doing AOT by default

20:17 (in order to support jar compatibility between clojure versions)

20:17 nothing too exciting, I'm afraid

20:18 seths: native code dependencies through JNI?

20:20 djork: I have got something to show y'all :)

20:20 http://imgur.com/8C0TS

20:21 technomancy: seths: I think so... I haven't really paid much attention to that. =)

20:22 stuff that makes penumbra go... openGL bindings etc.

20:22 seths: djork: looks like Clojure on an iPhone ?

20:22 djork: (p.s. this is Clojure-related and I am not a spam bot, sorry that looked pretty spammy)

20:22 not running on the iPhone

20:22 but editing, yes

20:22 seths: oh, you ported Emacs

20:22 ;-)

20:22 djork: :) yup all done

20:23 seths: can it compile / run the code?

20:23 djork: not yet... working on the remote end

20:23 it will send it to a server running something like clojurebot

20:23 but I'd really like a full REPL

20:23 jamesswift: hey folks. i don't want to re-invent the whee so i need a recommendation. what would you use for persisting (in the storage sense) very big trees (millions of nodes) but keeping them as accessible as any nested map. also of concern would be the tree probably shouldn't be completely held in memory but just caches frequently or recently used nodes. thanks!

20:23 djork: and I'd REALLY like to be able to build apps that run remotely with this editor

20:24 and also gist.github.com integration

20:24 load/save to a gist

20:24 pretty-print'ed

20:25 chouser: djork: thats an iphone app not a web page?

20:25 djork: yeah

20:25 seths: djork: neat

20:25 djork: the hard part will be parsing the code

20:25 not looking forward to that really

20:25 seths: djork: might want to ask the people responsible for clojurebot on how to white/black list certain commands

20:26 djork: yeah, clojurebot is open sourced now

20:26 seths: o

20:26 djork: I've taken a look at it

20:26 and they're in here :)

20:26 hiredman: has always been

20:33 the-kenny: Is there a helpful function for accessing resources in contrib?

20:34 seths: jamesswift: might consider cross-posting this question to the Google Group

20:35 polypus: jamesswift: have you looked at neo4j, or any of the semantic triplestores? like sesame or mulgara. they may be of some use

20:37 jamesswift: seths, polypus: thanks. will have a look.

20:46 the-kenny: hm.. got anyone here example code for accessing resources in clojure?

20:49 hiredman: http://gist.github.com/273279

20:51 the-kenny: hm.. should this work in a repl?

20:52 hiredman: possibly

20:53 I have used the code in a long time

20:53 the-kenny: hm.. don't look so. Can I access resources in the jar of the project when I use it?

20:54 hiredman: that is what it is for

20:55 the project's version information is kept in a version file in the 'root' of the jar

20:55 the-kenny: ah good

20:55 hiredman: you are using lein's repl?

20:56 last I heard there was a bug where it left the resources directory out of the classpath

21:01 the-kenny: hiredman: It works in a jar, thank :)

21:01 s/thank/thanks/

21:23 hiredman: Just pushed creation of web.xml and appengine-web.xml to my fork :) Not really beutiful (replacing multiple strings in a string is annoying) but it works :)

21:23 hiredman: excellent

21:24 the-kenny: sorry for the formatting-mess in appengine-setup... emacs forced it

21:25 hiredman: *shrug*

21:25 how does one watch projects in github these days?

21:25 the-kenny: :library-path is now war/WEB-INF/lib and :resources-path is war/WEB-INF/ so they get pushed as well

21:26 There's a butten on the left side and at the same height like the user- and project-name

21:27 hiredman: I see a smiley face

21:27 the-kenny: uh.. on the right, sorry

21:28 hiredman: ugh

21:28 I have enable javascript (and flash)

21:28 makes github even slower

21:29 technomancy: you don't need flash

21:29 hiredman: I don't, but enabling js enables flash too

21:30 technomancy: oh, yuck

21:30 the only thing I miss about not having flash is the github network graphs

21:30 they need to port that to SVG. =\

21:31 hiredman: I guess I could find yet another firefox plugin to block flash seperately

21:54 the-kenny: It's late here.. I'll go to bed and will continue hacking tomorrow :) Good Night

Logging service provided by n01se.net