#clojure logs

2008-12-27

00:58mibuhey does anyone know how to create a (sorted-map-by) by value?
01:23replacamibu: still there?
02:20replacaI always expect to see a tumbleweed rolling through here about this time of night
02:57replacaand there went one, rolling through the darkness
03:43Lau_of_DKGood morning all
08:25Lau_of_DKSomebody help the slow student! The SqlDataReader that is used here, where do I dig up that class?
08:25Lau_of_DK(not java.sql)
08:38ChousukeLau_of_DK: looks like C# :P
08:44Lau_of_DKDo you realise how much I regretted that question after posting?
08:44Chousuke:P
08:44Lau_of_DKBut the C# approach is very very nice compared to Javas preparedStatement/addBatch
08:49ChousukeI suppose.
08:50Lau_of_DKand addBatch forces me to record types as well :(
09:54Lau_of_DKClojureQL now supports dynamic values in Query/Insert-into structures: (let [abc 5] (sql (query [id name] developers.employees (= id ~abc))))
11:16Lau_of_DKoh my :(
11:19chrisnhi lau
11:19Lau_of_DKHey my friend :)
11:20chrisndid you try out the program?
11:20Lau_of_DKnot yet :(
11:20chrisnI checked in a new repl_wave or something like that.
11:20chrisnAll you have to do is load it
11:20chrisnAnd you should get the demo
11:22Lau_of_DKCool
11:22Lau_of_DKI've pull in a little while
11:22Lau_of_DKI'll
11:23chrisnlet me know
11:42soothIs HEAD useable?
11:43Lau_of_DKchrisn: It might be a couple of hours :( Sorry
11:44chrisndon't worry about it. I have a bunch of details to wrap up.
12:45Lau_of_DKQuestion: if I have {:a 5} and {:b 10}, how do I merge them into {:a 5, :b 10} ?
12:50zakwilsonLau_of_DK: (assoc map1 (interleave (keys map2) (vals map2)) should work. I don't know of a built in function to do this.
12:53dudleyf(doc merge)
12:53clojurebotReturns 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:58Lau_of_DKzakwilson: Thanks, I was fidling with interleave a minute ago, but didnt get that far :)
12:59zakwilsonLau_of_DK: it looks like merge or conj is the right answer.
12:59Lau_of_DKNot sure
13:09zakwilson(merge {:a 5} {:b 10})
13:14Lau_of_DKprefix with ,
13:14Lau_of_DK,(merge {:a 5} {:b 10})
13:14clojurebot{:b 10, :a 5}
13:15zakwilsonAhh... I see.
13:20soothIs trunk supposed to be useable?
13:20Lau_of_DKsooth: yea...
13:21soothNobody having problems with latest?
13:21danlarkinsooth: did you ant clean after you svn up'ed?
13:21soothdanlarkin: No. Why do I need to clean first?
13:22Chousukedoesn't the default build target do that automatically anyway
13:22soothdanlarkin: That did it. Thanks
13:22Lau_of_DKsvn is bad, git is good
13:23danlarkinChousuke: no, just running "ant" does not "ant clean", otherwise it wouldn't really be an incremental build would it :)
13:37Lau_of_DKIsnt there a simply way to go from {:a 5, :b 10} => "a, b" ?
13:42hoeckLau_of_DK: (apply str (interpose ", " (map name (keys {:a 1, :b 2})))) is the simplest way I'm aware of at the moment
13:43Lau_of_DKuh good, I forgot about 'name', thanks hoeck
13:44Lau_of_DKGood crowd, thanks :)
13:44jgracinare there any restrictions as to the size of array given to 'apply'?
13:44hoeckno problem, we're basically working on the same thing :)
13:45jgracinany reason why 'reduce' should be preferred to apply in the above solution?
13:45hoeckjgracin: i think not
13:45Chousukedanlarkin: actually, looking at the build file, yes it does.
13:47Chousukejgracin: apply is better.
13:47hoeckjgracin: str is optimized for apply, builds only one stringbuilder instead of many when used in reduce
13:47jgracinhoeck: I see.
13:48jgracinthanks
13:59danlarkinChousuke: no I'm pretty sure the default ant task does not clean
14:02Lau_of_DKCouldnt somebody just make that update script already?
14:07Lau_of_DK(sql (insert-into developers.employees :id ~abc :name "Frank" :language "PHP" :iq ~xyz))
14:07Lau_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:07Lau_of_DKUuuh it works so well now :)
14:11danlarkinLau_of_DK: looks sweet!
14:11Chousukedanlarkin: <target name="init" depends="clean">
14:11Lau_of_DKdanlarkin: thanks, its really shaping up, but suggestions for query-forms and such are very welcome
14:11ChousukeI think that was a recent change.
14:12danlarkinChousuke: I'm at 1162 and I have <target name="init">
14:13Chousukedanlarkin: heh
14:14Chousukedanlarkin: the change was made in 1163 :)
14:14danlarkinohhh I still haven't switched over to the google code reo
14:14danlarkinrepo
14:14danlarkinwell, that explains it
14:24Lau_of_DKDoes anyone here have a good info site on how to work with Java/sql in a parameterized fasion ?
14:32Lau_of_DKDo we 'switch' in Clojure?
14:37danlarkinLau_of_DK: what's that mean?
14:37Lau_of_DK(switch x 1: do-1 2: do-2 :else do-this)
14:38soothcond?
14:39Lau_of_DKIts cond, just more concise, because you can leave out the comparator
14:41Lau_of_DKits a simple macro to write, so dont worry about it
14:42chrisnwhy not use multimethods?
14:42Lau_of_DKI might do that, but its a littled bloated if you ask me
14:42chrisnThey are more amenable to extension at runtime
14:42chrisnThat is why I like them. They are very syntaxy.
14:43Lau_of_DKIn this case, extension doesnt go a long way, Im just testing class types
14:44chrisnwhat about class hierarchy?
14:44Lau_of_DKWhat about it?
14:44arbscht_Lau_of_DK: clojure.contrib has a few goodies like {f,in-,re-}case and condp
14:44chrisnswitch statements break quickly when you have objects derived from other objects.
14:44Lau_of_DKarbscht_: cool, I'll have a look
14:45Lau_of_DKchrisn: These are primitive data-types
14:45chrisnYour execution is dependent upon switch order, not upon derivation hierarchy as one would like
14:45chrisnoh fine then
14:45chrisnuse your goddamn switch statements :).
14:45Lau_of_DKI see what you're saying and the entire design of my program is based on multimethods... I just want this little switch thing :)
14:49Lau_of_DK(let [xyz 5 abc 8]
14:49Lau_of_DK (backend/execute (sql (query [id name] developers.employees (and (> id ~xyz) (< id ~abc))))))
14:49Lau_of_DK{:name Jack D., :id 6}
14:49Lau_of_DK{:name Mike, :id 7}
14:49Lau_of_DKCheck it out guys, thats one Lispy SQL query! :)
14:50arbscht_neat
14:59zakwilsonLau_of_DK: Have you seen CLSQL?
15:00Lau_of_DKNo - Is it much different from SchemeQL ?
15:10kabnybah I go crazy with wireless on Ubuntu!
15:10kabnyi want to swap to linux because it is better for programming but ,my god...
15:13Lau_of_DKkabny: You should check with the good folks at #ubuntu or whatever distro you use, but it really is quite simple
15:13Lau_of_DKUbuntu 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:13kabny clojurebot : contrib?
15:15kabnycontrib?
15:15kabnyclojurebot
15:15kabny, (+ 2 3 4)
15:15kabny,(+ 2 3 4)
15:15clojurebot9
15:16kabny,(+ 2 3 4 5)
15:16clojurebot14
15:16kabny,contrib?
15:16kabnyhow do I ask?
15:16dreishclojurebot: contrib
15:16clojurebotcontrib is http://sourceforge.net/projects/clojure-contrib/
15:17Lau_of_DKclojurebot: contrib is http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib/trunk/
15:17clojurebotIn Ordnung
15:17Lau_of_DKclojurebot: contrib?
15:17clojurebotcontrib is http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib/trunk/
15:17arbscht_aren't they moving to code.google?
15:17kotarakHmmm... isn't that move to google code?
15:17arbscht_heh
15:17Lau_of_DKhey wait.. isnt that moved to google?
15:40Lau_of_DKclojurebot: clojure-mode?
15:40clojurebotclojure-mode is an Emacs mode for Clojure, found at git://github.com/jochu/clojure-mode.git
15:40Lau_of_DKIs the maintainer of this mode present in this channel tonight?
15:42Chousukeyeah, contrib is at google code
15:42Chousukehttp://code.google.com/p/clojure-contrib/
15:42technomancyLau_of_DK: I haven't been able to contact him. wanted to fix the way he handles autoloads
15:43Lau_of_DKtechnomancy: Also the highlighting is surpassed by Vim-mode now Im told, which is UNACCEPTABLE! :)
15:43kabnycan someone explain to me how to correctly install contrib on windows?
15:43kabnyshould I just zip the folder contrib?
15:43Chousukerun ant
15:43kabnycould it need some external packages too?
15:43technomancyLau_of_DK: that's crazy! what specifically is the difference?
15:44Lau_of_DKapply, reduce and other functions are not highthed in Emacs, but are in Vim
15:44Lau_of_DKkabny: Step #1) Install Linux, Step #2) Follow Linux instructions (ie, type ant)
15:44technomancythose are just normal functions though... not sure if they deserve to be highlighted.
15:45technomancynot sure if it's wise to highlight every single function in core, I mean
15:45Lau_of_DKWhat could it hurt?
15:46technomancyI 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:47Lau_of_DKIts just a matter of choosing the right colors
15:47kotaraktechnomancy: special forms are highlighted differently to macros or functions
15:47Lau_of_DKblue = func, green = special form
15:48technomancyah, I didn't realize they were different.
15:48kabnyhow do I run ant on windows?
15:48Lau_of_DKkabny: I already explained :)
15:49technomancyLau_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:50technomancyLau_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:50Lau_of_DKOK - Youre not up for forking? :)
15:52technomancyI forked it already.
15:52kabnyLau: but like I said before fooken ubuntu wireless doesnt work
15:53technomancywow, I didn't realize there were still wifi chipsets that weren't supported.
15:53Lau_of_DKkabny: 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:53Lau_of_DKtechnomancy: So you dont want me to fork ?
15:54technomancyLau_of_DK: you can have your own fork.
15:54Lau_of_DKThanks
15:54technomancyif the original maintainer comes back online it makes it easier to tell which changes came from whom.
15:55Lau_of_DKWonder what happend, it came out so quickly, then withered
15:55technomancydunno
15:55technomancyI wouldn't mind becoming the de-facto maintainer if this guy steps down or disappears
15:55technomancysince I'm pretty comfortable with elisp.
15:55Lau_of_DKIf you have your own fork, just start putting in the work
15:55Lau_of_DKCan you post a Github link ?
15:56technomancysure: http://github.com/technomancy/clojure-mode/tree/master
15:56Lau_of_DKIm watching you
15:56technomancyI 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:57Lau_of_DKOr you can give me push rights to your repo, that might be simpler
15:57technomancyit'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:58Lau_of_DKIn the true Non-Git spirit, I just feel its better allround to have 1 public repo
15:58technomancyheh
15:58technomancywhat's your github ID?
15:58technomancysame as IRC?
15:59Lau_of_DKLau-of-DK
15:59Lau_of_DK(dont support underscore, which is a great reason for switching to Bitbucket)
15:59technomancyheh
16:01gnuvince;-)
16:01gnuvinceHg and BitBucket are nice.
16:01Lau_of_DKIndeed
16:01gnuvinceToo bad Git is just unstoppable
16:01Lau_of_DKDoesnt make a difference does it
16:03gnuvinceThe "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:05Lau_of_DKkotarak 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:06kotarakI don't know, whether they are superior. They just fit my style of working.
16:07Chousukewhat kind of ways?
16:09kotarakUsing patch queues of hg.
16:10Chousukethe wiki page says it's like quilt for git
16:11kotarakquilt is independent of git, AFAIK.
16:11kabnyGit + Github is awesome, everybody use it pleas ek thanks
16:12kotarakhg + bitbucket is awesome, everybody use it please k thanks
16:12Lau_of_DKhmm, I must give kotarak + bitbucket points for spelling
16:13kabnytechnomanyc: where can I check if it is supported or not(my wifi chipset, i have realtek RTL8187B)?
16:13Chousukekotarak: having a patch queue sounds a lot like having a topic brach for changes.
16:14technomancykabny: I usually check thinkwiki.org, but that's somewhat thinkpad-specific.
16:14Lau_of_DKChousuke: You mean instead of applying/removing pathes, you just branch and merge?
16:14kotarakChousuke: but it's not quite the same. eg. you can't exchange the order of two commits.
16:14Chousukekotarak: sure you can
16:14Lau_of_DKYou can ? :)
16:14Chousukeit's just git rebase --interactive
16:15technomancyor you can do it all out of Emacs with magit. =)
16:15Lau_of_DK...or Egg
16:15technomancyLau_of_DK: I pushed out my autoload changes for clojure-mode.el
16:15kotarakChousuke: hmmm, you can merge or skip or keep commits, but also exchange the order? Then I misread the docs.
16:15Lau_of_DKtechnomancy: cool
16:16Chousukeso, branch from master, work, git rebase --interactive master, edit commits however you like, then merge master with the cleaned up branch.
16:16Lau_of_DKtechnomancy: technomancy added you to clojure-mode 16 minutes ago
16:16Lau_of_DKDoes this mean that I can push to it ?
16:16Chousukemaybe it's not as nice as mercurial's patch queues though... hmm.
16:17ChousukeI haven't used mercurial so I don't know exactly how it works.
16:17Lau_of_DKChousuke: Do you run rebase while youre in the experimental branch ?
16:17kotarakChousuke: basically it shows again, that both, git and hg, are mostly equivalent. :)
16:17Chousukethere's also http://repo.or.cz/w/topgit.git
16:17technomancyLau_of_DK: you should be able to.
16:17ChousukeLau_of_DK: yeah.
16:18kotaraknever got topgit to work.
16:18Lau_of_DKClojureQL was founded on a 2� hour discussion about Hg vs Git, whereafter we proceeded to discuss Emacs vs Vim for ~15 hours....
16:18ChousukeLau_of_DK: or when you're done with your changes, you can branch a new cleanup branch and rebase that instead :P
16:18kotarakAlways complained, that the topic branch was not topgit-controlled, when in fact it was.
16:19technomancyhah... /me just used a comma for unquote instead of ~
16:19technomancythat's going to take a lot of getting used to
16:19Lau_of_DKChousuke: 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:20ChousukeLau_of_DK: rebase basically replays your changes on top of another branch
16:20Chousuke--interactive just allows you to quash, reorder or skip the changes when rebasing.
16:21Lau_of_DKIn a Yes/No styled UI?
16:21ChousukeLau_of_DK: in a text editor :))
16:21Chousuke-)
16:22Lau_of_DKok
16:22Lau_of_DKtechnomancy: Are you quite happy with adding all the highlights manually in clojure-font-lock-keywords?
16:23technomancyLau_of_DK: that sounds fine, yeah.
16:24Lau_of_DKbut...
16:24Lau_of_DK:)
16:26technomancyLau_of_DK: I'm going to submit it to ELPA too.
16:27Lau_of_DKELPA? I had to google it
16:27Lau_of_DKDefinitioner af ELPA p� nettet p�: Engelsk
16:27Lau_of_DK
16:27Lau_of_DK * The Automobile and Touring Club of Greece
16:27Lau_of_DKBut it makes sense I guess
16:27technomancyit's the package manager for elisp
16:27technomancyvery handy
16:27Lau_of_DKk
16:34technomancyanyone else wish clojure had a package manager too?
16:34kabnyWhere is the ant_home vaiable?
16:37kabnyWhere is the ant_home vaiable?
16:37fyuryukabny: what OS? it's an environment variable
16:38kabnywindows
16:38fyuryudo you have ant?
16:38kabnyyes
16:39fyuryukabny: Win+Pause -> Advenced -> Environment variables (or something, I don't have English windows version)
16:39kabnyyes im there
16:39kabnybut there is no ant_home variable
16:40fyuryuthen add it
16:40kabnyshould ia dd it to user-variables
16:40kabnyok
16:40kabnyto system or users?
16:40fyuryuand put path to ant directory as value
16:40fyuryuuser
16:41fyuryubut it doesn't matter if you're the only user
16:42kabnyC:/ant/;
16:42kabnyANT_HOME
16:42kabnyi tshouldnt be to the ant.jar?
16:42fyuryukabny: drop the semicolon
16:42kabnyI get "ant not recognized as a..."
16:42kabnywhen doing ant form the command line
16:43fyuryureopen the command line
16:44kabnyi did
16:45fyuryustill the same? try typing: set ANT_HOME=C:\ant
16:47fyuryukabny: wait a minute, did you add ant bin directory to PATH?
16:49kabnyyes works now but
16:49kabnyUnable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
16:49kabnyb\tools.jar
16:50kabnyand I dont have tools.jar
16:50kabnywhat is it and how do I get it?
16:51fyuryudo you have jdk installed or only java runtime?
16:51bOR_hehe. a mirror of my own problems.
16:52bOR_setenv JAVA_HOME /usr/java/jdk1.6.0_11/
16:52bOR_ 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:52bOR_solved it for me.
16:52bOR_cshrc shell.
16:54fyuryukabny: and as bOR_ said, JAVA_HOME needs to be set to the jdk dir
16:55kabnyjre jdk i ahve both
16:56kabnyjava_home i should create too then?
16:56fyuryukabny: yes
16:56kabnyah there tools is
16:57kabnywiiii!!!!!!!!!!!!1
16:57kabnythanks
16:57kabnynow lets see
16:57kabnyjust ant contrib?
16:58fyuryujust ant
16:58kabnyuh?
16:58kabnyinside trunk?
16:59kabnyshould I first place trunk in the dir of Clojure
16:59fyuryuin the directory in which build.xml is present
16:59kabnyyes
16:59fyuryukabny: no
16:59kabnybut where will it then place the contrib stuff?
16:59kabnyhow will ant now where to put it?
16:59kabnyC:/clojure
16:59fyuryuit won't
17:00fyuryuyou'll have to do it yourself
17:00fyuryuant will produce clojure-contrib.jar
17:00kabnyi see now!
17:00bOR_ok. my turn for a question.
17:00bOR_for is a nice macro.
17:01fyuryuand you just have to have it in you classpath (see clojure wiki for example of a handy .bat script )
17:02bOR_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:02bOR_with variable length collections fed to it.
17:02bOR_seems like I've to spell out the structure of the collection in order to get all the permutations.
17:03bOR_( the [x [ 1 2 3] y [1 2] z [4 5 6]] [x y z] version does what I want)
17:05bOR_(but I don't always know the length of the set of collections coming in)
17:05bOR_should check if one of clojure's library has a permutation-like function.
17:06kabnycheck seq-utils
17:06fyuryubOR_: i think there was something for permutations in contrib
17:06kabnyseq-utils...
17:07fyuryubOR_: also: http://github.com/rosado/libs4clj/tree/master/rosado/math/permutations.clj
17:07kabnyhow do you import from contrib?
17:07kabny(import '(clojure-contrib sql)) fails
17:07bOR_thanks
17:08fyuryu(require '(clojure.contrib sql))
17:08fyuryukabny: the namespace is clojure.contrib
17:09kabnyah
17:09kabnyimport from java and require for clojure-libs in general?
17:09kabnyis contrib sql ready to use directly?
17:09kabnyI have jdbc+derby working with clojure already
17:10fyuryukabny: yes, import for java stuff
17:10fyuryukabny: no idea about sql, never used it so far
17:11kabnyand then how do I call stuff inside sql? sql/f ?
17:12kabnyand that is recommended? you dont import the whole namespace so to speak so you can refer to functions directly?
17:12fyuryukabny: clojure.contrib.sql/f, but it's better to (require '[clojure.contrib sql :as sql])
17:13fyuryukabny: then you can call (sql/f ...))
17:13kabnyah i see
17:13fyuryukabny: you can also (use '(lib.name ))
17:14kabnyand then i can refer to f direclt(which i dont want i like tos ee where stuff is coming from)?
17:14fyuryukabny: to have everything from the lib in yo namespace
17:14fyuryukabny: yes
17:17kabnyif u do onylk require, how do you calla function?
17:17kabny(require '[clojure.contrib sql :as sql])
17:17kabnydoesnt work
17:18kabnyuser=> java.lang.IllegalArgumentException: Don't know how to create ISeq from: Keyword (NO_SOURCE_FILE:0)
17:18kotarak(require '[clojure.contrib.sql :as sql])
17:18kotarakor (require '(clojure.contrib [sql :as sql]))
17:18fyuryukabny: (require '[clojure.contrib.sql :as sql])
17:19fyuryukabny: sorry, there was a mistake in my first example (note the dot between contrib and sql)
17:19kabnywhy 2 different?
17:19kabnyno worries works now
17:20kabnywhen 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:20kotarakkabny: 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:28Lau_of_DKtechnomancy: I added all the functions from the Sequences page on Clojure.com.... by hand :P
17:38technomancythanks! =)
17:41technomancyLau_of_DK: can you push that out?
17:41Lau_of_DKI was rejected, investigating
17:43kabnyhmm i thought there was permutations in seq-utils?
17:44kabnyit isnt there...
17:44Lau_of_DKOk, done
17:44Lau_of_DKits in lazy-seq
17:44technomancycool
17:45Lau_of_DKI gotta hit the sack, will add more when time becomes cheaper :)
17:46kabnyI want to start mp3s(and other media files) froma clojure-app, is there a good Java-library for this?
17:49danlarkinhe maintains swank-clojure too, to which he just pushed last night
17:49danlarkinso he is active in some capacity, at least
17:49technomancyah, good to know.
17:50kabnyhow do I import a jar-file that contains numbers? ie jl1.0.jar?
17:50kabnyemacs seems to chopit up
18:03kabnyhow do I import a jar-file that contains numbers? ie jl1.0.jar?
18:03kabnyemacs seems to chopit up
18:06danlarkinkabny: what do you mean emacs chops it up?
18:07kabnyoh wait now it works allt he sudden
18:08kabnyso is it possible to do applets with clojure?
18:18danlarkinkabny: yup. I haven't done it myself but I've read of people doing it
18:18danlarkinkabny: isn't web start the new hotness though?
18:20kabnydont even know what web start is
18:33kabnyah i will look into web start after chekcing wikipedia seems cool :)
19:08kabnyfor miglayout, which jar should i download?
19:08kabnyhttp://migcalendar.com/miglayout/versions/3.6.2/
19:08kabnyall?
19:08kabnyor just miglayout-3.6.2.jar?
19:09kabnythe miglayout that comes with contrib doesnt come with miglayout does it?
19:09kotarakdepends on what you want to do. If you use Swing, the swing jar is sufficient.
19:09kotarakNo. Contrib does not contain the miglayout jar
19:10kabny(require '[clojure.contrib.miglayout :as mig])
19:10kabnyuser=> java.lang.ClassNotFoundException: net.miginfocom.swing.MigLayout (miglayout.clj:0)
19:10kabnyyou mean miglayout-3.6.2-swing.jar is enough?
19:11kotarakThen the miglayout jar is not in your classpath.
19:11kotarakkabny: yes. worked for me.
19:11kabnyyou mean miglayout-3.6.2.jar everything?
19:11kabnyis miglayout-3.6.2.jar everything?
19:11kotarakI think so.
19:12kabnyhow do I tell the classpath to include everything in a dir?
19:13kotarakI don't know, how you do it with Java. Have a script, that does that for me.
19:13technomancyit's remarkable how hard to use the classpath is compared to the load path of other languages.
19:13kabnynow it worked to import. thanks!
19:13kabnyyes
19:14kabnybut I keep hearing it makes it flexible
19:14technomancyI find that hard to believe.
19:14kotaraktechnomancy: never had problems with the classpath. But, in some funny way, I never have the usual problems... :]
19:15technomancykotarak: 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:15kotarakThe jar stuff, was really nice up to now: download jar, add to classpath, works. But maybe my setups are very simple...
19:15technomancythere's no mechanism for systemwide libraries
19:15technomancykotarak: the second step is unnecessary in languages with better load-path mechanisms.
19:16kotaraktechnomancy: 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:16kotaraktechnomancy: then for me it amounts to: download jar. Drop in correct directory. Works.
19:17technomancyright 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:17kotarakThen there might be other packages managers like apt-get, which could build up a CLASSPATH on the fly.
19:17technomancyand (2) you're back to manually managing dependencies, which is a waste of time; the computer should handleg that for you
19:18kotaraktechnomancy: 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:18kabnycontrib url again pls?
19:19kabnyclojurebot: contrib?
19:19clojurebotcontrib is http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib/trunk/
19:19Chousukeno
19:20Chousukekabny: http://code.google.com/p/clojure-contrib/
19:20Chousukeclojurebot: contrib is http://code.google.com/p/clojure-contrib/
19:20clojurebotAck. Ack.
20:05technomancykotarak: 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:05technomancythat's the fatal flaw
20:05technomancyotherwise you could treat it just like a regular lisp's load-path
20:07technomancythe CLI interaction (with classpath woes) is the only thing worse in clojure than other lisps
20:09technomancyI hope to see if it can be improved by using hashdot (http://hashdot.sourceforge.net) which looks promising.
20:13kabnywhat is the advantage of gogle code over github?
20:13kabnyor why is contrib on google code?
20:13kotarakbecause SVN is used instead of git
20:13kabnyheresy!
20:18kotarakkabny: besides: gc has a wiki, bug tracker, download area, code reviews, ...
20:18kabnydoesnt github?
20:20danlarkinkabny: don't bother with the DVCS argument
20:29technomancygithub doesn't have a bug tracker and doesn't let you track releases in quite so fine-grained a fashion
20:30technomancynot that clojure *has* any releases to track, but whatever.
20:30technomancyand it's not using the bug tracker either... huh.
20:30kabnydoes (Hmm. xxxx) mean (new Hmm xxxx) ?
20:30technomancyI think so.
20:38kabnycan I do (doc someJavaMethod) somehow?
20:47danlarkinkabny: there's a show function in contrib
20:47danlarkinrepl-utils or something?
20:48kabnyand it is possible to start the repl with that included?
20:48technomancywhat's a good resource for learning how to use Dates in Java?
20:48technomancyeverything Google turns up is either trivial or so verbose that it sounds like gibberish.
20:49eric-at-hometechnomancy: standard java dates are always so verbose that they seem like gibberish :-(
20:49technomancyeric-at-home: that's what I was afraid of.
20:49eric-at-homecalendar is the class that's able to do more than just store a date value, but it has a very poor api
20:50eric-at-homethere's another option
20:50technomancyI assume clojure doesn't have anything special?
20:50eric-at-homejoda time is an alternative with a better design, calendar is the standard but isn't as good
20:51eric-at-homeI'm a Java programmer by day and am gradually moving our codebase from standard java date/time to joda time.
20:51technomancyhuh... I just need to store a simple value for this.
20:52eric-at-homethen you dont need any of that. java.util.Date has everything you need.
20:52technomancyshouldn't this work after importing Date? (.Date 2008 12 27)
20:52eric-at-homeDoes that call the Date constructor on three arguments? If so it looks right.
20:53technomancymaybe 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:54technomancyoh wait... it's deprecated in favour of a method that takes a long... which is totally useless for me! yay.
20:54dreishDid you mean (Date. 2008 12 27)?
20:54technomancydreish: ah... that works.
20:54eric-at-home(new Date 2008 12 27) does something.
20:54technomancycan you tell I haven't been doing this long? =)
20:54eric-at-homeNote that it isn't 1 indexed.
20:55eric-at-homeYour date is jan 27.
20:55technomancyeric-at-home: you're kidding.
20:55eric-at-homeoh, and the year is 3909.
20:55eric-at-homejava has an incredibly stupid api.
20:56technomancythis whole "access Java, without any wrappers" being touted as a strength is starting to seem kind of duplicitous
20:56eric-at-homedays start with 1, months start with 0, and years is the current year minus 1970.
20:56technomancy...
20:56technomancyok, fuck that. I'm going to use a struct.
20:57technomancyeric-at-home: thanks for the tips. I know crazy when I see it.
20:57eric-at-homeI recommend making a wrapper for dates. not all java apis are that bad, but this one sure is.
20:57dreishtechnomancy: Without any wrappers doesn't mean you're not allowed to make one.
20:58technomancydreish: right, it's just not "batteries included"
20:58eric-at-homeJava has a standard SQL library, but clojure-contrib is getting a wrapper for it. I imagine dates will be the same way.
20:59eric-at-homethose were the two java apis that always bothered me the most.
20:59technomancyone would certainly hope
20:59technomancysurely there's something out there already, even if it's not in contrib
20:59eric-at-homei'm pretty happy with clojure.
20:59technomancyI love it too! I just have high expectations. =)
20:59dreishtechnomancy: It's an awfully new language.
21:00kabnyjdbc seems ok but contrib-sql seems like an improvement and hopefully someone is making it even better?
21:00kabnyi started on my own wrapper for jdbc too
21:00eric-at-homejdbc is not okay :-(
21:00technomancydreish: I know... the advantage of that is that I can help shape the future direction.
21:00kabnywhy not?
21:00kabnyanyone 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:00kabny?
21:01eric-at-homejdbc provides the basic capabilities for accessing a database, but it's too low level to be using directly.
21:01technomancyand 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:10kabnyclojurebot: blame technomancy for all failures
21:10clojurebotI don't understand.
21:11kabnywhere is clojurebot commands?
21:11inertia-what is the likelihood that clojure will be easily portable to other VMs?
21:12eric-at-homeinertia: If portability to other VMs were a goal, using Java without wrappers would be a very bad idea.
21:12inertia-:)
21:12inertia-reliance on the jvm scares me
21:13inertia-especially when llvm looks "so cool"
21:13eric-at-homeI like the jvm much better than java the language.
21:13inertia-of course, but that's not my point
21:13inertia-i've been using ppc linux for the last 6 months
21:13inertia-and the FOSS jvm options are just not that great compared to our friend mr. hotspot
21:14inertia-which has current binaries, afaik, only available for x86
21:14eric-at-homeI use x86 and Mr. Hotspot :-)
21:14inertia-well you are a disgusting binary blob consumer ;)
21:15eric-at-homeYes, I also prefer web applications because it means I don't need to care about portability of my tools.
21:15inertia-sure, fine
21:15kabnyclojurebot: technomancy is to blame for all failures
21:15clojurebotIk begrijp
21:15kabnyclojurebot: technomancy?
21:15clojurebottechnomancy is to blame for all failures
21:15kabnyhihi
21:16eric-at-homedoes clojure work on the FOSS jvms?
21:16kabnyfoss=?
21:16eric-at-homefree and open source software
21:22kabnyhow about adnroid+clojure?
21:23kabnyim currently writing a webapp+android app, clojure for the web, java for the phone.
21:23kabnybut can clojure generate classes for the dalvik vm?
21:23kabnywould it be a problem with runtime overhead?
21:24inertia-eric-at-home: kind of; the last i checked it didn't load right after the AOT changes
21:24inertia-i dont know java or the jvm all that well
21:24dreishLast time I used clojure with IcedTea as included in Fedora 8, it was fine.
21:24chrisnWhat is the clojure equivalent to getClass().getResourceAsStream?
21:25chrisnActually, what is the equiv to getClass?
21:27chrisnfound it.
21:28chrisnlook for a class of the same name as your namespace with __init appended
21:28chrisnhaha
21:30inertia-dreish: ah right i never did get to compile that
21:30inertia-i was so relieved just to find a compliant 1.5 vm that i forgot about icepick :)
21:34kabnyi want in mig:
21:34kabnya b c d
21:35kabnytextfield f
21:35kabnyso textfield goes from a to c and then button the same row
21:35kabnybut if I say for example (JTextField 30) then a will be 30 too...
21:44technomancykabny: it's not necessarily a blame for failures as it is for crazy-looking code (in the Ruby situation)
21:45technomancylike 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:45technomancybut maybe clojure's style won't evolve as much as Ruby's has.
21:46technomancyanyway, my main motivation for bringing up these shortcomings is to have someone point me to a workaround. =)
21:47technomancyor 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:48technomancyI 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:49kabnyyes that would be very nice
21:50eric-at-homeMy first non-trivial clojure app is a wordpress clone to host my blog - still working on that :-)
21:51technomancyI'm porting the application I wrote for the RailsDay 06 24-hour programming competition. Fun stuff.
21:52technomancyIt's a huge mental break to work without an ORM. Stranger for me than immutability, for some reason.
21:54kabnyso any miglayout gurus here or not?
21:57eric-at-homekabny: Looks like not. I never even heard of it.
22:00kabnyi figured it out anyway, kind of
22:01kabnyeric-at-home: its the ultimate layoutmanager for GUIs in Java...
22:02eric-at-homekabny: I do a fair amount of Java layout work, so I will need to look into that.
22:21technomancywhoa... you can't use cons to create improper lists... that's interesting!
22:21technomancylooks like it's trying to force the second arg into a sequence... but I thought conj was the sequence-specific version of cons.
22:30technomancyfor CL, is ASDF a package manager?
22:31technomancyI 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:34technomancy"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:59kabnyif I want to distribute an exe-file how do I do? can Java produce exe-files? is that what jars are?
22:59kabnyi know clojure recently got compile
22:59kabnybut that creates jars or class-files right?
23:35kabnyI must say I recommend miglayout for anyone doing GUIs and thanks a lot to whoever created miglayout for contrib!
23:48eric-at-homekabny: 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:50kabnyso can I make an exe?
23:50kabnyI mean for endusers it should just be doubleclick and then it should run
23:54duck1123In most operating systems you can easily set it so it's double clickable
23:55duck1123or at the very least, include a shell script / batch file