2010-01-09
| 01:10 | mebaran151 | hiredman, what deps do I need for your compojure package (as it does claim it is "better") |
| 03:40 | LauJensen | Good weekend all |
| 03:44 | grantmichaels | LauJensen: setting up arch s per 'cast =) |
| 03:49 | LauJensen | Sweet :) |
| 03:50 | grantmichaels | never have played w/ arch before ... slackware, gentoo, ubuntu, mint, debian, suse, puppy ... but never arch =) |
| 03: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 |
| 03:51 | LauJensen | And Pacman greatly outperforms apt-get |
| 03:52 | grantmichaels | seems pretty fast |
| 04:57 | LauJensen | Any paredit fans in here? |
| 04:59 | grantmichaels | planning to be using that in the rig i'm setting up |
| 05: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 |
| 05:09 | esj | LauJensen: I've got the basic paredit, clojure-mode going with a slime repl alongside |
| 05:10 | LauJensen | ejs: So Repl with paredit and clojure-highlighting? I'm guessing you're running a more recent version than me |
| 05:10 | esj | but no slime-repl-mode (googling now to find out what that is) |
| 05:11 | esj | ok, maybe. |
| 05:11 | esj | I followed this magic recipe http://learnclojure.blogspot.com/2009/11/installing-clojure-on-ubuntu-910-karmic.html |
| 05:12 | LauJensen | ah ok |
| 05:12 | LauJensen | We're not using the same Slime |
| 05: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 ... |
| 05:13 | esj | yeah, i don't think my slime does clojure highlighting |
| 05:13 | esj | in the repl |
| 06:36 | esbena | how do I add items to a _set_? is '(set (cons :A #{:A :B :C}))' really the way to do it? |
| 06:37 | Chousuke | esbena: conj is the polymorphic add operator. |
| 06:37 | Chousuke | esbena: works for any clojure data structure. |
| 06:39 | Chousuke | ,[(conj #{} 'a) (conj {} '[k v])]; like this |
| 06:39 | clojurebot | [#{a} {k v}] |
| 06:41 | hiredman | (let [a #{1 2} a’ (conj a 3)] a’) |
| 06:41 | hiredman | ,(let [a #{1 2} a’ (conj a 3)] a’) |
| 06:41 | clojurebot | #{1 2 3} |
| 06:41 | Chousuke | :P |
| 06:42 | hiredman | ,(int "′") |
| 06:42 | clojurebot | java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character |
| 06:42 | hiredman | ,(-> "′" .getBytes vec) |
| 06:42 | clojurebot | [-30 -128 -78] |
| 06:42 | hiredman | ,(-> "’" .getBytes vec) |
| 06:42 | clojurebot | [-30 -128 -103] |
| 06:42 | Chousuke | ,(int \’) |
| 06:42 | clojurebot | 8217 |
| 06:43 | hiredman | ′ is the unicode prime glyph |
| 06:44 | hiredman | but I don't seem to have a set of keys that will generate it |
| 06:52 | esbena | Chousuke: thanks, you have helped me many times now :) |
| 07:39 | hipertracker | how to simple introspect clojure object? Is there anything similiar to dir(x) in Python or x.methods in Ruby ? |
| 08:11 | chouser | hipertracker: to get useful info, it depends on the type of object. |
| 08:12 | chouser | hipertracker: are you wanting to look at a Clojure data structure, a namespace, a java object, or... ? |
| 08:14 | chouser | 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. |
| 08:25 | bagucode | Hello all |
| 08:29 | chouser | bagucode: good morning |
| 08:30 | bagucode | chouser: thank you, it's 2:30 pm here though ;) |
| 08:30 | chouser | :-) |
| 08:30 | chouser | you can save that up and use it tomorrow morning then. |
| 08: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 |
| 08:33 | chouser | bagucode: what platform have you teseted? |
| 08:33 | bagucode | OS X 10.6, 64 bit intel. A macbook pro |
| 08:36 | bagucode | 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. |
| 08:36 | chouser | ah, good. |
| 08: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. |
| 08:43 | bagucode | 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 :) |
| 08:44 | chouser | have you tried it out for your original use case yet? |
| 08: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. |
| 09:16 | quizme | what is CLOJURE_EXT supposed to point to? ... the example is /Users/mb/Library/Clojure <--- is that where the jar files are? |
| 09:22 | fliebel | Is there something like transient strings and numbers? |
| 09: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. |
| 09:25 | bagucode | fliebel: Strings and numbers are the immutable underlying java types so I would guess the answer is no |
| 09:26 | bagucode | yeah ofc, there are the java classes StringBuilder and StringWriter :) |
| 09:26 | fliebel | I to would have guessed that, but I was thinking in an Ruby way for a moment... |
| 09:26 | bagucode | the str function uses stringbuilder internally right? |
| 09:27 | fliebel | http://github.com/richhickey/clojure/blob/f4c58e3500b3668a0941ca21f9aa4f444de2c652/src/clj/clojure/core.clj#L356 |
| 09:28 | fliebel | It does |
| 09:28 | bagucode | Right, so it should be pretty efficient at concatenating stuff |
| 09:30 | fliebel | If you do all the concatenation in one blow... |
| 09: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. |
| 09:32 | fliebel | Sounds good… I'll have to look up replaceAll, if that is mutual… That would be evil Ruby style string processing. |
| 09: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 |
| 09:34 | fliebel | It seems to offer a few basic get, set, insert, replace, etc. functions |
| 09:35 | bagucode | Oh, I thought it just did concatenation :D my bad |
| 09:35 | fliebel | lol, first there is a screen full of append and insert functions, then a few others. |
| 09: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. |
| 09:36 | fliebel | I know... |
| 09:38 | fliebel | 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. |
| 09:39 | bagucode | bye |
| 09:46 | quizme | anybody here use vimclojure ? |
| 09:46 | the-kenny | quizme: Yeah, some people do it |
| 09:47 | quizme | i just got my nailgun server up |
| 09:47 | the-kenny | The author is here sometimes too. |
| 09:47 | quizme | not sure what to do next |
| 09: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. |
| 09:50 | quizme | the-kenny do you know how to use vimclojure ? |
| 09:50 | the-kenny | quizme: No, sorry. I'm on Emacs |
| 09:50 | quizme | the-kenny k |
| 09:51 | bagucode | Anyone here using anything other than emacs or vim? |
| 09:51 | the-kenny | bagucode: There's a netbeans and/or eclipse plugin |
| 09: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 |
| 09:52 | the-kenny | bagucode: Emacs is perfect for lisp-programming by default |
| 09:54 | bagucode | the-kenny: It should be since it's mostly written in lisp :P |
| 09:54 | the-kenny | bagucode: That's what I'm refering to :p |
| 09:55 | quizme | i think you need a phd to get these editors to work... |
| 09:56 | the-kenny | quizme: Not really. The installation of slime and clojure with the help of elpa in emacs is really easy |
| 09: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. |
| 09:56 | the-kenny | I recommend everyone to try both editors |
| 09:57 | bagucode | the elpa auto install is broken on emacs 22 |
| 09:57 | quizme | i'm gonna try slime again... |
| 09:57 | bagucode | eh |
| 09:57 | bagucode | I mean the swank-clojure auto install of clojure |
| 09:58 | bagucode | elpa works, but then it breaks when starting slime the first time and swank tries to get clojure |
| 09:58 | bagucode | So use emacs 23 if you can |
| 09:58 | the-kenny | bagucode: hm.. Never used the auto-install for clojure. I use leiningen for everything |
| 09: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 |
| 09:59 | the-kenny | bagucode: I have a project for that ;) |
| 09:59 | bagucode | haha |
| 10:24 | quizme | yeah slime was easy |
| 10:24 | quizme | 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 | quizme | 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 | quizme | 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 | arohner | let me see if I can dig up the doc |
| 11:08 | arohner | 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 | mebaran151 | cool |
| 11:21 | mebaran151 | and currently the best way for indexes is just raw-sql right? |
| 11:21 | mebaran151 | I have to admit, getting query to return results was a little hairy |
| 11:22 | mebaran151 | 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 | mebaran151 | 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 | LauJensen | 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 | mebaran151 | here were my two macros |
| 11:28 | mebaran151 | https://gist.github.com/4e36f245662acaa7c6ce |
| 11:29 | mebaran151 | that way if you need the laziness you can just use the apply-sql macro to the result set |
| 11:29 | mebaran151 | I thought it seemed like a nice idiom |
| 11:29 | mebaran151 | while dosql will just return the sql as is |
| 11:32 | mebaran151 | http://gist.github.com/272977 << public version |
| 11:32 | LauJensen | mebaran151: You don't like doc-strings? :) |
| 11:32 | mebaran151 | hmmm? |
| 11:33 | mebaran151 | oh you mean with usage and such |
| 11:33 | LauJensen | The doc-tring for run is pretty explanatory |
| 11:33 | LauJensen | Same for let-query |
| 11:33 | mebaran151 | oh |
| 11:33 | mebaran151 | 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 | LauJensen | Apologize for any misunderstandings |
| 11:34 | mebaran151 | and the error I was getting didn't indicate I'd called the function wrong |
| 11:35 | mebaran151 | it just said the result set was closed |
| 11:36 | mebaran151 | 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 | fliebel | 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 | mebaran151 | 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 | mebaran151 | fliebel, I think apache-commons usually has some good stuff for this sort of thing |
| 11:46 | mebaran151 | 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 | mebaran151 | 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 | edbond | how it works? |
| 12:12 | mebaran151 | I wish lazy-seqs could be annotated with an optional close method |
| 12:12 | mebaran151 | so I could represent more db stuff in terms of lazy-seqs |
| 12:13 | mebaran151 | 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 | mebaran151 | 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 | bagucode | 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 | bagucode | 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 | mebaran151 | I'd like something like the pre post conditions |
| 12:20 | mebaran151 | 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 | mebaran151 | hiredman has one actually |
| 12:22 | mebaran151 | 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 | mebaran151 | it could probably replace try and finally if done correctly |
| 12:28 | mebaran151 | feels like with metadata you have most of what you need |
| 12:29 | mebaran151 | everything that would ever need closing could be described by a hash-map |
| 12:29 | mebaran151 | 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 | fliebel | http://gist.github.com/273028 |
| 13:23 | the-kenny | fliebel: Looks like lazyness |
| 13:23 | the-kenny | 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 | arohner | 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 | arohner | ,(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 | fliebel | works! |
| 13:28 | fliebel | 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 | defn | 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 | defn | sorry i still haven't touched utterson |
| 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 | defn | (assuming they're not evil morons) |
| 13:45 | defn | 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 | fliebel | xkcd.com is slowing me down though... |
| 13:50 | fliebel | *opens up cljex* |
| 13:51 | fliebel | defn: whoa, it's not showing "it's working" anymore |
| 13:53 | defn | who what? |
| 13:53 | defn | 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 | defn | fliebel: yeah, sort of a bummer, but *shrug*, they'll come eventually |
| 13:54 | defn | 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 | defn | it should be organized by namespace, and with a scrolling frame |
| 13:55 | defn | 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 | fliebel | How do you use a Python project in Clojure? |
| 13:56 | {newbie} | fliebel: jyton |
| 13:56 | {newbie} | i guess |
| 13:56 | {newbie} | 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 | fliebel | 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 | defn | 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 | defn | 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 | headius | 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 | headius | 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 | defn | (import javax.sound.midi) |
| 14:03 | defn | exception... hmm |
| 14:03 | fliebel | defn: http://www.google.com/search?q=java+midi+tutorial |
| 14:04 | defn | fliebel: thanks buddy |
| 14:06 | defn | 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 | bagucode | Unless someone can pull a complete and feature packed visual studio plugin for clojure out of a hat |
| 14:14 | bagucode | Does anyone know what the people dabbling with clojureclr use? |
| 14:14 | bagucode | 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 | LauJensen | +e |
| 14:23 | fliebel | I'm not… |
| 14:23 | odrzut | hellow |
| 14:24 | hiredman | ugh |
| 14:24 | hiredman | 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 | hiredman | seems nice and simple to me |
| 14:42 | hiredman | 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 | clojurebot | danlarkin's clojure-json at master - GitHub |
| 14:56 | clojurebot | 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 | esj | "Minor mode for pseudo-structurally editing Lisp code." t) |
| 15:00 | esj | (add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode +1))) |
| 15:00 | esj | (add-hook 'clojure-mode-hook (lambda () (paredit-mode +1))) |
| 15:00 | esj | (add-hook 'lisp-mode-hook (lambda () (paredit-mode +1))) |
| 15:00 | esj | (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 | defn` | 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 | mebaran151 | 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 | LauJensen | mebaran151: Did you read my blogpost RE ClojureQL? |
| 16:20 | mebaran151 | LauJensen, that was what I would recommend |
| 16:21 | mebaran151 | though duck-streams might make it a little nicer to read from the stream |
| 16:22 | mebaran151 | thanks for pointing me to your blogpost! |
| 16:22 | mebaran151 | has everything I should need |
| 16:22 | the-kenny | chouser: Is or was "raised?" a function in error-kit? |
| 16:23 | the-kenny | 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 | defn | i have no idea why -- this wasn't the case before |
| 16:40 | defn | M-x swank-clojure-project /my/proj |
| 16:40 | defn | (System/getProperty "user.dir") => /my/proj/src/dir/ |
| 16:41 | defn | Is there any way to force swank to set its path |
| 16:42 | defn | 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 | {newbie} | < 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 | Chousuke | ie (defn a [x] #(b (inc x))) (defn b [x] #(a (inc x))) (trampoline a) |
| 18:08 | Chousuke | trampoline stops bouncing once you return something that's not a function |
| 18:08 | Chousuke | so that's an infinite loop. but I suppose you could adapt it |
| 18:08 | Chousuke | hm |
| 18:08 | Chousuke | (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 | esbena | :) |
| 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 | hiredman | star |
| 18:29 | hiredman | 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 | hiredman | and in the last few days there have been at least a hundred "me too" comments |
| 18:30 | hiredman | 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 | hiredman | 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 | hiredman | the appengine datastore is not 'bigtable' |
| 18:42 | hiredman | 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 | the-kenny | 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 | mebaran151 | you wrote to the BigTable |
| 19:01 | mebaran151 | oh it's not BigTable |
| 19:02 | mebaran151 | 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 | hiredman | which, is, if I recall, the multipart bit |
| 19:12 | hiredman | I also took the liberty of gutting the compojure namespace |
| 19:13 | hiredman | 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 | the-kenny | 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 | the-kenny | liebke's is working :) |
| 19:39 | the-kenny | 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 | hiredman | no |
| 19:46 | hiredman | I didn't get that far, and it apears the sdk is not in maven |
| 19:47 | hiredman | 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 | the-kenny | like "lein appengine-push" |
| 19:50 | hiredman | sure |
| 19:50 | hiredman | I only got as far as appengine-setup |
| 19:50 | hiredman | well, starting on it |
| 19:50 | the-kenny | hm ok |
| 19:50 | hiredman | generate the directories, alter project.clj |
| 19:52 | hiredman | I did push what I had to clojars |
| 19:52 | hiredman | I should push the source to github |
| 19:52 | hiredman | lein-gae |
| 19:54 | hiredman | http://github.com/hiredman/lein-gae/ |
| 19:55 | hiredman | it's not much |
| 19:55 | hiredman | 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 | the-kenny | s/script/plugin/ |
| 20:06 | hiredman | sure |
| 20:06 | hiredman | well, I would rather it used the java directly |
| 20:06 | hiredman | 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 | hiredman | 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 | seths | about 40 minutes, some slides and some demo |
| 20:16 | seths | 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 | technomancy | (in order to support jar compatibility between clojure versions) |
| 20:17 | technomancy | 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 | djork | http://imgur.com/8C0TS |
| 20:21 | technomancy | seths: I think so... I haven't really paid much attention to that. =) |
| 20:22 | technomancy | 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 | djork | not running on the iPhone |
| 20:22 | djork | but editing, yes |
| 20:22 | seths | oh, you ported Emacs |
| 20:22 | seths | ;-) |
| 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 | djork | it will send it to a server running something like clojurebot |
| 20:23 | djork | 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 | djork | and also gist.github.com integration |
| 20:24 | djork | load/save to a gist |
| 20:24 | djork | 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 | djork | 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 | djork | 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 | hiredman | 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 | hiredman | 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 | hiredman | 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 | the-kenny | s/thank/thanks/ |
| 21:23 | the-kenny | 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 | hiredman | 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 | the-kenny | 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 | hiredman | I have enable javascript (and flash) |
| 21:28 | hiredman | 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 | technomancy | the only thing I miss about not having flash is the github network graphs |
| 21:30 | technomancy | 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 |