#clojure log - Dec 25 2010

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

5:04 fliebel: Good morning and Happy Christmas! (You must be getting a lot of these today) (Still 200 people in here?) (Happy Christmas is always with capitals, by the way) (No more comments…)

5:06 Lajla: fliebel, opdat de heer sterve!

5:29 fbru02: morning all !!

6:09 Raynes: $seen cemerick

6:09 sexpbot: cemerick was last seen quitting 20 hours and 6 minutes ago.

6:52 GOSUB: is there any way to mimic a Java class with a bunch of fields in Clojure? Will cast help?

6:52 Raynes: Isn't the fact that proxy implicitly binds 'this' to a proxy instance against Rich's own opinions towards anaphora?

6:54 I imagine that the relevant opinions came well after the point where the implementation being changed in order to support his opinion would have been a breaking change.

6:54 * Raynes goes back to reading things that aren't his own book.

8:11 mrSpec: Morning!

8:11 skelter: (Merry Christmas)

8:12 Raynes: Ho ho ho.

8:12 skelter: (times 3 ho)

8:12 mrSpec: I have problem when trying to make jar file. I use lein uberjar, everything is fine. but when I run java -jar project-standalone.jar I got: Exception in thread "main" java.lang.NoSuchMethodError: edu.uci.ics.jung.visualization.VisualizationViewer.<init>(Ledu/uci/ics/jung/algorithms/layout/Layout;)V

8:12 Could you help me? under emacs all works fine

8:13 Raynes: &(apply str (repeat 3 "ho "))

8:13 sexpbot: ⟹ "ho ho ho "

8:14 skelter: mrSpec, tell us more about your app. Is VisualizationViewer's constructor your own code or a dependency?

8:14 Raynes: mrSpec: That sort of error is usually something to do with mismatched versions of compiled things. Try lein clean, making sure that it eliminates the classes/ directory.

8:15 An old class that has recently changed but hasn't been updated can be the result of that.

8:16 s/can be the result of that/can result in that/

8:16 sexpbot: <Raynes> An old class that has recently changed but hasn't been updated can result in that.

8:16 mrSpec: skelter: I use class method : [lay (new edu.uci.ics.jung.algorithms.layout.ISOMLayout g)]

8:16 s/class/object/ g is graph

8:16 so I dont write anything mine

8:16 Raynes: ok I'll try

8:17 skelter: I'd try Raynes suggestion, see if a dep has changed. Has this call ever worked?

8:17 mrSpec: I've never used uberjar before :(

8:17 so dont know if it worked

8:17 skelter: If it persists, pull apart the uberjar and ensure that the dependency jar is getting packaged with it.

8:18 Raynes: Note that you can view the internals of the jar file (and any jar file) by opening it up in Emacs.

8:18 skelter: really? I never tried that

8:18 Raynes: Yup.

8:18 Emacs has it's own neat little mode for viewing zip files.

8:19 Jar files are just zip files with fancy extensions, so it works the same.

8:19 mrSpec: after lein clean... problem has occured :(

8:19 ok I'll look into jar file :)

8:19 skelter: I figured that. I didn't know it would open up zips either.

8:20 Then the question is how to fix it, or why is lein uberjar not picking up a dep. I'm not sure there. I'm new to all this.

8:20 you might be able to limp by by adding your dependency jar

8:20 mrSpec: ah one more idea

8:21 maybe I have something wrong in my project's deps?

8:21 I'll paste it, sec

8:22 skelter: I wasn't going to suggest that until you checked your uberjar, but yeah. On the other hand, I'd expect the other steps to have problems, like lein repl . Perhaps not

8:22 mrSpec: http://paste.lisp.org/display/118035

8:23 I use ver. 1.7.6 and 2.0.1

8:24 Raynes: You're using two different versions of the same library?

8:24 In the same project?

8:24 If so, you've found your problem.

8:25 skelter: I agree. that is the most suspicious thing I see.

8:25 mrSpec: I think yes... but lein deps didnt want to download Jung2 version 2.0.1

8:26 skelter: do you have a local nexus or artifactory?

8:26 mrSpec: so I downloaded 2.0.1 where I could, and 1.7.6 where I couldnt...

8:26 skelter: or could install them in your local .m2

8:26 mrSpec: skelter: could you tell me something more? I dont get it :/

8:27 I've used: http://mvnrepository.com/artifact/net.sf.jung

8:27 skelter: lein had a faq on how to do this.

8:28 Raynes: mrSpec: Did you try [net.sf.jung/jung2 "2.0.1"]

8:28 It looks like that is where it is located.

8:28 http://stackoverflow.com/questions/3854719/what-is-a-maven-repository-url-for-jung2-java-graph-framework

8:29 See the accepted answer, wherein a link is included to the location of the library on maven central.

8:29 mrSpec: oo

8:29 Raynes: So, it kind of has to work.

8:29 skelter: bonus!

8:29 mrSpec: I'm trying :D

8:29 skelter: so they changed the namespace of jung?

8:32 Raynes: Well, they changed the groupId apparently.

8:32 I think that's what you meant though.

8:32 skelter: yes. apologies for the lack of imprecision. ;)

