2008-12-27
| 00:58 | mibu | hey does anyone know how to create a (sorted-map-by) by value? |
| 01:23 | replaca | mibu: still there? |
| 02:20 | replaca | I always expect to see a tumbleweed rolling through here about this time of night |
| 02:57 | replaca | and there went one, rolling through the darkness |
| 03:43 | Lau_of_DK | Good morning all |
| 08:25 | Lau_of_DK | Somebody help the slow student! The SqlDataReader that is used here, where do I dig up that class? |
| 08:25 | Lau_of_DK | (not java.sql) |
| 08:38 | Chousuke | Lau_of_DK: looks like C# :P |
| 08:44 | Lau_of_DK | Do you realise how much I regretted that question after posting? |
| 08:44 | Chousuke | :P |
| 08:44 | Lau_of_DK | But the C# approach is very very nice compared to Javas preparedStatement/addBatch |
| 08:49 | Chousuke | I suppose. |
| 08:50 | Lau_of_DK | and addBatch forces me to record types as well :( |
| 09:54 | Lau_of_DK | ClojureQL now supports dynamic values in Query/Insert-into structures: (let [abc 5] (sql (query [id name] developers.employees (= id ~abc)))) |
| 11:16 | Lau_of_DK | oh my :( |
| 11:19 | chrisn | hi lau |
| 11:19 | Lau_of_DK | Hey my friend :) |
| 11:20 | chrisn | did you try out the program? |
| 11:20 | Lau_of_DK | not yet :( |
| 11:20 | chrisn | I checked in a new repl_wave or something like that. |
| 11:20 | chrisn | All you have to do is load it |
| 11:20 | chrisn | And you should get the demo |
| 11:22 | Lau_of_DK | Cool |
| 11:22 | Lau_of_DK | I've pull in a little while |
| 11:22 | Lau_of_DK | I'll |
| 11:23 | chrisn | let me know |
| 11:42 | sooth | Is HEAD useable? |
| 11:43 | Lau_of_DK | chrisn: It might be a couple of hours :( Sorry |
| 11:44 | chrisn | don't worry about it. I have a bunch of details to wrap up. |
| 12:45 | Lau_of_DK | Question: if I have {:a 5} and {:b 10}, how do I merge them into {:a 5, :b 10} ? |
| 12:50 | zakwilson | Lau_of_DK: (assoc map1 (interleave (keys map2) (vals map2)) should work. I don't know of a built in function to do this. |
| 12:53 | dudleyf | (doc merge) |
| 12:53 | clojurebot | Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result.; arglists ([& maps]) |
| 12:58 | Lau_of_DK | zakwilson: Thanks, I was fidling with interleave a minute ago, but didnt get that far :) |
| 12:59 | zakwilson | Lau_of_DK: it looks like merge or conj is the right answer. |
| 12:59 | Lau_of_DK | Not sure |
| 13:09 | zakwilson | (merge {:a 5} {:b 10}) |
| 13:14 | Lau_of_DK | prefix with , |
| 13:14 | Lau_of_DK | ,(merge {:a 5} {:b 10}) |
| 13:14 | clojurebot | {:b 10, :a 5} |
| 13:15 | zakwilson | Ahh... I see. |
| 13:20 | sooth | Is trunk supposed to be useable? |
| 13:20 | Lau_of_DK | sooth: yea... |
| 13:21 | sooth | Nobody having problems with latest? |
| 13:21 | danlarkin | sooth: did you ant clean after you svn up'ed? |
| 13:21 | sooth | danlarkin: No. Why do I need to clean first? |
| 13:22 | Chousuke | doesn't the default build target do that automatically anyway |
| 13:22 | sooth | danlarkin: That did it. Thanks |
| 13:22 | Lau_of_DK | svn is bad, git is good |
| 13:23 | danlarkin | Chousuke: no, just running "ant" does not "ant clean", otherwise it wouldn't really be an incremental build would it :) |
| 13:37 | Lau_of_DK | Isnt there a simply way to go from {:a 5, :b 10} => "a, b" ? |
| 13:42 | hoeck | Lau_of_DK: (apply str (interpose ", " (map name (keys {:a 1, :b 2})))) is the simplest way I'm aware of at the moment |
| 13:43 | Lau_of_DK | uh good, I forgot about 'name', thanks hoeck |
| 13:44 | Lau_of_DK | Good crowd, thanks :) |
| 13:44 | jgracin | are there any restrictions as to the size of array given to 'apply'? |
| 13:44 | hoeck | no problem, we're basically working on the same thing :) |
| 13:45 | jgracin | any reason why 'reduce' should be preferred to apply in the above solution? |
| 13:45 | hoeck | jgracin: i think not |
| 13:45 | Chousuke | danlarkin: actually, looking at the build file, yes it does. |
| 13:47 | Chousuke | jgracin: apply is better. |
| 13:47 | hoeck | jgracin: str is optimized for apply, builds only one stringbuilder instead of many when used in reduce |
| 13:47 | jgracin | hoeck: I see. |
| 13:48 | jgracin | thanks |
| 13:59 | danlarkin | Chousuke: no I'm pretty sure the default ant task does not clean |
| 14:02 | Lau_of_DK | Couldnt somebody just make that update script already? |
| 14:07 | Lau_of_DK | (sql (insert-into developers.employees :id ~abc :name "Frank" :language "PHP" :iq ~xyz)) |
| 14:07 | Lau_of_DK | {:type :dk.bestinclass.clojureql/Insert, :table developers.employees, :values {:name "Frank", :iq (clojure.core/unquote xyz), :language "PHP", :id (clojure.core/unquote abc)}, :env {:xyz 5, :abc 8}, :sql "INSERT INTO developers.employees (name, iq, language, id) VALUES (Frank, ?, PHP, ?)"} |
| 14:07 | Lau_of_DK | Uuuh it works so well now :) |
| 14:11 | danlarkin | Lau_of_DK: looks sweet! |
| 14:11 | Chousuke | danlarkin: <target name="init" depends="clean"> |
| 14:11 | Lau_of_DK | danlarkin: thanks, its really shaping up, but suggestions for query-forms and such are very welcome |
| 14:11 | Chousuke | I think that was a recent change. |
| 14:12 | danlarkin | Chousuke: I'm at 1162 and I have <target name="init"> |
| 14:13 | Chousuke | danlarkin: heh |
| 14:14 | Chousuke | danlarkin: the change was made in 1163 :) |
| 14:14 | danlarkin | ohhh I still haven't switched over to the google code reo |
| 14:14 | danlarkin | repo |
| 14:14 | danlarkin | well, that explains it |
| 14:24 | Lau_of_DK | Does anyone here have a good info site on how to work with Java/sql in a parameterized fasion ? |
| 14:32 | Lau_of_DK | Do we 'switch' in Clojure? |
| 14:37 | danlarkin | Lau_of_DK: what's that mean? |
| 14:37 | Lau_of_DK | (switch x 1: do-1 2: do-2 :else do-this) |
| 14:38 | sooth | cond? |
| 14:39 | Lau_of_DK | Its cond, just more concise, because you can leave out the comparator |
| 14:41 | Lau_of_DK | its a simple macro to write, so dont worry about it |
| 14:42 | chrisn | why not use multimethods? |
| 14:42 | Lau_of_DK | I might do that, but its a littled bloated if you ask me |
| 14:42 | chrisn | They are more amenable to extension at runtime |
| 14:42 | chrisn | That is why I like them. They are very syntaxy. |
| 14:43 | Lau_of_DK | In this case, extension doesnt go a long way, Im just testing class types |
| 14:44 | chrisn | what about class hierarchy? |
| 14:44 | Lau_of_DK | What about it? |
| 14:44 | arbscht_ | Lau_of_DK: clojure.contrib has a few goodies like {f,in-,re-}case and condp |
| 14:44 | chrisn | switch statements break quickly when you have objects derived from other objects. |
| 14:44 | Lau_of_DK | arbscht_: cool, I'll have a look |
| 14:45 | Lau_of_DK | chrisn: These are primitive data-types |
| 14:45 | chrisn | Your execution is dependent upon switch order, not upon derivation hierarchy as one would like |
| 14:45 | chrisn | oh fine then |
| 14:45 | chrisn | use your goddamn switch statements :). |
| 14:45 | Lau_of_DK | I see what you're saying and the entire design of my program is based on multimethods... I just want this little switch thing :) |
| 14:49 | Lau_of_DK | (let [xyz 5 abc 8] |
| 14:49 | Lau_of_DK | (backend/execute (sql (query [id name] developers.employees (and (> id ~xyz) (< id ~abc)))))) |
| 14:49 | Lau_of_DK | {:name Jack D., :id 6} |
| 14:49 | Lau_of_DK | {:name Mike, :id 7} |
| 14:49 | Lau_of_DK | Check it out guys, thats one Lispy SQL query! :) |
| 14:50 | arbscht_ | neat |
| 14:59 | zakwilson | Lau_of_DK: Have you seen CLSQL? |
| 15:00 | Lau_of_DK | No - Is it much different from SchemeQL ? |
| 15:10 | kabny | bah I go crazy with wireless on Ubuntu! |
| 15:10 | kabny | i want to swap to linux because it is better for programming but ,my god... |
| 15:13 | Lau_of_DK | kabny: You should check with the good folks at #ubuntu or whatever distro you use, but it really is quite simple |
| 15:13 | Lau_of_DK | Ubuntu comes with madwifi, works with almost everything. If it doesnt work with your device, you can wrap your windows driver with ndiswrapper. If that doesnt work, get a cable |
| 15:13 | kabny | clojurebot : contrib? |
| 15:15 | kabny | contrib? |
| 15:15 | kabny | clojurebot |
| 15:15 | kabny | , (+ 2 3 4) |
| 15:15 | kabny | ,(+ 2 3 4) |
| 15:15 | clojurebot | 9 |
| 15:16 | kabny | ,(+ 2 3 4 5) |
| 15:16 | clojurebot | 14 |
| 15:16 | kabny | ,contrib? |
| 15:16 | kabny | how do I ask? |
| 15:16 | dreish | clojurebot: contrib |
| 15:16 | clojurebot | contrib is http://sourceforge.net/projects/clojure-contrib/ |
| 15:17 | Lau_of_DK | clojurebot: contrib is http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib/trunk/ |
| 15:17 | clojurebot | In Ordnung |
| 15:17 | Lau_of_DK | clojurebot: contrib? |
| 15:17 | clojurebot | contrib is http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib/trunk/ |
| 15:17 | arbscht_ | aren't they moving to code.google? |
| 15:17 | kotarak | Hmmm... isn't that move to google code? |
| 15:17 | arbscht_ | heh |
| 15:17 | Lau_of_DK | hey wait.. isnt that moved to google? |
| 15:40 | Lau_of_DK | clojurebot: clojure-mode? |
| 15:40 | clojurebot | clojure-mode is an Emacs mode for Clojure, found at git://github.com/jochu/clojure-mode.git |
| 15:40 | Lau_of_DK | Is the maintainer of this mode present in this channel tonight? |
| 15:42 | Chousuke | yeah, contrib is at google code |
| 15:42 | Chousuke | http://code.google.com/p/clojure-contrib/ |
| 15:42 | technomancy | Lau_of_DK: I haven't been able to contact him. wanted to fix the way he handles autoloads |
| 15:43 | Lau_of_DK | technomancy: Also the highlighting is surpassed by Vim-mode now Im told, which is UNACCEPTABLE! :) |
| 15:43 | kabny | can someone explain to me how to correctly install contrib on windows? |
| 15:43 | kabny | should I just zip the folder contrib? |
| 15:43 | Chousuke | run ant |
| 15:43 | kabny | could it need some external packages too? |
| 15:43 | technomancy | Lau_of_DK: that's crazy! what specifically is the difference? |
| 15:44 | Lau_of_DK | apply, reduce and other functions are not highthed in Emacs, but are in Vim |
| 15:44 | Lau_of_DK | kabny: Step #1) Install Linux, Step #2) Follow Linux instructions (ie, type ant) |
| 15:44 | technomancy | those are just normal functions though... not sure if they deserve to be highlighted. |
| 15:45 | technomancy | not sure if it's wise to highlight every single function in core, I mean |
| 15:45 | Lau_of_DK | What could it hurt? |
| 15:46 | technomancy | I guess it's just a matter of consistency. Special forms should be highlighted so you know normal evaluation rules don't apply, but if you start highlighting everything you lose that information. |
| 15:47 | Lau_of_DK | Its just a matter of choosing the right colors |
| 15:47 | kotarak | technomancy: special forms are highlighted differently to macros or functions |
| 15:47 | Lau_of_DK | blue = func, green = special form |
| 15:48 | technomancy | ah, I didn't realize they were different. |
| 15:48 | kabny | how do I run ant on windows? |
| 15:48 | Lau_of_DK | kabny: I already explained :) |
| 15:49 | technomancy | Lau_of_DK: if it's still consistent and distinguished from special functions, seems like a good idea to add all the functions in core then. |
| 15:50 | technomancy | Lau_of_DK: if you can't get ahold of the author either, just fork it on github and let me know so I can pull from you. |
| 15:50 | Lau_of_DK | OK - Youre not up for forking? :) |
| 15:52 | technomancy | I forked it already. |
| 15:52 | kabny | Lau: but like I said before fooken ubuntu wireless doesnt work |
| 15:53 | technomancy | wow, I didn't realize there were still wifi chipsets that weren't supported. |
| 15:53 | Lau_of_DK | kabny: alright alright :) If you invest a little time you'll get it to work. I have a brand new laptop with premium wifi-card, detect OOB in Intrepid |
| 15:53 | Lau_of_DK | technomancy: So you dont want me to fork ? |
| 15:54 | technomancy | Lau_of_DK: you can have your own fork. |
| 15:54 | Lau_of_DK | Thanks |
| 15:54 | technomancy | if the original maintainer comes back online it makes it easier to tell which changes came from whom. |
| 15:55 | Lau_of_DK | Wonder what happend, it came out so quickly, then withered |
| 15:55 | technomancy | dunno |
| 15:55 | technomancy | I wouldn't mind becoming the de-facto maintainer if this guy steps down or disappears |
| 15:55 | technomancy | since I'm pretty comfortable with elisp. |
| 15:55 | Lau_of_DK | If you have your own fork, just start putting in the work |
| 15:55 | Lau_of_DK | Can you post a Github link ? |
| 15:56 | technomancy | sure: http://github.com/technomancy/clojure-mode/tree/master |
| 15:56 | Lau_of_DK | Im watching you |
| 15:56 | technomancy | I could add the functions, but I'm not likely to get around to it right away... so if you want it faster you can make your own fork, add it, and let me know. |
| 15:57 | Lau_of_DK | Or you can give me push rights to your repo, that might be simpler |
| 15:57 | technomancy | it's not that complicated to deal with pulling between repos, but if you're just starting out with git and don't feel comfortable with that, I could do that |
| 15:58 | Lau_of_DK | In the true Non-Git spirit, I just feel its better allround to have 1 public repo |
| 15:58 | technomancy | heh |
| 15:58 | technomancy | what's your github ID? |
| 15:58 | technomancy | same as IRC? |
| 15:59 | Lau_of_DK | Lau-of-DK |
| 15:59 | Lau_of_DK | (dont support underscore, which is a great reason for switching to Bitbucket) |
| 15:59 | technomancy | heh |
| 16:01 | gnuvince | ;-) |
| 16:01 | gnuvince | Hg and BitBucket are nice. |
| 16:01 | Lau_of_DK | Indeed |
| 16:01 | gnuvince | Too bad Git is just unstoppable |
| 16:01 | Lau_of_DK | Doesnt make a difference does it |
| 16:03 | gnuvince | The "git doesn't track files, it tracks content" is sort of weird to me, and there are some things I like better about Mercurial, but in the end, it seems that Git's adoption rate is way greater than that of Mercurial, so I'm reluctantly learning to use it. |
| 16:05 | Lau_of_DK | kotarak pointed out some pretty superior ways of dealings with minor-commits in terms of patching, so I promised him that the next tag-team work we do will be in Hg... I will miss Egg though |
| 16:06 | kotarak | I don't know, whether they are superior. They just fit my style of working. |
| 16:07 | Chousuke | what kind of ways? |
| 16:09 | kotarak | Using patch queues of hg. |
| 16:10 | Chousuke | the wiki page says it's like quilt for git |
| 16:11 | kotarak | quilt is independent of git, AFAIK. |
| 16:11 | kabny | Git + Github is awesome, everybody use it pleas ek thanks |
| 16:12 | kotarak | hg + bitbucket is awesome, everybody use it please k thanks |
| 16:12 | Lau_of_DK | hmm, I must give kotarak + bitbucket points for spelling |
| 16:13 | kabny | technomanyc: where can I check if it is supported or not(my wifi chipset, i have realtek RTL8187B)? |
| 16:13 | Chousuke | kotarak: having a patch queue sounds a lot like having a topic brach for changes. |
| 16:14 | technomancy | kabny: I usually check thinkwiki.org, but that's somewhat thinkpad-specific. |
| 16:14 | Lau_of_DK | Chousuke: You mean instead of applying/removing pathes, you just branch and merge? |
| 16:14 | kotarak | Chousuke: but it's not quite the same. eg. you can't exchange the order of two commits. |
| 16:14 | Chousuke | kotarak: sure you can |
| 16:14 | Lau_of_DK | You can ? :) |
| 16:14 | Chousuke | it's just git rebase --interactive |
| 16:15 | technomancy | or you can do it all out of Emacs with magit. =) |
| 16:15 | Lau_of_DK | ...or Egg |
| 16:15 | technomancy | Lau_of_DK: I pushed out my autoload changes for clojure-mode.el |
| 16:15 | kotarak | Chousuke: hmmm, you can merge or skip or keep commits, but also exchange the order? Then I misread the docs. |
| 16:15 | Lau_of_DK | technomancy: cool |
| 16:16 | Chousuke | so, branch from master, work, git rebase --interactive master, edit commits however you like, then merge master with the cleaned up branch. |
| 16:16 | Lau_of_DK | technomancy: technomancy added you to clojure-mode 16 minutes ago |
| 16:16 | Lau_of_DK | Does this mean that I can push to it ? |
| 16:16 | Chousuke | maybe it's not as nice as mercurial's patch queues though... hmm. |
| 16:17 | Chousuke | I haven't used mercurial so I don't know exactly how it works. |
| 16:17 | Lau_of_DK | Chousuke: Do you run rebase while youre in the experimental branch ? |
| 16:17 | kotarak | Chousuke: basically it shows again, that both, git and hg, are mostly equivalent. :) |
| 16:17 | Chousuke | there's also http://repo.or.cz/w/topgit.git |
| 16:17 | technomancy | Lau_of_DK: you should be able to. |
| 16:17 | Chousuke | Lau_of_DK: yeah. |
| 16:18 | kotarak | never got topgit to work. |
| 16:18 | Lau_of_DK | ClojureQL was founded on a 2� hour discussion about Hg vs Git, whereafter we proceeded to discuss Emacs vs Vim for ~15 hours.... |
| 16:18 | Chousuke | Lau_of_DK: or when you're done with your changes, you can branch a new cleanup branch and rebase that instead :P |
| 16:18 | kotarak | Always complained, that the topic branch was not topgit-controlled, when in fact it was. |
| 16:19 | technomancy | hah... /me just used a comma for unquote instead of ~ |
| 16:19 | technomancy | that's going to take a lot of getting used to |
| 16:19 | Lau_of_DK | Chousuke: So basically rebase is a reversed merge where you push change into the master branch, and your experimental branch will then function as a patch ? |
| 16:20 | Chousuke | Lau_of_DK: rebase basically replays your changes on top of another branch |
| 16:20 | Chousuke | --interactive just allows you to quash, reorder or skip the changes when rebasing. |
| 16:21 | Lau_of_DK | In a Yes/No styled UI? |
| 16:21 | Chousuke | Lau_of_DK: in a text editor :)) |
| 16:21 | Chousuke | -) |
| 16:22 | Lau_of_DK | ok |
| 16:22 | Lau_of_DK | technomancy: Are you quite happy with adding all the highlights manually in clojure-font-lock-keywords? |
| 16:23 | technomancy | Lau_of_DK: that sounds fine, yeah. |
| 16:24 | Lau_of_DK | but... |
| 16:24 | Lau_of_DK | :) |
| 16:26 | technomancy | Lau_of_DK: I'm going to submit it to ELPA too. |
| 16:27 | Lau_of_DK | ELPA? I had to google it |
| 16:27 | Lau_of_DK | Definitioner af ELPA p� nettet p�: Engelsk |
| 16:27 | Lau_of_DK | |
| 16:27 | Lau_of_DK | * The Automobile and Touring Club of Greece |
| 16:27 | Lau_of_DK | But it makes sense I guess |
| 16:27 | technomancy | it's the package manager for elisp |
| 16:27 | technomancy | very handy |
| 16:27 | Lau_of_DK | k |
| 16:34 | technomancy | anyone else wish clojure had a package manager too? |
| 16:34 | kabny | Where is the ant_home vaiable? |
| 16:37 | kabny | Where is the ant_home vaiable? |
| 16:37 | fyuryu | kabny: what OS? it's an environment variable |
| 16:38 | kabny | windows |
| 16:38 | fyuryu | do you have ant? |
| 16:38 | kabny | yes |
| 16:39 | fyuryu | kabny: Win+Pause -> Advenced -> Environment variables (or something, I don't have English windows version) |
| 16:39 | kabny | yes im there |
| 16:39 | kabny | but there is no ant_home variable |
| 16:40 | fyuryu | then add it |
| 16:40 | kabny | should ia dd it to user-variables |
| 16:40 | kabny | ok |
| 16:40 | kabny | to system or users? |
| 16:40 | fyuryu | and put path to ant directory as value |
| 16:40 | fyuryu | user |
| 16:41 | fyuryu | but it doesn't matter if you're the only user |
| 16:42 | kabny | C:/ant/; |
| 16:42 | kabny | ANT_HOME |
| 16:42 | kabny | i tshouldnt be to the ant.jar? |
| 16:42 | fyuryu | kabny: drop the semicolon |
| 16:42 | kabny | I get "ant not recognized as a..." |
| 16:42 | kabny | when doing ant form the command line |
| 16:43 | fyuryu | reopen the command line |
| 16:44 | kabny | i did |
| 16:45 | fyuryu | still the same? try typing: set ANT_HOME=C:\ant |
| 16:47 | fyuryu | kabny: wait a minute, did you add ant bin directory to PATH? |
| 16:49 | kabny | yes works now but |
| 16:49 | kabny | Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li |
| 16:49 | kabny | b\tools.jar |
| 16:50 | kabny | and I dont have tools.jar |
| 16:50 | kabny | what is it and how do I get it? |
| 16:51 | fyuryu | do you have jdk installed or only java runtime? |
| 16:51 | bOR_ | hehe. a mirror of my own problems. |
| 16:52 | bOR_ | setenv JAVA_HOME /usr/java/jdk1.6.0_11/ |
| 16:52 | bOR_ | setenv PATH "/home/boris/.local/bin:/usr/local/ii/bin/:/usr/java/jdk1.6.0_11/bin:/usr/java/jdk1.6.0_11/lib${PATH}" |
| 16:52 | bOR_ | solved it for me. |
| 16:52 | bOR_ | cshrc shell. |
| 16:54 | fyuryu | kabny: and as bOR_ said, JAVA_HOME needs to be set to the jdk dir |
| 16:55 | kabny | jre jdk i ahve both |
| 16:56 | kabny | java_home i should create too then? |
| 16:56 | fyuryu | kabny: yes |
| 16:56 | kabny | ah there tools is |
| 16:57 | kabny | wiiii!!!!!!!!!!!!1 |
| 16:57 | kabny | thanks |
| 16:57 | kabny | now lets see |
| 16:57 | kabny | just ant contrib? |
| 16:58 | fyuryu | just ant |
| 16:58 | kabny | uh? |
| 16:58 | kabny | inside trunk? |
| 16:59 | kabny | should I first place trunk in the dir of Clojure |
| 16:59 | fyuryu | in the directory in which build.xml is present |
| 16:59 | kabny | yes |
| 16:59 | fyuryu | kabny: no |
| 16:59 | kabny | but where will it then place the contrib stuff? |
| 16:59 | kabny | how will ant now where to put it? |
| 16:59 | kabny | C:/clojure |
| 16:59 | fyuryu | it won't |
| 17:00 | fyuryu | you'll have to do it yourself |
| 17:00 | fyuryu | ant will produce clojure-contrib.jar |
| 17:00 | kabny | i see now! |
| 17:00 | bOR_ | ok. my turn for a question. |
| 17:00 | bOR_ | for is a nice macro. |
| 17:01 | fyuryu | and you just have to have it in you classpath (see clojure wiki for example of a handy .bat script ) |
| 17:02 | bOR_ | but I don't see how I can use it to translate ([ 1 2 3] [1 2] [4 5 6]) into (114 115 116 124 125 126 214 215 216 etc) |
| 17:02 | bOR_ | with variable length collections fed to it. |
| 17:02 | bOR_ | seems like I've to spell out the structure of the collection in order to get all the permutations. |
| 17:03 | bOR_ | ( the [x [ 1 2 3] y [1 2] z [4 5 6]] [x y z] version does what I want) |
| 17:05 | bOR_ | (but I don't always know the length of the set of collections coming in) |
| 17:05 | bOR_ | should check if one of clojure's library has a permutation-like function. |
| 17:06 | kabny | check seq-utils |
| 17:06 | fyuryu | bOR_: i think there was something for permutations in contrib |
| 17:06 | kabny | seq-utils... |
| 17:07 | fyuryu | bOR_: also: http://github.com/rosado/libs4clj/tree/master/rosado/math/permutations.clj |
| 17:07 | kabny | how do you import from contrib? |
| 17:07 | kabny | (import '(clojure-contrib sql)) fails |
| 17:07 | bOR_ | thanks |
| 17:08 | fyuryu | (require '(clojure.contrib sql)) |
| 17:08 | fyuryu | kabny: the namespace is clojure.contrib |
| 17:09 | kabny | ah |
| 17:09 | kabny | import from java and require for clojure-libs in general? |
| 17:09 | kabny | is contrib sql ready to use directly? |
| 17:09 | kabny | I have jdbc+derby working with clojure already |
| 17:10 | fyuryu | kabny: yes, import for java stuff |
| 17:10 | fyuryu | kabny: no idea about sql, never used it so far |
| 17:11 | kabny | and then how do I call stuff inside sql? sql/f ? |
| 17:12 | kabny | and that is recommended? you dont import the whole namespace so to speak so you can refer to functions directly? |
| 17:12 | fyuryu | kabny: clojure.contrib.sql/f, but it's better to (require '[clojure.contrib sql :as sql]) |
| 17:13 | fyuryu | kabny: then you can call (sql/f ...)) |
| 17:13 | kabny | ah i see |
| 17:13 | fyuryu | kabny: you can also (use '(lib.name )) |
| 17:14 | kabny | and then i can refer to f direclt(which i dont want i like tos ee where stuff is coming from)? |
| 17:14 | fyuryu | kabny: to have everything from the lib in yo namespace |
| 17:14 | fyuryu | kabny: yes |
| 17:17 | kabny | if u do onylk require, how do you calla function? |
| 17:17 | kabny | (require '[clojure.contrib sql :as sql]) |
| 17:17 | kabny | doesnt work |
| 17:18 | kabny | user=> java.lang.IllegalArgumentException: Don't know how to create ISeq from: Keyword (NO_SOURCE_FILE:0) |
| 17:18 | kotarak | (require '[clojure.contrib.sql :as sql]) |
| 17:18 | kotarak | or (require '(clojure.contrib [sql :as sql])) |
| 17:18 | fyuryu | kabny: (require '[clojure.contrib.sql :as sql]) |
| 17:19 | fyuryu | kabny: sorry, there was a mistake in my first example (note the dot between contrib and sql) |
| 17:19 | kabny | why 2 different? |
| 17:19 | kabny | no worries works now |
| 17:20 | kabny | when writing sql in the prompt after successfull import it says not found but sql/insert-values works. shouldnt sql at leats return "namespace sql" or something? |
| 17:20 | kotarak | kabny: the first is for a single shot, while the second form is nice for several require's: (require '(clojure.contrib [sql :as sql] [def :as d] duck-streams)) |
| 17:28 | Lau_of_DK | technomancy: I added all the functions from the Sequences page on Clojure.com.... by hand :P |
| 17:38 | technomancy | thanks! =) |
| 17:41 | technomancy | Lau_of_DK: can you push that out? |
| 17:41 | Lau_of_DK | I was rejected, investigating |
| 17:43 | kabny | hmm i thought there was permutations in seq-utils? |
| 17:44 | kabny | it isnt there... |
| 17:44 | Lau_of_DK | Ok, done |
| 17:44 | Lau_of_DK | its in lazy-seq |
| 17:44 | technomancy | cool |
| 17:45 | Lau_of_DK | I gotta hit the sack, will add more when time becomes cheaper :) |
| 17:46 | kabny | I want to start mp3s(and other media files) froma clojure-app, is there a good Java-library for this? |
| 17:49 | danlarkin | he maintains swank-clojure too, to which he just pushed last night |
| 17:49 | danlarkin | so he is active in some capacity, at least |
| 17:49 | technomancy | ah, good to know. |
| 17:50 | kabny | how do I import a jar-file that contains numbers? ie jl1.0.jar? |
| 17:50 | kabny | emacs seems to chopit up |
| 18:03 | kabny | how do I import a jar-file that contains numbers? ie jl1.0.jar? |
| 18:03 | kabny | emacs seems to chopit up |
| 18:06 | danlarkin | kabny: what do you mean emacs chops it up? |
| 18:07 | kabny | oh wait now it works allt he sudden |
| 18:08 | kabny | so is it possible to do applets with clojure? |
| 18:18 | danlarkin | kabny: yup. I haven't done it myself but I've read of people doing it |
| 18:18 | danlarkin | kabny: isn't web start the new hotness though? |
| 18:20 | kabny | dont even know what web start is |
| 18:33 | kabny | ah i will look into web start after chekcing wikipedia seems cool :) |
| 19:08 | kabny | for miglayout, which jar should i download? |
| 19:08 | kabny | http://migcalendar.com/miglayout/versions/3.6.2/ |
| 19:08 | kabny | all? |
| 19:08 | kabny | or just miglayout-3.6.2.jar? |
| 19:09 | kabny | the miglayout that comes with contrib doesnt come with miglayout does it? |
| 19:09 | kotarak | depends on what you want to do. If you use Swing, the swing jar is sufficient. |
| 19:09 | kotarak | No. Contrib does not contain the miglayout jar |
| 19:10 | kabny | (require '[clojure.contrib.miglayout :as mig]) |
| 19:10 | kabny | user=> java.lang.ClassNotFoundException: net.miginfocom.swing.MigLayout (miglayout.clj:0) |
| 19:10 | kabny | you mean miglayout-3.6.2-swing.jar is enough? |
| 19:11 | kotarak | Then the miglayout jar is not in your classpath. |
| 19:11 | kotarak | kabny: yes. worked for me. |
| 19:11 | kabny | you mean miglayout-3.6.2.jar everything? |
| 19:11 | kabny | is miglayout-3.6.2.jar everything? |
| 19:11 | kotarak | I think so. |
| 19:12 | kabny | how do I tell the classpath to include everything in a dir? |
| 19:13 | kotarak | I don't know, how you do it with Java. Have a script, that does that for me. |
| 19:13 | technomancy | it's remarkable how hard to use the classpath is compared to the load path of other languages. |
| 19:13 | kabny | now it worked to import. thanks! |
| 19:13 | kabny | yes |
| 19:14 | kabny | but I keep hearing it makes it flexible |
| 19:14 | technomancy | I find that hard to believe. |
| 19:14 | kotarak | technomancy: never had problems with the classpath. But, in some funny way, I never have the usual problems... :] |
| 19:15 | technomancy | kotarak: it's really annoying how you can use apt-get to install a Java library, but then that library is not available to you unless you change your shell invocation of clojure. |
| 19:15 | kotarak | The jar stuff, was really nice up to now: download jar, add to classpath, works. But maybe my setups are very simple... |
| 19:15 | technomancy | there's no mechanism for systemwide libraries |
| 19:15 | technomancy | kotarak: the second step is unnecessary in languages with better load-path mechanisms. |
| 19:16 | kotarak | technomancy: I use a modified clj.sh from some github repo. It uses the directory from CLOJURE_LIB (or similar named) to load all jar therein. |
| 19:16 | kotarak | technomancy: then for me it amounts to: download jar. Drop in correct directory. Works. |
| 19:17 | technomancy | right but (0) that should be built-in to the JVM instead of requiring a separate download and (1) there's no generally accepted convention for the location of that directory. |
| 19:17 | kotarak | Then there might be other packages managers like apt-get, which could build up a CLASSPATH on the fly. |
| 19:17 | technomancy | and (2) you're back to manually managing dependencies, which is a waste of time; the computer should handleg that for you |
| 19:18 | kotarak | technomancy: add (1) which is a good thing, because that is the responsibility of the system in use. Mac will certainly differ from Linux as will Windows. |
| 19:18 | kabny | contrib url again pls? |
| 19:19 | kabny | clojurebot: contrib? |
| 19:19 | clojurebot | contrib is http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib/trunk/ |
| 19:19 | Chousuke | no |
| 19:20 | Chousuke | kabny: http://code.google.com/p/clojure-contrib/ |
| 19:20 | Chousuke | clojurebot: contrib is http://code.google.com/p/clojure-contrib/ |
| 19:20 | clojurebot | Ack. Ack. |
| 20:05 | technomancy | kotarak: apt-get can't build up the classpath for you because there's nontrivial overhead for every entry into the classpath... so every java library you install would slow down the jvm more. |
| 20:05 | technomancy | that's the fatal flaw |
| 20:05 | technomancy | otherwise you could treat it just like a regular lisp's load-path |
| 20:07 | technomancy | the CLI interaction (with classpath woes) is the only thing worse in clojure than other lisps |
| 20:09 | technomancy | I hope to see if it can be improved by using hashdot (http://hashdot.sourceforge.net) which looks promising. |
| 20:13 | kabny | what is the advantage of gogle code over github? |
| 20:13 | kabny | or why is contrib on google code? |
| 20:13 | kotarak | because SVN is used instead of git |
| 20:13 | kabny | heresy! |
| 20:18 | kotarak | kabny: besides: gc has a wiki, bug tracker, download area, code reviews, ... |
| 20:18 | kabny | doesnt github? |
| 20:20 | danlarkin | kabny: don't bother with the DVCS argument |
| 20:29 | technomancy | github doesn't have a bug tracker and doesn't let you track releases in quite so fine-grained a fashion |
| 20:30 | technomancy | not that clojure *has* any releases to track, but whatever. |
| 20:30 | technomancy | and it's not using the bug tracker either... huh. |
| 20:30 | kabny | does (Hmm. xxxx) mean (new Hmm xxxx) ? |
| 20:30 | technomancy | I think so. |
| 20:38 | kabny | can I do (doc someJavaMethod) somehow? |
| 20:47 | danlarkin | kabny: there's a show function in contrib |
| 20:47 | danlarkin | repl-utils or something? |
| 20:48 | kabny | and it is possible to start the repl with that included? |
| 20:48 | technomancy | what's a good resource for learning how to use Dates in Java? |
| 20:48 | technomancy | everything Google turns up is either trivial or so verbose that it sounds like gibberish. |
| 20:49 | eric-at-home | technomancy: standard java dates are always so verbose that they seem like gibberish :-( |
| 20:49 | technomancy | eric-at-home: that's what I was afraid of. |
| 20:49 | eric-at-home | calendar is the class that's able to do more than just store a date value, but it has a very poor api |
| 20:50 | eric-at-home | there's another option |
| 20:50 | technomancy | I assume clojure doesn't have anything special? |
| 20:50 | eric-at-home | joda time is an alternative with a better design, calendar is the standard but isn't as good |
| 20:51 | eric-at-home | I'm a Java programmer by day and am gradually moving our codebase from standard java date/time to joda time. |
| 20:51 | technomancy | huh... I just need to store a simple value for this. |
| 20:52 | eric-at-home | then you dont need any of that. java.util.Date has everything you need. |
| 20:52 | technomancy | shouldn't this work after importing Date? (.Date 2008 12 27) |
| 20:52 | eric-at-home | Does that call the Date constructor on three arguments? If so it looks right. |
| 20:53 | technomancy | maybe I just don't know how to read JavaDoc, but it says lists in the Constructor Summary: Date(int year, int month, int day) |
| 20:54 | technomancy | oh wait... it's deprecated in favour of a method that takes a long... which is totally useless for me! yay. |
| 20:54 | dreish | Did you mean (Date. 2008 12 27)? |
| 20:54 | technomancy | dreish: ah... that works. |
| 20:54 | eric-at-home | (new Date 2008 12 27) does something. |
| 20:54 | technomancy | can you tell I haven't been doing this long? =) |
| 20:54 | eric-at-home | Note that it isn't 1 indexed. |
| 20:55 | eric-at-home | Your date is jan 27. |
| 20:55 | technomancy | eric-at-home: you're kidding. |
| 20:55 | eric-at-home | oh, and the year is 3909. |
| 20:55 | eric-at-home | java has an incredibly stupid api. |
| 20:56 | technomancy | this whole "access Java, without any wrappers" being touted as a strength is starting to seem kind of duplicitous |
| 20:56 | eric-at-home | days start with 1, months start with 0, and years is the current year minus 1970. |
| 20:56 | technomancy | ... |
| 20:56 | technomancy | ok, fuck that. I'm going to use a struct. |
| 20:57 | technomancy | eric-at-home: thanks for the tips. I know crazy when I see it. |
| 20:57 | eric-at-home | I recommend making a wrapper for dates. not all java apis are that bad, but this one sure is. |
| 20:57 | dreish | technomancy: Without any wrappers doesn't mean you're not allowed to make one. |
| 20:58 | technomancy | dreish: right, it's just not "batteries included" |
| 20:58 | eric-at-home | Java has a standard SQL library, but clojure-contrib is getting a wrapper for it. I imagine dates will be the same way. |
| 20:59 | eric-at-home | those were the two java apis that always bothered me the most. |
| 20:59 | technomancy | one would certainly hope |
| 20:59 | technomancy | surely there's something out there already, even if it's not in contrib |
| 20:59 | eric-at-home | i'm pretty happy with clojure. |
| 20:59 | technomancy | I love it too! I just have high expectations. =) |
| 20:59 | dreish | technomancy: It's an awfully new language. |
| 21:00 | kabny | jdbc seems ok but contrib-sql seems like an improvement and hopefully someone is making it even better? |
| 21:00 | kabny | i started on my own wrapper for jdbc too |
| 21:00 | eric-at-home | jdbc is not okay :-( |
| 21:00 | technomancy | dreish: I know... the advantage of that is that I can help shape the future direction. |
| 21:00 | kabny | why not? |
| 21:00 | kabny | anyone good with miglayout? how do I make a textfield span 3 columns without extending the button on the row over it to do the same |
| 21:00 | kabny | ? |
| 21:01 | eric-at-home | jdbc provides the basic capabilities for accessing a database, but it's too low level to be using directly. |
| 21:01 | technomancy | and then everyone can blame me five years down the road when "clojure style" becomes something more concrete... like they do with Ruby and the libraries written in 2000. =) |
| 21:10 | kabny | clojurebot: blame technomancy for all failures |
| 21:10 | clojurebot | I don't understand. |
| 21:11 | kabny | where is clojurebot commands? |
| 21:11 | inertia- | what is the likelihood that clojure will be easily portable to other VMs? |
| 21:12 | eric-at-home | inertia: If portability to other VMs were a goal, using Java without wrappers would be a very bad idea. |
| 21:12 | inertia- | :) |
| 21:12 | inertia- | reliance on the jvm scares me |
| 21:13 | inertia- | especially when llvm looks "so cool" |
| 21:13 | eric-at-home | I like the jvm much better than java the language. |
| 21:13 | inertia- | of course, but that's not my point |
| 21:13 | inertia- | i've been using ppc linux for the last 6 months |
| 21:13 | inertia- | and the FOSS jvm options are just not that great compared to our friend mr. hotspot |
| 21:14 | inertia- | which has current binaries, afaik, only available for x86 |
| 21:14 | eric-at-home | I use x86 and Mr. Hotspot :-) |
| 21:14 | inertia- | well you are a disgusting binary blob consumer ;) |
| 21:15 | eric-at-home | Yes, I also prefer web applications because it means I don't need to care about portability of my tools. |
| 21:15 | inertia- | sure, fine |
| 21:15 | kabny | clojurebot: technomancy is to blame for all failures |
| 21:15 | clojurebot | Ik begrijp |
| 21:15 | kabny | clojurebot: technomancy? |
| 21:15 | clojurebot | technomancy is to blame for all failures |
| 21:15 | kabny | hihi |
| 21:16 | eric-at-home | does clojure work on the FOSS jvms? |
| 21:16 | kabny | foss=? |
| 21:16 | eric-at-home | free and open source software |
| 21:22 | kabny | how about adnroid+clojure? |
| 21:23 | kabny | im currently writing a webapp+android app, clojure for the web, java for the phone. |
| 21:23 | kabny | but can clojure generate classes for the dalvik vm? |
| 21:23 | kabny | would it be a problem with runtime overhead? |
| 21:24 | inertia- | eric-at-home: kind of; the last i checked it didn't load right after the AOT changes |
| 21:24 | inertia- | i dont know java or the jvm all that well |
| 21:24 | dreish | Last time I used clojure with IcedTea as included in Fedora 8, it was fine. |
| 21:24 | chrisn | What is the clojure equivalent to getClass().getResourceAsStream? |
| 21:25 | chrisn | Actually, what is the equiv to getClass? |
| 21:27 | chrisn | found it. |
| 21:28 | chrisn | look for a class of the same name as your namespace with __init appended |
| 21:28 | chrisn | haha |
| 21:30 | inertia- | dreish: ah right i never did get to compile that |
| 21:30 | inertia- | i was so relieved just to find a compliant 1.5 vm that i forgot about icepick :) |
| 21:34 | kabny | i want in mig: |
| 21:34 | kabny | a b c d |
| 21:35 | kabny | textfield f |
| 21:35 | kabny | so textfield goes from a to c and then button the same row |
| 21:35 | kabny | but if I say for example (JTextField 30) then a will be 30 too... |
| 21:44 | technomancy | kabny: it's not necessarily a blame for failures as it is for crazy-looking code (in the Ruby situation) |
| 21:45 | technomancy | like RDoc works great, but if you look at the original (circa 2000) implementation it makes you throw up a bit in the back of your throat. |
| 21:45 | technomancy | but maybe clojure's style won't evolve as much as Ruby's has. |
| 21:46 | technomancy | anyway, my main motivation for bringing up these shortcomings is to have someone point me to a workaround. =) |
| 21:47 | technomancy | or to have someone help me write a package manager for clojure that would abstract away dependencies, classpath craziness, etc... that would be good too |
| 21:48 | technomancy | I already have a name for it (packajes), but I don't think I'm ready to write a package manager as my first nontrivial clojure app. =) |
| 21:49 | kabny | yes that would be very nice |
| 21:50 | eric-at-home | My first non-trivial clojure app is a wordpress clone to host my blog - still working on that :-) |
| 21:51 | technomancy | I'm porting the application I wrote for the RailsDay 06 24-hour programming competition. Fun stuff. |
| 21:52 | technomancy | It's a huge mental break to work without an ORM. Stranger for me than immutability, for some reason. |
| 21:54 | kabny | so any miglayout gurus here or not? |
| 21:57 | eric-at-home | kabny: Looks like not. I never even heard of it. |
| 22:00 | kabny | i figured it out anyway, kind of |
| 22:01 | kabny | eric-at-home: its the ultimate layoutmanager for GUIs in Java... |
| 22:02 | eric-at-home | kabny: I do a fair amount of Java layout work, so I will need to look into that. |
| 22:21 | technomancy | whoa... you can't use cons to create improper lists... that's interesting! |
| 22:21 | technomancy | looks like it's trying to force the second arg into a sequence... but I thought conj was the sequence-specific version of cons. |
| 22:30 | technomancy | for CL, is ASDF a package manager? |
| 22:31 | technomancy | I can find lots of information about it, but nothing that actually explains what it is. (other than "mkdefsystem done right", which is not very helpful.) |
| 22:34 | technomancy | "The problem is not with ASDF, it's with the users." <- This is why it's good that Clojure hasn't inherited too much from CL. =) |
| 22:59 | kabny | if I want to distribute an exe-file how do I do? can Java produce exe-files? is that what jars are? |
| 22:59 | kabny | i know clojure recently got compile |
| 22:59 | kabny | but that creates jars or class-files right? |
| 23:35 | kabny | I must say I recommend miglayout for anyone doing GUIs and thanks a lot to whoever created miglayout for contrib! |
| 23:48 | eric-at-home | kabny: if you have a jar, the command to execute it is something like "java --jar yourprogram.jar" which is not quite as nice as "./yourprogram.jar" |
| 23:50 | kabny | so can I make an exe? |
| 23:50 | kabny | I mean for endusers it should just be doubleclick and then it should run |
| 23:54 | duck1123 | In most operating systems you can easily set it so it's double clickable |
| 23:55 | duck1123 | or at the very least, include a shell script / batch file |