2011-04-13
| 00:35 | kephale001 | /j #incanter |
| 00:35 | kephale001 | upps |
| 00:35 | kephale001 | any incanter folks here? |
| 02:49 | devn | ,(let [{:keys [a b c d]} {:a 1 :b 2 :c 3 :d 4}] [a b c d]) |
| 02:49 | clojurebot | [1 2 3 4] |
| 02:49 | devn | ,*clojure-version* |
| 02:49 | clojurebot | {:major 1, :minor 2, :incremental 0, :qualifier ""} |
| 02:49 | devn | hmm, weird |
| 02:52 | devn | im doing this in my repl and i keep getting nil |
| 02:52 | devn | the thing im using is clearly a map |
| 02:54 | devn | ,(let [{:keys [layer octave duration n-notes repetitions]} {:layer "0" :octave "5" :duration "q" :n-notes "16" :repetitions "2"}] [layer]) |
| 02:54 | clojurebot | ["0"] |
| 02:54 | devn | weird |
| 02:57 | devn | (def note-map-coll (first [{:layer 0 :octave 5 :duration "q" :n-notes 16 :repetitions 2}, {:layer 1 :octave 3 :duration "q" :n-notes 4 :repetitions 8}])) |
| 02:58 | devn | (defn play-random-note-maps [{:keys [layer octave duration n-notes repetitions]} nmc] [layer]) |
| 02:59 | devn | ;=> "Wrong number of args (1)" |
| 02:59 | devn | when calling (play-random-note-maps note-map-coll) |
| 03:02 | devn | (defn play-random-note-maps [nmc] |
| 03:02 | devn | (let [{:keys [layer octave duration n-notes repetitions]} nmc] |
| 03:02 | devn | [layer])) |
| 03:03 | stirfoo | devn: don't key arguments have to be in a rest list? [& {:keys ...}] |
| 03:03 | devn | ^^works, is this intentional? |
| 03:04 | devn | stirfoo: no, but curiously... |
| 03:04 | devn | (defn play-random-note-maps [{:keys [layer octave duration n-notes repetitions]} & nmc] [layer]) |
| 03:04 | devn | ;=> ["0"] |
| 03:08 | devn | curious...bed time |
| 03:09 | stirfoo | are defn, defmacro, let, and letfn argument destructuring handled the same? |
| 03:10 | stirfoo | my ver: {:major 1, :minor 2, :incremental 0, :qualifier ""} |
| 03:16 | stirfoo | ,(print "foo") |
| 03:16 | clojurebot | foo |
| 03:18 | stirfoo | ,(defmacro awhen [x f] `(when-let [r# ~x] (~f r#))) |
| 03:18 | clojurebot | DENIED |
| 03:19 | stirfoo | bah! |
| 03:29 | stirfoo | ,(print "bar") |
| 03:29 | clojurebot | bar |
| 03:29 | stirfoo | so, you just don't like macros |
| 04:05 | raek | stirfoo: yes they are handled the same. but note that with defn, you can't do (defn foo args ...) or (defn foo [:as args] ...) |
| 04:05 | raek | stirfoo: this is because destructuring are done for function parameters, but not the whole parameter list |
| 04:20 | noidi_ | I have an unbound var, for which I need to establish a binding during my cucumber test run. I can't use binding, since in cuke4duke there's no way to surround all the test code. |
| 04:21 | noidi_ | alter-var-root doesn't work, since the var has no root binding |
| 04:21 | noidi_ | and I can't re-def the var since it's defined in another namespace |
| 04:22 | raek | noidi_: alter var root takes the var object as an argument |
| 04:22 | ejackson | hello |
| 04:22 | noidi_ | what's the best way to set the var's binding for the rest of the programs execution? intern? push-thread-bindings (without popping)? |
| 04:22 | raek | it sounds like you are sending it the value of the var |
| 04:23 | raek | if you want to set it once during initialization, and binding is not an option, then I'd suggest alter-var-root or intern |
| 04:23 | raek | (alter-var-root #'the-var altering-fn) |
| 04:23 | noidi_ | that doesn't work without a root binding |
| 04:23 | raek | (intern 'the-ns 'the-var value) |
| 04:23 | raek | oh, now I see :) |
| 04:24 | raek | the intern version should work, then |
| 04:24 | noidi_ | thanks, I'll go with intern |
| 04:25 | raek | if you use lein, it is probably possible to make a wrapping binding with a hook |
| 04:26 | noidi_ | I use maven |
| 04:27 | noidi_ | cuke4duke sucks a bit when it comes to setup/teardown code... |
| 04:29 | noidi_ | but yay, the intern hack worked |
| 04:36 | clgv | noidi_: I am curious. what is cuke4duke used for? there is only a short sentence talking about "step definitions". |
| 04:37 | noidi_ | it's Cucumber for JVM languages http://cukes.info/ |
| 04:38 | clgv | ah "behavior driven development". I did read about bdd for c# some weeks ago |
| 04:40 | noidi_ | I don't buy completely into the whole BDD thing, but cucumber is quite nice for writing tests that exercise the complete program |
| 04:41 | clgv | I had similar thoughts while reading: it enables tests whose definition is much more similar to specified use cases |
| 04:42 | clgv | s/much more/very/ |
| 04:42 | sexpbot | <clgv> I had similar thoughts while reading: it enables tests whose definition is very similar to specified use cases |
| 07:07 | markoman | what are good practices to create tests on clojure? |
| 07:08 | ejackson | do so :) |
| 07:09 | markoman | i have punch of files now and want to do tests for them, maybe not the order some suggest, but anyway. i wonder if I should test every function, what about defn- ? |
| 07:09 | ejackson | you should really only test the interface functions |
| 07:09 | markoman | do you usually test with big sets of good, bad, correct and false values? |
| 07:10 | ejackson | i try to get an example of each mode of success/failure etc |
| 07:10 | ejackson | there are no coverage tools, but you would like to exercise each logical phase of your code |
| 07:11 | markoman | can you provide example of "each phase"? |
| 07:13 | markoman | is there any tool in clojure to get started with tests easily? i mean when i create new project with lein, it creates a test file fore core.clj. something similar that scans files on src and creates some files automated? |
| 07:19 | ejackson | sorry, "each phase" -> "each logical branch " |
| 07:19 | ejackson | i dunno of any tests |
| 07:19 | ejackson | i just make a test directory and put the tests in there |
| 07:19 | ejackson | dunno what's to automate :) |
| 07:21 | markoman | you could have a skeleton of files and public functions from files pre made |
| 07:22 | markoman | im lazy writer and copy paster :) |
| 07:26 | markoman | https://github.com/marick/Midje seems to be one of the many test frameworks |
| 07:29 | clgv | markoman: it is. there is also clojure.test |
| 07:30 | markoman | im using (is) tests at the moment, but thinking if there are more organized ways, especially for web apps |
| 07:31 | clgv | yeah I've been using them too |
| 07:34 | clgv | I was considering to test midje next when I start testing the new code |
| 07:38 | ejackson | yeah I looked at it, but i'm sticking with clojure.test for now |
| 07:39 | markoman | decisions :) |
| 07:40 | clgv | yeah I am still wondering if midje provides me real advantages and if it's mature enough |
| 07:43 | markoman | there is also this https://github.com/semperos/robot-remote-server-clj robotframework for automated testing |
| 07:44 | clgv | markoman: I am not doing webdevelopment, so dont need that one ;) |
| 07:45 | markoman | right. it would be ideal to make tests first and use functions from tests on actual app, but it requires total twist of mind, at least on my case |
| 07:46 | clgv | hmm don't know that test-first is always a good choice |
| 07:46 | clgv | s/that/if/ |
| 07:46 | sexpbot | <clgv> hmm don't know if test-first is always a good choice |
| 07:48 | TimMc | I try for test-first as an ideal, but I don't hate myself if I implement first. It works out to a nice balance. |
| 07:48 | markoman | id like to have bug free apps, tired of problems and time they take, lol |
| 07:48 | TimMc | Writing unit tests after implementation catches enough bugs as it is. :-) |
| 07:49 | ejackson | i agree. pure TDD presumes the lack of a repl |
| 07:49 | ejackson | i like to play about in the REPL get it in line |
| 07:49 | ejackson | then write the tests to 'tie it down' |
| 07:49 | ejackson | can think more flexibly, i find |
| 07:49 | TimMc | I don't think that's true, though. |
| 07:50 | clgv | with all the probabilistic stuff I do, it's sometimes really difficult to come up with complete tests |
| 07:50 | TimMc | ejackson: I think the REPL is great for getting a correct implementation quickly, but that's probably orthogonal to whether you've already written the tests. |
| 07:50 | markoman | (probably-true test case) |
| 07:51 | TimMc | clgv: You pass around a random seed? |
| 07:51 | markoman | or just (probably? test case) :) |
| 07:51 | TimMc | (Or use binding, I guess.) |
| 07:52 | clgv | hmm for simple cases this is an option. I used mocking to select the cases I need |
| 07:52 | ejackson | TimMc: writing tests often fixes my initial mode of thought on a problem, whereas playing in a repl often leads me to new thoughts and thus a different interface to test |
| 07:53 | TimMc | ejackson: There is that. |
| 07:54 | markoman | i still find myself uncomfortable with testing new functions on REPL. I mean it takes time to collect all pieces from repl history and put on function |
| 07:54 | ejackson | markoman: Oh i write code in a file, and use C-x C-e to pass it to the repl to avoid that |
| 07:55 | markoman | plus knowing, what is active on current repl namespace, that gives gray hairs too |
| 07:55 | ejackson | i *do* end up with giant (comment ...) blocks that I then purge |
| 07:55 | ejackson | otherwise yes, you have spaghetti |
| 07:55 | markoman | lol, that I know very well already |
| 07:55 | clgv | In fact you cant test everything in REPL. I often have to write new functions that are deep within my algorithm framework, so that a huge setup would be required to get the input for these functions - debug-repl is an option though |
| 07:56 | ejackson | clgv: yeah, I have same problems, getting into a deep context |
| 07:56 | ejackson | i keep meaning to try these debug tools, but never seem to get around to it :( |
| 07:56 | clgv | you should get started with debug-repl easily |
| 07:57 | clgv | it's kinda nice to launch a repl inside your algorithm at a point you specified |
| 07:57 | markoman | emacs slime? |
| 07:57 | ejackson | yeah, emacs+slime |
| 07:58 | ejackson | markoman: the other thing I do have a foo-lab.clj file, that loads up relavent libraries, and play there |
| 07:58 | ejackson | but *always* write the tests afterwards |
| 07:59 | ejackson | for me its mostly to keep tabs on the interfaces so that if something changes between when I worked in the repl, and time t, a test will break to alert me |
| 08:00 | markoman | yeah, its good tip, test interfaces primarily |
| 08:01 | markoman | you mean you create a foo-lab and :use or :require all your libs there? |
| 08:02 | clgv | markoman: depends - my only interface function is the main algorithm which is not easily testable, so I have to test its inner parts |
| 08:02 | ejackson | i think its the accepted practice for unit testing |
| 08:02 | ejackson | although I agree with clgv too :) |
| 08:03 | markoman | clgv: sure. i think different purposes makes the different |
| 08:03 | markoman | difference* |
| 08:04 | clgv | e.g. it was a pretty good idea to test the creation of the commulative distribution function and it's usage to select a random element accordingly |
| 08:05 | ejackson | indeed ! |
| 08:05 | ejackson | inversion sampling :) |
| 08:06 | ejackson | that's such a cute idea |
| 08:09 | markoman | (vals {:a 1 :b 2}) is different datatype than [1 2] |
| 08:09 | markoman | how can you convert vals same, or are they both ordered lists? |
| 08:10 | clgv | let's see which: ##(type (vals {:a 1 :b 2})) and ##(type [1 2]) ;) |
| 08:10 | sexpbot | (type (vals {:a 1, :b 2})) ⟹ clojure.lang.APersistentMap$ValSeq |
| 08:10 | sexpbot | (type [1 2]) ⟹ clojure.lang.PersistentVector |
| 08:10 | ejackson_ | ##(type (into [] (vals {:a 1 :b 2}))) |
| 08:10 | sexpbot | ⟹ clojure.lang.PersistentVector |
| 08:10 | clgv | &(compare (vals {:a 1 :b 2}) [1 2]) |
| 08:10 | sexpbot | java.lang.ClassCastException: clojure.lang.APersistentMap$ValSeq cannot be cast to java.lang.Comparable |
| 08:11 | markoman | vector should keep its index order by default? |
| 08:12 | markoman | persistent map sounds like it keeps order too |
| 08:18 | clgv | &(= (seq (vals {:a 1 :b 2})) (seq [1 2])) |
| 08:18 | sexpbot | ⟹ true |
| 08:32 | markoman | ok, seq and type into makes them same |
| 08:33 | markoman | thanks again guys |
| 08:37 | ejackson | markoman: sortof. into turns into a the vals into an actual vector. seq just presents a seq over each collection. |
| 08:38 | clgv | $source group-by |
| 08:38 | sexpbot | group-by is http://is.gd/JJJRzs |
| 08:38 | cemerick | I simply can't help it. :-( |
| 08:39 | ejackson | where is the troll show ? |
| 08:40 | cemerick | It's not much of a show. :-) |
| 08:40 | edw | Thinking of Marilyn Manson: "We're all stars now, in the troll show..." |
| 08:40 | ejackson | you should feed it spicier trolltreats |
| 08:41 | cemerick | ejackson: I'd feel badly for the unwilling spectators. |
| 08:42 | ejackson | i guess so, it sortof makes you a troll too... |
| 08:42 | ejackson | a troll of the 2nd order |
| 08:42 | edw | $source map |
| 08:42 | sexpbot | map is http://is.gd/Fd9Ag4 |
| 08:42 | edw | That is kinda awesome. |
| 08:45 | clgv | edw: it is :) |
| 08:45 | clgv | findfn is even better ;) |
| 08:48 | edw | sexpbot is a bit cagey regarding help. Talking to it is like playing zork. Kinda hot. |
| 08:49 | clgv | $findfn {:bla 1 :blubb 2 :lala 3 :haha 4} [:bla :lala] {:bla 1 :lala 3} |
| 08:49 | sexpbot | [clojure.core/select-keys] |
| 08:49 | clgv | edw: that's what I meant - feels like magic ;) |
| 08:50 | ejackson | what ! |
| 08:50 | ejackson | its become selfaware |
| 08:50 | edw | How many minutes did it take to develop a sense of irony? |
| 08:51 | edw | $findfn {:a 1 :b 2 :c 4} [1 2 3] |
| 08:51 | sexpbot | [] |
| 08:51 | edw | $findfn {:a 1 :b 2 :c 4} [1 2 4] |
| 08:51 | sexpbot | [clojure.core/vals] |
| 08:52 | edw | I could spend all day talking to sexpbot. |
| 08:54 | edw | Whoa, it automatically posts gists when its responses get too chatty! |
| 09:15 | matthias_ | okay... so i got swank and leiningen and emacs + slime working but... how do i now build and run a clojure program? i made a new project and put some code into core.clj and then added the program's namespace to the project.clj after :main, but it says it doenst find a main. im not even sure how that's supposed to work, do clojure programs have mains? |
| 09:20 | edw | matthias_: Check out the "sample" test project in the leiningen repo on github. I'd tell you the answer, but I'd rather help you develop mad learning skillz. |
| 09:27 | matthias_ | i've checked it out, that's where i saw the :main stuff |
| 09:27 | matthias_ | but i havent read all of it yet |
| 09:28 | ejackson | matthias_: you'll only use a main if you precompile stuff, usually in clojure you won't need to do so |
| 09:28 | edw | OK, I couple of "hints": 1) in projects.clj: ":main nom.nom.nom". |
| 09:29 | edw | 2) in src/nom/nom/nom.clj: "(defn -main [& args] ... ) |
| 09:30 | edw | (End quote.) |
| 09:30 | matthias_ | ugh, i think i was in the wrong folder. its like folder/folder/folder/project.clj, i was in folder/folder and folder/project.clj also exists |
| 09:30 | ejackson | matthias_: if you have lein, swank, emacs and slime all working then all you need to is: |
| 09:30 | matthias_ | weird |
| 09:30 | ejackson | issue: lein swank from the project root directory |
| 09:30 | matthias_ | there's a start function in the program im trying to run |
| 09:31 | ejackson | then in emacs go M-x slime-connect |
| 09:31 | ejackson | that'll bring up a repl in emacs |
| 09:31 | ejackson | from there you're off |
| 09:31 | edw | ejackson: I didn't even want to touch the "why do you want a `main' anyway?" question... There's some REPL philosophy grokking that needs to occur her. |
| 09:32 | matthias_ | does lein search for a project.clj in a higher directory if it doesnt find one where you are? |
| 09:32 | edw | s/her\./here./ |
| 09:32 | sexpbot | <edw> ejackson: I didn't even want to touch the "why do you want a `main' anyway?" question... There's some REPL philosophy grokking that needs to occur here. |
| 09:32 | ejackson | matthias_: don't think so, issue it from the root |
| 09:32 | matthias_ | well that seems to have happened when i was in the wrong folder |
| 09:32 | matthias_ | maybe |
| 09:33 | matthias_ | at least it ran without complaining when i was in a folder without project.clj |
| 09:34 | matthias_ | getting lots of artifacts missing when i run lein deps now... but i dont see it telling me what's actually missing |
| 09:35 | matthias_ | looks like it cant find clojure contrib :| |
| 09:35 | edw | matthias_: Are you starting with the simplest possible scenario that should work? You don't need a lot of dependencies to get a lein project running a swank server and Emacs connected to it. |
| 09:35 | matthias_ | i've already had that |
| 09:36 | matthias_ | now im trying to run an example program from the web |
| 09:36 | matthias_ | (its tetris with penumbra) |
| 09:37 | edw | matthias_: Dude, try creating a new, empty, lein project, adding swank to the dev-dependencies, firing it up, and connecting to it. Keep it simple... |
| 09:37 | matthias_ | oh, i had to add clojure contrib to the deps |
| 09:37 | matthias_ | i did that before |
| 09:37 | edw | Does it work? |
| 09:38 | matthias_ | yes it does |
| 09:39 | matthias_ | i mean the simple version worked |
| 09:39 | edw | So what didn't work that led you to download a random project from the internet and try to get that to work? |
| 09:40 | matthias_ | slime still says it cant find the (start) function. thats define in my core.clj |
| 09:40 | edw | Dude you (use 'core)? |
| 09:40 | matthias_ | i didnt download a random project. i got swank + slime to work and then i wanted to run a real program. everything worked until there, but i couldnt get the real program to work |
| 09:40 | matthias_ | no |
| 09:41 | edw | Try that. |
| 09:41 | matthias_ | Could not locate core__init.class or core.clj on classpath: |
| 09:41 | matthias_ | [Thrown class java.io.FileNotFoundException] |
| 09:41 | edw | Is core in 'src/'? |
| 09:42 | matthias_ | its in src/tetris/ |
| 09:42 | edw | So, did you do a (use 'tetris.core)? |
| 09:43 | matthias_ | org.lwjgl.opengl.GL11 |
| 09:43 | matthias_ | [Thrown class java.lang.ClassNotFoundException] |
| 09:43 | edw | Is that a depenedency? |
| 09:44 | edw | s/dependendency/dependency/ |
| 09:45 | matthias_ | penumbra is a dependency. penumbra uses lwjgl |
| 09:46 | matthias_ | i installed lwjgl using synaptic. dont know how to add it as a dependency |
| 09:46 | edw | And I have no idea what synaptic is. |
| 09:47 | matthias_ | the package manger gui of ubuntu |
| 09:48 | matthias_ | is there really no easier way to run a clojure program? i thought it must be something like "cljcompile bla.clj" "these jars are not in your classpath!" *adds to classpath* "cljcompile bla.clj" "success!" "clj bla.class" program runs :> |
| 09:48 | edw | Well that org.lwjgl.opengl... reference is probably to some Java glue classes (that are missing). |
| 09:50 | edw | Yes, you can `lein run' and if you've defined a main package, its `main-' will be be called. |
| 09:50 | matthias_ | oh, i think i had to run lein native-deps |
| 09:50 | edw | Err, `-main' function. |
| 09:52 | matthias_ | aahhh now it works :) |
| 09:52 | edw | There have got to be easier ways to play Tetris under Ubuntu... |
| 09:52 | matthias_ | thanks for your help |
| 09:52 | edw | You're welcome. |
| 10:46 | choffstein | Hey all. What is the best way to find out whether clojure core or contrib contains a function? For example, if I want to know if there is a natural log implementation, what's the best way to try to find that? |
| 10:47 | TimMc | choffstein: I use clojuredocs.org |
| 10:49 | jlf` | choffstein: http://clojuredocs.org/clojure_core/clojure.core/find-doc |
| 10:49 | choffstein | perfecto. Thanks |
| 10:50 | choffstein | angerman, I can feel your pain |
| 10:51 | angerman | choffstein: worst of all. It simply makes no sense. the users have to connect to an ssl site. The routing is funtional, there's just no state. |
| 10:51 | angerman | it makes no sense at all. |
| 10:51 | choffstein | angerman: that is confusing ... |
| 10:51 | choffstein | angerman: I would be happy to give you a set of fresh eyes, though no promise I can get anywhere on it |
| 10:52 | angerman | choffstein: nah, it's been reviewed three times already. I'm currently thinking about the clients network topology. |
| 10:52 | choffstein | angerman: well, best of luck :) |
| 10:52 | angerman | choffstein: thanks, will need it :D |
| 10:53 | choffstein | when you have to start thinking network topology level... |
| 10:53 | angerman | especially because I don't think I'll be able to obtain any reliable information from the persons within... |
| 10:53 | angerman | that's probably along the lines of: "Well, we click this icon and then we are on the internet" |
| 10:55 | TimMc | angerman: Session data is stored in cookies? |
| 10:56 | angerman | no. cookies are only used to identification, then the session-data is pulled out of memcache |
| 10:57 | TimMc | And users are getting each others' data? |
| 10:57 | angerman | apparently. but it looks more like they get another session. |
| 10:57 | TimMc | Ah, OK. |
| 10:57 | TimMc | Consistently? |
| 10:57 | angerman | no |
| 11:01 | TimMc | I'm not sure what network topology has to do with this. |
| 11:01 | angerman | TimMc: I'm wondering if there is some weird proxy in between. |
| 11:01 | TimMc | Ah. |
| 11:03 | TimMc | angerman: In a case like this, it might be interesting to send the cookie data explicitly in the response body and have JS check to see if they differ. :-P |
| 11:03 | TimMc | In any case, it sounds like a slog. |
| 11:05 | sritchie | hey all -- once I bundle up a project with "lein uberjar", how can I use it to load up a repl? |
| 11:06 | sritchie | something like -- java -jar myproject-standalone.jar clojure.lang.Repl |
| 11:07 | angerman | TimMc: yes. it is _very_ strange. |
| 11:08 | TimMc | Anybody seeing checksum problems with maven central? |
| 11:10 | clgv | sritchie: you can use clojure.main/repl in your -main function explicitely |
| 11:11 | sritchie | clgv: ah, got it. so, I should add ":main clojure.main" to project.clj? |
| 11:11 | TimMc | sritchie: java -cp myproject-standalone.jar clojure.lang.Repl is a start |
| 11:11 | sritchie | or define a -main function in one of my namespaces, point to that, and run clojure.main/repl there? |
| 11:12 | clgv | sritchie: hmm would be an option as well. I thought you might have a -main function already, so you could include the repl call in there |
| 11:12 | TimMc | sritchie: So you're not asking how to get a REPL in an arbitrary uberjar? |
| 11:12 | sritchie | TimMc: that would be more helpful, I think |
| 11:13 | sritchie | I'm getting -- Failed to load Main-Class manifest attribute from forma-0.1.0-standalone.jar |
| 11:13 | sritchie | I'm not sure how to provide that at the command line |
| 11:13 | TimMc | That's not what I get. |
| 11:13 | TimMc | It yells at me about clojure.lang.repl being deprecated and then gets me a repl anyway. |
| 11:14 | TimMc | c.l.Repl, rather |
| 11:14 | sritchie | here's my command -- java -jar forma-0.1.0-standalone.jar clojure.lang.repl |
| 11:14 | sritchie | s/repl/Repl |
| 11:14 | sexpbot | <sritchie> here's my command -- java -jar forma-0.1.0-standalone.jar clojure.lang.Repl |
| 11:14 | sritchie | do you have any :main at all defined? |
| 11:14 | TimMc | You want -cp I think. |
| 11:14 | TimMc | Instead of running the jar, you use it as a library. |
| 11:15 | sritchie | Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes |
| 11:15 | sritchie | followed by |
| 11:15 | sritchie | Could not find the main class: clojure.lang.Repl. Program will exit. |
| 11:15 | sritchie | but that gives me a lead! |
| 11:25 | angerman | Are bindings call local? |
| 11:27 | amalloy | angerman: huh? |
| 11:29 | raek | clgv: clojure.main defines a main function, but it hase the name "main" instead of "-main", so you can't use the :main option for that directly, unfortunately |
| 11:29 | edw | Why does (java.lang.Math/PI) not throw an exception? |
| 11:29 | raek | iirc, this was discussed recently at the leiningen mail list |
| 11:30 | clgv | raek: sritchie needed it. so he might still implement his own main and call clojure.main/repl in it |
| 11:31 | sritchie | clgv: bundling with cake uberjar, then running java -cp myapp-standalone.jar clojure.lang.Repl actually ended up working out |
| 11:31 | raek | you could also start you project with java -jar myproject-standalone.jar clojure.main |
| 11:32 | raek | hrm, maybe you need to have -cp instead of -jar there... |
| 11:32 | Vinzent | http://paste.lisp.org/display/121462 - any ideas? This code is in fn called from the macro |
| 11:34 | amalloy | Vinzent: are you on clojure 1.3? |
| 11:35 | Vinzent | amalloy, no, stable 1.2 |
| 11:36 | amalloy | &(let [f "f"] (fn [x] (throw (UnsupportedOperationException. (str "z" type))))) |
| 11:36 | sexpbot | ⟹ #<sandbox15764$eval18933$fn__18934 sandbox15764$eval18933$fn__18934@144774e> |
| 11:37 | amalloy | Vinzent: sexpbot is on 1.2.0 and it works; i tried it on 1.2.1 and it works. i'm going to say you have something messed up in your environment. maybe stale AOT compiled classes? those cause messes "like" this |
| 11:37 | Vinzent | it's ok from the repl for me too. Problem appears only in that function. |
| 11:37 | edw | &(java.lang.Math/PI) |
| 11:37 | sexpbot | ⟹ 3.141592653589793 |
| 11:38 | edw | ^^^ ??? |
| 11:38 | amalloy | edw: it's not printing all the infinite digits! oh no! |
| 11:39 | amalloy | Vinzent: that is not clear. what do you mean, it's okay from the repl but only "in that function". if that function works in the repl, the problem is not in that function |
| 11:39 | edw | No, what's bothering me is that both "java.lang.Math/PI" and "(java.lang.Math/PI)" eval to the same thing. |
| 11:39 | edw | I am confused. |
| 11:40 | amalloy | &(map macroexpand '((Math/PI) Math/PI)) |
| 11:40 | sexpbot | ⟹ ((. Math PI) Math/PI) |
| 11:40 | amalloy | &(doc .) |
| 11:40 | sexpbot | ⟹ "Special Form: Please see http://clojure.org/special_forms#." |
| 11:40 | amalloy | go read about the . special-form: it says it's just fine to call a field as a function |
| 11:41 | amalloy | hm. that link kinda sucks, though |
| 11:42 | edw | Ah. Thanks. Makes sense if you think of it as if it's calling an implicit getter. |
| 11:42 | amalloy | try http://clojure.org/java_interop |
| 11:42 | edw | amalloy: No prob; I know where. Ah. Thanks. |
| 11:43 | Vinzent | amalloy, well, fn itself works fine, but when called from the macro leads to that creepy exceptions. I can paste the whole code, but don't think somebody wants to read it all |
| 11:43 | amalloy | heh. i'm glad thinking of an implicit getter works for you, cause it certainly doesn't do anything for me |
| 11:43 | edw | I'm trying to work with Java here, trying not to be a hater. |
| 11:47 | amalloy | edw: what really happens is that (. Math PI) looks inside of the Math class to see whether Math has a field named PI or a no-arg method named PI |
| 11:47 | amalloy | that allows ##(.PI Math) to expand into something simple |
| 11:47 | sexpbot | java.lang.IllegalArgumentException: No matching field found: PI for class java.lang.Class |
| 11:47 | amalloy | hm. guess not |
| 11:48 | amalloy | &(map macroexpand '((Math/PI) (.PI Math))) |
| 11:48 | sexpbot | ⟹ ((. Math PI) (. (clojure.core/identity Math) PI)) |
| 11:48 | amalloy | feh |
| 11:51 | edw | I'll checkout out the source. This came up because I was verifying my conversion of Morrie's Law into radians, and accidentally typed (java.lang.Math/PI) and got an answer. |
| 11:51 | amalloy | edw: you don't have to type java.lang., you know |
| 11:52 | edw | Ah. Thanks. But it's a nice reminder to pay respect to the gods. |
| 11:55 | amalloy | *smile* on the contrary, the java gods only want you typing when they demand it. else it is sacrelige |
| 11:56 | edw | But srsly, I knew I didn't have to type some part of it, but I'm getting over a cold and the amber light on my caffeine guage just lit up. |
| 11:56 | edw | s/guage/gauge/ |
| 11:56 | sexpbot | <edw> But srsly, I knew I didn't have to type some part of it, but I'm getting over a cold and the amber light on my caffeine gauge just lit up. |
| 12:02 | Vinzent | Ah! there was a typo, not 'type' but 'foo' of course: http://paste.lisp.org/display/121462#1 And no, I have no aot-things. When any local var passed to the Exception constructor, ExceptionInInitializerError is throwed |
| 12:03 | amalloy | Vinzent: i figured you actually meant type. but it works fine with foo too |
| 12:03 | amalloy | &(let [f "f"] (fn [x] (throw (UnsupportedOperationException. (str "z" f))))) |
| 12:03 | sexpbot | ⟹ #<sandbox15764$eval19011$fn__19012 sandbox15764$eval19011$fn__19012@17994ab> |
| 12:07 | Vinzent | amalloy, i can't reproduce it too. There is a macro which calls one fn, then passes the result to another, then uses last result to generate some defs. I've tried to write thing with similar structure but have no luck |
| 12:22 | Vinzent | So I have no idea what actually leads to the exception; probably it'd be better to pass just a static string... |
| 12:31 | matthias_ | (im completely new to slime and emacs and clojure) hmm, i tried running a function by having the point in it and pressing C-M-x. slime is running and if i start the same function by typing it in the repl, it works. i tried making a new function (println "bla"). running that with C-M-x worked. saw bla in the repl. but starting the other function doesnt work. it's the start function of penumbra's tetris example. any guesses why that might b |
| 12:31 | matthias_ | e? |
| 12:31 | clojurebot | the reason to use the immutable types is that it saves you from all that stuff; if you don't use them you don't get the benefit. |
| 12:31 | matthias_ | uh huh |
| 12:31 | matthias_ | wow, that got a bit long |
| 12:31 | amalloy | matthias_: just long enough to split into two messages :P |
| 12:32 | matthias_ | heh |
| 12:32 | amalloy | "having point in it" sounds worrying. C-M-x evals the form *starting* at point |
| 12:32 | amalloy | i think |
| 12:32 | Vinzent | тщ |
| 12:32 | amalloy | i usually use either C-c C-c (eval top-level form containing point) or C-x C-e (eval point ending at form) |
| 12:32 | Vinzent | *no |
| 12:32 | matthias_ | hmm, i thought it starts the "toplevel form". some video said so, and it seemed to be working |
| 12:33 | matthias_ | i'll try cc |
| 12:33 | amalloy | matthias_: they're probably right, then. as i said, i don't use it much |
| 12:35 | matthias_ | difference seems to be that cc also compiles? i dont really get it |
| 12:35 | matthias_ | C- C-c didnt work either, but got a different reply in the minibuffer |
| 12:47 | rak85 | hi, guys! |
| 12:48 | rak85 | is there any way to remove the keys in a hash which have empty values? |
| 12:48 | rak85 | or giving a condition? |
| 12:48 | rak85 | or a function? =P |
| 12:49 | amalloy | filter |
| 12:50 | amalloy | &(into {} (remove (comp nil? val) {:a 1 :b nil}))) |
| 12:50 | sexpbot | ⟹ {:a 1} |
| 12:50 | rak85 | filter is returning a list for me |
| 12:50 | amalloy | a little more involved than needed to remove strictly nils, but more flexible than the simple ##(into {} (filter val {:a 1 :b nil})) |
| 12:50 | sexpbot | ⟹ {:a 1} |
| 12:51 | cemerick | amalloy: you need nil? to remove strictly nils |
| 12:52 | cemerick | &(into {} (filter val {:a false :b nil})) |
| 12:52 | sexpbot | ⟹ {} |
| 12:52 | rak85 | thanks, amalloy |
| 12:52 | cemerick | Truthiness, you hurt so bad. :-) |
| 12:52 | amalloy | cemerick: yeah, i know |
| 12:52 | cemerick | I know you know; just being pedantic in a spare moment. :-) |
| 12:53 | amalloy | *laugh* thanks; my life might actually be fun if you didn't have spare moments |
| 13:08 | Raynes | cemerick: http://www.reddit.com/r/Clojure/comments/gn3d1/can_has_meet_clojure_website/c1p1vdz This must be why we write books. |
| 13:10 | cemerick | Raynes: that's a nice comment :-) |
| 13:10 | Raynes | Nice. Frightening, but nice. |
| 13:10 | cemerick | I can't say I have any groupies of my own yet, though. |
| 13:28 | devn | better way to do #(apply str (interleave " " ["A1" "A2" "A3"])) ? |
| 13:29 | amalloy | devn: clojure.string/join |
| 13:29 | devn | ,(apply str (interleave " " ["A1" "A2" "A3"])) |
| 13:29 | clojurebot | " A1" |
| 13:29 | amalloy | you also meant intperpose, not interleave |
| 13:29 | devn | blah thank you :\ |
| 13:29 | amalloy | &(doc interpose) |
| 13:29 | sexpbot | ⟹ "([sep coll]); Returns a lazy seq of the elements of coll separated by sep" |
| 13:29 | devn | and of course..join..*doh* |
| 13:32 | stirfoo | Why would slime not pretty print an expanded macro (C-c RET)? Not sure if this is the correct place to ask that question, but there it is. |
| 13:38 | edw | Has the state of Clojure SLIME debugging advanced in the last couple months? |
| 13:38 | technomancy | edw: there's this: http://georgejahad.com/clojure/swank-cdt.html |
| 13:39 | edw | technomancy: Thanks! |
| 13:40 | edw | Ruh roh: "Installing *should* now be just a matter of..." (Em. mine.) |
| 13:51 | matthias_ | erm, java is currently using 1gb of ram... im not doing anything, just having swank open |
| 13:54 | pdk | ,(/ (+ .7 .9 1) 3) |
| 13:54 | clojurebot | java.lang.Exception: Unable to resolve symbol: .7 in this context |
| 13:54 | pdk | ,(/ (+ 0.7 0.9 1) 3) |
| 13:54 | clojurebot | 0.8666666666666667 |
| 14:03 | fliebel | pdk: Floating point is lovely, eh? |
| 14:04 | amalloy | i don't get the joke. ##(/ 2.6 3) is basically the same, right? i wouldn't expect rounding errors for that |
| 14:04 | sexpbot | ⟹ 0.8666666666666667 |
| 14:11 | znutar_ | Is there some handy reference for the differences between java floating point and ieee754? |
| 14:11 | fliebel | &(/ (rationalize 2.6) 3) |
| 14:11 | sexpbot | ⟹ 13/15 |
| 14:22 | chouser | ,(/ (+ 7/10 9/10 1) 3) |
| 14:22 | clojurebot | 13/15 |
| 14:22 | chouser | ,(double (/ (+ 7/10 9/10 1) 3)) |
| 14:22 | clojurebot | 0.8666666666666667 |
| 14:27 | choffstein | What is the best way to set a default value for a function input? |
| 14:29 | Chousuke | choffstein: multiple arities? |
| 14:30 | Chousuke | eg. (defn foo ([] (foo :defval)) ([x] (do something with x))) |
| 14:30 | choffstein | yeah, I guess. so if I do (defn f [a b] ...), if b is not supplied, it has a default value. I assume this can only really be done using match cases on arity or with a map input, right? |
| 14:31 | Chousuke | yeah. |
| 14:31 | Chousuke | for that case, just supply both arities [a] and [a b] |
| 14:31 | choffstein | okay. thanks. |
| 14:33 | cemerick | choffstein: don't forget about keyword args |
| 14:56 | dnolen | interesting how fancy abstractions in Haskell, SML, and Ocaml, Scala don't play well with usability features like pattern matching... |
| 15:12 | angerman | yikes, why are ssl certs so damn expensive? |
| 15:13 | angerman | (and the system is flawed… just gives the client a warm and fuzzy feeling :( ) |
| 15:13 | angerman | anyone got a sugestion? |
| 15:13 | MarkN3D | Seller's market, I guess |
| 15:13 | MarkN3D | Did you check GoDaddy? I thought they had certs for relatively cheep |
| 15:15 | angerman | oh crap, what's that warrenty about? |
| 15:15 | kencausey | angerman: The value of an SSL certificate is in the certainty that it represents who it claims to represent. |
| 15:15 | cemerick | angerman: I'm idly investigating gandi.net. They seem to have very reasonable cert prices, along with a good assortment of other stuffs. |
| 15:15 | kencausey | angerman: As such, if the certifier does proper checking (aka labor) then the costs can be high. |
| 15:17 | angerman | kencausey: yes, yes, yes… but they ssl provider seem to focus on ecommerce and offer some insurance… :/ |
| 15:17 | angerman | kencausey: doesn't ssl encrypt the data channel as well? |
| 15:18 | kencausey | I should say that the last time I got one I got it from GoDaddy |
| 15:18 | kencausey | But this is for a non-public site so identification certainty is of little importance |
| 15:18 | kencausey | angerman: of course, and for me that was the important part |
| 15:19 | kencausey | we got along for years with a self-signed certificate but it became more and more annoying so it was worth about $30 per year to deal with it |
| 15:19 | angerman | yea right. that's all I neeed, the user should feel fuzzy because it has the *secure* feature feeling and I get a secured channel. |
| 15:19 | semperos | if I have a seq of seqs, all integers; how do I find the inner seq with the largest number in first position? |
| 15:20 | semperos | e.g. [ [1 2 3 4] [200 5 6 7 8] [9 10 11] ] |
| 15:20 | semperos | in this case, I want [200 5 6 7 8] returned |
| 15:20 | semperos | since 200 is larger than 1 or 9 (the first element of the other two vectors) |
| 15:21 | angerman | kencausey: yea, been going with self singed ssl for a while as well. But the more computer-challenged the people become the worse it gets. |
| 15:22 | angerman | hmm comodo (via namecheap) starts at 8,95/yr |
| 15:23 | markskilbeck | semperos: first and sort, I'd guess. |
| 15:25 | semperos | markskilbeck: actually, sort will save me work I was already doing; thanks |
| 15:25 | markskilbeck | semperos: ##(first (sort-by first > [[1 2 3] [200 4 5] [6 7 8]])) |
| 15:25 | sexpbot | ⟹ [200 4 5] |
| 15:25 | semperos | nice |
| 15:26 | choffstein | anyone use marginalia? |
| 15:26 | choffstein | it looks ... awesome |
| 15:26 | semperos | yep |
| 15:26 | angerman | choffstein: marginalia? |
| 15:26 | semperos | quite nice |
| 15:27 | semperos | fogus' code documentation tool |
| 15:27 | choffstein | any gotchas I should be aware about? |
| 15:27 | angerman | semperos: ohh the literate code thing with markdown? |
| 15:27 | semperos | yep |
| 15:27 | angerman | yea, that looked nice |
| 15:27 | semperos | choffstein: not that I'm aware of |
| 15:27 | semperos | it's hosted on Github, so you can just leave fogus an issue if something is up :) |
| 15:28 | markoman | i have two problems to throw on table now |
| 15:28 | choffstein | Just wondering if it was as awesome as it looks before I jump in head first :D |
| 15:28 | semperos | as long as you understand it's not producing documentation like on clojure.org or javadoc |
| 15:28 | semperos | I just add it as a dev-dep and run "lein marg" do generate the docs |
| 15:28 | semperos | produces a single uberdoc.html file |
| 15:28 | semperos | that's it |
| 15:28 | markoman | first one is simple i want [1 2 3] -> "1,2,3" |
| 15:30 | semperos | ,(apply str (interpose "," [1 2 3])) |
| 15:30 | clojurebot | "1,2,3" |
| 15:30 | amalloy | augh. clojure.string/join |
| 15:30 | semperos | :) |
| 15:30 | semperos | where's the fun in that? |
| 15:31 | semperos | markoman: I'd check clojure.string for any string needs by default, including join |
| 15:31 | markoman | alright, will do that |
| 15:32 | rak85 | hi, everyonde |
| 15:32 | rak85 | *everyone |
| 15:32 | rak85 | how do i check if a given string is in a list of strings? |
| 15:32 | rak85 | i'm trying contains? |
| 15:32 | markoman | $source join |
| 15:32 | sexpbot | Source not found. |
| 15:32 | amalloy | clojurebot: contains? |
| 15:32 | clojurebot | contains? is for checking whether a collection has a value for a given key. If you want to find out whether a value exists in a Collection (in linear time!), use the java method .contains |
| 15:32 | rak85 | but it's not returning properly... |
| 15:32 | markoman | $source clojure.string/join |
| 15:32 | sexpbot | clojure.string/join is http://is.gd/1eAPlt |
| 15:33 | rak85 | (contains? [1 2 3 4 "adf"] "adf) -> false |
| 15:33 | rak85 | sorry, (contains? [1 2 3 4 "adf"] "adf") -> false |
| 15:33 | amalloy | rak85: do you read what people say? i just asked clojurebot about contains, just for you |
| 15:33 | rak85 | Yes, I read amalloy |
| 15:34 | semperos | ,(some #{"asdf"} [ 1 2 3 "asdf" ]) |
| 15:34 | clojurebot | "asdf" |
| 15:34 | semperos | ,(some #{ "asdf"} [ 1 2 3 "asd" ]) |
| 15:34 | clojurebot | nil |
| 15:35 | semperos | rak85: ^^ |
| 15:35 | semperos | is that what you meant? |
| 15:36 | markskilbeck | rak85: amalloy told you why contains? *wouldn't* work. |
| 15:55 | markoman | ok, join is clear now. then other q is more complicated to present but im sure answer is simple |
| 15:58 | fliebel | chouser, fogus`: JoC has arrived! Thank you for writing that. |
| 15:59 | chouser | fliebel: Thanks, hope you enjoy it! |
| 15:59 | amac | forgot to order that |
| 16:00 | chouser | amac: I don't know if you get the ebook with it when you order from amazon. |
| 16:00 | fliebel | chouser: What is the ebook anyway? Not the meap I assume? |
| 16:01 | chouser | The PDF is available now, laid out like the printed book (to wit, rather better than the early MEAP versions) |
| 16:01 | semperos | and has color :) |
| 16:01 | chouser | other formats will be available eventually: epub, mobi, etc. |
| 16:03 | markoman | so the question is here http://pastebin.com/BmZbkJZF how to loop list and get expected return |
| 16:06 | amac | chouser: good to know regarding the ebook, I love my kindle |
| 16:07 | chouser | markoman: maybe replace the 'let' line with (for [dtype (map :dtype division)] |
| 16:07 | chouser | hm, no that's not right |
| 16:08 | chouser | (defn form-generate division-coll (for [division division-coll] ...then your let, etc...)) |
| 16:09 | markoman | yes, i was thinking i need to variables for division in there, let me test |
| 16:09 | phenom_ | what's the easiest way to get the name of a function passed in as a parameter ? |
| 16:09 | phenom_ | chouser: just got my copy of JoC :) thnx for all the work ! |
| 16:10 | chouser | phenom_: quite welcome. Fogus did most of the work, but I'll take the credit anyway. |
| 16:11 | choffstein | Anyone use marginalia that can tell me why my comments at the bottom of: https://github.com/newfoundresearch/construct-index/blob/master/src/construct_index/core.clj don't make it into the docs (http://github.com/newfoundresearch/construct-index/raw/master/docs/uberdoc.html)? Thanks. |
| 16:13 | choffstein | For some reason, it just seems to ... stop working half way through my comments :D |
| 16:15 | markoman | im starting to love this channel and language, thanks chouser :) |
| 16:17 | markoman | working version http://pastebin.com/qAf3GdcQ |
| 16:19 | fogus` | choffstein: Can you modify the comments at lines 127-128 to remove the ## and -- ? They might be causing issues. Not sure yet though. |
| 16:19 | markoman | I seem to have this repeating pattern on my codes now: {:id (:id args)} its kind of transfering key from one map to other, not bad if its just id, but when it multiplies Im thinking if there is a shortcut |
| 16:19 | choffstein | i'll try it now fogus` |
| 16:20 | fogus` | Thanks |
| 16:21 | choffstein | Doesn't seem to make a difference |
| 16:21 | markoman | is it time for macros here? |
| 16:23 | fogus` | Weird. I'll investigate later tonight |
| 16:23 | fogus` | Sorry about that |
| 16:25 | markoman | i think its just filtering map |
| 16:26 | choffstein | fogus`: No worries. It is an amazing tool :) |
| 16:29 | markoman | (select-keys args [:id]) -> {:id (:id args)} -> {:id 'some} I think |
| 16:54 | choffstein | man, it's amazing how much my network messes up my clojure work when I try to use clojars. |
| 16:54 | choffstein | Things that don't compile now because of strange errors will work fine on my home network... |
| 17:02 | choffstein | like, for example, 'resolve-uri' cannot be found in hiccup. Of course it can. But for some reason, lein deps just gets some whacky downloads on this network. It is ... strange. |
| 17:03 | jkkramer | choffstein: have you tried lein clean to see if it helps? |
| 17:07 | scottj | anyone know where the project fetcher is hosted? |
| 17:08 | choffstein | jkkramer: yep |
| 17:17 | wwmorgan | if I have a collection of key-value pairs [[:a :b] [:a :c] [:d :e]], how can I turn it into a map grouped by key? {:a [:b :c] :d [:e]} ? |
| 17:19 | raek | ,(group-by first [[:a :b] [:a :c] [:d :e]]) |
| 17:19 | clojurebot | {:a [[:a :b] [:a :c]], :d [[:d :e]]} |
| 17:20 | chouser | ,(reduce (fn [m [k v]] (assoc m k (conj (m k []) v))) {} [[:a :b] [:a :c] [:d :e]]) |
| 17:20 | clojurebot | {:d [:e], :a [:b :c]} |
| 17:21 | raek | ,(apply merge-with into (for [[k v] [[:a :b] [:a :c] [:d :e]]] {k [v]})) |
| 17:21 | clojurebot | {:d [:e], :a [:b :c]} |
| 17:22 | wwmorgan | thanks raek, chouser |
| 17:23 | chouser | ,(->> [[:a :b] [:a :c] [:d :e]] (group-by first) (map (fn [[k v]] [k (map second v)])) (into {})) |
| 17:23 | clojurebot | {:a (:b :c), :d (:e)} |
| 17:23 | scottj | (reduce (fn [m [k v]] (update-in m [k] conj v)) {} [[:a :b] [:a :c] [:d :e]]) |
| 17:24 | Raynes | I thought I was in #perl for a moment there. What, with all these ways to do the same thing. :> |
| 17:26 | scottj | s/conj/(fnil conj [])/ |
| 17:26 | sexpbot | <scottj> (reduce (fn [m [k v]] (update-in m [k] (fnil conj []) v)) {} [[:a :b] [:a :c] [:d :e]]) |
| 17:28 | drewr | I have a script that bootstraps some code using eval, but eval insists on printing to stdout the result of the ns form inside |
| 17:28 | drewr | is there any way to turn that off or otherwise do what I'm doing? |
| 17:30 | polypus | best client lib for redis: clj-redis or redis-clojure or wrapping jedis or ?? |
| 17:31 | fliebel | polypus: Or Aleph? |
| 17:32 | fliebel | https://github.com/ztellman/aleph/blob/master/src/aleph/redis.clj |
| 17:33 | polypus | fliebel: ty, forgot about that one. looking better and better since i also want websockets |
| 17:57 | devn | clj-redis |
| 17:57 | devn | polypus: that's your best bet...right now |
| 17:58 | devn | Q: If I have a (defn [{:keys [foo bar]}] [foo bar]), is there an option I can use to retain the original map as something I can pass along? |
| 17:59 | raek | devn: {:keys [foo bar], :as m} |
| 18:00 | joshua__ | Hmm. When I do lein deps I'm getting a slew of WARNING] POM for 'org.clojure:clojure:pom:1.2.0:compile' is invalid. It will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for project org.clojure:clojure at /root/.m2/repository/org/clojure/clojure/1.2.0/clojure-1.2.0.pom |
| 18:00 | joshua__ | I have no idea what I'm doing wrong. |
| 18:01 | devn | raek: hmph, thought i tried that, guess not. thanks! |
| 18:03 | MarkN3D | joshua__: I seem to recall seeing something like that when using an old version of marginalia, does that help? |
| 18:03 | joshua__ | MarkN3D, Nope, not really. I get that errors for -every- project I have. So I can't really do anything with Clojure right now =/ |
| 18:04 | joshua__ | So I not only get it for Clojure, but for Enlive etc. When I use lein run it fails saying clojure.main not found. |
| 18:04 | MarkN3D | joshua__: Hmm, corrupted lein plugin? |
| 18:04 | raek | joshua__: maybe you could try to remove the files in ~/.m2/ |
| 18:04 | MarkN3D | reinstall leiningen? |
| 18:06 | joshua__ | raek, looks like that is working ;) |
| 18:06 | raek | maybe it was a corrupted download |
| 18:07 | joshua__ | Might be. I'm on the school network which can cut out randomly. |
| 18:08 | MarkN3D | I'll have to remember that one |
| 18:10 | joshua__ | Gah. Checksums keep failing.. |
| 18:10 | joshua__ | A lot of: [WARNING] *** CHECKSUM FAILED - Error retrieving checksum file for org/mongodb/mongo-java-driver/2.0/mongo-java-driver-2.0.pom - IGNORING |
| 18:10 | joshua__ | Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: end tag name </HEAD> must be the same as start tag <META> from line 1 (position: START_TAG seen ...snapshots/enlive/enlive/1.0.0-SNAPSHOT/maven-metadata.xml"></HEAD>... @1:361) |
| 18:10 | joshua__ | ??? |
| 18:11 | raek | looks like you get HTML in your files |
| 18:11 | raek | maybe a login portal or something |
| 18:12 | raek | or a bad http proxy |
| 18:26 | joshua__ | raek, ahh. Thank must be it. I have to go through a proxy, because I'm on the schools internet... this sucks. This also explains why I don't get the error when I ssh to my linode box. |
| 23:02 | choffstein | Any idea where I could be dredging up this error from (using hiccup): Exception in thread "main" java.lang.IllegalAccessError: resolve-uri does not exist (form_helpers.clj:1) |
| 23:03 | choffstein | digging down the stack trace, it seems to be coming from me calling (:use [hiccup core page-helpers form-helpers]) in one of my name spaces |
| 23:03 | choffstein | but I don't know why it would be giving that error |
| 23:44 | choffstein | Why in the world am I getting this error? |
| 23:46 | choffstein | why ... why ... why |
| 23:46 | carllerche | Are there any clojure json parsers than can take a lazy seq and return a lazy seq/ |
| 23:46 | amalloy | carllerche: don't think so. json objects are hashes |
| 23:47 | carllerche | amalloy: I'm trying to parse the campfire streaming API which returns a stream of json hashes... not sure of the best way to do it (my "learn clojure" project is trying to write a campfire bot) |
| 23:49 | choffstein | well, well, well...hiccup 0.3.0 works, but not 0.3.4. Interesting. I wonder why... |
| 23:51 | technomancy | I really hope hiccup is named after the hero of http://en.wikipedia.org/wiki/How_to_Train_Your_Dragon_(film) |
| 23:55 | technomancy | why does this echo a newline despite the output redirection? rlwrap -m -q '"' /bin/true > /dev/null 2>&1 |
| 23:57 | amalloy | technomancy: rlwrap uses ncurses or something doesn't it? |
| 23:57 | amalloy | (fyi, foo &>/dev/null is shorthand for that) |
| 23:58 | justinlilly | http://i.imgur.com/dcVGX.png -- I don't see a newline? ... or at least not an extra one. |
| 23:59 | amalloy | good point. neither do i; that rlwrap produces the same output as echo -n, not echo, for me |