2010-11-18
| 00:40 | sandGorgon | i have a 3rd party jar that i want to use in my leiningen project - I cannot bundle it to clojars. how do i use it ? because copying it in the "lib" folder causes it to be deleted whenever i do "lein clean" |
| 00:41 | amalloy | sandGorgon: i'm not an expert here, but if you can build their jar with maven i can help |
| 00:42 | LauJensen | "im no expert here, so if you drink my poison I may be of some assistance" :) |
| 00:42 | amalloy | LauJensen: more or less |
| 00:42 | _ato | sandGorgon: one way is to install it to your local maven repository (~/.m2). Leiningen will look for a jar there before it goes searching clojars etc |
| 00:42 | sandGorgon | amalloy, well i have the jar itself lying with me |
| 00:43 | sandGorgon | _ato, let me try that... kinda inconvenient though |
| 00:43 | amalloy | sandGorgon: that's basically my suggestion too :P |
| 00:43 | _ato | something like this, I think: mvn install:install-file -Dfile=foo-1.0.jar -DgroupId=org.some.group -DartifactId=foo -Dversion=1.0 |
| 00:43 | LauJensen | sandGorgon: That would be my suggestion too, 'cake install jarfile.jar' |
| 00:48 | _ato | might be able to stick it in ~/.lein/plugins too |
| 00:48 | _ato | I'm not sure if that gets appended to the project's classpath or only lein itself's classpath |
| 00:49 | _ato | won't get bundled with uberjar though |
| 00:54 | sandGorgon | hmm.. there is :native-path |
| 01:06 | sandGorgon | ahh... copy the 3'rd party libs to the "lib" folder itself. Just set ":disable-implicit-clean true" . lein wont delete-recreate the lib folder |
| 01:56 | joshua__ | I have a vector of vectors. How can I insert two vectors into the middle of this vector of vectors. Like [stuff stuff (create-two-vectors) more-stuff] would produce [stuff stuff created created more-stuff]? |
| 01:59 | joshua__ | Sorry if this isn't even possible. From what I've read it is suppose to very easy to do whatever you want in lisp by typing (turn-off-gravity). Actually that was python, but still. |
| 02:02 | amalloy | joshua__: it's possible, but usually you shouldn't |
| 02:02 | amalloy | vectors have fast random access, and fast append, but slow insert |
| 02:03 | amalloy | (that's one of the reasons there's no easy way to do it) |
| 02:03 | joshua__ | kk |
| 02:04 | joshua__ | So how about good documentation for hiccup? |
| 02:04 | amalloy | but concat would be the way to go, if you wanted to (i think) |
| 02:06 | joshua__ | I was just trying to write more dryly with hiccup, I'm pretty sure there has to be a more dry way to add labels to these form input fields. =( |
| 02:06 | amalloy | don't know anything about hiccup, i'm afraid |
| 02:09 | amalloy | but here's a really gross way to do what you asked: ##(let [vs [[1 2] [3 4] [5 6]] [before after] (split-at 1 vs)] (apply conj (vec before) [7 8] [9 10] after)) |
| 02:09 | sexpbot | ⟹ [[1 2] [7 8] [9 10] [3 4] [5 6]] |
| 02:09 | joshua__ | Bad pun 1: Don't worry I won't hold my breath. Bad pun 2: You don't know it, I'm scared now! What templating library should I use!?! Look you scared away the hiccups. |
| 02:11 | amalloy | i'm sure LauJensen will come by any moment to tell me how dreadful my answer is... |
| 02:11 | joshua__ | Yea, I'll pass on that. Don't sweat this one I can make it through without fixing it, it is no problem at all. |
| 02:12 | joshua__ | You already made me dance for joy, your doing great! ;P |
| 02:12 | amalloy | my life's work is complete |
| 02:12 | amalloy | therefore: i will go to bed. enjoy clojure, joshua__ |
| 02:12 | joshua__ | Thanks, have a good night sleep! |
| 02:18 | LauJensen | joshua__: hiccup is php for clojure, try Enlive |
| 02:19 | joshua__ | Thank you so much! I was really not enjoying hiccup, but was going to keep trecking on. |
| 02:20 | LauJensen | joshua__: Enlive gives you 100% code/presentation separation, bestinclass.dk is totally enlive generated and opensource |
| 02:30 | joshua__ | Oh your that guy! Some of your articles got me interested in clojure! You also helped me set up emacs. =) |
| 02:32 | joshua__ | I'm going to head to bed, thanks for the advice. Going to dive into enlive tomorrow. |
| 02:48 | LauJensen | Great, see you tomorrow :) |
| 02:49 | bobo_ | naw, dont call hiccup php, nothing deserves to be compared to php :-/ |
| 02:49 | bobo_ | but i see your point =) |
| 02:49 | LauJensen | bobo_: right...except hiccup :) |
| 02:50 | bobo_ | i showed a frontend guy how enlive works at work... he didnt belive me it could work |
| 02:50 | bobo_ | he thought his jquery templates was as good as it gets |
| 02:58 | kotrin | jquery templates? |
| 03:01 | bobo_ | its a plugin to jquery |
| 03:01 | bobo_ | it has for loops and craps in the html |
| 03:01 | bobo_ | and it puts html in your javascript |
| 03:02 | LauJensen | bobo_: Its essentially the same as Pure in that regard. Its a proven technique :) |
| 03:05 | bobo_ | Pure? |
| 03:06 | LauJensen | Pure is a javascript lib which has similar capabilities, just without the awesomeness |
| 03:06 | raek | jk_: pong! |
| 03:09 | bobo_ | Pure looks 10 times cleaner then the crap he used. why did he use that crap *sigh* |
| 03:15 | raek | bobo_: btw, did you see the "guestbook" ampleyfly and I did for the last Linköping Clojure User Group meeting? |
| 03:16 | raek | ring + moustache + enlive + 90's HTML |
| 03:17 | raek | http://services.raek.se/guestbook/ |
| 03:17 | raek | if you look at it for too long time, you will go blind |
| 03:17 | LauJensen | raek: Man you could patent ugly |
| 03:18 | raek | :) |
| 03:18 | bobo_ | raek: no i didnt! |
| 03:18 | bobo_ | omg! |
| 03:19 | kotrin | holy batmans this is an awesome website |
| 03:24 | _ato | it needs a frameset, blink tag and a marquee |
| 03:24 | _ato | I like the mouse following cat thing |
| 03:42 | raek | https://github.com/raek/lcug-guestbook |
| 03:54 | hiredman | *cough* |
| 03:54 | hiredman | pardon me |
| 05:00 | Tordmor | Hi! Any idea on how to rephrase that? http://pastie.org/1307987 |
| 05:03 | raek | if you use refs, you don't need the exceptions |
| 05:05 | raek | (defn new-player [players name] (if (contains? players name) false (alter players assoc name (ref (make-player name))))) |
| 05:07 | raek | sorry. ...(contains? @players name)... |
| 05:07 | raek | and (do (alter ...) true) |
| 05:07 | raek | but with atoms, I think throwing an exception is the only way to abort the change |
| 05:09 | Tordmor | ok, thanks. How is the performance/memory with refs as opposed to atoms? |
| 05:09 | raek | you could perhaps factor out the function you pass to swap! |
| 05:10 | raek | and call it something like non-replacing-assoc |
| 05:10 | raek | atoms are more lightweight, but limited |
| 05:11 | Tordmor | :) |
| 05:11 | Tordmor | wrong window, sorry |
| 07:03 | blubber | Hi, any emacs guru around that can tell me how to change the color of parenthesis in clojure-mode? |
| 07:16 | hsuh | first time i needed mutable state and i'm having trouble... is there a better way to express those forever-running loops (code doesnt work because swap! takes a function): http://pastie.org/1308193 |
| 07:19 | AWizzArd | hsuh: there is also reset! |
| 07:19 | AWizzArd | Which takes no function. |
| 07:20 | AWizzArd | Your defn example is best be (reset! your-atom 10) |
| 07:20 | AWizzArd | if there were not reset! you would say (swap! yout-atom (constantly 10)) |
| 07:20 | hsuh | ow! thanks a lot man |
| 07:20 | hsuh | how should a beginner find about that? i was looking at http://clojure.org/atoms |
| 07:21 | Tordmor | hsuh: by asking on irc :) |
| 07:22 | AWizzArd | hsuh: you could search all docstrings for "atom" and see where it shows up. |
| 07:22 | AWizzArd | (find-doc "atom") |
| 07:22 | hsuh | hm, right... |
| 07:22 | AWizzArd | It also lists reset!. |
| 07:23 | hsuh | ooops, also forgot to deref |
| 07:54 | jk_ | raek: u there? |
| 07:54 | raek | yes |
| 07:54 | jk_ | raek: http://tinypic.com/r/11iha34/7 |
| 07:55 | jk_ | raek: that's how you run a snippet in the current repl in ccw |
| 07:55 | jk_ | raek: you were asking about it last night but i wasn't at a computer |
| 07:56 | raek | ah, I got the answer from someone else |
| 07:56 | jk_ | that was me :) |
| 07:56 | jk_ | i was on my phone last night |
| 07:56 | raek | neat that it has the same keyboard binding as in emacs... |
| 07:57 | jk_ | raek: i don't know if it's a conflicting binding with another pluging or what but the kb shortcut doesn't work. i actually have to click it, which is mildly annoying |
| 07:57 | jk_ | raek: i have a ton of plugins loaded so i'll need to look at that a bit closer |
| 08:02 | AWizzArd | JFYI, interesting: http://www.infoq.com/interviews/functional-langs |
| 09:20 | edw | Any Incanter users here? |
| 09:20 | blubber | Hi, any emacs guru around that can tell me how to change the color of parenthesis in clojure-mode? |
| 09:24 | aan4nd | Hello folks. Is anyone able to either link me to, or walk me through, the most basic possible set of steps for getting a REPL running in vimclojure? I feel I have exhausted Google's usefulness. |
| 09:40 | @rhickey | ,(.. Runtime getRuntime totalMemory) |
| 09:40 | clojurebot | 28307456 |
| 09:40 | @rhickey | take that, -> :) |
| 09:41 | chouser | oh, fine. |
| 09:41 | stuartsierra | :) |
| 09:42 | chouser | rhickey: btw, thanks for sticking up for ... well, whatever you're sticking up for in LtU. Seriously out of my depth. |
| 09:42 | stuartsierra | chouser: I'm watching your Strange Loop talk right now. |
| 09:43 | chouser | stuartsierra: you won't learn anything about Clojure there, but I hope you enjoy it anyway. :-) |
| 09:44 | stuartsierra | Doing an article on the same topic, wanted to check out other explanations. |
| 09:46 | @rhickey | chouser: I liked your talk and wished more of the LtU commenters had watched it, just to see the modesty of the argument. There's such a cult of novelty and precedence there, and Clojure doesn't really play that, being mostly unoriginal |
| 09:47 | chouser | I probably should have read a few more papers than I did before claiming to talk about a subject like that. |
| 09:47 | chouser | rhickey: hm, interesting point. |
| 09:47 | stuartsierra | chouser: nah, you got it :) |
| 09:47 | @rhickey | chouser: I do think you undersold protocols a bit, saying the only advantage was perf |
| 09:48 | chouser | rhickey: thanks for saying you liked it. That means a lot to me. |
| 09:48 | chouser | rhickey: compared to multimethods? what else do you get? |
| 09:48 | @rhickey | advantages are also - grouping of related functions, good bridge to host, concrete mixin and implementation composition |
| 09:48 | fogus` | rhickey: Whoops. I was certain there would be a more thoughtful discussion. :-( |
| 09:49 | chouser | Mmm, bridge to host is indeed a bigger deal than I made of it. |
| 09:49 | @rhickey | fogus`: no worries, I think they are coming around :) |
| 09:49 | chouser | the grouping of related functions I intentionally dropped, as it wouldn't be hard to build something for that ad-hoc on top of multimethods |
| 09:50 | @rhickey | chouser: really? I wonder |
| 09:51 | @rhickey | without circumscribing the dispatch, what do you hang the grouping on? |
| 09:52 | @rhickey | what is the equivalent of satisfies? |
| 09:52 | fogus` | chouser: I thought it was a very nice talk. I rarely post on LtU, but thought your talk was a nice reason to break my silence. |
| 09:54 | chouser | the grouping with protocols is mainly useful from the host perspective, and sure "satisfies" |
| 09:54 | chouser | since name resolution is still at the namespace level |
| 09:54 | @rhickey | and documentation |
| 09:55 | chouser | yes |
| 09:55 | @rhickey | and mixin composition |
| 09:55 | stuartsierra | Is "disj" suitable as "remove from generic unordered collection"? |
| 09:56 | @rhickey | stuartsierra: that's not a set? |
| 09:56 | stuartsierra | not a set per se |
| 09:56 | @rhickey | if it has dupes what does disj do? |
| 09:57 | stuartsierra | no dups |
| 09:57 | stuartsierra | abedra and I wrote a consistent hashing impl |
| 09:57 | @rhickey | so a collection of unique items that's not a set? hrm |
| 09:57 | stuartsierra | I made it implement conj, disj, and ILookup |
| 09:58 | @rhickey | how is it not a set? |
| 09:58 | stuartsierra | stu halloway thought we were abusing deftype by calling it an IPersistentSet |
| 09:59 | @rhickey | in what way was it not? |
| 09:59 | stuartsierra | If you call "get" or IFn.invoke, it acts like a map. If you call conj or disj, it acts like a set. |
| 10:00 | @rhickey | maybe you're abusing get and IFn |
| 10:00 | stuartsierra | hrm |
| 10:01 | @rhickey | or, it's really a map |
| 10:01 | stuartsierra | I think it's both map-like and set-like. |
| 10:01 | stuartsierra | You want set-like behavior when you add or remove nodes. |
| 10:02 | stuartsierra | And map-like behavior when you look up the node for a given input key. |
| 10:02 | @rhickey | you're pushing it with the latter |
| 10:03 | @rhickey | in that sense all functions are map-like |
| 10:03 | @rhickey | just use a named function |
| 10:03 | stuartsierra | hmm, ok. |
| 10:04 | tonyl | morning |
| 10:04 | stuartsierra | It was just really convenient to say (map my-consistent-hash bunch-of-inputs) |
| 10:07 | @rhickey | stuartsierra: well, the IFn thing is less bad than get |
| 10:09 | @rhickey | IFn doesn't break IPersistentSet |
| 10:09 | stuartsierra | And "get" does? |
| 10:10 | @rhickey | yes, you break with the semantics of get |
| 10:10 | @rhickey | for sets |
| 10:10 | stuartsierra | ah, ok, that makes sense |
| 10:17 | raek | blubber: I only know of this: http://dishevelled.net/elisp/rainbow-parens.el |
| 10:27 | mattmitchell_ | i'm trying to find a way to test that a string is not empty, is there something like ruby's blank? string method? |
| 10:28 | stuartsierra | ,(empty? "") |
| 10:28 | clojurebot | true |
| 10:28 | stuartsierra | ,(clojure.string/blank? " ") |
| 10:28 | clojurebot | java.lang.ClassNotFoundException: clojure.string |
| 10:28 | stuartsierra | (require 'clojure.string) |
| 10:29 | mattmitchell_ | stuartsierra: awesome thanks. |
| 10:30 | mattmitchell_ | ok cool, looking at the string api now :) |
| 11:04 | Tordmor | blank? doesn't seem to know unicode whitespace |
| 11:04 | Tordmor | ,(let [s (str \uFEFF \uFEFF)] (prn s (count s) (clojure.string/blank? s))) |
| 11:04 | clojurebot | java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.string |
| 11:05 | stuartsierra | It's going by java.lang.Character/isWhitespace |
| 11:10 | Tordmor | Ah, as opposed to isSpaceChar |
| 11:11 | Tordmor | makes sense |
| 11:22 | rata_ | hi |
| 11:23 | rata_ | is there any difference between (merge-with into ...) and (merge-with merge ...)? |
| 11:23 | rata_ | (besides into being more general, as it also works with any kind of seq, not just maps) |
| 11:26 | chouser | rata_: in general, into can be used anywhere you use merge, except that into take exactly 2 args where merge can take more |
| 11:32 | rata_ | chouser: ok, thanks |
| 11:33 | rata_ | in the case of merge-with, that's not a problem, because into will always receive two args |
| 11:33 | chouser | right |
| 11:33 | rata_ | and is there any difference on performance between them? |
| 11:36 | chouser | into currently uses transients, while merge does not. Hm, but merge uses .reduce on the seq chunks. |
| 11:36 | chouser | rata_: I guess I'd use 'into' unless you have a specific need for merge, or measure if you care enough to see which is faster in your use cases. |
| 12:09 | AWizzArd | ,(quote ?[]) ; ==> ?[] |
| 12:09 | clojurebot | ? |
| 12:11 | hiredman | AWizzArd: what are you doing? |
| 12:12 | hiredman | ?[] is a symbol followed by an empty vector and quote quotes one thing |
| 12:17 | AWizzArd | hiredman: can ?[] not be a symbol? |
| 12:18 | amalloy | AWizzArd: [] are not legal symbol characters |
| 12:18 | AWizzArd | I see. |
| 12:18 | amalloy | &(symbol "?[]") |
| 12:18 | sexpbot | ⟹ ?[] |
| 12:18 | amalloy | er |
| 12:18 | amalloy | wow |
| 12:18 | AWizzArd | Not legal when the reader is doing it. |
| 12:19 | hiredman | right, the reader's dispatch table sees [ and starts a vector |
| 12:21 | chouser | well, I think it's correct to say they're not legal and that 'symbol' doesn't check for legality. |
| 12:22 | chouser | chances are eventually either that will become legal and get a reader syntax (perhaps |?[]|), or 'symbol' will check and reject it. |
| 12:23 | amalloy | chouser: good point. now that i think of it, you can get all kinds of actually-illegal symbols and keywords that way |
| 12:23 | amalloy | &(keyword "this has spaces in it") |
| 12:23 | sexpbot | ⟹ :this has spaces in it |
| 12:28 | Lajla | chouser, is (symbol "true") a legal symbol? |
| 12:29 | Lajla | ->(symbol "true") |
| 12:29 | Lajla | &(symbol "true") |
| 12:29 | sexpbot | ⟹ true |
| 12:29 | amalloy | Lajla: true is certainly a legal symbol |
| 12:29 | chouser | Lajla: sure |
| 12:30 | chouser | ,(= true 'true) |
| 12:30 | clojurebot | true |
| 12:30 | chouser | oh |
| 12:30 | Lajla | That still doesn't prove its symbolhood |
| 12:30 | Lajla | &(symbol? true) |
| 12:30 | sexpbot | ⟹ false |
| 12:30 | Lajla | That disproves it though |
| 12:30 | chouser | &(symbol? 'true) |
| 12:30 | sexpbot | ⟹ false |
| 12:30 | amalloy | Lajla: no it doesn't |
| 12:30 | Lajla | True is a self evaluating boolean |
| 12:30 | Lajla | Seems to me. |
| 12:30 | Lajla | Not a symbol |
| 12:31 | amalloy | &(let [x 1] (symbol? x)) |
| 12:31 | sexpbot | ⟹ false |
| 12:31 | amalloy | x is obviously a symbol here |
| 12:31 | Lajla | Yes |
| 12:31 | Lajla | but that's not my issue |
| 12:31 | Lajla | The point if is true is a symbol. |
| 12:31 | Lajla | Like nil and T are in CL. |
| 12:31 | chouser | Lajla: your examples were not what you meant, but I see your point. |
| 12:31 | chouser | it is a good point |
| 12:31 | Lajla | And if a symbol composed of the chars t, r, u, and e, is a legal symbol. |
| 12:32 | Lajla | What I mean is, that the reader has a praecidence of the boolean over the symbol doesn't per se mean that such a symbol cannot exis.t |
| 12:32 | Lajla | Or be created by other means. |
| 12:32 | Lajla | Like (symbol "true") |
| 12:32 | Lajla | &(= (symbol "true") true) |
| 12:32 | sexpbot | ⟹ false |
| 12:33 | amalloy | &(symbol? (symbol "true")) |
| 12:33 | sexpbot | ⟹ true |
| 12:41 | Lajla | amalloy, so yeah, the reader basically gives praecidence to the boolean over the symbol. |
| 12:41 | Lajla | Not sure if a symbol like that is legal. |
| 12:41 | Lajla | well, it is. |
| 12:41 | Lajla | &(symbol? (symbol "Ich liebe dich, und I worship your shadow {][[]p][].")) |
| 12:41 | sexpbot | ⟹ true |
| 12:42 | Lajla | Seems clear to me that it's a possible symbol, there's just no reader syntax for it. |
| 12:42 | Lajla | Not too unusual. |
| 12:42 | Lajla | &(= #(+ 1 %) '#(+ 1 %)) |
| 12:42 | sexpbot | ⟹ false |
| 12:42 | Lajla | Hmm |
| 12:43 | Lajla | Memory location maybe |
| 12:43 | Lajla | &('#(+ 1 %) 2) |
| 12:43 | sexpbot | java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn |
| 12:43 | amalloy | Lajla: they're different classes |
| 12:43 | Lajla | Hmm |
| 12:43 | Lajla | list eh |
| 12:43 | Lajla | &'#(+ 1 %) |
| 12:43 | sexpbot | ⟹ (fn* [p1__6287#] (+ 1 p1__6287#)) |
| 12:43 | Lajla | Ahaa |
| 12:44 | raek | that is what the evaluator gets |
| 12:44 | Lajla | &(conj 3 '#(+ 1 %)) |
| 12:44 | sexpbot | java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IPersistentCollection |
| 12:44 | Lajla | Whoops |
| 12:44 | Lajla | wrong order |
| 12:44 | Lajla | &(conj '#(+ 1 %) 3) |
| 12:44 | sexpbot | ⟹ (3 fn* [p1__6303#] (+ 1 p1__6303#)) |
| 12:52 | alexyk | I'm trying to use incanter after already using io, get: java.lang.IllegalStateException: copy already refers to: #'clojure.contrib.io/copy in namespace: user (NO_SOURCE_FILE:0)... how do I hide copy again? |
| 12:54 | amalloy | (use '[clojure.contrib.io :exclude [copy]])? |
| 12:55 | amalloy | alexyk: there's also ns-unmap: ##(doc ns-unmap) |
| 12:55 | sexpbot | ⟹ "([ns sym]); Removes the mappings for the symbol from the namespace." |
| 12:55 | alexyk | amalloy: yes, the copy is already in scope and need to be purged |
| 12:55 | amalloy | right. so ns-unmap once (or restart the repl), and after that :exclude |
| 12:55 | alexyk | this is really annoying as IllegalState prevents Incanter to be loaded |
| 12:56 | amalloy | alexyk: nonsense |
| 12:56 | alexyk | in some cases we get a warning, so I didn't expect an f-up |
| 12:56 | amalloy | (require) instead of (use) |
| 12:56 | hiredman | use clojure.java.io instead of the clojure.contrib.io |
| 12:56 | alexyk | hiredman: ah ok |
| 12:57 | amalloy | which is a good habit anyway, so that you and/or people reading your code can tell where the functions came from: (:require [foo.bar.io :as io]) |
| 12:57 | hiredman | hmm, actually, that is loopy |
| 12:57 | hiredman | incanter is bringing in it's own copy when you :use it? |
| 12:57 | alexyk | hiredman: yep |
| 12:58 | hiredman | well then you need to require |
| 12:58 | hiredman | I would recommend :require incanter and :use clojure.java.io |
| 13:02 | alexyk | incanter is very fragmented, everything is in a different namespace... have to use all with an :as I guess |
| 13:04 | hiredman | you might look at nstools, it's googleable |
| 13:48 | imphasing | I'm attempting to format a number with google refine, so that commas are inserted every 3 digits, as per US custom. Does anyone know if there's an easy way to do this with clojure? |
| 13:51 | LauJensen | Gentlemen, after 2.5 hard years Im excited to announce ClojureQL is now released in 1.0.0 beta! Screencast + Blogpost showing the basics here: http://bestinclass.dk/index.clj/2010/11/clojureql--1.0.0-now-in-beta.html - Feedback is encouraged :) There's also a #clojureql for those who need support |
| 13:54 | chouser | & (.format (java.text.NumberFormat/getInstance) 12345678) |
| 13:54 | sexpbot | ⟹ "12,345,678" |
| 13:54 | chouser | imphasing: but I think that's locale-dependant |
| 13:55 | imphasing | chouser: Ah, ok. I decided to just make a dirty webservice in PHP to interface with refine |
| 13:56 | chouser | & (.format (java.text.DecimalFormat. "##,##.00") 12345678) |
| 13:56 | sexpbot | , java.lang.Exception: EOF while reading |
| 13:56 | clojurebot | Invalid token: java.lang.Exception: |
| 13:56 | sexpbot | .00") 12345678) java.lang.Exception: Unable to resolve symbol: .00 in this context |
| 13:56 | chouser | ,(.format (java.text.DecimalFormat. "##,##.00") 12345678) |
| 13:56 | sexpbot | , java.lang.Exception: EOF while reading |
| 13:56 | sexpbot | .00") 12345678) java.lang.Exception: Unable to resolve symbol: .00 in this context |
| 13:56 | clojurebot | "12,34,56,78.00" |
| 13:56 | clojurebot | Invalid token: java.lang.Exception: |
| 13:57 | chouser | weird |
| 13:57 | chouser | hm probably want ##,###.00 instead |
| 13:57 | sexpbot | , java.lang.Exception: EOF while reading |
| 13:57 | sexpbot | #.00 instead java.lang.Exception: No dispatch macro for: . |
| 13:57 | clojurebot | Invalid token: java.lang.Exception: |
| 13:58 | chouser | oh, I see. I'm making sexpbot start it's message with a , which triggers clojurebot to fail. hooray. |
| 13:59 | mroessler | @LauJensen: Have you thought about windowing in ClojureQL? For example, from you aggregate example that is the equivalent of "SELECT corr(x+y) from users", how about implementing "SELECT corr(x+y) over (partition by something order by somethingelse) from users"? |
| 14:01 | LauJensen | mroessler: I haven't thought about that yet |
| 14:16 | ninjudd | mroessler: that would be a great feature to add in clojureql 1.1 |
| 14:19 | stuartsierra | anybody have the link for Stu Halloway's Protocol slides from JAOO? |
| 14:21 | LauJensen | stuartsierra: http://tinyurl.com/2cpm5gb |
| 14:22 | stuartsierra | yeah, eventually that got me there |
| 14:22 | stuartsierra | but not the particular slides I wanted |
| 14:22 | stuartsierra | Here's what I was looking for: http://gotocon.com/dl/jaoo-aarhus-2010/slides/StuartHalloway_ClojureProtocolsArenotInterfaces.pdf |
| 14:22 | LauJensen | stuartsierra: http://cloud.github.com/downloads/stuarthalloway/clojure-presentations/ClojureProtocolsJAOO.pdf not that one? |
| 14:23 | stuartsierra | ah! |
| 14:25 | mroessler | @ninjudd My suspicion is that it is quite difficult to implement. I'm trying to figure out how to do windowing type analysis in just Clojure code. For example, given a sequence or a structmap like apply an aggregate (corr,min,max,etc.) over partitions within it. This enables analysis of moving averages for example to data that includes >1 grouping. |
| 14:27 | hiredman | mroessler: please stop @'ing at people |
| 14:27 | hiredman | irc is not twitter |
| 14:27 | ninjudd | mroessler: how standard is WINDOW and OVER in sql? i know postresql supports it |
| 14:28 | mroessler | hiredman: is the proper way using name: I don't know I'm new to IRC. |
| 14:29 | hiredman | nick: or nick, |
| 14:29 | hiredman | : requires shift, but , doesn't |
| 14:29 | ninjudd | who's nick? |
| 14:30 | hiredman | ninjudd: http://tools.ietf.org/html/rfc2812#section-3.1.2 |
| 14:30 | mroessler | ninjudd: windowing became part of sql in SQL:1999 and was expanded in SQL:2003. Yes, it is very well supported by Postgresql in the open source area. Greenplum SNE and Greenplum also support it excellently. Then to my knowledge all the standard proprietary db like Oracle, MSQL also support it. Just not in mysql. |
| 14:31 | Chousuke | neither : or , require the shift key if you use tab completion :P |
| 14:31 | mroessler | hiredman: thanks to you and nick, I now how to use IRC. |
| 14:34 | ninjudd | mroessler: if you're interested in helping add it to 1.1, let me know, and we can discuss syntax ideas and details in #clojureql |
| 14:35 | KirinDave | I am having a Bad Clojure Day™ |
| 14:36 | mroessler | ninjudd: yes. I'll look for you in #clojureql in near future. |
| 14:37 | KirinDave | Can anyone recommend a better way to go about doing this: https://gist.github.com/705478 |
| 14:37 | KirinDave | I didn't see a way to magically do this in clj-time |
| 14:37 | LauJensen | ClojureQL now in HN: http://news.ycombinator.com/item?id=1918954 :) |
| 14:38 | KirinDave | But it's weird to me that both clj-time and JodaTime seem to have problems trying to fuzzy-match. |
| 14:38 | amalloy | chouser: man, i step away for an hour, and i come back to see you've started the robot wars |
| 14:38 | KirinDave | Any advice on how to make it clearer and easier? |
| 14:39 | KirinDave | I feel like it's ugly code. |
| 14:39 | KirinDave | LauJensen: Oh damn man, this is relevant to my interests. |
| 14:39 | hiredman | jodatime just plain refuses to parse human readable timezones like PST, it surprises me that people continue to sing it's praises |
| 14:39 | chouser | amalloy: :-) |
| 14:40 | KirinDave | hiredman: codahale was saying that people love it because of things like its interval handling that actually has all kinds of little details (like offsets and leap years and older calendars). But I too am surprised. |
| 14:40 | KirinDave | hiredman: Any advice on how to make that code less terrible? |
| 14:42 | hiredman | I have no advice |
| 14:44 | KirinDave | At least I didn't have to say class DateParsingStrategy ... :P |
| 14:44 | hiredman | besides watch out for the bug on ubuntu where if you use a 32bit jvm on a 64bit system if you call getResource before trying to use SimpleDateParser (from the jre) it will parse all timezones as GMT |
| 14:44 | KirinDave | God I hate code like that. |
| 14:44 | KirinDave | hiredman: For HTTP 1.1 it is the clients error if they send me timestamps that are not UTC |
| 14:44 | hiredman | and since clojure code is loading via getResource … |
| 14:44 | KirinDave | hiredman: So I think i will be okay in that regard. but I didn't know that, thanks for the warning. |
| 14:45 | hiredman | KirinDave: right, well, sticking to the rfc doesn't often survive contact with reality |
| 14:46 | KirinDave | hiredman: Hopefully someone will submit a patch for it then. I'm just trying to get the remaining logic and states into some semblance of order before I drop a point release and put clothesline up on clojars. |
| 14:46 | hiredman | sure |
| 14:47 | KirinDave | Are you guys at all interested in clothesline? I know it's sorta pre-mature for real use |
| 14:48 | hiredman | we don't do any webstuff in clojure |
| 14:49 | hiredman | we have some rest apis we expose built on ring, but nothing very complex, all internal |
| 14:49 | mroessler | hiredman: what else to use that has something like getFirstDayOfWeek(); if not joda? |
| 14:49 | dnolen | LauJensen: congrats! |
| 14:50 | LauJensen | dnolen: thanks buddy :) |
| 14:50 | hiredman | mroessler: I don't care about the first day of the week, I just want to be able to parse dates |
| 14:51 | mroessler | hiredman: that makes a good argument to stick with joda. |
| 14:51 | hiredman | no |
| 14:51 | hiredman | joda cannot parse timezones |
| 14:51 | hiredman | non-starter |
| 14:52 | hiredman | our data parser is a list of about 10 functions and growing, each one gets tried in turn to parse the date |
| 14:53 | hiredman | I swear to you, I have seen date headers that have the timezone as {5}, curly braces and all |
| 14:54 | dnolen | LauJensen: ClojureQL looks real sweet now. Makes writing SQL look positively fun. Whodda thunk?! |
| 14:54 | stuartsierra | A theoretical question: |
| 14:54 | LauJensen | hehe, thats right! Like Chris said, bringing Relational Algebra back to Relational Databases. I have high hopes for this project :) |
| 14:55 | stuartsierra | Are static methods overloaded on argument type a solution to the Expression Problem? |
| 14:55 | stuartsierra | (in Java) |
| 14:57 | hiredman | stuartsierra: you cannot add a new static method for a new set of argument types later |
| 14:57 | stuartsierra | yes |
| 14:58 | mjg123 | hello folks. What is the fn for adding an item to the _end_ of a list? |
| 14:58 | LauJensen | mjg123: doesnt exist |
| 14:58 | amalloy | mjg123: use a vector instead |
| 14:58 | mjg123 | :) |
| 14:58 | mjg123 | fair enough. |
| 14:58 | LauJensen | amalloy: you should be busy reading my blogpost, arent you following bestinclass.dk yet?! |
| 14:58 | stuartsierra | (concat the-list (list the-item)) |
| 14:59 | amalloy | &(map #(conj % 10) [1 2 3] '(1 2 3)) |
| 14:59 | sexpbot | java.lang.IllegalArgumentException: Wrong number of args (2) passed to: sandbox4381$eval6376$fn |
| 14:59 | amalloy | &(map #(conj % 10) [[1 2 3] '(1 2 3)]) |
| 14:59 | sexpbot | ⟹ ([1 2 3 10] (10 1 2 3)) |
| 14:59 | hiredman | stuartsierra: that adds lazy-seq overhead everytime you do it and you will blow the stack when you try to read it |
| 14:59 | amalloy | LauJensen: i actually did read (some of) it! |
| 14:59 | amalloy | but then i got to the screencast and it was like, blah, not gonna watch that at work |
| 15:00 | LauJensen | Its very work related though |
| 15:00 | mjg123 | OK - I've been using stuartsierra's technique but I wondered why there wasn't a core fn for doing that |
| 15:00 | hiredman | ,(first (nth (iterate #(concat % [1]) []) 20000)) |
| 15:00 | clojurebot | java.lang.StackOverflowError |
| 15:00 | dpro | hi |
| 15:00 | amalloy | LauJensen: sadly not, at the moment. i'm working with cassandra, not sql |
| 15:00 | mjg123 | cheers |
| 15:01 | amalloy | mjg123: because you shouldn't add to the end of an immutable linked list |
| 15:01 | amalloy | it's super-inefficient |
| 15:01 | dpro | I'm playing around with labrepl, what do I need to import from compojure so I get the (html ...) function ? |
| 15:01 | tomoj | LauJensen: coincidentally I was just thinking "hmm.. wonder how clojureql is coming along" while staring at c.c.sql nasty |
| 15:01 | tomoj | looks awesome |
| 15:01 | tomoj | clojureql punts on table creation, right? |
| 15:01 | LauJensen | punts? |
| 15:01 | amalloy | LauJensen: gives up |
| 15:02 | tomoj | I mean, there's nothing in there for creating tables, is there? |
| 15:02 | tomoj | i.e. "it's not my problem" |
| 15:02 | LauJensen | contrib.sql is imported in clojureql.core, so use those functions |
| 15:02 | hiredman | dpro: html was split out into a seperate project, check weajester's github repos, I forget what it is called |
| 15:02 | LauJensen | One of the ways to get this done in 2 weeks was to piggy back a little on contrib |
| 15:02 | tomoj | LauJensen: thanks |
| 15:02 | LauJensen | np |
| 15:04 | dpro | hiredman: thx |
| 15:04 | dpro | hiredman: it's "hiccup" |
| 15:05 | LauJensen | hiccup, aka. PHP for Clojure :) |
| 15:07 | dpro | LauJensen: why ? I guess (html :foo "bar") is still more idiomatic than (str "<tag> " "text" ...) |
| 15:07 | dpro | LauJensen: the latter really looks like echo "...." |
| 15:07 | LauJensen | dpro: The common complaint about PHP is that it mixes code and presentation, and then most people turn around and do the exact same thing in Clojure. Use Enlive templates instead, 100% separation |
| 15:08 | dpro | LauJensen: I might eventually, I'm not planning a webapp, just wanted to get through with the laprepl chapters |
| 15:08 | LauJensen | ah ok |
| 15:09 | chouser | we have whole files full of PHP without any HTML in site. No mixing of presentation with code. It's still not a good language. |
| 15:09 | LauJensen | chouser: How does it feel to be boasting about the architecture of your PHP code? :D |
| 15:10 | amalloy | LauJensen: it's like kosher hot dogs at a hot-dog-eating competition |
| 15:10 | tonyl | i like the language |
| 15:10 | dpro | chouser: php is an abomination, but usually it's chosen by the less gifted, and then the bright people get the calls to "fix it by tomorrow" |
| 15:11 | lrenn | LauJensen: I'd prefer to have the full power of my language available. I'll enforce the no code/presentation seperation myself thank you. |
| 15:11 | LauJensen | tonyl: You like PHP? |
| 15:11 | LauJensen | lrenn: How does that comment fit in the context? |
| 15:11 | tonyl | yeah, I don't really hate any language though |
| 15:11 | lrenn | LauJensen: that hiccup is somehow ad. |
| 15:12 | chouser | Mmmmm PHP architecture. This isn't just code, it's form-following-function. It's design elegance and practical delivery coupled loosely into the height of reliability and maintainability. |
| 15:12 | lrenn | LauJensen: bad* |
| 15:12 | LauJensen | hehe |
| 15:12 | LauJensen | chouser: When did you get into marketing? :) |
| 15:12 | tonyl | the only thing that bothers me is the functions don't follow a naming scheme, but that is not a big hurdle to climb |
| 15:13 | LauJensen | lrenn: I must admit I dont see the point in using hiccup if you enforce separation yourself |
| 15:13 | dpro | tonyl: nevermind they also randomly operate on your data in place and returning results at other times |
| 15:13 | chouser | We have really learned how to generate customer drive and to enhance end to end reliability as our main focus. |
| 15:14 | tonyl | yup |
| 15:15 | amalloy | chouser: all very nice, but are your core values future-compatible? |
| 15:15 | rickmode | Monad question: I'm trying to use state-m and m-seq together.. anyone up on monads? |
| 15:16 | amalloy | rickmode: don't you want to use a monad transformer? |
| 15:16 | rickmode | amalloy: doesn't seem to fit |
| 15:16 | lrenn | LauJensen: because I'd rather use clojure than http://enlive.cgrand.net/syntax.html. I'm not saying enlive is bad, I'm just saying hiccup isn't evil. |
| 15:17 | LauJensen | lrenn: Are you sure you understand Enlive? It doesnt sound like it |
| 15:17 | chouser | amalloy: Maybe not yet, but I'm not worried, because first we have to gain business drive. |
| 15:17 | mroessler | LauJensen: Excellent video presentation on ClojureQL |
| 15:17 | LauJensen | mroessler: Thanks a lot |
| 15:19 | rickmode | amalloy: I have a list of state-m monad functions that take a map and return a [value and the map (possibly in a new state)]. In one situation I want the to run the map through the entire list, so using state-m and m-seq works fine. |
| 15:19 | tonyl | chouser: where do you work at? if you don't mind me asking |
| 15:19 | rickmode | amalloy: now I want to run the map through the list of function until a particular value arises |
| 15:19 | amalloy | rickmode: i don't actually have much practical experience with monads; it just sounded like you were trying to transform things based on my reading of the tutorials |
| 15:21 | rickmode | amalloy: ah... i've read the tutorials, read the source, read the group. The use of monads in clojure isn't widely discussed. I suspect I'd have to learn me some haskell to master monads. |
| 15:21 | lrenn | LauJensen: probably not. Reading up now. |
| 15:21 | chouser | tonyl: http://www.sentryds.com/ We actually have a really great team of smart, effective developers. But like most places, we also have old design decisions that need to be addressed. |
| 15:22 | dnolen | lrenn: I'm sneaking in some Clojure into the New York Times w/ Enlive :D It rules. I have a lengthy tutorial on it if you want to dig in. cgrand's documentation is ... spare. |
| 15:22 | tonyl | chouser: no way, that company was in my list to apply for a job this past summer. what a coincidence. |
| 15:22 | hiredman | chouser: you guys should totally use php.lisp |
| 15:23 | tonyl | oh yeah, I've heard about php.lisp. gotta take a look at it. hopefully it is not just another abstraction level |
| 15:23 | rickmode | dnolen: would you recommend enlive over only hiccup even for a smallish site? |
| 15:24 | hiredman | well, uh, there was some stupid php in parens thing, that really had nothing to do with lisp except adding extra parens |
| 15:24 | hiredman | which made the frontpage in progreddit |
| 15:24 | dnolen | rickmode: having editing markup mixed with logic for years - hiccup and templating languages now drive me insane. |
| 15:24 | hiredman | then there is php.lisp which is my lisp interpreter written in php |
| 15:25 | hiredman | I started work on a compiler but got side tracked |
| 15:25 | lrenn | dnolen: actually reading your tutorial now. |
| 15:25 | tonyl | hiredman: is it this one https://github.com/lunant/lisphp ? |
| 15:25 | hiredman | no |
| 15:26 | chouser | tonyl: you should. we're hiring, and it's a great team to work with. |
| 15:26 | chouser | tonyl: oh, was it just for a summer internship? |
| 15:26 | hiredman | tonyl: that may be the pile of garbage I mentioned that made the reddit frontpage, but I don't recall |
| 15:26 | lrenn | dnolen: but for example, look at the size of your looping section :) I'd rather just use for :) |
| 15:26 | rickmode | dnolen: I don't mean mixed use. I've had a dream of entirely code generated markup and am having a stab at it. Seems good (ideal) situation when developer has full control of design. I can totally see how this would break down if I was working with a graphic designer. |
| 15:27 | dnolen | rickmode: something to consider is that you often need to style things based on first and last or even odd and it needs to work in ever browser - putting that into your markup (whether HTML or Clojure) stinks. Enlive makes it way cleaner and you get CSS3 and crazier matching control. |
| 15:27 | hiredman | https://github.com/hiredman/php.lisp is php.lisp, and I was of course, joking when I suggested that chouser use it |
| 15:27 | dnolen | lrenn: I don't mention that Enlive has a for already. in anycase for non-trivial things it's cleaner. Cuz you ending up having for everywhere in a real page. |
| 15:27 | lrenn | dnolen: I don't maintain a giant site, so my needs are different. i can obviously see the need for something like this. |
| 15:28 | dnolen | lrenn: yes, if other browsers don't matter much to, hiccup is simpler. |
| 15:28 | rickmode | dnolen: why doesn't a separate CSS class work in that case? can the rules not all be expressed in CSS? |
| 15:28 | tomoj | LauJensen: clobbering the transient fns in clojureql.core seems unfortunate |
| 15:28 | rickmode | er.. those cases, I mean |
| 15:28 | dnolen | rickmode: not in CSS that works in every browser no. |
| 15:28 | LauJensen | tomoj: (use [clojureql.core :as cql]) if you need them |
| 15:29 | LauJensen | I just had never seen a namespace which both worked on transients and databases before :) |
| 15:29 | rickmode | dnolen: gotcha... well.. enlive is now on my TODO list ;) |
| 15:29 | tomoj | require, rather? |
| 15:29 | LauJensen | right |
| 15:29 | tomoj | hmm |
| 15:29 | lrenn | dnolen: yeah, i love the scrapping stuff. thanks for the tutorial. |
| 15:29 | LauJensen | tomoj: If its a problem I can let them drop to clojure.core if they get passed something other than a table, like sort/take/drop |
| 15:29 | dnolen | lrenn: np. |
| 15:31 | tonyl | chouser: no, I was actually looking for a full-time job. I think I might apply to it when my contract is over here |
| 15:32 | tonyl | hiredman: thanks I'll check it out |
| 15:32 | tomoj | LauJensen: wow, hadn't noticed those |
| 15:32 | LauJensen | tomoj: You didnt watch the screencast yet? |
| 15:32 | rickmode | dnolen: i did notice some of the tutorials do indeed use hiccup with enlive. Anyway... is there a newer version of enlive? the "master" on github still uses clojure 1.1 (perhaps this doesn't matter?) |
| 15:32 | tomoj | nope |
| 15:32 | LauJensen | tomoj: okay well.. go watch :) |
| 15:32 | tomoj | just read the README |
| 15:33 | hiredman | tonyl: if you want, it's a "my first interpreter" kind of project |
| 15:33 | chouser | tonyl: you should. And don't forget to mention you know me. :-) |
| 15:37 | tonyl | hiredman: I was actually thinking of doing a lisp interpreter in php :P this would be a good exploration |
| 15:38 | KirinDave | We might have another opening for a dev @ banksimple. This is a clojure+scala friendly environment. |
| 15:38 | tonyl | chouser: great! I will. This was random |
| 15:41 | Raynes | neotyk: ping |
| 15:42 | neotyk | Raynes: pong |
| 15:42 | Raynes | neotyk: Did you ever get a moment to read that? raek rewrote a paragraph in the Leiningen section. |
| 15:42 | Raynes | It's not all that important though. Mostly a correction. |
| 15:43 | Raynes | Just wondering if you've got any feedback before I publish it in a little while. |
| 15:43 | mroessler | KirinDave: Go banksimple! I like hearing about you guys. |
| 15:43 | neotyk | Raynes: yes, I've send you my notes in priv chat |
| 15:44 | KirinDave | mroessler: Heh. |
| 15:44 | Raynes | You did, or are going to? I haven't received anything yet. |
| 15:44 | neotyk | I did |
| 15:45 | Raynes | Do it again, please. :p |
| 15:45 | dnolen | rickmode: doesn't really matter, I'm using Enlive with 1.2.0. |
| 15:47 | rickmode | dnolen: cool. I guess lein / cake won't pull in an older version of a dependency than the main project |
| 15:50 | neotyk | does any other build tool than Maven support multi module builds? |
| 15:51 | LauJensen | neotyk: Clojuresque |
| 15:51 | neotyk | $google Clojuresque |
| 15:51 | sexpbot | First out of 159 results is: kotarak / clojuresque / overview – Bitbucket |
| 15:51 | sexpbot | http://bitbucket.org/kotarak/clojuresque |
| 15:51 | LauJensen | thats the one |
| 15:52 | neotyk | LauJensen: thank you |
| 15:52 | LauJensen | np |
| 15:53 | dnolen | rickmode: I would assume not. |
| 15:54 | neotyk | I don't find Groovy so groovy :( |
| 15:55 | LauJensen | yea me either neotyk |
| 16:00 | bobo_ | hm, does enlive remove the xmlns attribute from the html tag? |
| 16:08 | LauJensen | bobo_: no |
| 16:14 | bobo_ | it sure seems to remove it for me, maybe im just tired. il do a testproject tomorow. |
| 16:14 | tonyl | hiredman:ping |
| 16:15 | hiredman | pong |
| 16:15 | tonyl | where do you start your php.lisp? the vm.php file? |
| 16:16 | hiredman | lisp.php is the interpreter, it just interprets php.lisp |
| 16:17 | hiredman | no repl or anything, I was running this from mod_php |
| 16:19 | hiredman | the vm stuff was something I was fiddling with but never wnet anywhere |
| 16:20 | tonyl | alright, so how do you feed php.lisp (or any *.lisp file) to the interpreter? |
| 16:20 | tonyl | nvm |
| 16:20 | hiredman | :) |
| 16:20 | tonyl | i see it at the end of lisp.php |
| 16:20 | tonyl | this is cool, it uses a clojurish implementation on the host (php) |
| 16:21 | hiredman | compiler.php you can feed abitrary files into, but I don't think I ever finished the compiler |
| 16:21 | hiredman | the sample input to the compiler was a.lisp |
| 16:22 | hiredman | and it is actually a different lisp from the interpreter |
| 16:22 | tonyl | so as of now lisp.php does it |
| 16:22 | hiredman | does it? |
| 16:23 | tonyl | transforms the lisp syntax to php |
| 16:23 | hiredman | lisp.php doesn't |
| 16:24 | hiredman | it is actually an interpreter |
| 16:24 | hiredman | the compiler is what turns lisp in to php |
| 16:24 | tonyl | ok, yeah my bad. that is what I meant. |
| 16:24 | tonyl | nice work |
| 16:25 | hiredman | you are, too kind |
| 16:25 | hiredman | huh, interesting comma there |
| 16:25 | tonyl | probably but I am still learning lisp |
| 16:27 | hiredman | writing one is a good way to get a feel for the design space |
| 16:28 | tonyl | yeah, I am thinking about it, probably in C or C++ to resharpen those dull knifes |
| 16:29 | hiredman | an interpreter in C was my next target, I got as far as starting to write an object system... |
| 16:30 | tonyl | that might be a hurdle, but maybe a not full-blown object system would be necessary ... |
| 16:31 | hiredman | well it was just structs with pointer to a table of function pointers |
| 16:32 | hiredman | the table was a linked list and method looks up were O(n) :( |
| 16:33 | tonyl | oh |
| 16:34 | tonyl | maybe a implementing a hash array |
| 16:34 | hiredman | talk about yak shaving... |
| 16:34 | chouser | step 3, write garbage collector... |
| 16:35 | Chousuke | LauJensen: wow, quick response to my little issue report on cql :P |
| 16:35 | LauJensen | Chousuke: Yea we're a pretty intense team. But your comment was 100% correct and chouser had also made it a few hours ago, so its in the pipe |
| 16:35 | hiredman | chouser: I just used boehm |
| 16:36 | Chousuke | LauJensen: I didn't even have time to navigate away from the page :) |
| 16:36 | LauJensen | Chousuke: Well, we dont want to keep the community waiting. Now its bedtime for me though, good night to you all |
| 16:36 | chouser | hiredman: psh. why didn't you just use CL? |
| 16:37 | hiredman | uh, well, cl is digusting the code makes my skin itch |
| 16:37 | chouser | heh |
| 16:38 | tonyl | wonder how a no-garbage-collected lisp will look |
| 16:38 | hiredman | there was an mit ai memo about it |
| 16:38 | hiredman | "lets just pretend we have infinite ram and crash when it runs out" |
| 16:38 | Chousuke | There is one that's used for game development, right? |
| 16:39 | hiredman | "crashing is faster than gc anyway" |
| 16:39 | Chousuke | or at least was. |
| 16:39 | tonyl | lol or maybe just add a function that garbage collects anything |
| 16:39 | Chousuke | like free()? :P |
| 16:40 | tonyl | an on-called gc |
| 16:40 | tonyl | yeah |
| 16:40 | tonyl | :P |
| 16:40 | hiredman | yetch |
| 16:40 | hiredman | any way, using boehm is really easy, just link in and use |
| 16:41 | cemerick | rhickey: "I'm not a Lisp expert. Helpful suggestions are always welcome." – Rich Hickey http://dotlisp.sourceforge.net/dotlisp.htm :-D |
| 16:41 | Chousuke | oh right, this one http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp |
| 16:41 | hiredman | thank god he ignores so many suggestions |
| 16:43 | cemerick | I remember tinkering with jFli and jFoil years ago. Amazing how things change. |
| 16:48 | pdlogan | tonyl: "wonder how a no-garbage-collected lisp will look"... |
| 16:49 | pdlogan | way back in the days of the lisp machine, we'd often run as long as possible w/out GC then just reboot. |
| 16:50 | hiredman | I was reading a paper about an os written in ml, and apparently ml, or at least the ml they used is stackless |
| 16:50 | hiredman | everything is in the heap |
| 16:51 | pdlogan | several near-real-time lisp and smalltalk systems I am familiar with would pre-allocate a lot of stuff into pools, turn off GC, and "manually" allocate and free. |
| 17:04 | hsuh | anyone knows if you can use a connection pool with ClojureQL? |
| 17:06 | dnolen | hsuh: you can |
| 17:09 | lancepantz | hsuh: you can either imbed c3p0 or use a jndi resource |
| 17:09 | lancepantz | *embed :) |
| 17:13 | belun | hi what exactly does derefing mean ? |
| 17:14 | cemerick | belun: obtaining a value from a reference type (atoms, refs, futures, etc) using @ or deref |
| 17:14 | hiredman | ,(macroexpand '@foo) |
| 17:14 | clojurebot | (clojure.core/deref foo) |
| 17:14 | belun | there is no other way ? |
| 17:15 | hiredman | ^- what deref'ing means |
| 17:15 | hiredman | depends on the reference type |
| 17:15 | belun | why are those data types called reference types\ |
| 17:15 | hiredman | deref is just a function that calls the .deref method of something that implements the IDeref interface |
| 17:16 | belun | (i only know they are used for concurrency) |
| 17:16 | belun | ok what is the purpose of that interface ? |
| 17:17 | cemerick | belun: This might help explain the higher-order objective: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey |
| 17:19 | belun | will watch for that |
| 17:19 | belun | thx for help |
| 17:19 | cemerick | whew, that was a low-bandwidth connection |
| 17:49 | lancepantz | KirinDave: you guys are using both scala and clojure at banksimple, correct? |
| 17:49 | KirinDave | Yes. |
| 17:50 | lancepantz | both backend? |
| 17:50 | KirinDave | yes, although some of both will likely make it into the frontend |
| 17:50 | KirinDave | Because it's most likely gonna be jruby up in there |
| 17:51 | KirinDave | Padrino + jruby, I think they're suggesting |
| 17:51 | lancepantz | interesting, haven't heard of it |
| 17:51 | headius | jruby up in there? |
| 17:52 | headius | jruby all up in my sh*t |
| 17:53 | KirinDave | headius: We'd like to. |
| 17:53 | KirinDave | headius: I have come around from that time where I was skeptical @ Powerset. :D |
| 17:53 | headius | jruby in the front with something else in the back is a popular JVM combination these days |
| 17:53 | headius | linkedin's another big one very happy with that combination |
| 17:56 | KirinDave | headius: Well, the ability to share code between langs is really exciting to me |
| 17:56 | KirinDave | headius: I can write some clojure that talks to jruby and is also seating scala modules. That's wild. |
| 17:56 | headius | we've started to use that as a selling point of JRuby over other Ruby impls in fact |
| 17:57 | headius | accepting that Ruby's not the only kid on the block and showing how easy it is to use the right tool for the right tier |
| 17:57 | KirinDave | Yeah |
| 17:59 | Sgeo | So |
| 17:59 | Sgeo | Heard about the O(log_32 n) != O(log n) debacle, or at least part of it |
| 18:00 | hiredman | once you start writing business logic on top of your crud being polygot is a pain if you cannot share the business logic |
| 18:02 | quizme | https://github.com/thirdreplicator/levenshtein/blob/master/src/levenshtein/core.clj <-- is there a better way to parallelize this? |
| 18:06 | Sgeo | Just to be sure, everyone is aware that log_32 x = log_b x * a_constant (I think a_constant = 1/log_b 32) |
| 18:12 | Chousuke | Sgeo: There was no "debacle". Just people being more or less rigorous with their notation :P |
| 19:08 | rata_ | hi |
| 19:12 | Raynes | Has the getting started stuff on assembla been moved to confluence yet? I need to link to it, but I don't know where *to* link. |
| 20:25 | mattmitchell_ | aye, could someone tell me why this isn't printing? I'm guessing it has to do with lazy seqs? (map #(prn ( * 2 %)) [1 2 3 4]) |
| 20:25 | amalloy | mattmitchell_: got it in one. lazy seqs |
| 20:25 | amalloy | wrap the whole thing in a (dorun) |
| 20:25 | mattmitchell_ | amalloy: i have so much to learn :) |
| 20:26 | mattmitchell_ | amalloy: ha yeah that works, i need to read up on lazy seqs |
| 20:26 | mattmitchell_ | thanks! |
| 20:38 | joshua__ | Hi! I'm using Compojure, Enlive, and Appengine Magic. I was wondering what the best way of getting from a change to the code to a refresh of the browser is. Like is there a way to avoid having to restart the server and recompile after every typo? |
| 20:40 | tomoj | does swank-clojure work on app engine? :) |
| 20:42 | tomoj | I suppose not |
| 20:42 | joshua__ | I think that it does, not sure. |
| 20:43 | joshua__ | The appengine magic package mentioned you could use some datastore services within swank at least. |
| 20:44 | _ato | according to the appengine magic README the normal development workflow is develop locally against jetty |
| 20:44 | tomoj | wait, are you talking about seeing the changes on GAE? |
| 20:44 | tomoj | or on your local jetty? |
| 20:45 | joshua__ | local jetty |
| 20:45 | tomoj | and do you use swank already? |
| 20:45 | joshua__ | Yea. |
| 20:46 | tomoj | sounds like a problem with the magic package to me.. |
| 20:46 | joshua__ | I've been using lein repl since I woke up though... |
| 20:46 | tomoj | it's easy to make it so that when you C-c C-k the handler you passed to jetty, the changes are automatically in effect |
| 20:46 | joshua__ | So I guess I should use swank? |
| 20:46 | joshua__ | Alright. |
| 20:46 | tomoj | ah, I'd give it a try, yeah |
| 20:47 | tomoj | when you def-appengine-app, you might have to pass #'handler instead of handler |
| 20:47 | tomoj | not sure, never used it |
| 20:48 | hiredman | right, you do the same thing in ring if you want to pick up changes |
| 20:48 | amalloy | tomoj: i read the middle of this conversation first, and "sounds like a problem with the magic package" sounded like when someone wants the computer to just do what you want instead of what you said |
| 20:48 | tomoj | I misread their readme and thought they did this part |
| 20:49 | tomoj | (and also thought swank was already in use) |
| 21:12 | joshua__ | Thanks guys! I understand it now and it is working. |
| 21:25 | rata_ | technomancy: I was wondering if a (defn-debug ...) that puts a (swank.core/break) at the end of the function (i.e., that lets you see all the locals of the fn) but also lets you see the result of the function would be of interest for the general swank-clojure user |
| 21:26 | rata_ | (result in the sense of returned value) |
| 21:55 | quizme | how do you determin how much memory a variable is using in the JVM ? like for example how much memory is (def x {:a 1}) taking up? |
| 21:56 | amalloy | quizme: that's a hard thing to define, let alone ask the computer to tell you |
| 21:57 | amalloy | for example, it had to create objects for the :a keyword and the x symbol in order to make that definition. but those will still be around when it leaves, and they're not really part of the data from your POV |
| 21:57 | amalloy | does it count them, or just the 4-byte reference to them? |
| 21:58 | quizme | ok |
| 21:59 | quizme | there isn't anything like (size-of x) ? |
| 21:59 | amalloy | quizme: see above. what would it return? |
| 22:02 | quizme | i guess the before and after difference of the memory used. |
| 22:04 | quizme | but including the data structures it relies on |
| 22:04 | rata_ | quizme: short answer: there isn't |
| 22:05 | quizme | how about a way to determine the amount of memory used by the JVM currently. |
| 22:06 | rata_ | quizme: visualvm |
| 22:06 | quizme | rata_ ok cool thanks i'll check it out |
| 22:06 | rata_ | it let's you profile memory also... maybe that's what you want |
| 22:07 | quizme | rata_ yeah thanks. I have been wanting profiling tools. |
| 22:08 | rata_ | visualvm is the most amazing profiler I've come to know |
| 22:08 | rata_ | but for a reason I don't understand, it doesn't work with swank for me |
| 22:09 | rata_ | I must compile a clojure program to do the profiling |
| 22:09 | rata_ | coming from c++, that's not really an issue =P |
| 22:10 | dnolen | rata_: that's weird, visualvm + swank works just fine for me. |
| 22:10 | rata_ | also, it's probably just something I haven't figure out yet |
| 22:10 | rata_ | yes... I should be doing something wrong |
| 22:12 | rata_ | it was just a quick attempt... I didn't sit down to think what could be causing the problem |
| 23:10 | tonyl | good night |
| 23:14 | technomancy | rata_: I don't like the idea of changing the code for debugging purposes. you could do something less invasive using the same strategy as stubbs: http://technomancy.us/141 |
| 23:14 | technomancy | basically just alter-var-root for all defns that have :break metadata or something. |
| 23:14 | technomancy | or add-hook rather |
| 23:15 | KirinDave | technomancy: Hey man, I was hoping to get your advice on something. A piece of code I wrote has been bugging me. |
| 23:15 | KirinDave | technomancy: Got a sec? |
| 23:16 | technomancy | sure |
| 23:16 | KirinDave | technomancy: This seems liek a lot of code for a fairly simple task of parsing HTTP 1.1 compliant dates. Any advice? |
| 23:16 | KirinDave | https://gist.github.com/705478 |
| 23:19 | technomancy | I would use for rather than keep with a fn literal |
| 23:19 | KirinDave | technomancy: Oh? |
| 23:20 | technomancy | I wouldn't say that's particularly a lot of code to perform that task |
| 23:20 | KirinDave | technomancy: How about for the strategies? |
| 23:20 | KirinDave | Is there a more elegant way to do that, you think? |
| 23:20 | technomancy | I mean, it depends on how forgiving you want to be, but the JDK doesn't give you much to work with |
| 23:20 | rata_ | technomancy: I like the idea of the :break in the metadata... it's that part what really matters... btw, is there a leiningen plugin that does just that? |
| 23:21 | KirinDave | technomancy: Well this is using Joda, which is also kinda tedious for fuzzy date matching |
| 23:21 | technomancy | we use something fairly similar for our date parsing |
| 23:21 | technomancy | just run through a list of strategies, sanest first |
| 23:22 | technomancy | oh actually for may not be quite right to replace keep there |
| 23:22 | Licenser | technomancy: the curl thing is solved the rlwrap and user thing are still present in the master/stable branch |
| 23:22 | technomancy | KirinDave: but I'd use filter rather than keep. I would save keep for when you are calling out the fact that you want a false/nil distinction, which is very rare |
| 23:23 | technomancy | Licenser: cool; I'm looking at that ticket now =) |
| 23:23 | KirinDave | technomancy: Would using for make the code shorter? |
| 23:23 | Licenser | kk |
| 23:24 | Licenser | It contains are required fixes already - I realize that I am probably the only clown using clojure on solaris so I try to only report when I know how to fix it :P |
| 23:24 | technomancy | KirinDave: not really; you can use a :when clause, but you still have to make the body of the "for" include the value itself so it's not really much of a win. |
| 23:25 | technomancy | for is more of a win when people use filter and map on the same seq |
| 23:25 | technomancy | Licenser: well it's nice to have people submit bug reports rather than just complaining like the Windows users sometimes do =) |
| 23:25 | Licenser | :P |
| 23:26 | Licenser | that is since we are all developpers here - windows people excluded *runs to hide* |
| 23:26 | KirinDave | technomancy: Thanks for the input. |
| 23:27 | technomancy | KirinDave: sure. |
| 23:27 | technomancy | is clj-time a pretty literal wrapper around joda, or would it make sense to add some timezone-savviness there? |
| 23:28 | KirinDave | technomancy: I'm not trying to be the best at dates. The HTTP 1.1 spec says I can demand GMT/UTC. |
| 23:29 | Licenser | See you later peope! |
| 23:29 | KirinDave | technomancy: But I do think that clj-time could really stand for some of that. JodaTime has a lot of shortcomings |
| 23:29 | technomancy | KirinDave: aren't you lucky =) |
| 23:29 | KirinDave | technomancy: Ha. |
| 23:29 | KirinDave | Evidently a lot of webservers ignore that and allow arbitrary timestamps. I say "eff that" |
| 23:30 | technomancy | we have seen such wacky nonsense as: Sat, 1 Sep 2007 00:01:09 +{0}{1} |
| 23:30 | technomancy | I do appreciate how the JDK is relatively sane with things like "the 35th of November" rolling over into December |
| 23:32 | tomoj | I had wacky nonsense like 2-00-00 |
| 23:33 | tomoj | year 2 |
| 23:33 | KirinDave | Ha |
| 23:33 | KirinDave | I will just throw your shit out if you send that to me on an if-modified-since header. |
| 23:33 | KirinDave | "Screw you and the date unparser you rode in on." |
| 23:33 | tomoj | oh, that was squirreled away somewhere |
| 23:34 | tomoj | original source -> clojure -> php -> solr :( |
| 23:34 | tomoj | php is the culprit of course |
| 23:34 | Licenser | *look clj-time up since he exactly nees things like the current day now* |
| 23:34 | technomancy | 406 not acceptable! |
| 23:34 | technomancy | 406 This Simply Will Not Do |
| 23:35 | technomancy | in case anyone hasn't seen it yet: http://lizrevision.com/sms-shorthand-for-geeks-using-server-response-codes.html |
| 23:39 | KirinDave | 406 Screw You (And The Horse You Rode In On) |
| 23:43 | technomancy | User-Agent: Horse (Mozilla 5.0/compatible) |
| 23:52 | technomancy | rata_: oh sorry, yeah the stubbs plugin in the link there shows an example of how you'd do that in a lein plugin |
| 23:57 | rata_ | technomancy: yes, but it seems a little complicated for a newbie, thus I was wondering if there already exists a plugin for doing what I said using somethink like :break in metadata |