2009-10-08
| 00:00 | hiredman | dunno |
| 00:01 | hiredman | generally if you get disconnected and reconnect, but your ghost is still hanging around, irc servers give you nick_ |
| 00:01 | itistoday | ah gotcha |
| 00:02 | itistoday | well thanks, gotta go |
| 00:04 | hecktor | Is there a command from within the repl to reset the state of the repl? |
| 00:32 | rongenre | so if I have a hash-map. eg {:a 1, :b 2} |
| 00:33 | rongenre | ,{:a 1 :b 2} |
| 00:33 | clojurebot | {:a 1, :b 2} |
| 00:33 | rongenre | I can turn it into pairs with seq |
| 00:33 | rongenre | ,(seq {:a 1 :b 2}) |
| 00:33 | clojurebot | ([:a 1] [:b 2]) |
| 00:33 | rongenre | how do I turn it back (easily, I can use reduce, but I don't think that's the right way) |
| 00:35 | arbscht | ,(apply merge {} (seq {:a 1 :b 2})) |
| 00:35 | clojurebot | {:b 2, :a 1} |
| 00:35 | rongenre | Nice, I like it. Thanks. |
| 00:35 | arbscht | ,(into {} (seq {:a 1 :b 2})) |
| 00:35 | clojurebot | {:a 1, :b 2} |
| 00:36 | arbscht | ,(reduce conj {} (seq {:a 1 :b 2})) |
| 00:36 | clojurebot | {:b 2, :a 1} |
| 00:37 | arbscht | into is probably the best way |
| 02:01 | Raynes | Wouldn't it be a good idea to have a separate Google Group for job postings? Or some other means of getting job offers to the Clojure community that isn't the primary Google Group? |
| 02:41 | ztellman | just wrote a mandelbrot viewer, if anyone's into that sort of thing |
| 02:41 | ztellman | http://ideolalia.com/exploring-the-mandelbrot-set-with-your-gpu |
| 03:00 | LauJensen | Morning gents |
| 03:05 | Fossi | hi |
| 03:06 | tomoj | LauJensen: are you the clojureql person? |
| 03:06 | LauJensen | Yes sir |
| 03:06 | tomoj | so, is it true that I need to put jars for mysql/postgres/derby/... in lib/ in order to compile clojureql? |
| 03:07 | Fossi | hi |
| 03:08 | tomoj | ah well just got a BUILD SUCCESSFUL so, even if I really didn't need all of them, it's OK :) |
| 03:08 | LauJensen | tomoj, kotarak has almost exclusively set up the build environment - I don't think you need to put them there before running ant, Ivy should fetch whatever is necessary |
| 03:08 | tomoj | wasn't using Ivy, was just doing `ant -Dclojure.jar=...` |
| 03:09 | LauJensen | k, you shouldn't need it for building, it's not nitted in anywhere, you do need your jdbc adapter on the classpath when you actually start interacting with the database |
| 03:09 | tomoj | strange, I got compile errors until I dumped in jars for mysql, postgres, and derby |
| 03:10 | tomoj | oh well, it appears to have worked |
| 03:13 | LauJensen | I should look into that |
| 03:24 | LauJensen | 1: public LabeledComponentGroup(String labelString, JComponent... components) { |
| 03:24 | LauJensen | 2: public LabeledComponentGroup(String labelString, List<JComponent> components) { |
| 03:24 | LauJensen | I haven't seen the ... notation before, what's going on here? |
| 03:28 | tomoj | I believe that just means a variable number of arguments |
| 03:29 | cgrand | the last arg is just an array of JComponent |
| 03:29 | LauJensen | Ok, that would be my guess, but the weird thing is that I cannot instantiate this class ... maybe I'm not getting JComponents... |
| 03:29 | LauJensen | I'll get back to you guys |
| 03:32 | tomoj | LauJensen: so you pass a connection info map to clojureql every time you want to run a query. does it keep an active connection alive in the background, or does it make a new connection on every query? |
| 03:32 | LauJensen | tomoj, You can review our progress on lighthouseapp.com, so far it's a connection that opens and closes which easy body of code, but that's of course unecessary in most cases, so we're trying to agree on a method of resolution |
| 03:35 | tomoj | ah, I see, thanks |
| 03:36 | LauJensen | ,(javax.swing.JComponent.) |
| 03:36 | clojurebot | java.lang.InstantiationError: javax.swing.JComponent |
| 03:37 | LauJensen | http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComponent.html#JComponent() |
| 03:37 | LauJensen | Am I missing something here? |
| 03:42 | Chousuke | LauJensen: I don't think you're supposed to instantiate that |
| 03:43 | Chousuke | it's an abstract class :P |
| 03:44 | jaiganesh | hi |
| 03:44 | LauJensen | So whats the use? When I need to pass it to a constructor like LabeledComponentGroup, is it (#^JComponent (JTextField. x y z)) ? |
| 03:44 | LauJensen | hi |
| 03:44 | Chousuke | LauJensen: Without the extra parens :P |
| 03:45 | LauJensen | No dice |
| 03:45 | LauJensen | I can't instantiate the Labeledgroup |
| 03:45 | LauJensen | 'no matching ctor' |
| 03:46 | jaiganesh | i am reading a file one line at a time using this function |
| 03:46 | jaiganesh | (defn file-lines |
| 03:46 | jaiganesh | [file-name] |
| 03:46 | jaiganesh | (line-seq (BufferedReader. (FileReader. file-name)))) |
| 03:46 | jaiganesh | is there an alternate way in clojure? |
| 03:46 | LauJensen | (map #(do-stuff-to-line %) (.split (slurp "filename") "\n")) |
| 03:47 | Chousuke | LauJensen: it takes a List or an Array of JComponents apparently |
| 03:47 | jaiganesh | LauJensen: thanks a lot |
| 03:48 | LauJensen | Chousuke, aaaah, into-array is my friend, thanks |
| 03:48 | LauJensen | jaiganesh, np |
| 03:48 | Chousuke | LauJensen: or you can just use a plain clojure list |
| 03:48 | Chousuke | since there's a List<JComponent> constructor as well |
| 03:48 | LauJensen | wow |
| 03:48 | jaiganesh | .split can you explain that? |
| 03:49 | jaiganesh | oh ok got it |
| 03:49 | jaiganesh | splitting on newline character |
| 03:49 | Chousuke | slurp doesn't read the file one line at a time though. |
| 03:49 | LauJensen | Chousuke, I gave up when I saw that Vector wasn't unified with [] |
| 03:49 | jaiganesh | yeash slurp read the whole file into a string |
| 03:50 | Chousuke | jaiganesh: if you're using contrib there's the duck-streams library |
| 03:50 | jaiganesh | chousuke:thks will check it out |
| 03:51 | jaiganesh | how to know what functions defined in a library? |
| 03:51 | LauJensen | read the source? |
| 03:51 | tomoj | jeez, I'm getting a segfault with clojureql |
| 03:51 | jaiganesh | yeah thats one way |
| 03:52 | Chousuke | jaiganesh: contrib has documentation accessible via github |
| 03:52 | Chousuke | ~contrib |
| 03:52 | clojurebot | contrib is http://github.com/richhickey/clojure-contrib/tree/master |
| 03:52 | LauJensen | segfault?! |
| 03:53 | tomoj | LauJensen: that's what I thought! didn't even know those could happen in java |
| 03:53 | LauJensen | That has to be something in the jdbc driver you're using |
| 03:53 | Chousuke | it can't :) |
| 03:53 | Chousuke | you're accessing some non-java code. |
| 03:53 | LauJensen | What we do is make AST's and compile those into text, passing that to your driver |
| 03:53 | tomoj | ah, yes, my sqlite JDBC driver |
| 03:53 | LauJensen | That will never give you a segfault |
| 03:55 | tomoj | jaiganesh: you can also do like (ns-interns 'clojure.contrib.duck-streams) |
| 03:55 | tomoj | though the docs on the the gh-pages are easier to read :) |
| 03:59 | jaiganesh | Chousuke:ok |
| 03:59 | tomoj | guess I will just try with postgres |
| 04:00 | jaiganesh | i wana find if a string contains a substring , like "hello" contains "h".. how to do it? |
| 04:03 | tomoj | ,(.contains "hello" "h") |
| 04:03 | clojurebot | true |
| 04:04 | liwp | how do I get to the namespace doc string in the repl. (doc contrib.walk) prints out nil |
| 04:08 | LauJensen | tomoj, in our daily work I use postgres/mysql and kota is more on Derby, those 3 work well |
| 04:09 | LauJensen | We are working on literal strings for the predicate clause to queries, until that's up, there are situations where you need to use 'raw' |
| 04:09 | LauJensen | at least one I can think of anyway |
| 04:10 | LauJensen | (query table [date name value] (> date (- (Date.) (Date. 14 0 0))) or something similar, to pull up dates from the last 14 days, in that case you'd use (raw "SELECT... WHERE >= date(now() - INTERVAL 14 DAY);") |
| 04:14 | tomoj | LauJensen: yay, it works. thanks for making this! |
| 04:14 | clojurebot | for is not used often enough. |
| 04:15 | LauJensen | cool, np |
| 04:49 | tomoj | LauJensen: have you had problems with :auto-inc in postgres? |
| 04:50 | LauJensen | We had a create-table for postgres contributed, which was fundamentally flawed, I rewrote it a few commits ago and it's worked since, also with :auto-inc |
| 04:51 | tomoj | is there something special you have to do to tell create-table to use postgres? |
| 04:51 | tomoj | my tables are created fine but :not-null and :auto-inc seem to be ignored |
| 05:04 | LauJensen | tomoj, sorry, didn't catch your msg before now - You should run the demo, it demonstrates all facets of clojureql |
| 05:19 | tomoj | LauJensen: feel free to ignore me, don't want to bug you. trying to run the demo now but I can't figure out how to. it looks like the demo classes didn't get compiled into the jar, are they supposed to be? |
| 05:21 | LauJensen | I start up a repl, then load clojureql/src/dk/bestinclass/clojureql/demos/mysql.clj for instance, making sure that I have the appropriate user created in the dbms, then eval (-main) |
| 05:22 | LauJensen | That will then execute some 20 operations giving you the output, reading through the code, seeing the output will teach you just about everything you need to know about clojureql |
| 05:24 | crios_ | hello. can anyone clear me the monad-expr documentation? http://github.com/richhickey/clojure-contrib/blob/master/src/clojure/contrib/monads.clj |
| 05:25 | crios_ | :bind and :result should be m-bind and m-result ? |
| 05:25 | crios_ | I mean, :m-bind and :m-result |
| 05:25 | tomoj | LauJensen: thanks, that worked. and the demo successfully make a table with a primary key/serial |
| 05:25 | tomoj | so I must have been doing something wrong |
| 05:26 | LauJensen | Good, then at least now you have some working code to look at |
| 05:26 | tomoj | yep :) |
| 05:28 | crios_ | no Leibniz friend here :) ? |
| 05:29 | tomoj | LauJensen: aha. I simply forgot to require dk.bestinclass.clojureql.backend.postgres |
| 05:29 | tomoj | thanks for your help |
| 05:29 | LauJensen | aah :) np |
| 05:32 | liwp | crios_: yeah, I think you're right |
| 05:33 | liwp | crios_: or possible m-bind and m-return |
| 05:38 | liwp | crios_: but I don't think you need to worry about that with monad-expr, you simply pass in the steps as a binding vector and monad-expr will do the right thing for you |
| 05:41 | crios_ | liwp: thanks. I was trying to understand how domonad works |
| 05:41 | crios_ | The first part in http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/ is really obscure |
| 05:41 | crios_ | (for me) |
| 05:43 | crios_ | I understood that stuff as simply adding what in Java / OO would be a decorator pattern |
| 05:43 | crios_ | with a known interface |
| 05:44 | LauJensen | Am I the only one here who thinks that monads are a complete waste of time? |
| 05:44 | tomoj | I don't understand them yet :( |
| 05:45 | crios_ | Well, I could add, if just could understand their purpose :D |
| 05:47 | crios_ | Its purpose should be adding behaviour to existing functions, so that they can be chained together |
| 05:47 | crios_ | at least, this is my feeling |
| 05:47 | crios_ | what do you think? |
| 05:47 | LauJensen | From what I understood, researchers worked for years on monads, primarily in Haskell, extending, adapting, improving and when they we're done they looked up and saw that Excel had the same properties... ? |
| 05:48 | liwp | ,(use clojure.walk) |
| 05:48 | clojurebot | java.lang.ClassNotFoundException: clojure.walk |
| 05:48 | liwp | ,(use 'clojure.walk) |
| 05:48 | clojurebot | nil |
| 05:48 | liwp | ,(doc clojure.walk) |
| 05:48 | clojurebot | java.lang.ClassNotFoundException: clojure.walk |
| 05:49 | liwp | huh? |
| 05:49 | liwp | (use 'clojure.contrib.base64) |
| 05:49 | liwp | ,(use 'clojure.contrib.base64) |
| 05:49 | clojurebot | nil |
| 05:49 | liwp | ,(doc clojure.contrib.base64) |
| 05:49 | clojurebot | java.lang.ClassNotFoundException: clojure.contrib.base64 |
| 05:49 | liwp | ,(doc map) |
| 05:49 | clojurebot | "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments." |
| 05:50 | LauJensen | liwp, you can query clojurebot directly and play with him there, or alternatively, open a REPL locally and experiment |
| 05:51 | G0SUB | LauJensen: btw, where can I get the code of Clojurebot? |
| 05:51 | LauJensen | clojurebot, where are you? |
| 05:51 | G0SUB | whoops! |
| 05:51 | LauJensen | ~where are you? |
| 05:51 | clojurebot | http://github.com/hiredman/clojurebot/tree/master |
| 05:52 | G0SUB | nice |
| 05:56 | crios_ | still regarding http://github.com/richhickey/clojure-contrib/blob/master/src/clojure/contrib/monads.clj , I don't understand what the let in 'add-monad-step' do |
| 05:57 | crios_ | let [[bform expr] step] |
| 05:57 | crios_ | What does it do? |
| 05:59 | crios_ | the parameter mexpr is splitted in [bform expr] , correct? |
| 06:03 | liwp | LauJensen: I've done the playing locally, I just wanted to verify that clojure bot shows the same problem |
| 06:03 | liwp | LauJensen: try (doc clojure.walk) in your repl |
| 06:03 | liwp | do you get a doc string? |
| 06:04 | tomoj | is there a good way to define methods for multimethods in namespaces out of your control? |
| 06:05 | liwp | crios_: yeah, the let binding destructures a vector and binds the first element to bform and the second element to expr |
| 06:05 | LauJensen | liwp, I have no clojure.walk |
| 06:06 | liwp | LauJensen: you don't? are you on HEAD? I think it might have been clojure.contrib.walk in earlier |
| 06:06 | arbscht | crios_: step is destructured, not mexpr |
| 06:07 | liwp | LauJensen: anyhow, doc does not return a doc string for the name space even though one exists |
| 06:07 | LauJensen | I'm in a 2 weeks old snapshot |
| 06:07 | LauJensen | ~def walk |
| 06:07 | clojurebot | Excuse me? |
| 06:07 | LauJensen | ~def println |
| 06:08 | LauJensen | liwp, it's not in core |
| 06:09 | liwp | LauJensen: hmm, mine is src/clj/clojure/walk.clj |
| 06:09 | LauJensen | aaah, I see the problem |
| 06:09 | LauJensen | look in the top of that file :author "Stuart Sierra" :D |
| 06:09 | liwp | LauJensen: but back to the namespace doc string: I can see a doc string for example for clojure.contrib.base64 and I'm trying to figure out why it doesn't work for clojure.walk |
| 06:10 | liwp | LauJensen: why is that a problem? |
| 06:10 | LauJensen | (use 'clojure.walk) |
| 06:10 | LauJensen | ,(use 'clojure.walk) |
| 06:10 | clojurebot | nil |
| 06:10 | LauJensen | ,(doc walk) |
| 06:10 | clojurebot | "([inner outer form]); Traverses form, an arbitrary data structure. inner and outer are functions. Applies inner to each element of form, building up a data structure of the same type, then applies outer to the result. Recognizes all Clojure data structures except sorted-map-by. Consumes seqs as with doall." |
| 06:11 | liwp | that works for me too, but (doc clojure.walk) does not return the docstring for the namespace |
| 06:13 | LauJensen | Weird |
| 06:14 | cgrand | LauJensen: clojure.walk is more than 2 weeks old |
| 06:14 | LauJensen | cgrand, can you fetch the doc string for it from your repl? |
| 06:17 | cgrand | LauJensen: yes. Are you running a compiled clojure? |
| 06:18 | StartsWithK | liwp: you didn't compile your clojure-contrib but you have compiled version of clojure.walk? aot removes namespace metadata, i think its a known bug |
| 06:19 | liwp | StartsWithK: I think I've got compiled versions of both, but I might be wrong |
| 06:19 | liwp | anyhow, that would explain it |
| 06:19 | liwp | thanks |
| 06:19 | LauJensen | good catch |
| 06:20 | tomoj | is this a bad idea? https://gist.github.com/05542a0687e908fe2042 |
| 06:20 | Chousuke | there's a macro like that in contrib |
| 06:20 | Chousuke | (doc with-ns) |
| 06:20 | clojurebot | "clojure.contrib.with-ns/with-ns;[[ns & body]]; Evaluates body in another namespace. ns is either a namespace object or a symbol. This makes it possible to define functions in namespaces other than the current one." |
| 06:21 | Chousuke | tomoj: also, you don't need the # for bindings outside the syntax-quote :P |
| 06:22 | tomoj | ah, yes |
| 06:22 | tomoj | well since it's in contrib I guess it's not evil? |
| 06:22 | Chousuke | I dunno |
| 06:22 | tomoj | I just want to define extra methods for multimethods in some other namespace |
| 06:22 | Chousuke | you should be able to do (defmethod othernamespace/multi ...) |
| 06:23 | liwp | I've got clojure-contrib/src and clojure-contrib/classes in my classpath before clojure-contrib.jar so that might explain it |
| 06:23 | liwp | maybe I should only have the jar file in my classpath... |
| 06:27 | tomoj | Chousuke: great, thanks |
| 06:27 | tomoj | I tried (defn othernamespace/foo ...) (where foo wasn't in the other namespace) and got an error, and for some reason assumed that meant I couldn't (defmethod othernamespace/bar ...) (where bar IS in the other namespace) |
| 06:36 | tomoj | LauJensen: shouldn't compile-sql-alter dispatch on the class of db, like compile-sql does? |
| 07:29 | LauJensen | alter is currently being reworked completely |
| 07:29 | LauJensen | @ tomoj |
| 07:59 | AWizzArd | ~max people |
| 07:59 | clojurebot | max people is 182 |
| 08:10 | tomoj | LauJensen: ah, ok. I'll check out the logs |
| 08:33 | ambient | anyone know what tech Penumbra uses? seems that it doesn't use CUDA or any of that. |
| 08:44 | liwp | ambient: OpenCL? |
| 09:06 | ambient | doubtful, because opencl doesn't seem to have even C libraries yet for most platforms |
| 09:09 | jdz | ambient: you could as well go check the source code on github instead of guessing |
| 09:10 | ambient | well i already read through the code, but seems i have to read opengl api now also |
| 09:30 | Dawgmatix | whats used to write the documentation available on clojure.org ? and whats used to do the syntax highlighting of the examples ? |
| 09:56 | chouser | clojure.org is a wikispaces site, so it uses their markup. The coloring is done by a javascript file I believe. |
| 10:07 | ffailla | do clojure sets maintain insertion order? |
| 10:08 | liwp | no |
| 10:08 | liwp | you can use ordered sets for that |
| 10:08 | liwp | I think they maintain insertion order |
| 10:08 | chouser | sorted sets maintain sorted order |
| 10:09 | chouser | ,(sorted-set 4 2 5 3 1 3 2) |
| 10:09 | clojurebot | #{1 2 3 4 5} |
| 10:09 | ffailla | sorted sets incur the cost of sorting per insertion correct? |
| 10:09 | liwp | chouser: so there is no set that maintains insertion order? |
| 10:10 | chouser | liwp: nothing it Clojure anyway -- dunno if Java has something like that. You can use a vector or a list of course, if you don't mind the O(n) search time. |
| 10:11 | chouser | ffailla: sure, it's a red-black tree. |
| 10:11 | Chousuke | is that possible in the first place? :/ |
| 10:11 | chouser | probably. you might be able to cook up some combination of a map and a vector or something |
| 10:12 | chouser | actually, finger trees would do it I think. |
| 10:12 | Chousuke | how's your implementation doing? |
| 10:12 | chouser | O(1) insert keeping insertion order, O(log n) lookup. |
| 10:13 | tomoj | how fast are clojure sets at lookup? |
| 10:13 | crios_ | liwp: in Java you can use LinkedHashSet |
| 10:13 | liwp | crios_: thanks |
| 10:13 | crios_ | http://java.sun.com/j2se/1.4.2/docs/api/java/util/LinkedHashSet.html |
| 10:14 | chouser | Chousuke: not bad -- pretty much all working, just needs some performance improvements. |
| 10:14 | liwp | chouser: your impl relies on newnew? |
| 10:15 | chouser | liwp: yes |
| 10:15 | chouser | tomoj: hash-sets are essentially O(1) lookup. sorted-sets are O(log n) |
| 10:23 | tomoj | anyone done migrations in clojure? |
| 10:23 | tomoj | by that I mean database schema migrations |
| 11:43 | andysp | how to restart nagios? |
| 11:51 | replaca_ | ztellman: are you lurking? |
| 11:51 | ztellman | replaca_, yeah |
| 11:52 | ztellman | trouble running the mandelbrot demo? |
| 11:52 | replaca_ | sick of c#, eh? :-) |
| 11:52 | replaca_ | ztellman: do you know who replaca_ is? |
| 11:52 | ztellman | replaca_, no |
| 11:53 | replaca_ | ztellman: clue: I wrote the clojure pretty printer |
| 11:53 | ztellman | ah, gotcha |
| 11:53 | replaca_ | so I just wanted to give you some grief when I saw you in channel after I heard you were sick |
| 11:54 | ztellman | yeah, I'm trying to figure out whether to come into work today |
| 11:54 | replaca_ | don't - we don't want to share our germs this year |
| 11:54 | replaca_ | plus you're about to have vacation |
| 11:54 | ztellman | yeah |
| 12:32 | technomancy | so it looks like the JDK is has primitives for reading zip files, but it doesn't seem to have any actually useful "unzip this file into this location" methods... |
| 12:32 | technomancy | is there anything like that for Clojure? maybe in contrib? |
| 12:33 | tomoj | LauJensen: is there supposed to be a way to make multiple columns NOT NULL? |
| 12:33 | technomancy | probably should be in contrib if it's not already |
| 12:43 | cow-orker | inconsistent? on a sorted-map I'm allowed to run first and rest, but not destructure in let. (let [[x & xs] (sorted-map 1 2 3 4)] nil) |
| 12:43 | cow-orker | java.lang.UnsupportedOperationException: nth not supported on this type: PersistentTreeMap |
| 12:43 | clojurebot | ☕ |
| 12:46 | corruptmemory | deploying latest devastator to QA |
| 12:46 | corruptmemory | oops, wrong window |
| 12:46 | corruptmemory | carry on |
| 12:52 | rsynnott | clearly, corruptmemory works for a company which makes weapons for bad scifi books |
| 12:53 | corruptmemory | Alas, not far from the truth, although no weapons. Merely the other engineers here like to name things after Transformers, perhaps just as bad. |
| 12:54 | rsynnott | (happily, in the real world weapons either have non-threatening names, like Polaris, or meaningless names, like SS-18) |
| 12:55 | ambient | Carebear stare V9 |
| 12:56 | cow-orker | or maybe not "inconsistent" as there is no reader syntax for sorted-map. But it would have been nice anyway... some destructuring syntax that works with first/rest? anyway...no big deal :) |
| 12:56 | rsynnott | or downright deceptive names; Blue Peacock is a nuclear landmine filled with chickens, not peacocks, presumably for cost reasons |
| 13:01 | JAS415 | anyone have experience with pneumbra? |
| 13:01 | JAS415 | i'm trying to get it set upand having trouble |
| 13:01 | JAS415 | not sure what i'm doing wrong |
| 13:02 | replaca_ | JAS415: ztellman is your guy. He's around here sometimes |
| 13:02 | JAS415 | ok |
| 13:02 | ztellman | yeah, I'm here |
| 13:02 | ztellman | what kind of problem are you having? |
| 13:03 | JAS415 | well i'm on linux, and i'm getting an 'unsatisfied link error' |
| 13:03 | JAS415 | that my nativewindow_jvm isn't on the library path |
| 13:03 | JAS415 | interesting thing is all of the things in my library path have lib prepended to them |
| 13:03 | ztellman | are you using the startup script from the wiki? |
| 13:04 | JAS415 | so its libnativewindow_jvm |
| 13:04 | JAS415 | trying to |
| 13:04 | ztellman | hmm |
| 13:04 | ambient | i do -Djava.library.path=c:\path\to\penumbra\lib\windows |
| 13:05 | JAS415 | oh |
| 13:05 | JAS415 | maybe the ~ is screwing it up |
| 13:05 | ztellman | yeah, you generally have to give the full path |
| 13:06 | ztellman | seems like you shouldn't need to, but you do |
| 13:08 | JAS415 | it is literally supposed to be something like "/home/jon/pneumbra/lib/linux" ? |
| 13:09 | ztellman | yeah, though you transposed some characters in "penumbra" |
| 13:09 | ztellman | in case that was a copy/paste |
| 13:10 | JAS415 | well there's a problem |
| 13:12 | JAS415 | thanks, now it works |
| 13:12 | ztellman | great |
| 13:12 | ztellman | let me know if you have any other issues |
| 13:23 | tomoj | is it bad that I want to call a function whose namespace is known only at runtime? |
| 13:24 | tomoj | I guess I can just eval it, but it seems wrong :( |
| 13:27 | hiredman | ,((resolve (symbol "clojure.core" "+")) 1 2) |
| 13:27 | clojurebot | 3 |
| 13:27 | tomoj | ah, thanks |
| 13:28 | tomoj | I was trying stuff like #'(symbol ...) and realized that was idiotic, then gave up |
| 13:30 | ngoc | How to start REPL and evaluate something right after (or before) REPL is started? I want to both run a .clj file and hava REPL at the same time |
| 13:35 | ambient | i use emacs for that |
| 13:35 | ambient | or some other ide |
| 13:36 | Chousuke | ngoc: java -cp clojure.jar clojure.main --help :) |
| 13:36 | ngoc | I want to design a "make start" target that starts the program, and still gives REPL so that the user can interact with the program |
| 13:37 | Chousuke | you can start a repl with a startup script |
| 13:40 | ambient | anyone have tips for fast buffer switching in emacs? |
| 13:41 | funkenblatt | C-x <right>? |
| 13:41 | funkenblatt | or left |
| 13:41 | ambient | well i got like 40 buffers open but want to just switch between 4 or 5 |
| 13:41 | funkenblatt | oh |
| 13:41 | funkenblatt | well for that i usually just open up 4 or 5 windows |
| 13:42 | ambient | some kind of a keybind/tab-bar system would be highly useful |
| 13:43 | ambient | M-x bind-buffer M-1 foo.clj M-2 bar.clj etc.. |
| 13:43 | funkenblatt | it might exist already |
| 13:43 | rdd | check out iswitchb-mode or ido-mode |
| 13:45 | rdd | hm, they're not like what you suggested, but better than the default buffer switching function imo |
| 13:46 | tomoj | ido and friends are great |
| 13:50 | funkenblatt | well anyway it wouldn't be hard to write something like what ambient said |
| 13:51 | technomancy | ambient: yeah, ido is the way to go |
| 13:51 | ambient | somekind of a priority list for autobinding would be kinda sweet also, the most used files bubbling onto the top, or manually defining the priorities |
| 13:51 | ambient | ok, thx. i shall read about ido then |
| 13:52 | technomancy | ido puts the most recently accessed at the front |
| 14:05 | danlei | I use a mix of ido-switch-to-buffer, winner-undo, and C-x r w / C-x r j |
| 14:07 | danlei | (C-x r w is especially helpful if I want to preserve a split of file+repl, when using different languages) |
| 14:08 | danlei | bookmarks are nice too, but another story |
| 14:18 | drewr | I use elscreen |
| 14:18 | konr | Are there other screencasts besides Rich's? |
| 14:18 | drewr | each "screen" is a different window config |
| 14:18 | drewr | keeps me sane switching between emacs and the terminal |
| 14:19 | drewr | C-z always does what I expect |
| 14:19 | technomancy | konr: there's PeepCode (not free) |
| 14:19 | technomancy | konr: and there's a few very introductory ones on youtube |
| 14:20 | konr | technomancy: hmm, is peepcode worth it? |
| 14:20 | technomancy | konr: I think so, but since I wrote it I just might be biased. =) |
| 14:20 | konr | technomancy: haha |
| 14:20 | technomancy | most reviews were pretty positive though. |
| 14:32 | danlei | drewr: what's the difference to C-x r w then? |
| 14:47 | mrsolo | knor: this is new http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Rich-Hickey-and-Brian-Beckman-Inside-Clojure/ |
| 14:55 | savanni | Hey, I have a really simple JDBC question. |
| 14:56 | savanni | As far as I can tell, I'm supposed to create a connection using the getConnection() method on java.sql.DriverManager. The problem is that when I call (. java.sql.DriverManager (getConnection)), it says that getConnection does not even exist, and I am expecting it to say that getConnection requires more parameters. |
| 14:56 | savanni | Am I going in totally the wrong direction? |
| 14:58 | mrsolo | svanni: i juse clojure.contrib.sql instead of jdbc directly... |
| 14:59 | konr | technomancy: I'm downloading your screencast! Sounds nice! |
| 14:59 | Chousuke | savanni: when it says it doesn't exist it means that it doesn't exist for the parameters you called it with :P |
| 14:59 | technomancy | konr: cool; thanks |
| 15:00 | kotarak | savanni: there is also clojureql |
| 15:01 | savanni | Actually, i'm going to jdbc because there's at least one function, getMetaData, which isn't strictly an SQL function. |
| 15:02 | savanni | Chousuke: does that apply only to java methods? |
| 15:02 | Chousuke | savanni: yeah |
| 15:02 | savanni | Aaaahhhhh. |
| 15:02 | Chousuke | ,(identity 3 4) |
| 15:02 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args passed to: core$identity |
| 15:02 | savanni | Yeah, that's what I was expecting. |
| 15:03 | Chousuke | ,(Math/sqrt 2 3 4 5) |
| 15:03 | clojurebot | java.lang.IllegalArgumentException: No matching method: sqrt |
| 15:03 | rstehwien | konr: is that the Mire screencast from peepcode? It is awesome. |
| 15:03 | konr | rstehwien: yes! There are several interesting screencasts on it. I hope more clojure-related ones show up |
| 15:04 | rstehwien | konr: me too, the more clojure screencasts the better |
| 15:05 | slashus2 | Chousuke: You working on writing the reader in clojure? How is that going? |
| 15:05 | savanni | Booya! Access denied! |
| 15:05 | savanni | Thanks, Chousuke. |
| 15:09 | Chousuke | slashus2: stalled right now, studies interfere. :P |
| 15:11 | kotarak | savanni: you might want to look into show from clojure.contrib.repl-utils |
| 15:12 | savanni | Okay, I'll look at that, too. |
| 15:12 | savanni | I've got access, but it's a deep tree to traverse. |
| 15:14 | wooby | is use of test metadata idiomatic, or should one prefer test-is? |
| 15:15 | Chousuke | wooby: test-is is clojure.test nowadays, so use it :) |
| 15:16 | Chousuke | though you need a git version of clojure for it :/ |
| 15:16 | danlarkin | stuartsierra: got a minute? I'm getting weird behavior with duck-streams/copy |
| 15:17 | wooby | Chousuke: thanks |
| 15:17 | drewr | danlei: elscreen probably uses it underneath |
| 15:17 | danlarkin | stuartsierra: the output file is larger than the input file |
| 15:17 | drewr | danlei: less to keep in my head |
| 15:18 | drewr | just scroll through the tabs at top with C-z C-n |
| 15:18 | danlei | ah, ok |
| 15:33 | dermarius | hello everyone |
| 15:33 | LauJensen | Gents - I'm working on a single namespace little app, where I want to use a few images, how can I avoid using fully qualified paths ? (user.dir = "/home/") |
| 15:33 | LauJensen | hi dermarius |
| 15:33 | dermarius | I'm just trying to get along with emacs and clojure-mode.... but somehow the keystrokes are still a mystery for me |
| 15:34 | dermarius | is there a command to eval the whole buffer? |
| 15:34 | dermarius | C-x C-e seems not to compete with line breaks |
| 15:35 | danlei | dermarius: C-c C-l, C-c C-k the first one loads, the second one loads and compiles. besides, try C-h m in a blojure-mode buffer |
| 15:35 | Marius | ok, thanks... will give it a try |
| 15:35 | danlei | welcome |
| 15:40 | hiredman | LauJensen: if you don't put a '/' as the first element in the path it will not be fully qualified, and that is how you can avoid using fully qualified paths |
| 15:40 | hiredman | … |
| 15:41 | LauJensen | hiredman, does it then guarantee to set user.dir to the directory where java is launched from ? |
| 15:42 | hamza | hey guys, i am building xml from a set using reduce (reduce f [] data) but i get everything wrapped in a vector and that produces empty tag. is there a way to overcome this? |
| 15:42 | hiredman | LauJensen: if you want a nonspecific answer it's best to ask specific questions |
| 15:43 | hiredman | hamza: [] is an emtpy vector, and you are using it as the init value to reduce |
| 15:44 | hiredman | it is hard to say if that is the problem without looking at teh function, but that would be my guess |
| 15:44 | hiredman | LauJensen: by user.dir you mean the java property? |
| 15:45 | hiredman | and you want user.dir to be a relative path or something? |
| 15:46 | LauJensen | hiredman, yea - I just want to be sure, that when I ask people to run the app with java -cp . clojure.main proggy.clj - that it will always find the images in that folder |
| 15:46 | hamza | yeah thats the case function is (reduce (fn [f v] (conj f [:item [:desc (:desc v)]])) [] data) how would you produce an xml? or do i have to call first on the result |
| 15:46 | hiredman | LauJensen: uh |
| 15:46 | hiredman | LauJensen: that folder means the directory java is launched from? |
| 15:46 | LauJensen | yes |
| 15:47 | hiredman | so just user (System/getProperty "user.dir") |
| 15:47 | hiredman | use |
| 15:48 | hiredman | hamza: I've never produceded xml, just consumed it |
| 15:49 | hiredman | but your result is a bunch of xml fragments, I imagine you need to stick them in some kind of containing tag/element/whatever |
| 15:50 | hiredman | what are you using to produce the xml? |
| 15:50 | hiredman | I was thinking clojure.xml/emit or some such, but your format is completely different |
| 15:57 | stuartsierra | danlarkin: I'm back; what's the problem? |
| 15:57 | danlarkin | stuartsierra: the output file is larger than the input file |
| 15:58 | stuartsierra | oooo-kay |
| 15:58 | stuartsierra | What are you copying? File to File? |
| 15:59 | danlarkin | InputStream to Writer |
| 15:59 | stuartsierra | Might be an encoding issue. |
| 16:00 | danlarkin | it's binary data |
| 16:01 | stuartsierra | Then you should be writing to an OutputStream, no? |
| 16:03 | danlarkin | heh, I did not know that |
| 16:04 | stuartsierra | Yes, Reader & Writer are only for character data; InputStream and OutputStream are for binary data. |
| 16:04 | stuartsierra | (copy InputStream Writer) will first convert the content of the input stream to a string using the default encoding. |
| 16:04 | danlarkin | well that would explain it |
| 16:05 | stuartsierra | If you just want to read from an input stream and write to disk, you can use (copy InputStream File) |
| 16:06 | danlarkin | Yep, just made the change and now the tests pass, thanks :) |
| 16:06 | stuartsierra | no problem |
| 16:12 | zakwilson | So let's say I want to use Clojure to make a decent cross-platform GUI that's easy to distribute, and I don't want to tear out my hair. What tools should I be looking at? |
| 16:12 | stuartsierra | zakwilson: a magic lamp? |
| 16:14 | dermarius | :-D |
| 16:15 | triyo | is that like magic pony? |
| 16:16 | dermarius | its like the holy grail, but brighter |
| 16:16 | Chousuke | zakwilson: maybe Qt? :/ |
| 16:16 | dermarius | zakwilson: one could say java already contains a cross-platform GUI... what will be special with the GUI you're thinking about? |
| 16:17 | zakwilson | Qt seems like it would make distribution significantly harder. I was hoping for something that makes Swing nicer to work with. |
| 16:17 | zakwilson | But I didn't phrase the question that way because I don't want to limit my options. |
| 16:18 | fyuryu\ | who "owns" the the Clojure tshirts on zazzle.com? |
| 16:18 | dermarius | one thing which annoys me at swing is how the layout is managed |
| 16:18 | hiredman | Chouser maybe? |
| 16:18 | dermarius | i guess that's why ibm choose to develop SWT |
| 16:19 | hiredman | zakwilson: the #java regulars all seem to swear by swing |
| 16:19 | fyuryu\ | hiredman: thanks. That's what I thought. |
| 16:19 | rstehwien | zakwilson: There is a discussion at the following link that talks about guis. I like the idea of soemthing like the last declarative form or a groovy like gui builder http://stackoverflow.com/questions/233171/what-is-the-best-way-to-do-gui-in-clojure .... I don't like swing much either |
| 16:19 | fyuryu\ | chouser: ping |
| 16:20 | zakwilson | Swing seems like the obvious choice, but using it directly is pretty verbose. |
| 16:20 | Chousuke | contrib also has that miglayout wrapper thing but I don't know if it's any good. |
| 16:20 | rstehwien | zakwilson: mostly I liked swing until I wanted to do a tree or grid. |
| 16:20 | hiredman | rstehwien: the highest voted answer there is bs |
| 16:21 | chouser | fyuryu\: hi |
| 16:21 | rstehwien | hiredman: yeah, I actually liked the lowest voted item |
| 16:22 | fyuryu\ | chouser: hi, does any money from stuff on zazzle.com go to rhickey or is it all sold without any margins? |
| 16:22 | rstehwien | hiredman: my prefs were gui code that is declarative like "(form {:title :on-close dispose :x-size 500 :y-size 450}", a builder, maybe cells, or just straight swing |
| 16:22 | zakwilson | Short answer: write a macro? |
| 16:23 | zakwilson | Ok. I guess I was hoping somebody already had, and tested it well and put it on github or some such. |
| 16:24 | chouser | fyuryu\: none of the profit that zazzle shares has gone anywhere yet. I believe I've promised in the past that it would all go to rich. |
| 16:24 | danlei | rstehwien: yes, cells-gtk for example is a breeze to work with |
| 16:25 | danlei | rstehwien: if you meant a sorta reactive approach with "cells" |
| 16:25 | chouser | fyuryu\: there's hardly been enought to bother about yet. |
| 16:25 | fyuryu\ | chouser: I bought a something at a similar shop, but haven't made the shop itself public. I'm thinking about it. And I guess some cash for rhickey to pay for the servers etc would be nice |
| 16:26 | rstehwien | danlei: do you know if the cells-gtk for CL is similar to the Clojure neman.cells lib http://bitbucket.org/ksojat/neman/ ? |
| 16:27 | fyuryu\ | I don't care about the money anyway, I just wanted something to wear ;-) |
| 16:27 | fyuryu\ | http://dl.getdropbox.com/u/820389/clj02.png |
| 16:28 | hiredman | oooh |
| 16:28 | hiredman | clojure track suits |
| 16:29 | danlei | rstehwien: I never used it, but from what I read in the description, it looks alike, yes |
| 16:30 | rstehwien | danlei: thanks! the neman.cells has moved up on the list of things to look at then... to bad that list is really long ;) |
| 16:30 | danlei | rstehwien: in my opinion this is one of the best approaches to gui programming (at least the nicest I've ever worked with) |
| 16:32 | ambient | there's something for clojure/swing? |
| 16:35 | lisppaste8 | danlei pasted "cells<->fahrenheit" at http://paste.lisp.org/display/88401 |
| 16:35 | danlei | rstehwien: that's for example a fahrenheit celsius converter I did when learning cells-gtk |
| 16:36 | danlei | rstehwien: btw. thanks for to pointer at neman.cells, I'll check it out |
| 16:37 | lisppaste8 | danlei annotated #88401 "correct version" at http://paste.lisp.org/display/88401#1 |
| 16:37 | zakwilson | Paste is Cells-GTK? |
| 16:37 | danlei | yes |
| 16:37 | danlei | *pasted |
| 16:38 | rstehwien | daneli: no problem newman.cells (there is a google groups thread on cells) and miglayout in clojure.contrib might be something close to what I'd like. I'd love a declarative framework for gui but using doto is pretty close |
| 16:39 | danlei | hm ... I don't think so about doto :) |
| 16:40 | technomancy | wouldn't it be handy if file-seq took a string? |
| 16:40 | rstehwien | I'd like a dsl that takes something like this and makes the Swing for me |
| 16:40 | rstehwien | (form {:title :on-close dispose :x-size 500 :y-size 450} |
| 16:40 | rstehwien | [(button {:text "Close" :id 5 :on-click #(System/exit 0) :align :bottom}) |
| 16:40 | rstehwien | (text-field {:text "" :on-change #(.println System/out (:value %)) :align :center}) |
| 16:40 | rstehwien | (combo-box {:text "Chose background colour" :on-change background-update-function |
| 16:40 | rstehwien | :items valid-colours})]) |
| 16:41 | rstehwien | daneli: code pasted not mine or my ideal, just snagged for example. I've been spoiled by declaritive frameworks in Adobe Flex (sucks in its own way but nice to declare a gui) |
| 16:45 | danlei | rstehwien: I think cells-gtk (and maybe neman.cells) comes close. what I find most convenient is that you don't have to handle callbacks and such, just say what something contains and it updates automagically, that's the big win |
| 16:46 | danlei | as far as kt's cells is concerned, he describes it as "spread cheet" like approach |
| 16:47 | danlei | so, there would be no "on change", for example |
| 16:47 | danlei | just say what goes there, and if it changes, it's not your problem :) |
| 16:48 | danlei | (as in my pasted example) |
| 16:48 | rstehwien | danlei: That does sound nice. Flex has the ability to bind data in a similar fashion so that when the data changes the UI is updated and vice versa |
| 16:48 | danlei | yes, that's exactly what I mean |
| 16:48 | rstehwien | danlei: and data binding is a big win |
| 16:48 | StartsWithK | neman.cells is broken :/ never updated it to new watchers |
| 16:48 | danlei | I think that's THE way to handle guis (at least for a great part) |
| 16:49 | StartsWithK | is there a interest in more feature rich (and working) version of cells? |
| 16:49 | danlei | I still have to look at it, but generally: sure |
| 16:49 | rstehwien | danlei: I agree. Once you have that level of data binding it is hard to go back to having to do it yourself |
| 16:49 | danlei | (look at neman, that is) |