2009-09-01
| 03:22 | mikem` | i'm getting a java.io.IOException: Stream closed trying to read from a file. How can I know exactly which code threw this exception? how to continue debugging? |
| 03:27 | crc_ | could be a lazyness issue? reading past with-open scope? |
| 03:27 | crc_ | (just shooting in the dark :) |
| 03:28 | mikem` | crc_: probably :) I have (with-open [rdr (reader filename)] (line-seq rdr))), which I then use in further processing. |
| 03:28 | crc_ | ah! most probably thats it! |
| 03:29 | mikem` | so the line-seq is only "valid" within the with-open scope. |
| 03:29 | crc_ | since it returns a lazy seq. The reader behind the seq is only valid within that scope. |
| 03:29 | crc_ | may do a doall? |
| 03:31 | mikem` | where would the doall go? around (with-open) or (line-seq)? |
| 03:33 | crc_ | around line-seq. Anything outside of with-open is out of scope. If the file is big, you could also do a doseq within the scope and processing before it ends. |
| 03:33 | crc_ | If i remember right, c.contrib.duck-streams has a function that returns a sequence which closes the reader *after* it is consumed fully. |
| 03:34 | crc_ | that might be more appropriate? |
| 03:34 | mikem` | crc_: gott it, it works :) |
| 03:34 | crc_ | cool! |
| 03:35 | mikem` | hm, that would be useful (the stream that's closed when the sequence is consumed). i'll look into that |
| 04:20 | AWizzArd | How can I see which Clojure functions produced an error when an Exception was thrown? In the stack trace I only see evals and invokes and some applys and runs here and there. |
| 04:51 | mikem` | crc_: i guess the reader that closes the stream after the sequence is consumed is (read-lines): http://github.com/richhickey/clojure-contrib/blob/39618b6d881fb0c3b52de4929aa34134bb32ffdb/src/clojure/contrib/duck_streams.clj#L228 |
| 04:52 | crc_ | Yes. I think thats the one. |
| 04:56 | mikem` | yep, it works great. thanks for the pointer :) |
| 04:59 | crc_ | sure |
| 07:35 | AWizzArd | ~seen stuartsierra |
| 07:35 | clojurebot | stuartsierra was last seen parting #clojure, 817 minutes ago |
| 08:00 | adityo | how will i add type hints to a let binding? |
| 08:02 | adityo | for eg. (let [keyval] (.split foo-string "=")) |
| 08:02 | liwp | (let [var #^hint val] ...) |
| 08:02 | adityo | on compilation i get a warning 'call to split can't be resolved' |
| 08:03 | liwp | String.split returns a String array, right? I can't remember the syntax for a string array type hint... |
| 08:03 | adityo | liwp: thanks |
| 08:03 | liwp | ahh |
| 08:03 | liwp | you want to hint the .split call |
| 08:03 | adityo | liwp: yeah |
| 08:03 | liwp | ,(.split #^String "foo=bar" "=") |
| 08:03 | clojurebot | Metadata can only be applied to IMetas |
| 08:04 | liwp | blah |
| 08:04 | liwp | anyhow, that's how it should work |
| 08:04 | liwp | might be that you have to hint both args |
| 08:09 | liwp | so this work: |
| 08:09 | liwp | ,(let [#^String str "foo=bar"] (.split str "=")) |
| 08:09 | clojurebot | #<String[] [Ljava.lang.String;@678646> |
| 08:10 | liwp | i.e. the hint is before the var in the let binding |
| 08:12 | adityo | liwp: thanks i shall try it out :) |
| 08:19 | cschreiner | swank does not accept unicode, how can I fix this? |
| 08:20 | jdz | cschreiner: works like charm with utf-8 for me... |
| 08:20 | cschreiner | ok, so how do I set utf-8? |
| 08:21 | cschreiner | Coding system iso-latin-1-unix not suitable for "00004c(:emacs-rex (swank:.... |
| 08:21 | jdz | (slime-connect "127.0.0.1" 4005 'utf-8-unix) |
| 08:21 | cschreiner | ah |
| 08:21 | jdz | oh, sorry |
| 08:21 | jdz | (slime 'clojure 'utf-8-unix) |
| 08:22 | tashafa | ,(keys (apply hash-map [ a 5 b (inc a) c [a b] d {:foo c :bar (* a b)}])) |
| 08:22 | clojurebot | java.lang.Exception: Unable to resolve symbol: a in this context |
| 08:23 | tashafa | ,(keys (apply hash-map (list a 5 b (inc a) c [a b] d {:foo c :bar (* a b)}))) |
| 08:23 | clojurebot | java.lang.Exception: Unable to resolve symbol: a in this context |
| 08:23 | cschreiner | jdz: thanks |
| 08:30 | Chouser | This is cool abuse of the GPU: http://ideolalia.com/performance-in-clojure-and-factor |
| 08:30 | tashafa | ,(keys (apply hash-map '(a 2 b 7))) |
| 08:30 | clojurebot | (a b) |
| 08:31 | tashafa | ,(keys (apply hash-map [a 2 b 7])) |
| 08:31 | clojurebot | java.lang.Exception: Unable to resolve symbol: a in this context |
| 08:31 | liwp | you need to quote a and b in the vector |
| 08:31 | jdz | tashafa: don't you have your own repl? |
| 08:31 | tashafa | i dont have one right now |
| 08:31 | tashafa | sorry |
| 08:31 | Chouser | tashafa: you can PM clojurebot too |
| 08:32 | tashafa | oh thanks |
| 08:32 | liwp | Chouser: yeah, the penumbra GPU stuff was really nice |
| 08:32 | ambient | i'm looking at penumbra too, really cool how it does both opengl and shaders with s-expressions |
| 08:33 | ambient | even if opencl is done 100% on the cpu it might be faster than the java libs depending on how it's implemented, afaict |
| 08:48 | Fossi | is there a way to compare two maps "lazily", as in, at least all given elements of map 1 are in map 2 as well |
| 08:48 | Fossi | some kind of deep contains? |
| 08:53 | Chouser | ,(every? {:a 1, :b 2, :extra 3} (keys {:a 1, :b 4})) |
| 08:53 | clojurebot | true |
| 08:56 | Chousuke | Chouser: clever. |
| 08:57 | Chousuke | though that'll only test for keys I guess. |
| 09:01 | Chouser | ,(let [m1 {:a 1, :b 4}, m2 {:a 1, :b 2, :extra 3}] (= m1 (select-keys m2 (keys m1)))) |
| 09:01 | clojurebot | false |
| 09:33 | icylisper | http://paste.lisp.org/display/86361 ; how do I call a method on an instance; for example in the paste how do i call the method createChannel(). In java it would be conn.createChannel() |
| 09:33 | icylisper | (doto conn (.createChannel)) does not work |
| 09:34 | icylisper | any ideas ? |
| 09:35 | Chouser | I would guess newConnection is a static method of ConnectionFactory |
| 09:35 | icylisper | Chouser: yes |
| 09:35 | icylisper | ref: http://www.rabbitmq.com/api-guide.html |
| 09:35 | Chouser | then you want (ConnectionFactory/newConnection ...) instead. |
| 09:35 | icylisper | ah interesting. |
| 09:35 | Chouser | (.foo bar) is to call instance method foo on the the instance bar |
| 09:37 | Chouser | icylisper: if you really want to ignore that distinction, you can still use the plain . operator for either case: (. thing1 thing2) ...but that's generally considered unattractive these days. |
| 09:38 | icylisper | Chouser: makes sense :) |
| 09:39 | icylisper | Chouser: (def conn (ConnectionFactory/newConnection "localhost" 5672)) doesnt work. Could you correct me there ? |
| 09:40 | Chouser | icylisper: what sort of error do you get? |
| 09:40 | icylisper | Chouser: No Matching Method: newConnection |
| 09:41 | Chouser | icylisper: hm. This is a shot in the dark, but maybe try (ConnectionFactory/newConnection "localhost" (int 5672)) |
| 09:42 | Chouser | the 'int' shouldn't be required, but it's the last thing I can think of before digging in deeper. :-/ |
| 09:42 | mikem` | I think you need to call newConnection on a ConnectionFactory instance |
| 09:42 | Chouser | mikem`: you're right. |
| 09:42 | Chouser | bad assumption on my part back a ways. |
| 09:43 | Chouser | it's not a statis method at all. |
| 09:43 | rhickey | http://best-practice-software-engineering.blogspot.com/2009/09/clojure-clojure-book-review.html asks: "Is it really worth investing half a year in a hot language like Clojure to be able to produce code that is 3 times more accurate imperative Code?" |
| 09:43 | Chouser | icylisper: so -- what error were you getting with your original doto expression? |
| 09:44 | icylisper | Chouser: http://paste.lisp.org/display/86361 the doto works. However, doing (.createChannel conn) fails. |
| 09:45 | Chouser | icylisper: with what error? |
| 09:46 | icylisper | Chouser: No matching field found: createChannel for class com.rabbitmq.client.ConnectionFactory |
| 09:46 | icylisper | Chouser: wierd in java the method works on the conn instance |
| 09:46 | Chouser | ah! sheesh. ok, I see the problem. |
| 09:46 | icylisper | Chouser: :) |
| 09:46 | Chouser | doto returns the result of its first expression |
| 09:47 | Chouser | so conn is the Factory |
| 09:47 | icylisper | Chouser: ah brilliant. yeah. |
| 09:47 | rhickey | Chouser: in looking at the MIDI thing the other day, I found that the inheritance graph was quite screwy. An abstract superclass defined the method the op was trying to call, but only the most derived class derived from the interface the method was supposed to be a member of, so looking up from the implementing class didn't find the interface |
| 09:48 | Chouser | icylisper: the clue is in that error message, that it's trying to call createChannel on ConnectionFactory |
| 09:48 | rhickey | this one seems simpler :) |
| 09:48 | Fossi | rhickey: i don't get it. did he really mean "3 tumes more accurate imperative" or "than imperative"? |
| 09:48 | icylisper | Chouser: kewl. but how do i get the last expression using doto ? |
| 09:48 | rhickey | Fossi: I presume "than" |
| 09:49 | Chouser | icylisper: just don't use doto. |
| 09:49 | Chouser | icylisper: (def conn (.newConnection (new ConnectionFactory) "localhost" 5672)) |
| 09:49 | icylisper | Chouser: ook :) thanks a lot! |
| 09:49 | Chouser | or use -> or .. if you prefer to keep the same word order as doto |
| 09:50 | icylisper | Chouser: nice. |
| 09:51 | icylisper | Chouser: there works beautifully. Clojure rocks! |
| 09:51 | eevar2 | that blog post wasn't entirely coherent? i'm not sure what he's trying to say with his first point |
| 09:54 | LauJensen | ,(meta (cons (with-meta [1 2 3] {:vec true}) [4 5 6])) |
| 09:54 | clojurebot | nil |
| 09:54 | LauJensen | why ? |
| 09:54 | Chouser | ,(cons (with-meta [1 2 3] {:vec true}) [4 5 6]) |
| 09:54 | clojurebot | ([1 2 3] 4 5 6) |
| 09:54 | LauJensen | nvm, I got it |
| 09:59 | Chouser | using swig to get access to C++ objects from Clojure is pretty heady stuff. So much "just works" it makes me a bit dizzy. |
| 10:05 | Chouser | re: that blog article; it's interesting to me to consider what people seem to think the "lifespan" of Clojure will be. |
| 10:07 | Chouser | I suppose perl has been pretty well "dead" to me for a while, though I once loved it so dearly. |
| 10:08 | Chouser | wait, is this a public forum? |
| 10:08 | rhickey | I wondered if a) people think it takes 6 months, and b) is it worth it |
| 10:12 | rys | Perl isn't dead. It's just sat there quiet in the corner glueing everything else together ;) |
| 10:13 | cemerick | does that blog have any sway at all, anywhere? I'm bad at gauging the cred of random blogs that I'm not familiar with. |
| 10:13 | cemerick | spelling it "BLOG" is funny, though. |
| 10:13 | rhickey | I just thought it was an interesting question, not necessarily an important blog |
| 10:14 | cemerick | oh, OK |
| 10:14 | rhickey | i.e. how long did it take you to grok Clojure and was it worth it? |
| 10:14 | rhickey | and also, how steep is the learning curve? |
| 10:14 | cemerick | The basics took 2 weeks. I think becoming proficient (FWIW, in my case) took a solid 3-4 months. I actually only think I'm hitting my stride now. |
| 10:15 | cemerick | worth it? I'm here :-) |
| 10:15 | ambient | most problems learning clojure for me is definitely the functional approach and immutability |
| 10:15 | cemerick | Seriously though, of course it's worth it, at least if you're working away from the fleshy middle of the "I.T. Industry" |
| 10:16 | iBong | as a java -> ruby programmer (who absolutely has not grokked clojure) my brain continues to experience stiff resistance to everything but list comprehensions and multimethods, and yes I think it will be worth it |
| 10:16 | rhickey | Certainly most of the early adopters were willing to deal with sexprs. I think the next wave has a lot more people stuck at "not intuitive/easy to read", all flavors of "unfamiliar" |
| 10:16 | ambient | i think reading through SICP and doing stuff in it with Scheme definitely helped |
| 10:17 | ambient | in scheme one can use mutability way freer though, so it's not that big a step |
| 10:17 | ambient | afaict |
| 10:17 | jdz | except that mutation is introduced well good into half of the book (SICP) |
| 10:18 | rsynnott_ | I think it's very easy to pick up for someone who has programmed in common lisp |
| 10:18 | cemerick | I think the #1 issue as more people come in will be tools. I know the 133t hackers (;-)) love emacs, but 90% of programmers simply won't bother if that's the recommended path. |
| 10:18 | rsynnott_ | rhickey: maybe you should do a Dylan on it :) |
| 10:18 | rhickey | Dylan had its shot |
| 10:18 | ambient | yes, emacs+lisp at the same time is... heavy |
| 10:19 | rsynnott_ | (Dylan started off with s-exps but switched to a ruby-looking syntax) |
| 10:19 | ambient | a simple drscheme style IDE would be golden |
| 10:19 | ambient | although i dont know if I can call that simple |
| 10:19 | raphinou_ | rhickey: I wondered what your opinion is about the closure conversion feature of Jruby and if it's interesting for Clojure ( http://groups.google.com/group/clojure/browse_thread/thread/fa13ce48fe01893e ) |
| 10:20 | cemerick | ambient: no, it must be eclipse/netbeans/intellij/visual studio based. There's zero tolerance for one-off environments outside of enthusiasts. |
| 10:20 | iBong | I think the sexps shouldnt be much of a problem for most people coming from ruby, although some people are really into their tidy-looking dsls |
| 10:20 | rhickey | raphinou_: I think it is a gimmick of limited utility that muddies the language semantics |
| 10:21 | raphinou_ | ok rhickey, that's clear :-) thx |
| 10:21 | Chouser | I actually learned lazy seqs, immutable locals, and immutable collections on Scala first, so then switching to Clojure wasn't very hard at all. |
| 10:21 | cemerick | rhickey: hrm, do you do much swing? |
| 10:22 | cemerick | Chouser: yeah, I came the same way |
| 10:22 | Chousuke | I think you could get pretty close to that gimmick with a macro |
| 10:22 | cemerick | yeah, it doesn't need to be bolted into the language at all. |
| 10:23 | rhickey | cemerick: no, Chousuke: yes |
| 10:23 | Chouser | I would have rather learned the functional/immutable stuff here. #scala was a bit harsh a bit too often. |
| 10:24 | AWizzArd | Hi stuartsierra. I discovered a problem in append-spit. |
| 10:24 | raphinou_ | Chousuke: if you're talking about the listener gimmick, I'm interested in advice. I currently have a macro here: http://www.nsa.be/index.php/eng/Blog/Using-Jwt-yes-it-s-a-J-with-Clojure |
| 10:25 | stuartsierra | AWizzArd: what's the problem |
| 10:25 | AWizzArd | stuartsierra: when I do (binding [*default-encoding* "UTF-16"] (append-spit "/foo.txt" "x\n")) a few times in the repl, it will then write the utf-16 marker into each row. Loading this file will show in emacs new lines (not the first one) with a space in front. |
| 10:26 | AWizzArd | append-spit should not write the encoding marker if the file already exists |
| 10:26 | stuartsierra | Hmm, ok, I'll have to think about how to fix that. |
| 10:26 | stuartsierra | Can you file a ticket for it? |
| 10:26 | AWizzArd | just eval this form that I just posted 3x in your repl and then slurp the file and do a (map int (slurp "/foo.txt" "UTF-16")) |
| 10:27 | AWizzArd | stuartsierra: k |
| 10:27 | Chousuke | raphinou_: well, the simplest way of course is to write separate macros for each interface. but I think it would be possible to generate code that uses reflection at runtime to figure out which interface to implement. |
| 10:30 | raphinou_ | ok |
| 10:30 | Chousuke | raphinou_: for your code, you could have a (signal-listener [evt parameters] ...) that figures out which proxy to generate based on the number of elements in the parameter vector, for example. |
| 10:30 | raphinou_ | Chousuke: yes, that's what I do actually |
| 10:31 | raphinou_ | it implements Signal, Signal1, Signal2 etc for 0, 1 , 2 etc arguments |
| 10:31 | Chousuke | oh, heh, I didn't read that far yet. :P |
| 10:31 | raphinou_ | ok :) |
| 10:33 | Chousuke | did you work around the clojure bug in the macro yet though? |
| 10:34 | Chousuke | And I see you do (let [argsnum# ...] ...) there. that's not necessary. autogensyms only matter inside syntax-quote. |
| 10:34 | raphinou_ | well, cgrand attached a patch to http://www.assembla.com/spaces/clojure/tickets/181 |
| 10:34 | raphinou_ | ok, thx Chousuke for this remark. Good catch :-) |
| 10:35 | rhickey | raphinou_: I don't see a patch there |
| 10:36 | raphinou_ | ho, you're right rhickey. I just looked at his status update |
| 10:37 | Chousuke | hm, I wonder if he has notice the patch isn't there. |
| 10:37 | Chousuke | noticed* |
| 10:38 | cgrand | patch attached |
| 10:43 | ambient | not sure if this is the right place to ask but emacs doesn't seem to smart indent in clj file buffers, only in repl. any way to enable the indent in the file buffers? |
| 10:43 | eevar2 | ambient: does hitting tab indent your lines correctly? |
| 10:45 | rhickey | cgrand: thanks, approved. Is 186 supposed to have a patch attached? It is marked 'test' but no patch |
| 10:47 | cgrand | attached! |
| 10:47 | cgrand | I should learn to click submit buttons... |
| 10:47 | Chouser | ah... yes, you get multiple submit buttons on the assembla pages. |
| 10:48 | Chouser | if you fill out the file upload and then fill out a comment without "submit" in between, you're going to lose one or the other. |
| 10:48 | Chousuke | bad UI :/ |
| 10:49 | Chouser | Chousuke: fortunately that's the only site on the web with a bad UI, so we can all relaz. |
| 10:49 | Chouser | relax |
| 10:49 | cgrand | Chouser: ah? thanks! |
| 10:49 | Chousuke | heh. |
| 10:50 | Chousuke | I'm picky about UIs |
| 10:50 | rhickey | cgrand: cool - thanks for all the patches! |
| 10:53 | ambient | eevar2 yes it seems to do that |
| 10:54 | cgrand | rhickey: 186 should also apply cleanly on 1.0.x |
| 10:54 | eevar2 | rebinding the enter key to 'newline-and-indent, rather than just 'newline might do the trick |
| 10:54 | ambient | ok, i shall try that, ty |
| 11:05 | raphinou_ | rhickey, cgrand: FYI, I tested patch 181 and it works fine. thanks for the fix! |
| 13:04 | cemerick | wow, java 5 becomes EOL'ed this October |
| 13:10 | fdaoud | wow indeed |
| 13:29 | ambient | what would be the best data structure to handle 2d 24-bit RGB images? 1d arrays? |
| 13:29 | ambient | hmm, perhaps this is premature optimization |
| 13:32 | stuartsierra | ambient: 1-d arrays are generally the best way to manage binary data |
| 13:33 | ambient | ok |
| 13:33 | dnolen | ambient: 1d arrays are going to provide the fastest access to primitive data. 2d arrays are quite slow. |
| 13:34 | dnolen | rather > 1d arrays are slow. every dimension is another hit on dereferencing. |
| 13:34 | ambient | optimally, increasing the dimension only takes 1 clock cycle on the CPU, shift left |
| 13:35 | dnolen | ambient: not sure how the JVM does this, but it actually more like 3-4x slower for 2d arrays. |
| 13:35 | dnolen | in my own experience anyway. |
| 13:35 | ambient | ok |
| 13:35 | stuartsierra | In the JVM, byte[][] creates an array of pointers to byte[] |
| 13:36 | ambient | aww |
| 13:36 | ambient | 1d array of size width*height seems to be the way to do it then |
| 13:48 | Chouser | anyone know of a CSS parser for Java/clojure? |
| 13:49 | Chouser | oh, google says http://cssparser.sourceforge.net/ |
| 13:49 | LauJensen | Cant enlive handle that Chouser? |
| 13:50 | Chouser | enlive queries DOM trees, so no. |
| 13:55 | LauJensen | k |
| 15:37 | angerman | how much of kotka's stuff has made it into clojure? monads, lazy-map? |
| 15:38 | angerman | I'm just wondering what would be duplicated stuff if I used the parser |
| 15:49 | stuartsierra | Neither monads nor lazy-map are include in the Clojure distribution. monads are in contrib, I think. |
| 15:55 | angerman | stuartsierra: that's not kotka's stuff is it? |
| 15:57 | stuartsierra | oh, I don't know who wrote what |
| 15:57 | angerman | stuartsierra: well monads is by Konrad Hinsen |
| 15:58 | angerman | stuartsierra: ujmp is the universal java math p(...) |
| 15:59 | angerman | The thing with math libraries is: I don't want to care what sub-library is used. I just want to use a certain functionality and the library is supposed to take the best solution for the task. [...] |
| 15:59 | angerman | If I have 80 cores spare. it should try to get the best parrallel solution... if there are a lot of GPUs available it should try a more OpenCL or OpenGL or what ever seems possible solution. |
| 15:59 | angerman | but ujmp at least has the option to work with matrices bigger then the memory |
| 16:00 | stuartsierra | What you're describing is the holy grail of library optimization. |
| 16:00 | angerman | stuartsierra: yes I know :( |
| 16:00 | stuartsierra | I think that's one of the goals of Sun's X10 language. |
| 16:00 | angerman | it's a bit like jiting. |
| 16:01 | angerman | stuartsierra: the thing is, being a student. I work in very heterogenus networks. |
| 16:01 | stuartsierra | me too, as a coder in academia |
| 16:02 | angerman | e.g. I have two macbook, a p4 and access to the 4 mainfraims from the university. (though I never now how much resources are left on the mainframes) |
| 16:02 | angerman | (second macbook being the one of my g/f :) |
| 16:02 | stuartsierra | Right, so you want code that's automatically optimized for any one of those environments. For now, dream on. |
| 16:03 | angerman | maybe it boils down to that :) |
| 16:04 | angerman | all I want is to get the stupid breast cancer classification I work on to yield nice results and not violate any reasoning. |
| 16:06 | prospero_ | angerman: OpenCL is designed to work on CPUs and GPUs |
| 16:06 | prospero_ | what's missing is something that will distribute work across multiple OpenCL kernels |
| 16:06 | prospero_ | but as far as I understand it, it's being positioned as a homogeneous interface to heterogeneous computing resources |
| 16:06 | angerman | prospero_: well I'd like to look at it from a way higher perspective. |
| 16:07 | prospero_ | well, one layer of abstraction at a time |
| 16:07 | angerman | prospero_: I look at the problem the following way: I have a box with a certain amount of chips inside that all can do special computations. (some more generic then the others) |
| 16:08 | angerman | and then I have a problem: run a SVM on a dataset. |
| 16:08 | angerman | the first issue I run into is the limit of matrixes. |
| 16:09 | angerman | I have yet to see which java library does not exhibit that. I ran into issues with matlab and python so far. |
| 16:10 | prospero_ | you mean limits in the dimensions? |
| 16:10 | stuartsierra | how big are your matrices? |
| 16:10 | angerman | stuartsierra: more entries then an integer is large. |
| 16:10 | prospero_ | ha |
| 16:10 | angerman | And I think that's an inherative issue with BLAS ... |
| 16:11 | prospero_ | can't matrix operations be split over sub-matrices? |
| 16:11 | angerman | prospero_: in theory sure, split a matrix into four soub matrices |
| 16:12 | ambient | why not just parallelize by row |
| 16:12 | angerman | prospero_: the issue is the algorithm I'm supposed to use. |
| 16:12 | angerman | ambient: that's the next way I'm about to tackle. |
| 16:12 | angerman | the last solution I uses was so called recursive feature selection. |
| 16:12 | ambient | sounds complicated |
| 16:13 | angerman | problem with that approach is, it's not stable. |
| 16:13 | ambient | stable means so many things in CS |
| 16:13 | ambient | :P |
| 16:13 | angerman | ambient: this is stable it the most understandable way. |
| 16:14 | angerman | slightly vary the parameter (in this case the amount of features to keep in each run) and the result varies |
| 16:14 | angerman | and it's not even converging |
| 16:15 | angerman | anyway, thanks for listening guys :) |
| 16:16 | ambient | i wish the nice implmenetations of BLAS weren't so expensive :/ |
| 16:18 | angerman | ambient: I wish I wasn't supposed to use lagranean svm :) |
| 16:20 | prospero_ | on a vaguely related note, did anyone see the penumbra GPGPU stuff that's been on programming.reddit? |
| 16:20 | prospero_ | and if so, do they have any ideas on what would be an effective application to use as a tutorial? |
| 16:21 | prospero_ | I'm thinking n-body, and looking at how performance changes as n grows |
| 16:21 | ambient | laplace transform? |
| 16:21 | prospero_ | but I dunno if that's going to grab people |
| 16:22 | prospero_ | which do you think would be more understandable to people without a strong math background |
| 16:22 | prospero_ | because I don't think that's a prerequisite to using this |
| 16:22 | prospero_ | or rather, it shouldn't be |
| 16:23 | ambient | well you could show them simple 2d fluid simulation |
| 16:23 | prospero_ | hell, I'm pretty weak math-wise myself |
| 16:23 | ambient | that looks really nice |
| 16:23 | prospero_ | yeah, that would be a good one |
| 16:23 | ambient | dont remember what the formulas were called |
| 16:23 | prospero_ | navier-stokes |
| 16:23 | prospero_ | ? |
| 16:23 | ambient | yep, thats it |
| 16:24 | prospero_ | I could also do something much simpler, like the mona lisa evolution thing that was floating around |
| 16:24 | prospero_ | then the GPU would just be used as a fitness evaluator |
| 16:24 | ambient | im not sure that's good for GPGPU |
| 16:24 | angerman | or just do fft :p |
| 16:24 | prospero_ | you need to compare NxM pixels to each other |
| 16:24 | prospero_ | and then sum the absolute differences together, to get the fitness |
| 16:24 | hiredman | http://gist.github.com/179346 is an aot test script |
| 16:25 | Licenser | evening everyone :) |
| 16:25 | hiredman | (nonsequitur for clojurebot's url logger) |
| 16:25 | prospero_ | also, the image is already living on the GPU, since you rendered it |
| 16:25 | prospero_ | I agree, it's not custom-fitted to GPGPU |
| 16:26 | prospero_ | but it's a nice demonstration of how the whole logic doesn't have to fit on the graphics card |
| 16:26 | prospero_ | I dunno, I guess I could just do all of them over a few months |
| 16:26 | angerman | if you want other nice things you could so spring simularion. |
| 16:26 | ambient | jpeg compression |
| 16:26 | ambient | that's just not very visual |
| 16:26 | prospero_ | angerman: flag in the wind, or something? |
| 16:27 | angerman | e.g. chain 5 to 10 springs together and let the system find it's least-energy point |
| 16:27 | angerman | I might have a matlab file i wrote for class floating around somewhere ... |
| 16:28 | prospero_ | eh, I don't really speak matlab, so I don't know how much good it'd do me |
| 16:28 | prospero_ | but all good ideas |
| 16:28 | angerman | prospero_: if you know any imperative language you know matlab :( |
| 16:29 | prospero_ | angerman: ok, fair enough |
| 16:29 | prospero_ | at the very least, I've never tried |
| 16:29 | angerman | R is a very different beast though :) |
| 16:31 | angerman | prospero_: once I find the code I'll hand you a copy :) |
| 16:31 | angerman | can't take too long to find it :) |
| 16:31 | prospero_ | angerman: ok, thanks |
| 16:31 | angerman | prospero_: maybe you mix processing in for the visuals |
| 16:32 | prospero_ | angerman: I've already got a full-fledged OpenGL implementation |
| 16:32 | prospero_ | it was kind of a necessary prerequisite to the GPGPU stuff |
| 16:37 | angerman | ok, found it. |
| 16:37 | angerman | where to send? |
| 16:38 | angerman | ahh got an idea |
| 16:40 | angerman | do public dropbox links work? |
| 16:40 | angerman | https://dl-web.getdropbox.com/get/Matlab-Spring-Simulation.zip?w=cc3f9d92&dl=1 |
| 16:40 | ambient | 403 |
| 16:41 | angerman | awesome ... |
| 16:43 | angerman | http://dl.getdropbox.com/u/281539/Matlab-Spring-Simulation.zip |
| 16:47 | angerman | basically it's implementing a runge-kutta solver |
| 16:51 | Licenser | I wonder what is the best way to make Ruby (rails) talk to Clojure |
| 16:52 | Licenser | Is there a suggested and well working model for that? |
| 16:53 | Anniepoo | Use the JACOB library and the clojure binding to it somebody wrote to get to COM, then from COM to Ruby via the Ruby WIN32OLE extension =8cD |
| 16:54 | Licenser | I had the idea to use compojure (or how it is spelled) to make a RESTfull http model, then use ActiveResource on the ruby side, but having a webserver handle HTTP just to move some data seems to be a huge overhead and likely to kill every performance reason to do this |
| 16:54 | Licenser | Erm yes, let me just install windows on this sparc server o.o |
| 16:54 | Anniepoo | Use a windows emulator 8cD |
| 16:54 | Licenser | ah dosbox! |
| 16:55 | Licenser | I guess using sockets and a properetary protocoll might be better but then again isn't nearly as flexible I think |
| 16:57 | Anniepoo | I think the objective with capjure is to promote scalability, not per-box performance |
| 16:57 | Licenser | what is capjure? |
| 16:57 | Licenser | *looks it up* |
| 16:57 | hiredman | Licenser: you could use jruby and integrate via the jvm |
| 16:58 | Licenser | true the idea isn't bad |
| 16:58 | headius | yay |
| 16:58 | Licenser | actually I think it is quite ingeniuse |
| 16:58 | Licenser | too obviouse so |
| 16:58 | stuartsierra | Licenser: I mix JRuby and Clojure in one VM, haven't tried it with Rails. |
| 16:58 | stuartsierra | Interop is easy though, since they both implement the Java Collection interfaces. |
| 16:59 | Anniepoo | ask amit - Runa's mostly in Clojure, but their legacy stuff is Ruby |
| 16:59 | Anniepoo | http://s-expressions.com/2009/03/31/capjure-a-simple-hbase-persistence-layer/ |
| 16:59 | Anniepoo | this explains some of the rational for capjure |
| 16:59 | hiredman | you could use some kind of message queue |
| 16:59 | hiredman | bus |
| 17:00 | Licenser | *nods* |
| 17:00 | Licenser | that ends up with a proparitary implementation, not sure if that is good or bad |
| 17:01 | Licenser | I mean it would likely yield the best mixture of performance vs scalability |
| 17:08 | Chouser | so if I have a namespace of utilities that may be useful for both clojure users (who will call public functions) and Java users (who will call static methods of a gen-classed class), should I name the namespace util (clojurey) or Util (javay) |
| 17:09 | Anniepoo | it's a commercial question |
| 17:09 | Chousuke | you could have two namespaces :P |
| 17:10 | Chouser | and is it worth creating a -doSomeThings method fn that just turns around and calls the do-some-things fn? |
| 17:10 | Chouser | I guess I can just have the clojure users call the static methods |
| 17:11 | Anniepoo | I'd use the Java names - my argument - clojure includes the idea of calling java, so the 'world' is ready for a Java name in Clojure code |
| 17:11 | Chouser | then they'd expect (Util/doSomeThings ...) |
| 17:12 | Anniepoo | but the reverse isn't true |
| 17:13 | Anniepoo | any idea why ns-aliases always fails from the REPL? |
| 17:14 | Chouser | ,(require '[clojure.zip :as z]) |
| 17:14 | clojurebot | nil |
| 17:14 | Anniepoo | nvrmnd |
| 17:14 | Chouser | ,(ns-aliases *ns*) |
| 17:14 | clojurebot | {z #<Namespace clojure.zip>} |
| 17:14 | hiredman | Anniepoo: what do you mean by fails? |
| 17:14 | Licenser | Chouser: I'd use the clojurey way |
| 17:15 | Anniepoo | ,(ns-aliases 'foo) |
| 17:15 | clojurebot | java.lang.Exception: No namespace: foo found |
| 17:15 | Anniepoo | ,(do (in-ns 'foo) (def bar 2) (ns-aliases 'foo)) |
| 17:15 | clojurebot | DENIED |
| 17:16 | hiredman | that is not an alias |
| 17:16 | Anniepoo | clojurebot: paste |
| 17:16 | clojurebot | lisppaste8, url |
| 17:16 | lisppaste8 | To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste. |
| 17:17 | lisppaste8 | Anniepoo pasted "ns-aliases" at http://paste.lisp.org/display/86391 |
| 17:18 | Chouser | Anniepoo: namespace aliases are created using alias or the :as clause of use or require |
| 17:19 | Anniepoo | ah, ok |
| 17:19 | stuartsierra | The gen-class name does not have to be the same as the ns name, either. |
| 17:19 | Chouser | not quite sure why (ns-aliases 'user) doesn't work. |
| 17:19 | Chouser | stuartsierra: yeah... |
| 17:19 | Anniepoo | I'm trying to find a seq of public symbols in the namespace |
| 17:20 | hiredman | Chouser: works here |
| 17:20 | Chouser | hiredman: right, that's what I meant. |
| 17:20 | Chouser | dunno why it fails in her paste |
| 17:20 | Chouser | Anniepoo: ns-publics |
| 17:20 | hiredman | ,(count (ns-publics *ns*)) |
| 17:20 | clojurebot | 0 |
| 17:20 | hiredman | :| |
| 17:20 | Anniepoo | I want to make a tool for myself to learn all the core and contrib functions |
| 17:20 | hiredman | ,(count (ns-publics 'clojure.core)) |
| 17:20 | clojurebot | 477 |
| 17:20 | hiredman | zounds |
| 17:22 | Anniepoo | ah, i switched to foo namespace before (ns-aliases 'user) |
| 17:23 | hiredman | that shouldn't matter |
| 17:23 | Anniepoo | lovely |
| 17:23 | Anniepoo | did matter to me |
| 17:23 | hiredman | :/ |
| 17:23 | Anniepoo | this in the slime-repl clojure in emacs |
| 17:24 | Anniepoo | is there a function version of doc? |
| 17:25 | Chouser | print-doc |
| 17:25 | hiredman | print-doc takes a var |
| 17:26 | Anniepoo | ,(def boo 'clojure.core/merge)(print-doc boo) |
| 17:26 | clojurebot | DENIED |
| 17:26 | Chouser | ,(print-doc #'identity) |
| 17:26 | clojurebot | ------------------------- clojure.core/identity ([x]) Returns its argument. |
| 17:27 | Anniepoo | ooh, var, not symbol 8cD |
| 17:27 | Anniepoo | way cool |
| 17:55 | powr-toc | The docs at http://clojure.org/Reader say "keywords are like symbols except ... they cannot contain '.' or name classes" yet the following seems to work without error: |
| 17:55 | powr-toc | ,:foo.bar |
| 17:55 | clojurebot | :foo.bar |
| 17:55 | lisppaste8 | ambient pasted "lazy-seq problem" at http://paste.lisp.org/display/86393 |
| 17:56 | ambient | i have *print-length* set to 20 but (foo 5000000) still eats all my memory and crashes :/ |
| 17:56 | hiredman | ~ticket #1 |
| 17:56 | clojurebot | {:url http://tinyurl.com/ntftnj, :summary "Add chunk support to map filter et al", :status :test, :priority :normal, :created-on "2009-06-13T14:38:41+00:00"} |
| 17:56 | hiredman | hmmm |
| 17:57 | hiredman | ~ticket #17 |
| 17:57 | clojurebot | {:url http://tinyurl.com/nq6ef7, :summary "GC Issue 13: validate in (keyword s) and (symbol s)", :status :test, :priority :low, :created-on "2009-06-17T18:56:26+00:00"} |
| 17:58 | hiredman | ambient: don't use recur |
| 17:58 | hiredman | (inside a lazy-seq call) |
| 17:58 | ambient | it can't be used in lazy sequences? |
| 17:58 | hiredman | I would look for some examples of how to write functions using lazy-seq |
| 17:59 | Chousuke | ambient: it's not needed |
| 17:59 | hiredman | ambient: not inside the call to lazy-seq |
| 17:59 | ambient | well i dont quite grok lazy-seq yet but here's for more trying |
| 17:59 | Chousuke | (doc lazy-seq) |
| 17:59 | clojurebot | "([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls." |
| 17:59 | hiredman | lazy-seq essentially creates a thunk, which sets up another recur point |
| 17:59 | hiredman | so recur doesn't recur to the function frame |
| 18:00 | hiredman | it recurs to the thunk created by lazy-seq |
| 18:01 | hiredman | wait |
| 18:01 | hiredman | that might not be right |
| 18:01 | hiredman | I didn't notice the (loop there |
| 18:01 | hiredman | just saw a recur inside a (lazy-seq |
| 18:01 | Chousuke | the most common pattern is (defn foo [x] (when x (lazy-seq (cons (something x) (foo (somethingelse x)))))) |
| 18:02 | hiredman | but that is certainly not the way to produce a lazy sequence |
| 18:02 | Chousuke | now the trick is that since foo itself returns a lazy thing, the second argument of the cons is not actually evaluated until it's needed. |
| 18:04 | ambient | that looks a lot like tail recursion |
| 18:04 | Anniepoo | ,(read-line) |
| 18:04 | Anniepoo | dsfsdfsd |
| 18:04 | clojurebot | Execution Timed Out |
| 18:05 | tomoj | so, lazy-seq does or does not set up a recur point? |
| 18:05 | tomoj | I didn't think it did |
| 18:05 | Anniepoo | hmm.... doing (read-line) at the repl in emacs hangs me, it takes an infinite number of lines |
| 18:05 | hiredman | ~def lazy-seq |
| 18:06 | Chousuke | ambient: basically, you're setting up a thunk (with lazy-seq) that, when evaluated, conses whatever to another lazy sequence (which happens to be generated by the same function) |
| 18:06 | tomoj | Anniepoo: emacs does some weird things with input/output |
| 18:06 | tomoj | er, well, slime with clojure anyway |
| 18:06 | Anniepoo | 8cD I broke it. I must be getting better at this |
| 18:07 | Chousuke | ambient: and this "recursion" stops when foo returns nil and the return value of the previous invocation becomes (lazy-seq (cons whatever nil)) |
| 18:07 | Anniepoo | bet it's cause clojure only has half the proper \r\n at the end of the line |
| 18:07 | ambient | but it can be infinite too right? |
| 18:07 | Chousuke | ambient: yes. |
| 18:08 | hiredman | it sort of flatten's out the stack |
| 18:08 | ambient | well it takes some absorbing but thanks for the help |
| 18:08 | Chousuke | ambient: but because the "recursion" is lazy it won't accumulate stack frames. |
| 18:08 | tomoj | Anniepoo: I don't think it's anything to do with that |
| 18:08 | tomoj | Anniepoo: because I get the problem too |
| 18:08 | tomoj | it's just that slime doesn't have the repl connected to standard in, I guess |
| 18:09 | Anniepoo | ok, so read-line is broken within the repl? foo - that limits the usefulness of my toy |
| 18:09 | Chousuke | ambient: when consing, foo gets called, then returns the thunk, at which point it's done. then, when someone calls (rest ...), the thunk is evaluated, resulting in another call to foo which again returns just a thunk, etc... |
| 18:09 | tomoj | Anniepoo: just program functionally.. |
| 18:10 | tomoj | if you really want to read-line in the repl, it seems you can get it to work by going to the inferior lisp buffer to type in the input, but it seems to chop off the first character |
| 18:10 | Anniepoo | no, this is the 'repl' loop of a toy trainer , I need a loop - it's the UI |
| 18:10 | Anniepoo | thanks tomoj |
| 18:11 | Chousuke | can't you use your own repl function? |
| 18:11 | tomoj | I think you shouldn't use your repl within slime's repl |
| 18:11 | Anniepoo | no, no, I want to MAKE a repl like function - it shows you the docstring for a function, you type in the function name, - to learn clojure libs |
| 18:12 | tomoj | that doesn't sound like a repl to me :) |
| 18:12 | tomoj | but yeah, why run it within slime? |
| 18:13 | Anniepoo | of course -read, evaluate (did they get it right?) then print |
| 18:13 | Anniepoo | cause I'm debugging it? |
| 18:13 | hiredman | … |
| 18:13 | hiredman | sure, sure, *de*bugging |
| 18:13 | Anniepoo | ok, I'm enbugging it |
| 18:22 | ambient | (defn foon [x] (when (> x 0) (lazy-seq (foo (- x 1))))) i still get out of memory error with this :/ |
| 18:22 | powr-toc | are there any simple clojure examples of clojure programs that write simple clojure programs? |
| 18:24 | Anniepoo | ,(def i-write-clojure [a b] '(+ a b)) (i-write-clojure 3 2) |
| 18:24 | clojurebot | DENIED |
| 18:24 | Anniepoo | (that's defn) |
| 18:25 | powr-toc | I'm looking for inspiration/wisdom on how to programmatically write a simple s-exp tree of functions, which can later be executed |
| 18:25 | brool | powr-toc: well, any macro |
| 18:25 | tomoj | it's just lists |
| 18:25 | Anniepoo | ,(defn iwc [a b] '(+ a b)) (iwc 2 3) |
| 18:25 | clojurebot | DENIED |
| 18:26 | Anniepoo | that works at the repl, it's just clojurebot won't let me pollute it's innerds |
| 18:26 | tomoj | that works at your repl??? |
| 18:26 | powr-toc | brool: I know macros can do it, but I'm looking first at doing it without macros |
| 18:26 | tomoj | it doesn't work at my repl |
| 18:26 | Anniepoo | sorry, brain not working |
| 18:27 | Anniepoo | (defn iwc [a b] (list '+ a b))(iwc 2 3) |
| 18:28 | Anniepoo | that does |
| 18:28 | tomoj | or `(+ ~a ~b) |
| 18:28 | tomoj | the simplest way depends on what kind of stuff you want to build up I guess |
| 18:32 | powr-toc | tomoj: well ultimately I'm wanting to compose a filter pipeline, where the vast majority of functions are filters... i.e. it's just a list of functions that take the same argument... I will also need a very basic form of branching |
| 18:33 | tomoj | it seems strange to me to build the clojure code up in lists |
| 18:33 | tomoj | but sometimes you need to do that I guess |
| 18:33 | Anniepoo | ,(doc apply) |
| 18:33 | clojurebot | "([f args* argseq]); Applies fn f to the argument list formed by prepending args to argseq." |
| 18:33 | tomoj | like someone was in here before with a genetic programming thing that built up clojure code as lists |
| 18:34 | powr-toc | tomoj: so what would you suggest? Macros? |
| 18:34 | tomoj | I dunno, I still don't understand what you're trying to do |
| 18:34 | Anniepoo | powr, are you needing apply? like to write some filter-all I'd get the filter funs one by one and do apply with them (or map) |
| 18:35 | tomoj | you mean the functions are fixed and you just want to compose them in different ways? |
| 18:36 | tomoj | you don't need to have clojure write clojure code to do that |
| 18:38 | powr-toc | tomoj: well the idea is to have a restricted language, with a fixed set of filter funs that can be composed in different ways (probably ultimately built by partial application of arguments to more generic functions)... This tree should then form several purposes... 1) be executable 2) be easily processed into other representations, e.g. a graph |
| 18:38 | powr-toc | (by graph I mean a pictoral representation of the tree/program) |
| 18:39 | powr-toc | It should be pretty easy... but I've yet spent enough time with clojure to work it all out |
| 18:39 | powr-toc | s/yet/not-yet/ |
| 18:39 | tomoj | sorry, I still don't understand what you're saying really |
| 18:39 | Anniepoo | check out zippers |
| 18:40 | tomoj | if all you needed was to compose some functions, you can just (apply comp thefunctions) |
| 18:40 | tomoj | to get a function that's the composition |
| 18:40 | Anniepoo | I think you don't really want the tree to be executable, you want to be able to interpret it |
| 18:41 | powr-toc | Anniepoo: what advantage does that have? |
| 18:41 | Anniepoo | he's got a datastructure, he wants to represent it in various ways, one of which is execution |
| 18:42 | Anniepoo | (sorry, thot that was tomoj writing - s/he's/you/) |
| 18:44 | brool | powr-toc: so, given a list of functions, you want to apply predicates, possibly with conditionals? i.e., on numbers, [ (if >0? even?) (if <0? odd?) ] to find even negative and odd positive numbers? |
| 18:44 | brool | whoops, even positive and odd negatives |
| 18:45 | Anniepoo | ok, so you want a function (filter-all [seq-of-filters seq]) that reduces seq by applying each filtern in seq-of-filters in turn? |
| 18:46 | tomoj | that's what I thought too, but that's not a very good tree |
| 18:47 | Anniepoo | pine tree? |
| 18:47 | tomoj | I mean, it's just (foo (bar (baz ...))) |
| 18:47 | tomoj | not a very interesting tree I should say |
| 18:49 | Anniepoo | maybe that's whats wanted - (apply (comp filters) s) |
| 18:49 | tomoj | rather ((apply comp filters) s) I would think |
| 18:49 | Anniepoo | yah, you're right |
| 18:50 | powr-toc | You'd be right if I only needed filtering, but I need to represent it as a tree because I have conditionals... as execution might proceed down different branches... so at the top level I have a value to test... the value gets passed down a series of filters that test criteria... if those criteria pass then it might come to a branch-point, that might (on the basis of another function) randomly decide which branch to pass the value |
| 18:50 | powr-toc | for further evaluation |
| 18:50 | brool | so, it's still a list of filters, where some of the filters are a composition of other functions |
| 18:50 | tomoj | so you're doing logical combinations of predicate functions? |
| 18:51 | powr-toc | and it is those branch points, that make it a tree... and it is those along with the criteria that (amongst other things) I would want to represent pictorially |
| 18:51 | powr-toc | tomoj: yes |
| 18:52 | powr-toc | brool: yes |
| 18:52 | powr-toc | brool: except that I want to be able to draw what the tree of combinations looks like |
| 18:53 | powr-toc | (or at least have it a form that is easy to do such things) |
| 18:54 | tomoj | yeah doesn't sound to me like you want to be producing clojure code |
| 18:55 | brool | powr-toc: yah, the form of '(filter1 filter2 (branch filter3 filter4)) seems amenable |
| 18:55 | powr-toc | brool: that's the form I'm looking at |
| 18:56 | powr-toc | or perhaps more like '(filter1 filter2 (branch '(filter3 filter4) '(filter5 filter6))) |
| 18:56 | tomoj | eh |
| 18:56 | tomoj | I must be too tired |
| 18:56 | tomoj | I have no idea what you two are talking about :) |
| 18:57 | powr-toc | tomoj: haha... I had no idea I was so bad at explaining things... You can't be the only one ;-) |
| 18:57 | brool | branch just applies one set of filters or another, based on a conditional, i think |
| 18:57 | powr-toc | brool: exactly |
| 18:57 | tomoj | but where's the conditional |
| 18:58 | Anniepoo | so, powr, your filters might be something like |
| 18:59 | Anniepoo | (beanie-babies? tacos? (or lemons? unguents?) rats?) |
| 19:00 | tomoj | the way I understood it makes it difficult to write in something like boolean logic |
| 19:01 | tomoj | maybe it would help if you gave us an example :+ |
| 19:01 | Anniepoo | (powr, the pain goes down with time) |
| 19:02 | Anniepoo | ok, all, I've written a little file in emacs/slime, now how do I load the buffer? |
| 19:02 | brool | Ctrl-C Ctrl-L, I think? should be on the menu |
| 19:02 | Anniepoo | ah, ok, thanks |
| 19:02 | Anniepoo | the menu forces me into bad places (a winders file dialog) |
| 19:04 | tomoj | C-c C-k |
| 19:04 | ambient | wait, is (not (= x)) only way to test not equal? |
| 19:04 | ambient | (not (= x 0)) |
| 19:04 | brool | ambient: (not= x 0) |
| 19:04 | ambient | ok ty |
| 19:17 | Anniepoo | no clojure.contrib in my classpath for slime |
| 19:21 | brool | Anniepoo: did you add (setq swank-clojure-extra-classpaths ...)? |
| 19:21 | Anniepoo | no, that goes in .emacs? |
| 19:21 | Anniepoo | and does it literally have an ellipsis in it? |
| 19:22 | tomoj | clojure-install set that up magically for me I guess :/ |
| 19:22 | brool | no, i was eliding for brevity. i set mine up on Mac OS and it was kind of a pain |
| 19:22 | brool | let me paste me .emacs somewhere, sec |
| 19:22 | Anniepoo | thanks |
| 19:23 | tomoj | I think if it's unset you can just drop the jar in ~/.clojure |
| 19:23 | tomoj | whatever ~ means on windows |
| 19:23 | lisppaste8 | brool pasted ".emacs for slime/clojure" at http://paste.lisp.org/display/86395 |
| 19:23 | Anniepoo | thanks |
| 19:24 | tomoj | that last line seems strange to me |
| 19:24 | tomoj | isn't that the default? |
| 19:24 | brool | tomoj: wasn't working without it, but i might have a strange configuration |
| 19:25 | brool | seems strange you'd have to add it explicitly, i admit |
| 19:26 | tomoj | oh hmm |
| 19:26 | powr-toc | brool: tomoj: sorry... got interrupted by the misses... |
| 19:26 | tomoj | actually seems the default is to take clojure-src-root and stick on /clojure-contrib-src/ |
| 19:27 | tomoj | er, /clojure-contrib/src/ |
| 19:27 | Anniepoo | I had an install with a lot of problems, somebody turned me on to clojure box and I installed that |
| 19:27 | tomoj | oh.. dunno anything about clojure box |
| 19:28 | Anniepoo | strangely, I can't FIND a .emacs now |
| 19:32 | powr-toc | tomoj: branch would be a type of conditional... it would force evaluation down one of the branches on the basis of the value passed in |
| 19:35 | powr-toc | Though those values have been ommited from the sexp I showed above... as I thought they'd be supplied by apply or -> or some such |
| 19:45 | ambient | getting stack overflow errors with loop/recur.. wth :/ |
| 19:49 | Anniepoo | clojurebot: paste |
| 19:49 | clojurebot | lisppaste8, url |
| 19:49 | lisppaste8 | To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste. |
| 19:50 | ambient | nah, i got emacs macro for that :D |
| 19:51 | lisppaste8 | Anniepoo pasted ".emacs" at http://paste.lisp.org/display/86397 |
| 19:53 | Anniepoo | it's expecting a list? |
| 19:54 | ambient | try / instead of \\ |
| 19:54 | Anniepoo | I suspect emacs would be cool if it worked, but it doesn't |
| 19:56 | Anniepoo | forward slashes didn't help |
| 19:56 | lisppaste8 | ambient pasted "prime number gen stack problems" at http://paste.lisp.org/display/86398 |
| 19:56 | ambient | cant even get 1M primes :/ |
| 20:00 | hiredman | ambient: I would suggest going back through the pastes in #clojure, there must be about 1M methods for finding primes |
| 20:00 | hiredman | I imagine everyone in the channel is sick of it (maybe it's just me) |
| 20:00 | ambient | my problem isnt finding primes but learning clojure while writing code for finding primes |
| 20:00 | ambient | yeah ok |
| 20:00 | ambient | i shall look around |
| 20:01 | ambient | im sure nobody hasnt done huffman compression? :p thats my next step |
| 20:01 | hiredman | http://paste.lisp.org/list/clojure if your not familiar with paste.lisp |
| 20:01 | Anniepoo | anybody know where I might find documentation for swank-clojure-extra-classpaths?? |
| 20:03 | ambient | doesnt that thing have a search functionality? |
| 20:05 | hiredman | google? |
| 20:06 | hiredman | http://delicious.com/search?p=prime&chk=&context=userposts|clojurebot|lisppaste8&fr=del_icio_us&lc=0 |
| 20:07 | brool | ambient: http://paste.lisp.org/display/69952 |
| 20:08 | ambient | those things dont really solve my original problem, which was to find out the reason for running out of stack, but it might be better to continue this tomorrow |
| 20:09 | Anniepoo | ok, adding (list ) around it fixed the error, but addign that to my emacs isn't curing the problem |
| 20:09 | Anniepoo | ,(require 'clojure.contrib) |
| 20:09 | clojurebot | java.io.FileNotFoundException: Could not locate clojure/contrib__init.class or clojure/contrib.clj on classpath: |
| 20:10 | Anniepoo | same message I get |
| 20:12 | hiredman | well |
| 20:12 | hiredman | there is such thing as clojure.contrib |
| 20:12 | hiredman | so that is exactly correct |
| 20:13 | Anniepoo | ?? |
| 20:13 | hiredman | there are a bunch of namespaces that start with clojure.contrib |
| 20:13 | Anniepoo | ah! |
| 20:13 | Anniepoo | Aaaargh! |
| 20:13 | Anniepoo | LOL |
| 20:13 | Anniepoo | ok, I've been blaming emacs |
| 20:15 | brool | Anniepoo: that's M-x blame-emacs |
| 20:16 | Anniepoo | when I type that it writes a bunch of i-nodes into my NTFS file system |
| 20:31 | Anniepoo | ok, I can load my toy program, but can't get the repl to figure out where it is |
| 20:32 | Anniepoo | as in funfun is my namespace, but (require 'funfun) complains it can't find it |
| 20:32 | Anniepoo | ah! |
| 20:35 | powr-toc | does the mantra "use exceptions for exceptional conditions" apply in idiomatic clojure, or is it acceptable to signal other events whilst unwinding the stack? |
| 20:35 | powr-toc | with exceptions? |
| 20:36 | Anniepoo | it's very rare to throw exceptions in clojure |
| 20:36 | Anniepoo | it's a functional language, you're always 'unwinding the stack' |
| 20:46 | powr-toc | Anniepoo: what about error-kit then? |
| 20:47 | Anniepoo | error-kit? |
| 20:47 | Anniepoo | sorry, i just rebooted |
| 20:47 | Anniepoo | ah, the issue of exceptions |
| 20:48 | powr-toc | clojure.contrib.error-kit ... similar to common lisps condition system |
| 20:48 | Anniepoo | yes, the 'use exceptions for exceptional conditions' applies |
| 20:51 | Anniepoo | this is stupid |
| 20:51 | Anniepoo | attempting to load the file directly at the repl fails |
| 21:13 | Anniepoo | is ; a comment in elisp? |
| 21:13 | brool | yes |
| 21:14 | Anniepoo | thank you |
| 21:16 | Anniepoo | 8cD got paredit working, now if only I could run my program from within emacs |
| 21:18 | Anniepoo | I've got some bug - it's throwing an exception. But the stack trace doesn't give a clue where it is |
| 21:19 | Anniepoo | (thanks to those helping me deal with emacs 2day) |
| 21:21 | brool | did you try (.printStackTrace (.getCause *e))? |
| 21:21 | brool | Anniepoo: honestly, it's worth it once everything's working! |
| 21:22 | brool | or, if slime pops up the exception, you can hit "0" to get the root cause, usually |
| 21:22 | Anniepoo | ah! thanks! that's what that's for |
| 21:23 | Anniepoo | I keep getting bufferes with error messages |
| 21:23 | Anniepoo | I have to quit out of emacs every 10 mins to clear out all those buffers |
| 21:23 | Anniepoo | is there a way to get rid of them? |
| 21:26 | hiredman | stop doing things to generate errors? |
| 21:27 | Anniepoo | format /f c: ? become Amish? |
| 21:27 | brool | If you become Amish first, you don't need to format. More efficient. |
| 21:28 | brool | I think Q? or one of the number keys? iirc it says in the exception window how to close it. |
| 21:28 | Anniepoo | If I were Amish I'd be struggling with a wagon wheel that kept coming loose |
| 21:28 | Anniepoo | can't get away from technical issues |
| 21:29 | kylesmith_ | Is anyone here familiar with Incanter? |
| 21:30 | kylesmith_ | I'm trying to use non-local-model. It works for a toy example, but I'm getting divide by zero on other data. |
| 21:30 | brool | Probably be the same type of conversation anyway. "Oh, you're on 1.01 of the wagon wheel? You'll need to install 1.02 and make sure that your axle path is all set up properly." |
| 21:30 | Anniepoo | ok, I've got paredit, and I'm trying to turn s into (vec s) - is there a way to do this without retyping s? |
| 21:32 | liebke | kylesmith_: do you mean non-linear-model? do you have more details? |
| 21:33 | nsel | Anniepoo: put the cursor before s and do M-(. Also, try reading the docs... |
| 21:33 | kylesmith_ | oh yeah, non-linear-model. |
| 21:33 | Anniepoo | sorry - found it, it's called "depth changing commands" |
| 21:34 | kylesmith_ | I'm trying to it to fit parameters for classical molecular dynamics. |
| 21:34 | liebke | kylesmith_: were you using the default :guass-newton option or :newton_raphson? |
| 21:35 | kylesmith_ | I used a homegrown optimization function before, so I don't think the problem is in my code. |
| 21:35 | kylesmith_ | I just tried both. |
| 21:35 | liebke | same error in both cases? |
| 21:35 | kylesmith_ | yep |
| 21:36 | liebke | have you tried different starting values? (I'm trying to see if I can track down where the problem might be) |
| 21:37 | nsel | yeah the paredit docs are a little confusing, probably just because it's a hard thing to explain in a text file |
| 21:37 | kylesmith_ | well, my starting values should be reasonable, but let me play around with it |
| 21:37 | liebke | I'm sure they are, I'm just trying to see were my code is having a problem |
| 21:38 | liebke | maybe try reducing :max-iter (which defaults to 200). I need to make that function more robust, obviously :) |
| 21:45 | kylesmith_ | still calculating... my code is slow (I haven't done any performance optimization yet) |
| 21:47 | kylesmith_ | I included an arbitrary offset in my potentials (to compare between different programs). I just adjusted it such that the initial sum of squares would be much closer to zero. It crashed right away before, but it's still going. *crosses fingers* |
| 21:48 | liebke | I'll have to sign off soon, but you can email me, liebke at gmail. I haven't looked at the optimization library for a while, but I'll see if I can figure what the problem is on my side. |
| 21:49 | kylesmith_ | Cool, I'll email you a stack trace if it happens again. |
| 21:49 | liebke | thanks, good luck! |
| 21:49 | Anniepoo | @nsel - yah, I'm trying to find answers myself first, probably less so now, I'm at the end of a frusttrating 56 hours of fighting emacs |
| 21:49 | Anniepoo | (5 hour, not 56 =8c)) |
| 21:52 | nsel | it'll be 56 by the end of next week :) emacs is incredible but boy is it frustrating. It keeps going deeper and getting cooler until you're far enough in you can't ever use another editor because of what you'd be giving up, but you're not to the point where your emacs *works right* yet. |
| 21:54 | nsel | anyway didn't mean to bite your head off |
| 21:54 | Anniepoo | in total I'm about 35 hours in |
| 21:54 | Anniepoo | np |
| 21:56 | Anniepoo | I wonder if there are enough people in the bay area going thru this now to justify a get-together-and-slam-heads-collectively thing |
| 22:07 | Anniepoo | aaargh..... |
| 22:14 | prospero_ | so I just installed Snow Leopard, and my GPGPU benchmark is now running 10x faster |
| 22:14 | prospero_ | 100x faster than Java |
| 22:14 | prospero_ | how about that |
| 22:16 | mattrepl | nice |
| 22:17 | prospero_ | I already knew it was spending the majority of the time waiting to talk to the graphics card |
| 22:17 | prospero_ | I just figured it was a hardware limitation |
| 22:18 | Anniepoo | is this thru CUDA? |
| 22:19 | prospero_ | GLSL |
| 22:19 | prospero_ | http://ideolalia.com/performance-in-clojure-and-factor |
| 22:23 | Anniepoo | yah, this is great! |
| 23:14 | technomancy | so are auto-gensyms only guaranteed to be consistent within a single backquote form? |
| 23:14 | technomancy | I've got a backquote inside a ~ inside a backquote with a let binding in the first backquote that I want to reference in the second. |
| 23:14 | technomancy | but it generates a different sym |
| 23:22 | hiredman | yes |
| 23:22 | technomancy | I think what I'm trying to do is ill-adivsed. =) |
| 23:23 | technomancy | I'm trying to generate a proxy form that implements methods from functions provided in a map. |
| 23:24 | hiredman | makes sense to me |
| 23:24 | Chouser | technomancy: proxy is a great base material to build things on. |
| 23:24 | Chouser | note though that it actually uses a map internally that you're allowed to manipulate -- you might not even need a macro. |
| 23:26 | hiredman | ,(doc init-proxy) |
| 23:26 | clojurebot | "([proxy mappings]); Takes a proxy instance and a map of strings (which must correspond to methods of the proxy superclass/superinterfaces) to fns (which must take arguments matching the corresponding method, plus an additional (explicit) first arg corresponding to this, and sets the proxy's fn map." |
| 23:26 | technomancy | I just mean my nested backquote was probably ill-adivsed |
| 23:26 | technomancy | ooh. |
| 23:26 | technomancy | that's nice. |
| 23:26 | technomancy | thanks |