#clojure logs

2010-01-09

01:10mebaran151hiredman, what deps do I need for your compojure package (as it does claim it is "better")
03:40LauJensenGood weekend all
03:44grantmichaelsLauJensen: setting up arch s per 'cast =)
03:49LauJensenSweet :)
03:50grantmichaelsnever have played w/ arch before ... slackware, gentoo, ubuntu, mint, debian, suse, puppy ... but never arch =)
03:50LauJensenOk, 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
03:51LauJensenAnd Pacman greatly outperforms apt-get
03:52grantmichaelsseems pretty fast
04:57LauJensenAny paredit fans in here?
04:59grantmichaelsplanning to be using that in the rig i'm setting up
05:00LauJensenIf 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
05:09esjLauJensen: I've got the basic paredit, clojure-mode going with a slime repl alongside
05:10LauJensenejs: So Repl with paredit and clojure-highlighting? I'm guessing you're running a more recent version than me
05:10esjbut no slime-repl-mode (googling now to find out what that is)
05:11esjok, maybe.
05:11esjI followed this magic recipe http://learnclojure.blogspot.com/2009/11/installing-clojure-on-ubuntu-910-karmic.html
05:12LauJensenah ok
05:12LauJensenWe're not using the same Slime
05:13grantmichaels5: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 ...
05:13esjyeah, i don't think my slime does clojure highlighting
05:13esjin the repl
06:36esbenahow do I add items to a _set_? is '(set (cons :A #{:A :B :C}))' really the way to do it?
06:37Chousukeesbena: conj is the polymorphic add operator.
06:37Chousukeesbena: works for any clojure data structure.
06:39Chousuke,[(conj #{} 'a) (conj {} '[k v])]; like this
06:39clojurebot[#{a} {k v}]
06:41hiredman(let [a #{1 2} a’ (conj a 3)] a’)
06:41hiredman,(let [a #{1 2} a’ (conj a 3)] a’)
06:41clojurebot#{1 2 3}
06:41Chousuke:P
06:42hiredman,(int "′")
06:42clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character
06:42hiredman,(-> "′" .getBytes vec)
06:42clojurebot[-30 -128 -78]
06:42hiredman,(-> "’" .getBytes vec)
06:42clojurebot[-30 -128 -103]
06:42Chousuke,(int \’)
06:42clojurebot8217
06:43hiredman′ is the unicode prime glyph
06:44hiredmanbut I don't seem to have a set of keys that will generate it
06:52esbenaChousuke: thanks, you have helped me many times now :)
07:39hipertrackerhow to simple introspect clojure object? Is there anything similiar to dir(x) in Python or x.methods in Ruby ?
08:11chouserhipertracker: to get useful info, it depends on the type of object.
08:12chouserhipertracker: are you wanting to look at a Clojure data structure, a namespace, a java object, or... ?
08:14chouserclojure.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.
08:25bagucodeHello all
08:29chouserbagucode: good morning
08:30bagucodechouser: thank you, it's 2:30 pm here though ;)
08:30chouser:-)
08:30chouseryou can save that up and use it tomorrow morning then.
08:32bagucodeI 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
08:33chouserbagucode: what platform have you teseted?
08:33bagucodeOS X 10.6, 64 bit intel. A macbook pro
08:36bagucodechouser: 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.
08:36chouserah, good.
08:39bagucodeOh, 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.
08:43bagucodechouser: 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 :)
08:44chouserhave you tried it out for your original use case yet?
08:46bagucodeNope. 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.
09:16quizmewhat is CLOJURE_EXT supposed to point to? ... the example is /Users/mb/Library/Clojure <--- is that where the jar files are?
09:22fliebelIs there something like transient strings and numbers?
09:25chousernot sure how a transient number would be useful, but there's a StringBuilder that is a bit like a transient in some ways.
09:25bagucodefliebel: Strings and numbers are the immutable underlying java types so I would guess the answer is no
09:26bagucodeyeah ofc, there are the java classes StringBuilder and StringWriter :)
09:26fliebelI to would have guessed that, but I was thinking in an Ruby way for a moment...
09:26bagucodethe str function uses stringbuilder internally right?
09:27fliebelhttp://github.com/richhickey/clojure/blob/f4c58e3500b3668a0941ca21f9aa4f444de2c652/src/clj/clojure/core.clj#L356
09:28fliebelIt does
09:28bagucodeRight, so it should be pretty efficient at concatenating stuff
09:30fliebelIf you do all the concatenation in one blow...
09:31bagucodeYeah. Or you could use StringBuilder manually, just don't let it escape the function and it will be just like a transient.
09:32fliebelSounds good… I'll have to look up replaceAll, if that is mutual… That would be evil Ruby style string processing.
09:34bagucodeStringBuilder still just does concatenation. If you really want to modify things in place then get the characters from the string as an array
09:34fliebelIt seems to offer a few basic get, set, insert, replace, etc. functions
09:35bagucodeOh, I thought it just did concatenation :D my bad
09:35fliebellol, first there is a screen full of append and insert functions, then a few others.
09:36bagucodeStill 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.
09:36fliebelI know...
09:38fliebelI'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.
09:39bagucodebye
09:46quizmeanybody here use vimclojure ?
09:46the-kennyquizme: Yeah, some people do it
09:47quizmei just got my nailgun server up
09:47the-kennyThe author is here sometimes too.
09:47quizmenot sure what to do next
09:49bagucodechouser: 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.
09:50quizmethe-kenny do you know how to use vimclojure ?
09:50the-kennyquizme: No, sorry. I'm on Emacs
09:50quizmethe-kenny k
09:51bagucodeAnyone here using anything other than emacs or vim?
09:51the-kennybagucode: There's a netbeans and/or eclipse plugin
09:52bagucodethe-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
09:52the-kennybagucode: Emacs is perfect for lisp-programming by default
09:54bagucodethe-kenny: It should be since it's mostly written in lisp :P
09:54the-kennybagucode: That's what I'm refering to :p
09:55quizmei think you need a phd to get these editors to work...
09:56the-kennyquizme: Not really. The installation of slime and clojure with the help of elpa in emacs is really easy
09:56bagucodeI'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.
09:56the-kennyI recommend everyone to try both editors
09:57bagucodethe elpa auto install is broken on emacs 22
09:57quizmei'm gonna try slime again...
09:57bagucodeeh
09:57bagucodeI mean the swank-clojure auto install of clojure
09:58bagucodeelpa works, but then it breaks when starting slime the first time and swank tries to get clojure
09:58bagucodeSo use emacs 23 if you can
09:58the-kennybagucode: hm.. Never used the auto-install for clojure. I use leiningen for everything
09:59bagucodethe-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
09:59the-kennybagucode: I have a project for that ;)
09:59bagucodehaha
10:24quizmeyeah slime was easy
10:24quizmeyou only need a master's degree for that
10:42bagucodequizme: did you get it working?
10:42quizmebagucode yeah i got slime working
10:42bagucodequizme: Take a look at this http://www.bestinclass.dk/index.php/2009/12/clojure-101-getting-clojure-slime-installed/
10:43quizmebagucode but not vimclojure
10:43quizmebagucode thanks, yeah it worked for me.
10:43bagucodequizme: Can't help you with vimclojure, never used vim much. Just use it when there is no emacs on a system :)
10:44quizmebagucode: i used to like emacs more. now i like vim more...
10:44quizmebagucode: anyway, it's 7:45 a.m. here. Time for bed... hehe
10:44bagucodequizme: :)
11:04esbenaI'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:07arohneresbena: are you doing any mutual recursion?
11:07esbenayes
11:08arohneryou'll have to use a trampoline to avoid blowing the stack there
11:08arohnerlet me see if I can dig up the doc
11:08arohnerhttp://groups.google.com/group/clojure/msg/3addf875319c5c10
11:09esbenathx - I'll take a look at it
11:13mebaran151how does one do transaction in clojureql
11:21LauJensenmebaran151: (in-transaction (make-con.... ...) (body)) where body returns the result of your sql-statement
11:21mebaran151in-transaction
11:21mebaran151cool
11:21mebaran151and currently the best way for indexes is just raw-sql right?
11:21mebaran151I have to admit, getting query to return results was a little hairy
11:22mebaran151maybe 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:24mebaran151after this project, I'll try to hit the wiki and record the pitfalls of ClojureQL, slay some dragons etc
11:26LauJensenCool - 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:26LauJensenI fail to see how getting query results is difficult?
11:27mebaran151I didn't realize that run required a binding form
11:27mebaran151here were my two macros
11:28mebaran151https://gist.github.com/4e36f245662acaa7c6ce
11:29mebaran151that way if you need the laziness you can just use the apply-sql macro to the result set
11:29mebaran151I thought it seemed like a nice idiom
11:29mebaran151while dosql will just return the sql as is
11:32mebaran151http://gist.github.com/272977 << public version
11:32LauJensenmebaran151: You don't like doc-strings? :)
11:32mebaran151hmmm?
11:33mebaran151oh you mean with usage and such
11:33LauJensenThe doc-tring for run is pretty explanatory
11:33LauJensenSame for let-query
11:33mebaran151oh
11:33mebaran151I've was just working from the wiki
11:34LauJensenOk - I really need to dedicate some time to set up a proper Wiki
11:34LauJensenApologize for any misunderstandings
11:34mebaran151and the error I was getting didn't indicate I'd called the function wrong
11:35mebaran151it just said the result set was closed
11:36mebaran151I personally think my macros are slightly more natural :)
11:39fliebelharumph, 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:40fliebelIt's almost like the fastest way is to execute the cp command...
11:43mebaran151jdk7 has supposedly fixed this
11:44fliebelWhere do I get that? I'm on 1.6 I think… But that is just a guess
11:44mebaran151it's not out yet :(
11:44mebaran151the new Path stuff in java is actually kind of nice
11:44fliebelI thought so… So what do I do until that time arrives?
11:45mebaran151http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html
11:45mebaran151fliebel, I think apache-commons usually has some good stuff for this sort of thing
11:46mebaran151yep commons-io has a static copyFile function
11:46fliebelBut 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:47mebaran151http://commons.apache.org/io/api-release/index.html
11:47mebaran151a lot of java projects rely on apache-commons, bundling shouldn't be an issue if you include it in your jar
11:48fliebelmeh… If there is nothing in contrib I think it is better to write a few lines than to include another dependency.
11:53the-kennyHow should the tests for "lein test" be defined?
11:54fliebelHm, I'd like to know that as well.
11:58karmazillathe-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:58the-kennykarmazilla: 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:59karmazillaodd.. makes me wonder if the lein installation is messed up. :-/
12:00fliebelWrite meta-tests :D
12:00the-kennyah, I think I found the problem
12:08edbondwhat means '(def triangles (lazy-cons 0 (map + triangles (iterate inc 1))))'? I found it in solution of euler12
12:10mebaran151well I think lazy-cons is officially deprecated
12:11bagucodeYeah, it should look like this now: (def triangles (lazy-seq (cons 0 (map + triangles (iterate inc 1)))))
12:12edbondbagucode: thanks
12:12edbondhow it works?
12:12mebaran151I wish lazy-seqs could be annotated with an optional close method
12:12mebaran151so I could represent more db stuff in terms of lazy-seqs
12:13mebaran151maybe the closer could be stored in the metadata
12:14bagucodeYeah 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:14edbondhow its possible to use triangles when it's not defined yet?
12:14bagucodeJust make it close over the connection/stream etc.
12:16mebaran151well but what if I wanted to represent say an sql table as a paginated list select blah from table limit statements
12:16mebaran151and you might not consume the whole thing
12:16bagucodeedbond: 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:17bagucodemebaran151: 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:18edbondI should take a break and will try to get it. I saw similar in haskell fib defined using zip.
12:18bagucodeThe close function in the metadata could close over the source of the sequence (like a db conn or a stream) and close that
12:19bagucodewow, many close in that sentence :D
12:19mebaran151that's how I do it currently
12:19bagucodeNot good enough?
12:19mebaran151I just think maybe clojure should have an official protocol for that
12:19mebaran151I'd like something like the pre post conditions
12:20mebaran151except on close
12:21bagucodeYeah 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:22mebaran151yeah
12:22mebaran151hiredman has one actually
12:22mebaran151all sufficiently smart clojure is included in ClojureBot
12:24bagucodemebaran151: 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:25mebaran151yeah
12:25mebaran151it could probably replace try and finally if done correctly
12:28mebaran151feels like with metadata you have most of what you need
12:29mebaran151everything that would ever need closing could be described by a hash-map
12:29mebaran151or seq
12:50the-kennyIs there a simpler way for something like (= mymap (select-keys myothermap (keys mymap)))
13:21fliebelClojure 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:21arohnerfliebel: can you paste it?
13:21{newbie}lazyness attack?
13:22fliebelmaybe...
13:22fliebelhttp://gist.github.com/273028
13:23the-kennyfliebel: Looks like lazyness
13:23the-kennyadd a doall around the for
13:23fliebelIs it that stupid… I love and hate laziness...
13:24arohnerin clojure, you usually only use laziness for pure functions
13:24arohnerif you have side effects, use doseq
13:24the-kennyarohner: I once got data through some stream and modifies it with map to use it some minutes later.
13:24arohneryou can use just doseq instead of for + doall
13:25the-kennyBut because of map was lazy, the streams were dead and my data too :)
13:25fliebelBut doseq does not have the :when, does it?
13:25arohnerit has all of the options for has
13:25arohner,(doc doseq)
13:25clojurebot"([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:26fliebelcool
13:27fliebelworks!
13:28fliebelEverytime 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:43defnAnyone here ever do midi with clojure? Specifically on OSX 10.6 after the JVM update--
13:43defnI'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:43fliebelHey, defn, how are you doing?
13:44defnhiya fliebel
13:44defnsorry i still haven't touched utterson
13:44fliebelDon't worry about me, I was more like feeling sorry for you I did so much :)
13:45defnhaha it's okay -- it's fun to read other people's source
13:45defn(assuming they're not evil morons)
13:45defnwhich i dont believe you are :)
13:46fliebelI removed the worst spageti a few revisions ago ;)
13:46defnfliebel: ive been all focused on cljex lately, just trying to get it setup to the point where i feel comfortable letting it simmer
13:47fliebeldefn: 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:48defn:)
13:48fliebelI've already started a design :)
13:48fliebelxkcd.com is slowing me down though...
13:50fliebel*opens up cljex*
13:51fliebeldefn: whoa, it's not showing "it's working" anymore
13:53defnwho what?
13:53defnoh, lol yes
13:53fliebeldefn: but I don't see any examples either :(
13:53defni decided to just write the README and figure out how to make it work like the README describes as an afterthought
13:54defnfliebel: yeah, sort of a bummer, but *shrug*, they'll come eventually
13:54defni have permission from some bloggers to use their examples
13:54fliebeldefn: cool
13:54defni just want to fix the organization because i reall hate the layout right now
13:54defnit should be organized by namespace, and with a scrolling frame
13:55defnplus im getting rid of the pygments/python requirement and am going to switch to something like showdown
13:55fliebelIs there any possibility that functions are going to reference other functions? PHP style...
13:55fliebelHow do you use a Python project in Clojure?
13:56{newbie}fliebel: jyton
13:56{newbie}i guess
13:56{newbie}jython*
13:57fliebelNah, I alsoe found it in a Ruby project, there must be some magic to that, it was not a Jython project.
13:57fliebelnor jruby
13:58defnfliebel: i just call it with shell-out
13:58fliebelah...
13:58LauJensenBesides Twitter, what are some interesting websites with open APIs ?
13:58defnwhich is ugly, but python's markdown + codehilite extension was an all in one solution
13:59defnLauJensen: doesn't the government data site have an API?
13:59fliebelI see...
13:59LauJensendefn: Not that I know of
13:59defnhmmm, i know they have downloadable data sets
13:59defnfwiw
13:59headiusdefn: I was using midi on OS X without any tweaks on java 5 and 6 on 10.5
13:59headiusI don't know what mmj is
14:00pjacksonLauJensen: http://www.programmableweb.com/api/transport-for-london
14:00defnheadius: hmm, got any code hanging around?
14:00headiussure, for jruby
14:00LauJensenpjackson: Looks sweet, thanks
14:00defnthat'll work
14:00headiusappears to work just as well on 10.6
14:00fliebelLauJensen: How about Wordpress?
14:00LauJensenfliebel: Not interesting enough
14:01headiusdefn: http://github.com/jruby/jruby-demos
14:01headiusin the midi subdir
14:01fliebelLauJensen: why is microblogging more interesting than blogging?
14:01defnthanks headius
14:01LauJensenfliebel: It isn't
14:02defnit sort of is, in a way
14:03defn(import javax.sound.midi)
14:03defnexception... hmm
14:03fliebeldefn: http://www.google.com/search?q=java+midi+tutorial
14:04defnfliebel: thanks buddy
14:06defni wonder if lein works with the resources dir yet
14:07fliebeldefn: as soon as I start a synth I get a java application running :)
14:11bagucodeIs swank-clojure usable with clojureclr?
14:11hiredmanI doubt it
14:12bagucodeYeah 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:13bagucodeUnless someone can pull a complete and feature packed visual studio plugin for clojure out of a hat
14:14bagucodeDoes anyone know what the people dabbling with clojureclr use?
14:14bagucodeJust "offline" editing with clojure mode or such?
14:19fliebeldefn: have you succeeded yet with midi? I can't figure it out. :(
14:20LauJensenThis made my day: (set-default-font "-unknown-Liberation Mono-bold-normal-normal-*-12-*-*-*-m-0-iso10646-1")
14:21fliebelwhat does that do?
14:22LauJensenIf you're running Emacs its sets your default font to an extremely nice on :)
14:22LauJensen+e
14:23fliebelI'm not…
14:23odrzuthellow
14:24hiredmanugh
14:24hiredmanhow horrible, ttf please
14:35LauJensenIs it just me, or is Json really really painful to work with ?
14:36defn`im in agreement
14:41hiredmanreally?
14:41hiredmanseems nice and simple to me
14:42hiredmanclojure-json++
14:44defn`newb question: i added [autodoc "0.3.0-SNAPSHOT"] to my project -- how do i find out what name to (use) it as?
14:56LauJensenhiredman: clojure-json++ ?
14:56hiredman~google clojure-json
14:56clojurebotFirst, out of 12900 results is:
14:56clojurebotdanlarkin&#39;s clojure-json at master - GitHub
14:56clojurebothttp://github.com/danlarkin/clojure-json
14:56hiredmancan encode or decode clojure datastructures in json
14:57defn`How do you turn on paredit-mode by default when you run swank-clojure-project?
15:00bagucodedefn`: 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:00esjdefn: (autoload 'paredit-mode "paredit"
15:00esj "Minor mode for pseudo-structurally editing Lisp code." t)
15:00esj(add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode +1)))
15:00esj(add-hook 'clojure-mode-hook (lambda () (paredit-mode +1)))
15:00esj(add-hook 'lisp-mode-hook (lambda () (paredit-mode +1)))
15:00esj(add-hook 'lisp-interaction-mode-hook (lambda () (paredit-mode +1)))
15:00bagucodeoops
15:01esjloads it up for all the lispy stuff i have
15:01bagucodeshould be (add-hook 'clojure-mode-hook 'enable-paredit-hook)
15:01esjThink I stole the code from Lau :)
15:01defn`:)
15:01defn`thanks
15:02bagucodeyeah the line esj had there with clojure-mode-hook is the same as what I suggested but as a oneliner
16:04mebaran151anyway to set default values in ClojureQL?
16:09LauJensenIs there a slurp-variant somewhere in contrib which loots a java.net.URL ?
16:18mebaran151what kind of URL?
16:19mebaran151also Lau, how about deletes and updates in ClojureQL?
16:19LauJensen(defn download-url [url] (let [s (.openStream (java.net.URL. url))] (apply str (map #(char %) (take-while pos? (repeatedly #(.read s)))))))
16:20LauJensenmebaran151: Did you read my blogpost RE ClojureQL?
16:20mebaran151LauJensen, that was what I would recommend
16:21mebaran151though duck-streams might make it a little nicer to read from the stream
16:22mebaran151thanks for pointing me to your blogpost!
16:22mebaran151has everything I should need
16:22the-kennychouser: Is or was "raised?" a function in error-kit?
16:23the-kennychouser: Oh, forget it.
16:25{newbie}I don't get the difference between a doseq and a let + a dorun
16:26the-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:39defnagh -- (System/getProperty "user.dir") is getting set to the wrong directory in swank
16:39defni have no idea why -- this wasn't the case before
16:40defnM-x swank-clojure-project /my/proj
16:40defn(System/getProperty "user.dir") => /my/proj/src/dir/
16:41defnIs there any way to force swank to set its path
16:42defnah-ha: ,cd<CR>
18:02esbenaI 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{newbie}< than O(n)
18:06esbena{newbie}: I know, but it is a fixed-size problem I have to solve..
18:06Chousukeesbena: I thought using trampolne meant just returning a function from your mutually recursive thingy?
18:07Chousukeie (defn a [x] #(b (inc x))) (defn b [x] #(a (inc x))) (trampoline a)
18:08Chousuketrampoline stops bouncing once you return something that's not a function
18:08Chousukeso that's an infinite loop. but I suppose you could adapt it
18:08Chousukehm
18:08Chousuke(doc trampoline)
18:08clojurebot"([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:10esbenaChousuke: 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:10esbena:)
18:29hiredmanurgh 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:29hiredmanstar
18:29hiredmanI 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:30hiredmanand in the last few days there have been at least a hundred "me too" comments
18:30hiredmangrrrrrr
18:30greghit's like aol never went away
18:31chouserissue tracker for what project? not clojure, surely.
18:31hiredmanno, but for many other projects
18:31hiredmanthis particular issue is for google projects
18:41mebaran151hiredman, does googlebigtable have any transaction support?
18:41hiredmanuh, no idea
18:41hiredmanthe appengine datastore is not 'bigtable'
18:42hiredmanand even for datastore I am not sure, I think it does, but I haven't had to use it yet
18:55the-kennyIs there a way to read *all* objects from a string? Like (read-string "(foo bat) (baz)") -> [(foo bat) (baz)]
18:55the-kennyOh.. sorry. It's trivial with read
18:57mebaran151I 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:57hiredmanwell, call up google and see if they will give you bigtable
18:58timothypratley,(def a 1)
18:58clojurebotDENIED
19:01mebaran151haha, I thought it came with the GAE?
19:01mebaran151you wrote to the BigTable
19:01mebaran151oh it's not BigTable
19:02mebaran151they said it's built on Big Table
19:04the-kennyI'm a bit scared of using clojure on GAE because you can't use for example agents on it :/
19:04hiredman*shrug*
19:10the-kennyhiredman: I like the description of org.clojars.hiredman/compojure: "BETTER"
19:11hiredman:P
19:12the-kennyI'll use that version :p
19:12hiredmanI ripped out the part that stops it from working on appengine
19:12hiredmanwhich, is, if I recall, the multipart bit
19:12hiredmanI also took the liberty of gutting the compojure namespace
19:13hiredmanI should have just removed it entirely
19:13chouserare libs on clojars discoverable in any way?
19:16the-kennyhiredman: It seems like it doesn't pull the dependencies. I just got compojure.jar
19:16hiredmanI dunno, I just stole the pom from someother compojure jar
19:17the-kennythat's strange
19:17the-kennyato's version doesn't work either :/
19:17hiredmanato's may have been the one I got the pom from
19:18the-kennyato's tries to pull the dependencies, but dies while trying to pull clojure-master-bla
19:18the-kennyliebke's is working :)
19:39the-kennyhiredman: Any thoughts about writing a leiningen plugin for appengine? I'm not very experienced there, but it would be cool.
19:45hiredmanthe-kenny: yes, I started on one
19:46the-kennyhiredman: Oh, is it working? :)
19:46hiredmanuh
19:46hiredmanno
19:46hiredmanI didn't get that far, and it apears the sdk is not in maven
19:47hiredmanI do have an ant based appengine skeleton thing I was working on
19:47technomancychouser: search is a bit quirky now
19:47hiredmanwhich I have used to create an app or two
19:47technomancyunfortunately _ato's been offline for quite some time
19:49the-kennyhiredman: hm.. the important thing for me would be an easy option for publishing
19:49the-kennylike "lein appengine-push"
19:50hiredmansure
19:50hiredmanI only got as far as appengine-setup
19:50hiredmanwell, starting on it
19:50the-kennyhm ok
19:50hiredmangenerate the directories, alter project.clj
19:52hiredmanI did push what I had to clojars
19:52hiredmanI should push the source to github
19:52hiredmanlein-gae
19:54hiredmanhttp://github.com/hiredman/lein-gae/
19:55hiredmanit's not much
19:55hiredmanit's very ugly, infact
20:01the-kennyWahoo: http://ulrich-moritz-test.appspot.com/
20:03hiredmanyay!
20:04the-kennyhiredman: I'll pull lein-gae and try to do some work on it
20:05hiredmanthat would be very cool of you
20:06the-kennyMaybe the script should just wrap appcfg.sh [update,....]
20:06the-kennys/script/plugin/
20:06hiredmansure
20:06hiredmanwell, I would rather it used the java directly
20:06hiredmanappcfg just calls java
20:08technomancysounds awesome
20:09the-kennyOh, that's even better
20:11hiredmandid you see my appengine helper thing?
20:11hiredmanhttp://github.com/hiredman/appengine-helper
20:12the-kennynot yet
20:13hiredmanit is essentially a pre-lein attempt at this using ant
20:15sethstechnomancy: I am presenting Leiningen to the Wash. DC metro area Clojure meetup next Thurs
20:15sethsabout 40 minutes, some slides and some demo
20:16sethsanything on the horizon that might be of interest? I am subscribed to the google group for lein
20:17technomancyseths: next up is support for native code dependencies and not doing AOT by default
20:17technomancy(in order to support jar compatibility between clojure versions)
20:17technomancynothing too exciting, I'm afraid
20:18sethsnative code dependencies through JNI?
20:20djorkI have got something to show y'all :)
20:20djorkhttp://imgur.com/8C0TS
20:21technomancyseths: I think so... I haven't really paid much attention to that. =)
20:22technomancystuff that makes penumbra go... openGL bindings etc.
20:22sethsdjork: looks like Clojure on an iPhone ?
20:22djork(p.s. this is Clojure-related and I am not a spam bot, sorry that looked pretty spammy)
20:22djorknot running on the iPhone
20:22djorkbut editing, yes
20:22sethsoh, you ported Emacs
20:22seths;-)
20:22djork:) yup all done
20:23sethscan it compile / run the code?
20:23djorknot yet... working on the remote end
20:23djorkit will send it to a server running something like clojurebot
20:23djorkbut I'd really like a full REPL
20:23jamesswifthey 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:23djorkand I'd REALLY like to be able to build apps that run remotely with this editor
20:24djorkand also gist.github.com integration
20:24djorkload/save to a gist
20:24djorkpretty-print'ed
20:25chouserdjork: thats an iphone app not a web page?
20:25djorkyeah
20:25sethsdjork: neat
20:25djorkthe hard part will be parsing the code
20:25djorknot looking forward to that really
20:25sethsdjork: might want to ask the people responsible for clojurebot on how to white/black list certain commands
20:26djorkyeah, clojurebot is open sourced now
20:26sethso
20:26djorkI've taken a look at it
20:26djorkand they're in here :)
20:26hiredmanhas always been
20:33the-kennyIs there a helpful function for accessing resources in contrib?
20:34sethsjamesswift: might consider cross-posting this question to the Google Group
20:35polypusjamesswift: have you looked at neo4j, or any of the semantic triplestores? like sesame or mulgara. they may be of some use
20:37jamesswiftseths, polypus: thanks. will have a look.
20:46the-kennyhm.. got anyone here example code for accessing resources in clojure?
20:49hiredman http://gist.github.com/273279
20:51the-kennyhm.. should this work in a repl?
20:52hiredmanpossibly
20:53hiredmanI have used the code in a long time
20:53the-kennyhm.. don't look so. Can I access resources in the jar of the project when I use it?
20:54hiredmanthat is what it is for
20:55hiredmanthe project's version information is kept in a version file in the 'root' of the jar
20:55the-kennyah good
20:55hiredmanyou are using lein's repl?
20:56hiredmanlast I heard there was a bug where it left the resources directory out of the classpath
21:01the-kennyhiredman: It works in a jar, thank :)
21:01the-kennys/thank/thanks/
21:23the-kennyhiredman: 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:23hiredmanexcellent
21:24the-kennysorry for the formatting-mess in appengine-setup... emacs forced it
21:25hiredman*shrug*
21:25hiredmanhow does one watch projects in github these days?
21:25the-kenny:library-path is now war/WEB-INF/lib and :resources-path is war/WEB-INF/ so they get pushed as well
21:26the-kennyThere's a butten on the left side and at the same height like the user- and project-name
21:27hiredmanI see a smiley face
21:27the-kennyuh.. on the right, sorry
21:28hiredmanugh
21:28hiredmanI have enable javascript (and flash)
21:28hiredmanmakes github even slower
21:29technomancyyou don't need flash
21:29hiredmanI don't, but enabling js enables flash too
21:30technomancyoh, yuck
21:30technomancythe only thing I miss about not having flash is the github network graphs
21:30technomancythey need to port that to SVG. =\
21:31hiredmanI guess I could find yet another firefox plugin to block flash seperately
21:54the-kennyIt's late here.. I'll go to bed and will continue hacking tomorrow :) Good Night