2010-05-09
| 00:02 | _brian2_ | I think you define java exceptions for anything |
| 00:05 | sids | that's left to the library author to decide |
| 00:05 | _brian2_ | which uses a wrapper around the java (html/html-resource (java.net.URL. url)) |
| 00:06 | _brian2_ | well, they haven't addressed this problem |
| 00:08 | technomancy | hugod: have you gotten trunk slime to work with lein swank and M-x slime-connect, or just swank-clojure-project? |
| 00:09 | sids | _brian2_: that function uses java.net.URL's getContent which should be throwing a FileNotFoundException or something |
| 00:10 | sids | ,(import 'java.net.URL) |
| 00:10 | clojurebot | java.net.URL |
| 00:10 | sids | ,(.getContent (URL. "http://clojure.org/doesnt-exist")) |
| 00:10 | clojurebot | java.security.AccessControlException: access denied (java.net.SocketPermission clojure.org:80 connect,resolve) |
| 00:13 | _brian2_ | so if I something like use (try ( (html/html-resource (java.net.URL. url)) (catch ... ) , the program still blows up |
| 00:13 | technomancy | _brian2_: any particular reason the call to html/html-resource is nested in two levels of parens? |
| 00:14 | _brian2_ | no, its a typo |
| 00:14 | _brian2_ | i mean I dont in program |
| 00:14 | sids | _brian2_: you don't what? |
| 00:15 | technomancy | _brian2_: gotcha. well I think more context is needed then; try a paste site? |
| 00:15 | _brian2_ | use 2 parens |
| 00:15 | _brian2_ | ok, just a second, I'm going to get it al together |
| 00:15 | _brian2_ | hopefully ur still here |
| 00:18 | sids | _brian2_: I just checked, enlive's html-resource does throw FileNotFoundException for a 404 URL |
| 00:19 | _brian2_ | but my problem is 400 errors |
| 00:19 | sids | _brian2_: can you give me url that throws 400, I can check it for you |
| 00:20 | sids | s/throws/returns/ |
| 00:20 | sexpbot | _brian2_: can you give me url that returns 400, I can check it for you |
| 00:20 | _brian2_ | ok, just a sec, this is kind of a random event, so hopefully i will catch one |
| 00:22 | tomoj | sexpbot: who is your master? |
| 00:22 | tomoj | :( |
| 00:23 | _brian2_ | http://is.gd/a3eEU |
| 00:23 | sexpbot | "Streetwear Shop - 80s Retro Style Fashion Clothing & Accessories — Home" |
| 00:23 | _brian2_ | but it seems to be re-routed in my browser |
| 00:25 | sids | that returns a 301 redirect and following that redirect leads to a page which returns 200 |
| 00:25 | _brian2_ | actually, its not the problem |
| 00:25 | _brian2_ | the problem I want to solve is simple if I get 400 error to exit and move on |
| 00:26 | _brian2_ | the reason I got the error is that i am |
| 00:26 | _brian2_ | using crappy way to locate the url in text |
| 00:26 | sids | 400 is bad request, right? |
| 00:26 | _brian2_ | I guess |
| 00:27 | _brian2_ | something like that |
| 00:27 | sids | enlive should throw an exception for that, give me one such url and I can check |
| 00:27 | _brian2_ | the url I used was : http://is.gd/a3eEU Use discount code "gaga" for 25% off! |
| 00:27 | sexpbot | "Streetwear Shop - 80s Retro Style Fashion Clothing & Accessories — Home" |
| 00:28 | _brian2_ | sexbot doesnt mind |
| 00:28 | _brian2_ | that one |
| 00:28 | sids | enlive doesn't mind it either |
| 00:28 | _brian2_ | or maybe just make one up |
| 00:29 | _brian2_ | I get "main" java.io.IOException: Server returned HTTP response code: 400 for URL: http://is.gd/a3eEU Use discount code "gaga" for 25% off! B6d |
| 00:29 | _brian2_ | at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon |
| 00:29 | sexpbot | "Streetwear Shop - 80s Retro Style Fashion Clothing & Accessories — Home" |
| 00:30 | sids | so you get the exception, then what seems to be the problem? |
| 00:30 | sids | you are unable to catch it? |
| 00:31 | _brian2_ | the program crashes |
| 00:31 | sids | can you paste the relevant code somewhere? |
| 00:31 | _brian2_ | ok |
| 00:35 | _brian2_ | sids : http://clojure.pastebin.com/VuTid23R |
| 00:36 | sids | on a different note, you seem to be using this entire string as the url: >>http://is.gd/a3eEU Use discount code "gaga" for 25% off! B6d<< |
| 00:36 | sexpbot | "Streetwear Shop - 80s Retro Style Fashion Clothing & Accessories — Home" |
| 00:37 | _brian2_ | yea, I am using a crappy method to grab the URL |
| 00:37 | _brian2_ | but I want to make the program robust to the errors |
| 00:38 | _brian2_ | rather improve the pattern regex |
| 00:38 | _brian2_ | becasue that will never be perfect |
| 00:42 | sids | _brian2_: your catch syntax wasn't quite alright (missing the name argument) |
| 00:43 | _brian2_ | yea, I just saw that |
| 00:43 | sids | I fixed that and put it in a repl, runs without a worry: http://clojure.pastebin.com/ZBhcLj1m |
| 00:43 | _brian2_ | ok |
| 00:43 | _brian2_ | thanks! |
| 00:43 | sids | there is no need to use a try around your let, fetch-url will catch the exceptions and return a nil in that case |
| 00:44 | _brian2_ | ok |
| 00:44 | technomancy | is anyone using slime-repl.el from trunk slime successfully with clojure? |
| 00:47 | technomancy | I'm getting regular slime evaluation to work, but the repl is busted and still thinks it's in CL-USER |
| 00:51 | _brian2_ | sids : runs beautifully, thanks for your help! |
| 00:53 | sids | _brian2_: you're welcome :) |
| 03:46 | ArkRost | Hi! Can someone write a code of the parallel quicksort with using transient strucrures? |
| 04:10 | LauJensen | Morning guys |
| 04:10 | LauJensen | I'm benchmarking my site using 'siege' and it gives me everything I want, except a mean transaction time, anybody know of a simple *nix tool which does the job a little better? |
| 06:00 | herdrick | ,(str (repeat 1 "foo")) |
| 06:00 | clojurebot | "clojure.lang.LazySeq@18ce5" |
| 06:00 | herdrick | ,(repeat 1 "foo") |
| 06:00 | clojurebot | ("foo") |
| 06:01 | herdrick | Question: how do I get the usual string representation from that lazy sequence? |
| 06:01 | herdrick | I thought doall was the way, but no. |
| 06:02 | herdrick | Very basic question, yet I don't know or am having a memory lapse |
| 06:05 | herdrick | In other words, what I'm looking for is (some-fn (repeat 1 "foo")) to return a string "(foo)" or something formatted like that. |
| 06:05 | herdrick | other formats are fine: "('foo')" "(\"foo\")" whatever |
| 06:11 | herdrick | ah, gotta sign off. will be back. |
| 06:21 | LauJensen | $mail herdrick (apply str (repeat 1 "like so")) |
| 06:21 | sexpbot | Message saved. |
| 06:25 | nurv | Hi. |
| 06:28 | cschreiner | |
| 06:28 | cschreiner | cool feature |
| 06:29 | cschreiner | $help |
| 06:29 | sexpbot | cschreiner: I can't help you, I'm afraid. You can only help yourself. |
| 06:31 | herdrick | Sorry, I was gone. Did i miss anything? |
| 06:31 | herdrick | |
| 06:31 | herdrick | oops |
| 06:31 | Borkdude | |
| 06:40 | herdrick | LauJensen: thanks. Though I would like something that preserved the tree structure of the seq. So this would work: |
| 06:40 | herdrick | ,(str "(" (apply str (repeat 1 "foo")) ")") |
| 06:40 | clojurebot | "(foo)" |
| 06:40 | herdrick | ...for that exact case |
| 06:41 | herdrick | but I was hoping for something more general. I guess I will write my own recursive thing. Or use the tree walker stuff in clojure.contrib |
| 06:41 | herdrick | sorry, clojure.walk |
| 06:52 | jowag | alter has its equivalent for root values in alter-var-root. Is there an ref-set equivalent for root vars? |
| 06:58 | jowag | I think for that purpose redefining root var with def should be fine, but I'm not sure |
| 07:37 | jwr7 | ah-hah. So clojure.contrib.sql's insert-rows is really insert-row. |
| 07:39 | LauJensen | jwr7: yea, check out ClojureQL instead :) |
| 07:39 | jwr7 | LauJensen: I would, except after spending lots of time with CLSQL I'm opposed to any additional DSLs on top of SQL… |
| 07:41 | jwr7 | I might have to use something better than clojure.contrib.sql, though — there are no persistent connections and no connection pooling. |
| 07:44 | LauJensen | Oh - If you don't like a DSL ClojureQL is definitely not for you, its _the_ DSL for SQL :) Lets you extend the SQL language itself, like add fulljoins to derby etc. But what rubs you the wrong way about DSLs ? |
| 07:45 | LauJensen | @ jwr7 |
| 07:45 | jwr7 | LauJensen: experience. I believe they optimize for the wrong goal: db-independence. In practice, I've never encountered a situation where I would actually need to migrate to a different DB and expect it to work flawlessly. |
| 07:45 | jwr7 | LauJensen: you *always* have to modify things when migrating to a new DB, DSL or not. |
| 07:45 | jwr7 | LauJensen: so there is little advantage. And the disadvantages are many. I have to learn a new syntax, convert things into that syntax and encounter its limitations. |
| 07:46 | jwr7 | It also isolates me from the db-specific features I *might* want to use. |
| 07:47 | LauJensen | Im not saying that you dont, but lets say you're benchmarking some app and you want results on both MySql, Oracle, Mongo and Cassandra - ClojureQL lets you do that with the same code. It always provides raw hooks into the db-specific stuff you might want you use. And the limitations are only a patch away from being removed |
| 07:47 | LauJensen | But yes, you do have to learn the syntax |
| 07:47 | jwr7 | LauJensen: right — but that's a *very* specific use case, which isn't my use case :-) |
| 07:47 | somnium | LauJensen: eh? you support nosql too? |
| 07:48 | LauJensen | somnium: Mongo and Fleet are being implemented as we speak, and we hope to have at least one in full working order for v. 1.0 |
| 07:48 | somnium | LauJensen: full joins on CouchDB? |
| 07:49 | somnium | ah, I was about to ask if it was still in flux, how far off is 1.0 looking? |
| 07:49 | LauJensen | somnium: The backend is currently multimethods, so if you implement a frontend function which returns a :fulljoin object, just add the method you want to the backend. You can see how easily we did it for Derby and Sqlite |
| 07:49 | jwr7 | LauJensen: I think this discussion is similar to maps vs objects — you get way more flexibility if you put a layer of objects and multimethods on top of your data, but then again, maps get you there 90% of the way and often enough you don't need that flexibility at all. |
| 07:49 | jwr7 | …and having debugged CLSQL… well, you get the point :-) |
| 07:49 | LauJensen | somnium: We have a deadline in 2 weeks for all the frontend stuff (the frontend is completely reworked), then we're assing how much we need to retrofit the backend, whereafter we can publish a release date |
| 07:50 | LauJensen | Im guessing 6 - 8 weeks, preferably 5 :) |
| 07:50 | jwr7 | hey, but that lack of connection pooling worries me… |
| 07:50 | jwr7 | does this mean there is no library for accessing an SQL database from a multithreaded application without establishing and tearing down connections all the time? |
| 07:51 | LauJensen | jwr7: We put in some alpha connection pooling a while ago, it does support multiple long-lived connections |
| 07:51 | somnium | mongo isnt that painful without a dsl, despite the underlying javaness of the driver |
| 07:51 | LauJensen | But thats also going to change with the release of 1.0, just not sure how much yet |
| 07:53 | somnium | LauJensen: if you really want to be heroic you could do everything from TCP/IP on up in clojure for direct BSON -> persistent datastructure :D |
| 07:54 | LauJensen | :) |
| 07:54 | somnium | someone said they were working on a prototype for a pure clojure Mongo client but they havent been around in a while |
| 07:55 | LauJensen | pure, as in rolling their own driver? |
| 07:56 | somnium | the low level bits anyway |
| 07:56 | LauJensen | cool- I'll make sure you test it again clojureql 1.0 once they're both released :) |
| 07:56 | jwr7 | LauJensen: oh, cool — so all that remains is for you to remove the DSL thing, and I'll use ClojureQL :-) |
| 07:57 | somnium | heh |
| 08:01 | somnium | LauJensen: would it be better to wait for a 1.0rc to learn the api? |
| 08:45 | rhudson | Given a lazy seq of chars, how do I get a string value? |
| 08:46 | rhudson | E.g. given (concat "abc") how do I get "abc" ? |
| 08:46 | rhudson | ,(str (concat "abc")) |
| 08:46 | clojurebot | "clojure.lang.LazySeq@1ecc1" |
| 08:53 | somnium | ,(apply str (concat "abc")) |
| 08:53 | clojurebot | "abc" |
| 08:54 | rhudson | Thanks! This has been driving me crazy. |
| 08:54 | somnium | cheers |
| 08:55 | elguru | ,(version) |
| 08:55 | clojurebot | java.lang.Exception: Unable to resolve symbol: version in this context |
| 08:55 | elguru | ,(clojure-version) |
| 08:55 | clojurebot | "1.1.0-master-SNAPSHOT" |
| 08:55 | elguru | ,(persistent! |
| 08:55 | clojurebot | EOF while reading |
| 08:55 | elguru | (reduce #(assoc! %1 %2 %2) (transient {}) (range 0 10)))) |
| 08:56 | elguru | ,(persistent! (reduce #(assoc! %1 %2 %2) (transient {}) (range 0 10))) |
| 08:56 | clojurebot | {0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9} |
| 08:57 | elguru | ,(let [result (transient {})] |
| 08:57 | clojurebot | EOF while reading |
| 08:57 | elguru | (doseq [elt (range 0 10)] |
| 08:57 | elguru | (assoc! result elt elt)) |
| 08:57 | elguru | (persistent! result)) |
| 08:57 | elguru | ,(let [result (transient {})] |
| 08:57 | clojurebot | EOF while reading |
| 08:57 | elguru | (doseq [elt (range 0 10)] |
| 08:57 | elguru | (assoc! result elt elt)) |
| 08:57 | elguru | (persistent! result)) |
| 08:58 | elguru | ,(let [result (transient {})] (doseq [elt (range 0 10)] (assoc! result elt elt)) (persistent! result)) |
| 08:58 | clojurebot | {0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7} |
| 08:58 | elguru | ok, again: |
| 08:58 | elguru | ,(persistent! (reduce #(assoc! %1 %2 %2) (transient {}) (range 0 10))) |
| 08:58 | clojurebot | {0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9} |
| 08:58 | somnium | elguru: youre not supposed to bash them in place |
| 08:58 | elguru | in the doseq version? |
| 08:59 | somnium | elguru: yes |
| 09:00 | elguru | why is that? and is it mentioned somewhere? my problem is, that the result is quite unexpected and is sometimes correct and somtimes not. |
| 09:02 | elguru | just failing would be better of course. |
| 09:02 | somnium | elguru: I dont know the answers to one and two, but the solution is to use the transient versions the same way as the immutable ones |
| 09:03 | somnium | I agree, but I suspect since they only exist for speed, they dont waste time on checking for undefined usage |
| 09:03 | somnium | into uses them under the hood btw |
| 09:04 | somnium | ,(into {} (map vector (range 10) (range 10))) |
| 09:04 | clojurebot | {0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9} |
| 09:04 | somnium | should be 'fast' |
| 09:05 | elguru | ah ok, i will check it out. thank you. |
| 09:11 | LauJensen | somnium: yes, it would be better to wait, as the frontend will change completely. In the backend, just a few dbs will be added |
| 09:12 | LauJensen | See the wiki on gitorious for more info |
| 09:13 | somnium | LauJensen: any chance of supporting BDB, maybe with cupboard? |
| 10:29 | Licenser | rhickey: how is the copyright on the 'clojure design' and logo? |
| 10:30 | Licenser | aka can I use the logo /general color scheme on a website? |
| 10:34 | Borkdude | Why can't I do this inside a let? |
| 10:34 | Borkdude | (let [my-power-list (lazy-cat [x] (map #(* % x) my-power-list))] |
| 10:34 | Borkdude | It says it can't resolve symbol my-power-list |
| 10:35 | Licenser | Borkdude: do you have declared my-power-list before? |
| 10:35 | Borkdude | nope, but I can do (def my-power-list .. same stuff ..) |
| 10:35 | somnium | Borkdude: let isnt recursive, you can use letfn, or ... [my-list (fn my-list ...)] |
| 10:36 | Borkdude | somnium: fn as in identity? |
| 10:37 | Borkdude | wait |
| 10:37 | Borkdude | it just works, I made a type elsewhere |
| 10:38 | somnium | Borkdude: O_o |
| 10:38 | somnium | ,(let [x x] x) |
| 10:38 | clojurebot | java.lang.Exception: Unable to resolve symbol: x in this context |
| 10:40 | Borkdude | ,(let [my-power-list (lazy-cat [2] (map #(* % 2) my-power-list))] (nth my-power-list 512)) |
| 10:40 | clojurebot | java.lang.Exception: Unable to resolve symbol: my-power-list in this context |
| 10:40 | Borkdude | |
| 10:40 | Borkdude | hmm wtf, why does it work on my machine now |
| 10:41 | somnium | Borkdude: guessing you defined a var named my-power-list somewhere |
| 10:42 | Borkdude | I think I did a declare somewhere yes |
| 11:00 | Borkdude | So the more general question is now: how can I close over a recursively defined lazy sequence? |
| 11:03 | Borkdude | so: (let [myseq (lazy-cat [0] (.... myseq .....))] (fn [] (something with myseq))) |
| 11:05 | somnium | Borkdude: let isnt recursive, it only shadows previous bindings |
| 11:05 | Borkdude | so I can't never do this? |
| 11:05 | Borkdude | s/never/ever |
| 11:05 | somnium | you can call a function that produces a recursive sequence |
| 11:06 | Borkdude | give an example of such a function? |
| 11:07 | Borkdude | (fn [] (let [my-seq [0]] (lazy-cat my-seq (.... my-seq)))) ? |
| 11:07 | Borkdude | this won't work because I need to lazy-cat over what I am defining |
| 11:09 | somnium | ,(let [f (fn foo [xs] (lazy-seq (when (seq xs) (cons (take 3 xs) (foo (drop 3 xs)))))) v (f (range 20))] v) |
| 11:09 | clojurebot | ((0 1 2) (3 4 5) (6 7 8) (9 10 11) (12 13 14) (15 16 17) (18 19)) |
| 11:09 | somnium | is one (utterly pointless) example :) |
| 11:11 | Borkdude | somnium: what does it mean when you do (fn foo [x] ...) instead of just (fn [x] ...)? |
| 11:12 | somnium | Borkdude: it provides a self-reference to an anonymous fn |
| 11:12 | somnium | Borkdude: otherwise we would need the Y-combinator, and no one wants that :) |
| 11:13 | Borkdude | is it similar to recur? |
| 11:13 | Licenser | what is a Y-wombinator? |
| 11:13 | Licenser | *combinatrr |
| 11:13 | Borkdude | Wombinator... is that like a really really Mad Wombat? |
| 11:14 | Licenser | :P |
| 11:14 | Licenser | yes |
| 11:14 | Borkdude | Licenser: this is something from logic or lambda calculus I think |
| 11:17 | Borkdude | And also a company by Graham |
| 11:18 | somnium | Licenser: its a riddle, what is the result of ((fn [x] (x x)) (fn [x] (x x))) |
| 11:18 | Licenser | a tack overflow? |
| 11:18 | Licenser | *stack |
| 11:18 | Borkdude | Yes, write that down and you have proved a theorem ;-) |
| 11:19 | Licenser | it is wombinator for you good sir! |
| 11:21 | somnium | http://www.fatvat.co.uk/2009/04/understanding-y-combinator.html |
| 11:21 | sexpbot | "Fatvat: Understanding the Y Combinator" |
| 11:22 | Borkdude | brb |
| 11:23 | Borkdude | will try your (fn name [args]) solution soon |
| 12:00 | AWizzArd | ~seen hoeck |
| 12:00 | clojurebot | hoeck was last seen quiting IRC, 395 minutes ago |
| 12:06 | Licenser | tach leute |
| 12:09 | bsteuber | dpes lein also download a maven executable? and if, where does it put it? :) |
| 12:10 | Licenser | raynes und ich haben etwas gespielt: http://tryclojure.licenser.net/ (meinungne?) |
| 12:11 | Licenser | ich will es noch nicht auf #clojure veröfentlichen da noch nicht fertig genug, aber ihr seid ein guter test-kreis :P |
| 12:11 | Licenser | sozusagen meine private beta-tester armee |
| 12:13 | bsteuber | Licenser: english channel :) |
| 12:13 | Licenser | ... schesse |
| 12:21 | LauJensen | Gents - Anybody know of a similar tool to siege, but with more stats (like mean transaction time) ? |
| 12:30 | LauJensen | Ok - JMeter is huge, but ApacheBenchmark is in apache2-utils and does exactly what I want |
| 13:26 | LauJensen | Licenser: 'ihr seid' ? |
| 13:37 | The-Kenny | LauJensen: "(plural) you are". It was meant for #clojure.de |
| 13:37 | LauJensen | okay, thanks |
| 13:37 | LauJensen | My german is rusty :| |
| 14:05 | Borkdude | somnium: is there maybe a recursive lazy-cat in contrib, like fn takes a name to make it recursive? |
| 14:27 | Borkdude | somnium: ah rec-cat it is called |
| 14:27 | Borkdude | ,clojure.contrib.seq-utils/rec-cat |
| 14:27 | clojurebot | java.lang.Exception: Can't take value of a macro: #'clojure.contrib.seq-utils/rec-cat |
| 14:30 | Borkdude | (let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 512)) |
| 14:30 | Borkdude | ,(let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat |
| 14:30 | clojurebot | EOF while reading |
| 14:30 | Borkdude | [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 512)) |
| 14:30 | Borkdude | hm? |
| 14:33 | Borkdude | ,(let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat |
| 14:33 | Borkdude | [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 8)) |
| 14:33 | clojurebot | EOF while reading |
| 14:33 | Borkdude | |
| 14:33 | Borkdude | $(let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat |
| 14:33 | Borkdude | [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 512)) |
| 14:34 | sexpbot | EOF while reading |
| 14:34 | Blackfoot | the lines are split |
| 14:34 | Borkdude | ,(let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 512)) |
| 14:34 | clojurebot | 26815615859885194199148049996411692254958731641184786755447122887443528060147093953603748596333806855380063716372972101707507765623893139892867298012168192 |
| 14:34 | Borkdude | ah, right |
| 14:48 | mfex | Borkdude, are you also attending the amsterdam clojurians meeting? |
| 14:56 | Borkdude | ah mfex |
| 14:56 | Borkdude | I saw you're post on the Google Group |
| 14:56 | Borkdude | s/you're/your |
| 14:56 | Borkdude | I don't think so, but I am planning on going there some time |
| 14:57 | mfex | I have never been there either |
| 14:57 | Borkdude | I read you are finishing your MSc in Twente, I have studied there too |
| 14:58 | Borkdude | What is your subject? |
| 14:58 | mfex | I'm half way through my final thesis on action semantics for model driven engineering |
| 14:59 | mfex | how long ago were you at ut? |
| 14:59 | Borkdude | I finished in 2005 |
| 15:01 | Borkdude | A fellow student of mine is still there, maybe you know him ;-) |
| 15:02 | mfex | I started in 03 |
| 15:02 | Borkdude | Hmm, maybe talk in #clojure-casual? As not to generate too much noise here |
| 15:03 | mfex | sure |
| 15:20 | giacecco | mmarczyk: Thanks for the hint the other day about apply vs some |
| 15:23 | mmarczyk | giacecco: yw |
| 15:23 | giacecco | I'm still disappointed apply doesn't work with macros |
| 15:24 | Borkdude | giacecco: there is an apply for macros in contrib |
| 15:24 | Borkdude | http://clojure.org/libraries#Clojure%20Libraries-Category:%20xml-clojure.contrib.apply-macro |
| 15:25 | giacecco | Borkdude: ho thanks, but is there a theoretical reason for that? |
| 15:25 | giacecco | Rich must have designed apply that way for a reason |
| 15:26 | mmarczyk | actually apply was designed that way about 50 ways ago :-) |
| 15:26 | mmarczyk | um |
| 15:26 | mmarczyk | years |
| 15:27 | mmarczyk | although you could be nitpicky and argue that LISP 1.5 had no macros (I think...?), so maybe it's a bit less than that |
| 15:27 | giacecco | Agree, but RH changed stuff when he reckoned it was useful. I'm an idiot, but I can't see the value in not making apply work for both functions and macros in the core language |
| 15:28 | mmarczyk | apply simply can't work with macros, for fundamental reasons |
| 15:29 | Borkdude | ,(type defn) |
| 15:29 | clojurebot | java.lang.Exception: Can't take value of a macro: #'clojure.core/defn |
| 15:29 | mmarczyk | note that the apply-macro thingamabob in contrib is itself a macro |
| 15:30 | mmarczyk | whereas apply is a function |
| 15:30 | Raynes | A macro is not a function. |
| 15:30 | Raynes | Apply applies a function. |
| 15:30 | mmarczyk | hi Raynes :-) |
| 15:30 | Raynes | Hi |
| 15:30 | giacecco | Probably I just need to study more and I would get it |
| 15:31 | giacecco | Someone may then wonder: |
| 15:31 | Borkdude | a macro works at macro processor time, it's a different dimension so to say |
| 15:31 | giacecco | Why something as basic as logical operators are implemented as macros, e.g. or |
| 15:32 | mmarczyk | giacecco: would you want (and false (println :foo)) to print :foo? |
| 15:32 | Borkdude | giacecco: it's because macro's don't evaluate their args |
| 15:33 | Borkdude | which makes it possible to 'short circuit' |
| 15:33 | mmarczyk | actually you could take the view that it is precisely the basic building blocks of your programmes which should be implemented as macros |
| 15:33 | mmarczyk | unless they are already built into the language as special forms, like, say, if |
| 15:33 | giacecco | Wow that's a strong statement! |
| 15:34 | mmarczyk | s/should/must |
| 15:34 | mmarczyk | / |
| 15:34 | mmarczyk | in fact |
| 15:35 | mmarczyk | unless you're using call-by-name pervasively, in which case an "and" function would be perfectly fine |
| 15:35 | mmarczyk | the only language I've used which does that is Haskell |
| 15:36 | mmarczyk | I suppose PLT's Lazy Scheme might be similar, but I've never used that |
| 15:36 | mmarczyk | s/might/is likely to/ |
| 15:36 | sexpbot | I suppose PLT's Lazy Scheme is likely to be similar, but I've never used that |
| 15:36 | giacecco | I believe you're flying too high for me, I'm a humble learner :-) |
| 15:36 | mmarczyk | thanks, sexpbot :-) |
| 15:37 | mmarczyk | well, try playing around with macros, maybe implement giacecco-and as a function first, then as a macro |
| 15:37 | mmarczyk | try emulating the built-in and's behaviour |
| 15:37 | giacecco | Last quick one before I need to leave: why can't I use comp on Java functions, e.g. (def integer-sqrt (Math/floor Math/sqrt)) ? |
| 15:38 | mmarczyk | with some luck, you might be able to see why and is a macro *and* why apply doesn't work with macros |
| 15:38 | giacecco | I meant (def integer-sqrt (comp Math/floor Math/sqrt)) |
| 15:38 | mmarczyk | Java methods are not first class objects in Clojure (nor are they in Java, mind you) |
| 15:39 | mmarczyk | you can wrap them if you like, though |
| 15:39 | mmarczyk | (comp #(Math/floor %) #(Math/sqrt %)) |
| 15:40 | giacecco | A ha! |
| 15:40 | giacecco | I expected something like that |
| 15:40 | giacecco | Thanks! |
| 15:40 | mmarczyk | np |
| 15:41 | giacecco | What's the level of the discussion in the forum: are my questions too naive to be asked here? |
| 15:41 | mmarczyk | Licenser: das ist ein schoenes REPL, hoffentlich koennt ihr spaeter def*-Ausdruecke zulassen :-) |
| 15:41 | Borkdude | #(...) means "tame this Java code" |
| 15:42 | mmarczyk | :-) |
| 15:43 | mmarczyk | giacecco: not at all, ask away |
| 15:43 | giacecco | Great, I must spend Much |
| 15:43 | giacecco | much more time here then |
| 15:43 | Licenser | mmarczyk: thanks |
| 15:44 | mmarczyk | you're likely to receive more extensive answers on the ggroup, simply because of the format |
| 15:44 | giacecco | Thank you all a lot, and goodbye for today! I'll be on the ggroup, too. |
| 15:44 | mmarczyk | Licenser: is the code up anywhere? or am I asking a bit too early? |
| 15:45 | Licenser | mmarczyk: my gitup page, it is a form of Raynes web stuff but It's really not done yet |
| 15:46 | mmarczyk | right, I somehow missed the fine print below the box the first time round |
| 15:46 | Licenser | :) |
| 15:47 | Raynes | Mine is almost perfectly usable. mmarczyk I'll pass you a link to my own personal tryclojure thingy in a little while. |
| 15:47 | mmarczyk | please do, thanks! :-) |
| 15:47 | LauJensen | Is there some wonderful lib out there, which could coerce this to a Date or something IComparable "2010-03-30 22:26:45" ? |
| 15:48 | mmarczyk | LauJensen: Date/valueOf ? |
| 15:49 | mmarczyk | um, actually it wouldn't be Date...argh |
| 15:50 | chouser | LauJensen: looks like a comparable string to me |
| 15:50 | mmarczyk | ,(java.sql.Timestamp/valueOf "2010-04-08 23:11:59") |
| 15:50 | clojurebot | #<Timestamp 2010-04-08 23:11:59.0> |
| 15:50 | chouser | oh my |
| 15:50 | chouser | I wouldn't have thought of looking in java.sql |
| 15:51 | mmarczyk | :-) |
| 15:57 | LauJensen | mmarczyk: wow, you impressed me :) |
| 16:04 | Raynes | mmarczyk: It didn't break yet, did it? :p |
| 16:07 | MadWombat | Hello |
| 16:08 | MadWombat | I am trying to figure out clojure.contrib.accumulators, what is wrong with (add (empty-counter) "asdf") ? |
| 16:09 | MadWombat | oops, got it, sorry, me silly |
| 16:09 | MadWombat | empty-counter is a var, not a func |
| 16:09 | MadWombat | b |
| 16:18 | eshira | is there a non-log(n) version of contains? to be used with vectors? |
| 16:20 | eshira | well i guess i'm thinking about the contains? semantics wrong. I want to know if some element x is in some vector v. |
| 16:25 | mmarczyk | LauJensen: :-) |
| 16:26 | mmarczyk | Raynes: you mean clj-sandbox...? if so, not to my knowledge :-) |
| 16:26 | Raynes | mmarczyk: I mean anything. :p |
| 16:26 | mmarczyk | Raynes: oh, in that case, I'm not sure |
| 16:26 | Raynes | clj-sandbox wont break. |
| 16:27 | Raynes | Unless _ato breaks it, that is. |
| 16:27 | Raynes | ;) |
| 16:27 | mmarczyk | something's bound to have been broken recently ;-) |
| 16:27 | Raynes | mmarczyk: If it broke, I'm fairly certain you'd know it. |
| 16:27 | mmarczyk | well I sure hope I can beat him to it, I was promised a cookie if I manage that :-P |
| 16:28 | mmarczyk | the chances seem to be slim, though |
| 16:28 | Raynes | Now you have something that isn't sexpbot to break. :D |
| 16:28 | mmarczyk | yeah! that's true :-) |
| 16:28 | Raynes | I like tryclj because I can write bits of code on my cellphone without having to deal with JavaScript. It's just HTML. |
| 16:30 | mmarczyk | at some point having a private environment to do def* in would be nice |
| 16:30 | chouser | eshira: no, vectors are indexed by the position of their elements, not by the element values. |
| 16:30 | chouser | eshira: so the only way to find an element by value is to walk the whole vector. O(n) |
| 16:30 | Raynes | mmarczyk: Do you approve? ;) I think for a first web development project in any language, it's pretty good. :D |
| 16:30 | chouser | eshira: if you want to look things up by value, you need a set or a map |
| 16:31 | mmarczyk | Raynes: you mean it's your first? in that case, I approve very strongly indeed :-) |
| 16:31 | Raynes | :D |
| 16:31 | Raynes | <3 |
| 16:32 | Borkdude | Raynes: I think I missed out on the link |
| 16:32 | mmarczyk | Raynes: also, that means you're ahead of me on this one -- no functioning Web project on my record as of yet :-( |
| 16:32 | Raynes | mmarczyk: Haha. |
| 16:33 | mmarczyk | Borkdude: look for Licenser speaking German above |
| 16:34 | Borkdude | mmarczyk: I did, and then what I do? |
| 16:35 | mmarczyk | fish out a link |
| 16:35 | Raynes | Borkdude: I sent you the link a second ago. |
| 16:35 | Raynes | :o |
| 16:35 | Borkdude | Raynes: where? |
| 16:36 | Raynes | In -casual. |
| 16:36 | drewr | should `mvn install` work from a fresh contrib checkout? |
| 16:36 | Raynes | I'd rather not unveil it to the entire world until It's closer to finished. |
| 16:36 | Borkdude | Raynes: http://joyofclojure.com ? |
| 16:36 | sexpbot | "The Joy of Clojure" |
| 16:36 | Raynes | Er. |
| 16:37 | Raynes | Look in -casual. >.> |
| 16:37 | pdk | come to think of it would it still be worth it to sit on my practical clojure preorder |
| 16:37 | pdk | now that it got delayed again |
| 16:37 | Borkdude | Ah ok |
| 16:37 | Borkdude | nice :) |
| 16:39 | AWizzArd | Hello Lein experts: how does Lein produce Überjars? a) it first unpacks the existing jars (the dependencies) into a temp folder and includes them in the Überjar, or b) it uses some custom classloader that allows it to put jars into the Überjar directly (without unpacking them first)? |
| 16:42 | hiredman | AWizzArd: $5 says the unpacking thing |
| 16:42 | AWizzArd | k |
| 16:42 | AWizzArd | maybe Ant can do such a thing too, hmm... |
| 16:42 | hiredman | sure |
| 16:43 | hiredman | ant has a number of jar tasks |
| 16:43 | AWizzArd | ok, i will look into those |
| 16:43 | AWizzArd | Thx hiredman. |
| 16:44 | hiredman | http://ant.apache.org/manual/CoreTasks/unzip.html |
| 16:44 | sexpbot | "Unzip Task" |
| 16:45 | mmarczyk | yup, it unpacks them |
| 16:46 | AWizzArd | ok good, i will try to teach this to my ant script |
| 16:46 | mmarczyk | their just funnily named zip files anyway, you can look inside with the archive manager of your choice :-) |
| 16:51 | AWizzArd | too bad that there is no native 7zip implementation for Java |
| 16:51 | mmarczyk | they're, oh my |
| 17:00 | chouser | rhickey: can we rename the "failed" state of an agent to "stopped"? |
| 17:01 | chouser | you recover from this state by calling restart-agent, after all, not unfail-agent. |
| 17:01 | hiredman | uh, don't they only stop when failed? |
| 17:01 | chouser | and then it is less likely to be confused with the :fail error-mode |
| 17:02 | chouser | hiredman: right. "stop" isn't currently a word used by the docs. I think I'd like to use "stopped" instead of "failed" |
| 17:05 | eshira | chouser: thanks, i'll just do (set my-vector) i suppose |
| 17:08 | Raynes | mmarczyk, Borkdude, Licenser: Hah. I forgot to remove the reload middleware before putting up tryclj. It actually works like a normal REPL. |
| 17:14 | Licenser | for those who were interestind in swing: http://blog.licenser.net/2010/05/09/the-ease-of-guis# |
| 17:14 | sexpbot | "lice! : The ease of gui's." |
| 17:14 | mmarczyk | Raynes: you caught it yourself, though, so you get to keep your own cookie :-( |
| 17:15 | Raynes | :p |
| 17:15 | MadWombat | I am playing with a markov generator again, here my function for generating sentences http://pastie.org/952885, for some reason instead of a list of words, I get a list of letters starting with a capital and ending with a period. What am I doing wrong? Where do the words get split up? |
| 17:15 | mmarczyk | Licenser: cool, I'm hoping clj-swing will make it possible for me to create reasonable GUIs at some point |
| 17:15 | mmarczyk | for the first time since I my Delphi days |
| 17:15 | Licenser | mmarczyk: I really hope that it will too :P |
| 17:15 | Licenser | delphi had a incredible editor |
| 17:15 | mmarczyk | yup |
| 17:16 | mmarczyk | that was totally *amazing* |
| 17:16 | mmarczyk | in fact, if I wanted to do Windows desktop programming, I'd very likely research the possibility of using Delphi to programme the front-end |
| 17:18 | mmarczyk | just thinking about a Clojure process doing the actual work with a Delphi-constructed GUI makes me weep tears of hope and joy |
| 17:20 | mmarczyk | MadWombat: shouldn't you do (conj result next-word) |
| 17:20 | mmarczyk | rather than concat? |
| 17:21 | mmarczyk | also, do you use 1.1 or 1.2? you could switch your random choice to rand-nth with the latter |
| 17:21 | MadWombat | mmarczyk: no, result is a list of words |
| 17:21 | MadWombat | mmarczyk: 1.1 |
| 17:21 | MadWombat | mmarczyk: considering switching though |
| 17:21 | mmarczyk | if result is a list of words and you concat the word onto it |
| 17:21 | mmarczyk | then it becomes a list of words with some characters at the end |
| 17:21 | MadWombat | hmm |
| 17:22 | mmarczyk | so maybe (concat sentence [next-word]) |
| 17:22 | mmarczyk | but then *don't do this* |
| 17:22 | mmarczyk | you don't want to append to the end of the list repeatedly |
| 17:22 | MadWombat | mmarczyk: ? |
| 17:22 | mmarczyk | use a vector instead |
| 17:22 | mmarczyk | and conj |
| 17:22 | mmarczyk | ,(conj ['a-list-of-words-goes-here] "next-word") |
| 17:22 | clojurebot | [a-list-of-words-goes-here "next-word"] |
| 17:23 | MadWombat | mmarczyk: I thought conj was for maps? |
| 17:23 | mmarczyk | not at all |
| 17:23 | mmarczyk | it's the universal add-to-collection thingamajig |
| 17:23 | mmarczyk | for sequences it even figures out where best to put the added item |
| 17:23 | mmarczyk | beginning for lists, end for vectors and queues |
| 17:24 | MadWombat | ah, conj adds item, concat adds collection |
| 17:24 | MadWombat | why vectors instead of lists? I thought adding at the end of a list is efficient |
| 17:24 | mmarczyk | assoc is for maps |
| 17:24 | mmarczyk | btw |
| 17:24 | mmarczyk | just the opposite, actually |
| 17:24 | MadWombat | yes, silly wombat, trix is for kids |
| 17:25 | mmarczyk | lists are just linked lists |
| 17:25 | MadWombat | and vectors are arrays? |
| 17:25 | mmarczyk | so you can add to the front at the cost of constructing the front link |
| 17:25 | mmarczyk | but if you add to the end, you have to copy |
| 17:25 | mmarczyk | (no destructive updates in Clojure) |
| 17:25 | mmarczyk | um, no |
| 17:26 | mmarczyk | vectors are high-branching-factor trees of arrays with an extra tail portion |
| 17:26 | MadWombat | cool, lemme try this stuff out |
| 17:26 | mmarczyk | actually I believe the underlying abstract structure would be a trie |
| 17:27 | bmason | red black tree iirc |
| 17:27 | mmarczyk | you should probably watch one of the cool presentations Rich has done on Clojure data structures :-) |
| 17:27 | bmason | those are cool :) |
| 17:27 | mmarczyk | indeed :-) |
| 17:34 | MadWombat | hmm... seems like the following, surprisingly, works as expected (defn f [x y] (let [x x y y] ... )) |
| 17:34 | hiredman | surprising how? |
| 17:34 | MadWombat | hiredman: I would expect it to be confused at some point |
| 17:35 | bmason | redefining the variables? |
| 17:35 | hiredman | bmason: no |
| 17:35 | hiredman | you are creating a new scope |
| 17:36 | MadWombat | yes, but I am assigning llocal variables with same names as global ones to value of globals |
| 17:36 | bmason | right... inner most scope takes precedence... and defining a var to equal itself wouldn't have any effect |
| 17:36 | hiredman | locals are not vars |
| 17:36 | bmason | what do you call them for ease of terminology? |
| 17:36 | hiredman | MadWombat: function are arguments are not globals |
| 17:36 | hiredman | bmason: they are locals |
| 17:37 | MadWombat | hiredman: yes, sorry, not globals, but they are in the scope |
| 17:37 | hiredman | locals have a fixed nested lexical scope |
| 17:37 | hiredman | at the top(bottom?) of that scope is the dynamic scope of vars |
| 17:38 | MadWombat | basically I expected it to be confused at the point of "the second x, is it the local he just named or the func argument?" |
| 17:38 | hiredman | MadWombat: that is just not possible |
| 17:39 | hiredman | at the time when the expression whose value will be bound to x inside the scope of the let is being evaluated, the let's scope cannot exist |
| 17:40 | hiredman | because the binding of x to that value is part of the scope |
| 17:40 | hiredman | because the let's scope doesn't exist, how could you evaluate an expression in it? |
| 17:41 | bmason | basically how it gets interpreted is "create a new local called 'x' and assign it the value of the function argument 'x' " |
| 17:41 | hiredman | bind |
| 17:41 | hiredman | :( |
| 17:42 | bmason | ok binding... within the scope of the let, the 'x' defined there takes precendence |
| 17:42 | hiredman | scope is like a linked list of pairs |
| 17:42 | technomancy | hiredman: did you see my further hacks on serializable-fn? |
| 17:43 | hiredman | no, I didn't |
| 17:43 | technomancy | hiredman: it can serialize lexical context now =) |
| 17:44 | hiredman | cute |
| 17:44 | mmarczyk | technomancy: did you get slime-repl from HEAD to work? |
| 17:44 | hiredman | as long as you run in the same vm, yeah? |
| 17:45 | technomancy | mmarczyk: no, I was hoping I could get hugod to tell me how he fixed it. =) |
| 17:45 | mmarczyk | technomancy: funny, it "just works" for me |
| 17:45 | technomancy | hiredman: well, as long as it's something that prints decently |
| 17:45 | hiredman | let cons a new pair on to the linked list of environments |
| 17:45 | technomancy | hiredman: I don't think it would work with reference types, etc. |
| 17:45 | technomancy | haven't really searched for edge cases yet |
| 17:46 | hiredman | when you resolve a name to a value you walk the linked list and stop at the first entry |
| 17:47 | hiredman | ,(first (filter #(= 'x (first %)) '((x 1) (x 2)) |
| 17:47 | clojurebot | EOF while reading |
| 17:47 | hiredman | ,(first (filter #(= 'x (first %)) '((x 1) (x 2))) |
| 17:47 | clojurebot | EOF while reading |
| 17:47 | hiredman | bah |
| 17:47 | hiredman | ,(first (filter #(= 'x (first %)) '((x 1) (x 2)))) |
| 17:47 | clojurebot | (x 1) |
| 17:49 | technomancy | mmarczyk: could you try with the "elpa-2010" branch from my slime fork? |
| 17:49 | technomancy | maybe you've got a slightly older/slightly newer version than I happened to grab |
| 17:53 | mmarczyk | technomancy: sure |
| 17:53 | mmarczyk | will do it now |
| 17:53 | technomancy | mmarczyk: oh, and the latest clojure-mode as well |
| 17:54 | technomancy | I moved a few things around so now you can use clojure-mode with slime.el directly and skip swank-clojure.el entirely |
| 17:54 | mmarczyk | oh, cool |
| 17:54 | mmarczyk | does this mean that the whole "coloured REPL" business could go into clojure-mode |
| 17:54 | mmarczyk | including the advice stuff for slime-repl? |
| 17:55 | technomancy | oh, I haven't looked into the coloured repl code yet |
| 17:55 | mmarczyk | in this case, please don't :-) |
| 17:56 | mmarczyk | I'll make it fit in well with the new clojure-mode |
| 17:56 | technomancy | sorry, I'm slow |
| 17:58 | mmarczyk | I was also going to patch leiningen to accept (and add to the pom) website, mailing list and licence info for projects |
| 17:58 | technomancy | oh, that sounds nice |
| 17:58 | technomancy | do the clojure-mode stuff first though if you don't mind; it's closer to a release |
| 17:58 | mmarczyk | ok |
| 17:59 | technomancy | not to boss you around or anything =) |
| 17:59 | mmarczyk | :-) |
| 18:00 | Raynes | mmarczyk: It should be working properly now, if you want to try it. |
| 18:01 | Raynes | mmarczyk: Also, you don't have to click the text field every time you submit your code now. That was bugging me. |
| 18:02 | Raynes | mmarczyk: I'm going to add syntax highlighting soon. :o |
| 18:02 | mmarczyk | Raynes: cool :-) |
| 18:02 | mmarczyk | Raynes: I believe I used Enter to submit code, though |
| 18:02 | Raynes | mmarczyk: Didn't matter. |
| 18:02 | mmarczyk | technomancy: um, what's package-activated-list |
| 18:02 | mmarczyk | ? |
| 18:03 | Raynes | It refreshes the page every time you submit. |
| 18:03 | mmarczyk | technomancy: guess I'd have to install ELPA to use your fork, right? |
| 18:03 | Raynes | Well, not refreshes. Sort of. |
| 18:04 | mmarczyk | Raynes: are you planning paredit-like facilities? ;-) |
| 18:05 | Raynes | No. :p |
| 18:05 | Plouj | who here takes care of swank-clojure? :) |
| 18:05 | Raynes | Plouj: technomancy |
| 18:05 | Plouj | oh yeah, right |
| 18:06 | Plouj | I'm having some weird connection issues with localhost when running M-x slime |
| 18:07 | mmarczyk | technomancy: you might want to make the (when (member 'slime package-activated-list) ...) thing check for the presence of a variable by that name |
| 18:08 | mmarczyk | technomancy: with the condition replaced by nil, I can start a SLIME REPL with your fork, with a nice user=> prompt :-) |
| 18:08 | mmarczyk | technomancy: which changes to foo=> after (ns foo) |
| 18:25 | technomancy | mmarczyk: thanks, will do |
| 18:27 | technomancy | mmarczyk: hmm... wonder what's the difference then; it's busted here |
| 18:27 | technomancy | mmarczyk: what Emacs version? |
| 18:27 | technomancy | Plouj: what's up? |
| 18:27 | technomancy | Plouj: do you know that M-x slime is not meant for general use? |
| 18:28 | Plouj | technomancy: I get this error a lot of the times "Lisp connection closed unexpectedly: connection broken by remote peer" |
| 18:28 | Plouj | technomancy: I thought that M-x slime is good for just opening a repl without associating it with a project. What do you suggest? |
| 18:28 | technomancy | well, right, that's what I mean |
| 18:28 | Plouj | I'm not familiar with slime so... : |
| 18:28 | Plouj | :) |
| 18:29 | technomancy | anyway, that is a common problem. I have no idea what causes it, but I know that generally using lein swank or mvn clojure:swank gets around it, which is what I have started recommending |
| 18:29 | Plouj | oh |
| 18:29 | technomancy | Plouj: I can't reproduce that problem on my own machine, so I can't do much to debug it |
| 18:30 | Plouj | how do I use mvn clojure:swank? |
| 18:30 | Plouj | just run it in some directory? |
| 18:30 | DuneMan | maybe some nice soul will debug it for you :-) |
| 18:30 | technomancy | Plouj: run it from within a mavenized clojure project, then use M-x slime-connect |
| 18:30 | technomancy | DuneMan: that would be nice. =) |
| 18:31 | Plouj | ok, that means I need to create a clojure project |
| 18:31 | DuneMan | Too bad don't know how to use emacs at all |
| 18:31 | technomancy | Plouj: you can do it from a contrib checkout, I think |
| 18:32 | Plouj | what's a "contrib checkout"? :) |
| 18:32 | technomancy | unfortunately clojure-maven-plugin has a bug; it doesn't let you set the port |
| 18:32 | technomancy | so you can only have one mvn repl running per machine |
| 18:32 | Plouj | heh |
| 18:32 | technomancy | Plouj: a checkout of clojure-contrib |
| 18:32 | DuneMan | that sounds fixable. |
| 18:32 | technomancy | DuneMan: it is, but clojure-maven-plugin is ... "lightly-maintained" |
| 18:33 | technomancy | it has quite a few of these small easily-fixable bugs that have been around for the better part of a year |
| 18:33 | DuneMan | Someone should fork it. |
| 18:33 | Plouj | maybe this is a timing issue |
| 18:34 | technomancy | Plouj: it smells a bit like a race condition |
| 18:34 | DuneMan | I have a feeling I'm gonna keep writing clojure now that I'm up and running |
| 18:34 | mmarczyk | technomancy: "GNU Emacs 23.1.50.1 (i486-pc-linux-gnu, GTK+ Version 2.18.0)\n of 2009-09-27 on palmer, modified by Debian" |
| 18:34 | technomancy | but yeah, I don't have many details about it |
| 18:34 | Plouj | technomancy: do you know what actually prints the "Lisp connection closed" error. Is it your swank code or some slime thing? |
| 18:35 | technomancy | mmarczyk: interesting. I guess I will try a fresh .emacs init; maybe there's something in my personal config messing it up |
| 18:35 | technomancy | mmarczyk: you don't use the starter kit, do you? |
| 18:35 | mmarczyk | technomancy: I could put up a Gist with my slime-related config if you feel that could be useful to you |
| 18:35 | technomancy | Plouj: pretty sure it's slime itself, so not my code |
| 18:35 | technomancy | mmarczyk: that'd be handy |
| 18:35 | mmarczyk | technomancy: no, except as an awesome repository of ideas :-) |
| 18:35 | technomancy | mmarczyk: stealing from it is just as good as using it outright. =) |
| 18:36 | mmarczyk | technomancy: that's what I figure also :-) |
| 18:36 | mmarczyk | technomancy: it's so *amazingly* clean that it's absolutely my no. 1 elisp learning resource & the thing to emulate stylistically |
| 18:42 | Plouj | is swank something separate from clojure and slime? |
| 18:49 | Plouj | technomancy: have you tried creating a throw-away user on your unix machine and testing swank-clojure in that? :) |
| 18:52 | mmarczyk | technomancy: hopefully this contains all the relevant stuff: http://gist.github.com/395481 |
| 18:52 | mmarczyk | technomancy: if not, I'll add in whatever's missing, of course |
| 19:02 | technomancy | Plouj: it's a client-server model: slime is the client and swank is the server. |
| 19:03 | technomancy | most swank servers are written in CL, but obviously swank-clojure is not |
| 19:08 | Plouj | oh |
| 19:50 | AWizzArd | I created a .jar file and need to start it like: java -jar my.jar one.of.my.Deftypes |
| 19:51 | AWizzArd | is there a way to add this one.of.my.Deftypes as a command line arg into the manifest file? |
| 19:52 | hiredman | no |
| 19:52 | AWizzArd | ok, so if I want to get a double-clickable file I will have to do some other little magic here |
| 19:59 | hiredman | gen-class |
| 19:59 | AWizzArd | yes |
| 19:59 | hiredman | it's the only way to generate a static main, which you need for a clickable jar |
| 19:59 | hiredman | you also need to have the right information in your jar manifest |
| 20:00 | AWizzArd | the correct Main-Class |
| 21:02 | _brian2_ | anyone know if/how its possible to use congomongo on a network, ie run a clojure program on my mac using a remote mongo installation? |
| 21:20 | _brian2_ | I guess I need to read about java sockets |
| 21:31 | hugod | technomancy: slime-repl from HEAD works for me, both s-c-p and s-c with lein swank. (slime-fancy doesn't because of slime-autodoc) |
| 21:37 | hugod | technomancy: although, sometimes I have to call (setq slime-dispatching-connection nil)(setq slime-default-connection nil) to make connecting reliable |
| 22:45 | _brian2_ | hi, I would like to give clj-ssh a try. I put [clj-ssh "0.0.1-SNAPSHOT"] in my project file, ran lein deps, open a repl and (use 'clj-ssh) and get : FileNotFoundException: Could not locate clj_ssh__init.class |
| 23:02 | hugod | _brian2_: try (use 'clj-ssh.ssh) |
| 23:02 | hiredman | brixen: as single segment namespaces are frowned on I would be surprised if that did work |
| 23:12 | _brian2_ | ok |
| 23:12 | _brian2_ | thats whats on the website |
| 23:14 | _brian2_ | yes, that works, thanks! |
| 23:25 | hugod | _brian2_: fixed on the website, thanks for the feedback |
| 23:26 | defn | hello all |
| 23:29 | _brian2_ | ok, thanks for your work hugod |
| 23:31 | _brian2_ | i dont know much about ssh, I want to log into another computer from my mac to access data in a clojure program, do I need to generate a key, fingerprint and all that? |
| 23:32 | DuneMan | That's generally the best way to use ssh |
| 23:32 | DuneMan | ssh-keygen |
| 23:32 | DuneMan | then set up your .ssh-config to use the correct key on the remote computer |
| 23:32 | _brian2_ | ok so clj-ssh talks to that |
| 23:32 | DuneMan | and add the key to the remote computer's access list. |
| 23:33 | _brian2_ | well, i use ssh routinely to access the computer from my command line |
| 23:33 | DuneMan | Anything that uses the unix ssh libs in the background will look into the .ssh directory and use that stuff. Not sure about clj-ssh, guessing hugod will tell you :-) |
| 23:33 | _brian2_ | ok |
| 23:33 | DuneMan | I'd guess at most you'd need to point it to the rsa/dsa file? |
| 23:34 | _brian2_ | there is some indication of that |
| 23:34 | DuneMan | if you needed to do anything more than that, I'd say the lib is broken. |
| 23:34 | DuneMan | heh |
| 23:34 | hugod | clj-ssh will pick up .ssh/id_rsa by default |
| 23:34 | _brian2_ | ok, thanks |
| 23:34 | hugod | though if you have a passphrase, you'll need to add it explicitly |
| 23:35 | _brian2_ | is that the same as password? |
| 23:35 | technomancy | iirc jcsh does not respect DSA keys, I wonder if clj-ssh has the same problem |
| 23:35 | DuneMan | should probably not use dsa anymore anyway |
| 23:36 | hugod | technomancy: I've not tried that |
| 23:36 | hugod | clj-ssh uses jsch |
| 23:37 | technomancy | hugod: thanks for the tip about slime-default-connection etc; will try that |
| 23:37 | technomancy | no idea why it's giving me the CL-USER prompt |
| 23:37 | _brian2_ | hugod : i see you say you are trying to imitate something in the contrib library, why is that? |
| 23:37 | _brian2_ | is your's more up to date? |
| 23:38 | hugod | _brian2_: contrib.shell is just for local sh |
| 23:38 | _brian2_ | ok |
| 23:39 | _brian2_ | hugod : if I have more questions, do you mind if I post them to the issues area? |
| 23:39 | hugod | technomancy: I have seen that in the past - if I remember correctly, it was some sequencing issue, and disappeared after the first comman |
| 23:41 | hugod | _brian2_: sure, if they are issues, otherwise general usage questions can be answered here |
| 23:41 | _brian2_ | ok |
| 23:42 | hugod | if you don't get a response here, feel free to escalate to the issues |
| 23:43 | _brian2_ | what does that mean? |
| 23:43 | _brian2_ | exclamation marks? |
| 23:48 | DuneMan | technomancy: http://github.com/hugoduncan/clj-ssh/issues |
| 23:48 | DuneMan | erps |
| 23:48 | DuneMan | _brian2_: http://github.com/hugoduncan/clj-ssh/issues |
| 23:49 | _brian2_ | hugod : so if I just want to log into a computer is it -> (ssh "user@something.com) but where do I put the password? |
| 23:49 | _brian2_ | also that doesn't work |
| 23:49 | DuneMan | really, you should generate an rsa key and do passwordless login. |
| 23:49 | _brian2_ | ok |
| 23:49 | DuneMan | even if the lib makes it easy to do it the insecure way. |
| 23:50 | _brian2_ | the error is java.net.UnknownHostException |
| 23:51 | technomancy | I heard RSA had patent issues, which is why I always stuck with DSA |
| 23:52 | technomancy | that was a while ago; wouldn't be surprised if they expired |
| 23:52 | DuneMan | looks like username "blah" as an option. |
| 23:52 | hugod | _brian2_: (ssh "somthing.com" "ls" :username xx :password yy) |
| 23:52 | DuneMan | technomancy: Ah, I'm not actually aware. |
| 23:53 | hugod | _brian2_: or whatever command you want to run - it's not going to give you an interactive shell |
| 23:53 | _brian2_ | ok |
| 23:54 | _brian2_ | I would like to access a database and manipulate it using a clojure program, is that possible, or am I on the wrong track |
| 23:54 | technomancy | hugod: do you do those 2 setqs before it's connected? |
| 23:55 | hugod | technomancy: I run them whenever I have trouble making a connection, and then try again |
| 23:55 | DuneMan | tunneling a connection of ssh? |
| 23:55 | DuneMan | over* |
| 23:56 | DuneMan | One would think the right thing to do would be to use your databases java library to manipulate it |
| 23:56 | technomancy | hugod: remind me again why I'm running trunk slime? =) |
| 23:56 | DuneMan | and, at most, tunnel the connection over ssh. |
| 23:56 | DuneMan | And if you're using a database that doesn't have a good java driver, then you should probably think about joining 2010 and using a real database. |
| 23:56 | hugod | technomancy: because you like using sbcl ;-) |
| 23:57 | DuneMan | unless there's some reason why that's impractical. |
| 23:57 | technomancy | oh right, I am a child of the '80s. |
| 23:57 | _brian2_ | DuneMan : Im using mongo, the new kid on the block |
| 23:57 | DuneMan | Then use congomongo. |
| 23:57 | _brian2_ | i am |
| 23:57 | DuneMan | Then you don't need to do anything with ssh. |
| 23:58 | DuneMan | unless you don't want to open the port and want to tunnel the connection over ssh |
| 23:58 | DuneMan | I spoke at MongoSF last week |
| 23:58 | DuneMan | love it :-) |
| 23:59 | _brian2_ | well, where does congo mongo sit when I use it that way? |
| 23:59 | DuneMan | Tunneling it? |
| 23:59 | _brian2_ | I mean is it on the client or server |
| 23:59 | DuneMan | Congomongo is a client library for speaking to mongodb. |
| 23:59 | DuneMan | It wraps the java mongodb library. |