8:32 pre-coffee...pre-eggnog :)

8:33 Raynes: Psh! Coffee is for weaklings. I'm totally caffeine free and have been awake since 4:30AM.

8:35 skelter: LoL color me weak caffeine addict. I'm not even sure why I'm awake now.

8:35 Any luck mrSpec?

8:36 Raynes: ivey: Good morning and merry Christmas. :>

8:37 mrSpec: skelter: running....

8:38 works!

8:38 thanks! :D

8:38 Raynes: Great!

8:38 mrSpec: I had just commented the line with jung/jung 1.7,2

8:38 Raynes: :)

8:39 mrSpec: as I've already had jung-graph-impl

8:39 used*

8:41 lisp.pl/projects/CrawlerClj-1.0.0-SNAPSHOT-standalone.jar

8:41 testuj! :D

8:42 tzn uruchom xD

8:42 mozesz wpisac "% Mai 2010%"

8:42 :D

8:43 ahh sorry

8:43 wrong window

12:00 Raynes: &(update-in {:a {:deeply {:nested ['structure 'with 'a 'vector 'inside]}}} [:a :deeply :nested] conj 'inside 'of 'it)

12:00 sexpbot: ⟹ {:a {:deeply {:nested [structure with a vector inside inside of it]}}}

12:47 Dodek: hey, how does one usually specifies a multidimensional array in clojure? vector of vectors?

12:47 i am actually interested in two-dimensional matrix.

12:59 LauJensen: v of v

13:01 Raynes: LauJensen: Afternoon.

13:03 LauJensen: Raynes: evening :)

13:04 Dodek: LauJensen, ok, is there any more pleasant syntax than ((v 2) 3) ?

13:06 LauJensen: Dodek: Not if you dont make one, I think

13:08 Dodek: so i need to learn how one writes the macros in clojure, i guess.

13:08 LauJensen: no no, macros are for evaluation control

13:09 Dodek: i was thinking of some sort of reader macro

13:09 LauJensen: You cant implement reader macros w/o patch Clojure

13:10 Dodek: oh, that's a shame.

13:10 dnolen: Dodek: or a really wise limitation, depending on your perspective.

13:11 LauJensen: ,(letfn [(lookup [x y v] (-> (nth v x) (nth y)))] (lookup 1 1 [[1 2 3] [4 5 6] [7 8 9]]))

13:11 clojurebot: 5

13:11 Dodek: dnolen, yeah, one could say that

13:12 LauJensen: oops thats wrong, but you get the idea

13:12 Dodek: i really like the fact that you can put a vector in a function place of a form, and the index next

13:12 i find it sad that now i need to implement my own "aref"

13:13 dnolen: ,(get-in [[1 2 3 4] [5 6 7 8] [9 10 11 12]] [2 3])

13:13 clojurebot: 12

13:13 LauJensen: oh right, thanks dnolen

13:13 Dodek: seems i don't need to

15:11 islon: is this the right way to define a private var? (def ^:private home (System/getProperty "user.home"))

15:59 qbg: What is new #clojure?

17:30 Rostam: :)

21:14 ag90: Hello there.

23:01 stabin: Hi all, performing first steps with clojure faced the following issue: after downloading clojure-1.2 and clojure-contrib-1.2 and running interpreter I cannot (use 'clojure.contrib.repl-utils) - http://pastebin.com/dQduYcWJ . Am I doing something wrong, or it is some inconsistensy with adding function in one place, but not removing where it should have been removed with 1.2 release?

23:28 technomancy: stabin: that's just a warning. anyway, I think repl-utils is deprecated in 1.2; you shouldn't need it.

23:32 stabin: technomancy: http://pastebin.com/5frEBxBL - well, agee, package imported actually, was confused since expected to get show into current namespace; BTW, you are saying it is deprecated - where should I get show from?

23:36 technomancy: stabin: well I haven't used repl-utils, but from what I understand most of it is now automatically brought into repl sessions in 1.2

23:36 what are you looking for specifically?

23:37 stabin: technomancy: show function; it is not available by default, unlike e.g. source

23:38 technomancy: oh, I see. I guess you want (use '[clojure.contrib.repl-utils :only [show]])

23:38 unless you're using slime, in which case you want C-c S-i

23:38 auser: hm

23:39 stabin: technomancy: o, thanks. sorry for stupid questions, just starting clojure)

23:39 technomancy: sure... the namespace stuff is more confusing than it should be =\

23:54 auser: hm

23:54 can you not use a map in clojure-test?

Logging service provided by n01se.net