2013-04-13
| 00:12 | andyfingerhut | Anyone happen to know the motivation for creating Clojure's BigInt class? |
| 00:15 | hiredman | andyfingerhut: I think motivation was two fold 1. hashing 2. performance |
| 00:15 | hiredman | that should be an ordered list |
| 00:15 | hiredman | shouldn't |
| 00:15 | hiredman | ,(.hashCode 1) |
| 00:15 | clojurebot | 1 |
| 00:15 | hiredman | ,(.hashCode -1) |
| 00:15 | clojurebot | 0 |
| 00:16 | hiredman | ,(.hashCode (BigInteger. -1)) |
| 00:16 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: No matching ctor found for class java.math.BigInteger> |
| 00:16 | andyfingerhut | hiredman: hashing, meaning control over its hash value so that it hashed to consistent values as Longs and smaller integers? |
| 00:16 | hiredman | ,(.hashCode (BigInteger. "-1")) |
| 00:16 | clojurebot | -1 |
| 00:16 | hiredman | yeah |
| 00:16 | hiredman | performance is clojure's bigint's try to do long ops when the value is in the long range |
| 00:17 | andyfingerhut | I know BigInt's internally are stored as a long if they fit in that range, and have a Java ref to a BigInteger if they don't. Makes sense what you say. |
| 00:17 | hiredman | hashing is not a huge issue now that clojure has it's own hashing and equality stuff |
| 00:18 | andyfingerhut | Yeah, I've been looking through hasheq recently to understand it better, related to a CLJ ticket. |
| 00:18 | andyfingerhut | I guess hasheq came after BigInt was created? |
| 00:18 | hiredman | bigint was introduced in clojure 1.3, 1.4 parted ways with java's hashing and equality |
| 00:19 | andyfingerhut | OK, I think I've fooled myself into believing that I understand all of that. :-) It certainly matches with what I've been poking through. |
| 00:22 | andyfingerhut | Looking back on the last few years, it is odd to think how much work it takes to get to = and hash (usually) being consistent with each other. |
| 00:27 | hiredman | ~tell me about scala |
| 00:27 | clojurebot | http://www2.palomar.edu/users/mhudelson/studyguides/rmnsqvsgothic_wa.html |
| 00:27 | hiredman | ~more about scala |
| 00:27 | clojurebot | http://www2.palomar.edu/users/mhudelson/studyguides/rmnsqvsgothic_wa.html |
| 00:27 | hiredman | clojurebot: you suck |
| 00:27 | clojurebot | excusez-moi |
| 00:28 | muhoo | gawd this is driving me nuts, trying to figure out how to thread a bunch of little bits of state through a bunch of functions |
| 00:28 | andyfingerhut | Where did Clojurebot get a link like that for scala? |
| 00:28 | muhoo | i guess i could create one big god-map with everything in it and pass it down through every call in teh stack |
| 00:29 | andyfingerhut | muhoo: I've done it, and it can be made somewhat manageable. |
| 00:29 | hiredman | "we are completely screwed on ==." -- seen in #scala |
| 00:29 | muhoo | or maybe i need monads :-P |
| 00:29 | hiredman | is the one I was looking for |
| 00:30 | hiredman | feh, someone changed the content of the link |
| 00:30 | andyfingerhut | hiredman: That is a Scala programmer's assessment of Scala's "==" operator? |
| 00:31 | hiredman | I guess? It was something someone said years ago in #scala |
| 00:31 | muhoo | why waste time dissing scala when there is so much java to diss. |
| 00:36 | andyfingerhut | I come here not to diss other languages, but to document Clojure better |
| 00:37 | nightfly | Is this a reason why (.start (Thread. #(println "Moo"))) |
| 00:37 | nightfly | in nrepl doesn't seem to do anything? |
| 00:38 | muhoo | nightfly: it might be, printing to stdout |
| 00:38 | andyfingerhut | Yes :-) |
| 00:38 | muhoo | because stdout is thread local IIRC |
| 00:39 | muhoo | it's bound to the nrepl connection in the local thread. if you spawn another thread, all bets are off. there might be a way to force it to bind tho, i just don't happen to know it. |
| 00:40 | muhoo | ,(.start (Thread. #(println "Moo"))) |
| 00:40 | clojurebot | #<SecurityException java.lang.SecurityException: no threads please> |
| 00:41 | muhoo | heh |
| 00:44 | nightfly | Alrigh, that makes sense. Thanks, I thought the world was breaking for a bit. |
| 01:45 | shriphani | hello. are there any specific NLP libraries that people recommend for use with clojure? I am looking for the equivalent of SUTime in StanfordCoreNLP. |
| 02:09 | Apage43 | shriphani: there's https://github.com/dakrone/clojure-opennlp |
| 02:10 | Apage43 | shriphani: but |
| 02:10 | Apage43 | if there's a thing that's easy enough to use from java you can use it from Clojure with generally not much trouble |
| 02:10 | shriphani | but what ? |
| 02:12 | Apage43 | so just use SUTime if it does what you want |
| 02:12 | shriphani | Apage43: it just claims to do what I want :) |
| 02:13 | shriphani | it took an eternity to make the sample code compile and then I get shit results using it. |
| 02:15 | shriphani | but yeah maybe I am using the lib incorrectly but the documentation is shit and nobody who can help is awake now :) |
| 02:19 | wliao | shriphani: What's the problem? |
| 02:27 | muhoo | is there some way to do a def using a let form? like (deflet [x 2, y 3]) |
| 02:28 | muhoo | suppose i could write a macro to do it, but i'm surprised it doesn't exist alreay |
| 02:29 | metellus | how is that different from a plain let? |
| 02:30 | wliao | He's using `def` like `let` format. |
| 02:31 | muhoo | ah http://www.learningclojure.com/2010/09/astonishing-macro-of-narayan-singhal.html |
| 02:31 | metellus | but (let [x 2, y 3]) would od th esame thing |
| 02:31 | metellus | as far as I can see |
| 02:31 | metellus | do the same* |
| 02:32 | wliao | nope..different scope. |
| 02:32 | metellus | ah, okay |
| 02:34 | muhoo | i'm at the repl |
| 02:34 | muhoo | hiding a bunch of crap inside of let is useless |
| 02:34 | muhoo | i need to be able to pick apart these things, to look at them. i suppose i could use ritz, but i'd rather do it at the repl |
| 02:35 | muhoo | also, helpful for use with deftest |
| 02:41 | wliao | muhoo: I think your need is not as universal as `unsigned-bit-shift-right`, and that's why. |
| 02:48 | Raynes | muhoo: Hai |
| 02:57 | muhoo | Raynes: hey there, how goes? |
| 02:58 | Raynes | muhoo: Well enough! |
| 04:30 | wei_ | how do you use the "lein ring server" plugin with aleph instead of jetty? |
| 07:33 | berdario | Uhm, I realized I can't destructure a core.logic lvar |
| 07:33 | berdario | and there's no secondo or ntho |
| 07:34 | berdario | is there a better approach than repeatedly use firsto and resto? |
| 11:06 | naeg | is there a way to simplify a nested (map f ...) with same function? |
| 11:08 | bbloom | naeg: you'll need to elaborate or show an example, but i'll assume the answer to your question is either function composition or the `for macro |
| 11:09 | naeg | bbloom: was about to paste the example: http://pastebin.com/A8WdXaHw |
| 11:11 | bbloom | i'm not really sure what that's supposed to do |
| 11:12 | naeg | I'm basically doing (map (partial bit-check bitboard) [6 7 8 1]) twice |
| 11:12 | naeg | I thought I could handle that with reduce, but can't get it to work |
| 11:12 | bbloom | naeg: your outer map is applied to two sequences in parallel |
| 11:13 | bbloom | ,(map vector [1 2 3] "abc") |
| 11:13 | clojurebot | ([1 \a] [2 \b] [3 \c]) |
| 11:13 | naeg | yes, and that how it's supposed to be |
| 11:13 | bbloom | but it's not the same as (partial bit-check bitboard) |
| 11:14 | bbloom | let's rewind a second |
| 11:14 | bbloom | what is bitboard? |
| 11:14 | bbloom | what is bit-check? |
| 11:16 | thalassios_xelon | hello room:)),i use (recur (concat ..) ) and i get a stackoverflow,is it because of lazy evaluation? |
| 11:16 | naeg | bbloom: that's a bit more complicated, I'll try to come up with a general example |
| 11:18 | bbloom | thalassios_xelon: lazy evaulation will generally reduce the likelyhood of a lazy evaluation. more likely the problem is that your recursion is explodin |
| 11:18 | bbloom | g |
| 11:19 | thalassios_xelon | yes it happens only in big values |
| 11:19 | thalassios_xelon | but why it happens? it supposed tha recur doesnt cause stack overflows,i think the concat is doing it |
| 11:20 | bbloom | thalassios_xelon: i'd need to see a stack trace & some source code. not enough info provided |
| 11:20 | thalassios_xelon | ok 1 min |
| 11:26 | thalassios_xelon | its difficult to paste my code,it says this StackOverflowError clojure.lang.LazySeq.sval (LazySeq.java:42) |
| 11:26 | thalassios_xelon | is there a problem when using lazyseq in recur? |
| 11:26 | naeg | bbloom: that's basically the same as I'm doing, except that f does more complicated stuff than (+ a b) but still returns a single value: http://pastebin.com/EytSGcM3 |
| 11:27 | bbloom | thalassios_xelon: use pst |
| 11:29 | thalassios_xelon | StackOverflowError |
| 11:29 | thalassios_xelon | clojure.core/concat/fn--3923 (core.clj:678) |
| 11:29 | thalassios_xelon | clojure.lang.LazySeq.sval (LazySeq.java:42) |
| 11:29 | thalassios_xelon | clojure.lang.LazySeq.seq (LazySeq.java:60) |
| 11:29 | thalassios_xelon | clojure.lang.RT.seq (RT.java:484) |
| 11:29 | thalassios_xelon | clojure.core/seq (core.clj:133) |
| 11:29 | thalassios_xelon | clojure.core/concat/fn--3923 (core.clj:678) |
| 11:29 | thalassios_xelon | clojure.lang.LazySeq.sval (LazySeq.java:42) |
| 11:29 | thalassios_xelon | clojure.lang.LazySeq.seq (LazySeq.java:60) |
| 11:29 | thalassios_xelon | clojure.lang.RT.seq (RT.java:484) |
| 11:29 | bbloom | thalassios_xelon: and use a pastebin.... |
| 11:30 | xeqi | like refheap.com |
| 11:32 | bbloom | naeg: are the vectors always the same input? |
| 11:34 | naeg | bbloom: yes. I though about (reduce #(map f % %2) 1 (repeat 2 [1 2 3])) but that doesn't seem to work |
| 11:35 | bbloom | naeg: why not something simple like https://www.refheap.com/paste/13596 |
| 11:40 | naeg | bbloom: that's better, thanks |
| 11:44 | thalassios_xelon | https://www.refheap.com/paste/13598 its take a boolean formula and produces a CNF /DNF normal form |
| 11:44 | thalassios_xelon | it causes stackoverflow exception dont know why... |
| 11:58 | bakingbread | hi. coming from the ruby I have a little theoretical question.. why to use symbols in clojure at all if clojure's symbols are immutable - why not use strings as hash keys etc? |
| 12:01 | thalassios_xelon | bakingbread, i am new in programming,symbols evaluates to their value,string to themselfs |
| 12:03 | thalassios_xelon | in clojure the normal is to use keywords in maps |
| 12:03 | thalassios_xelon | as keys |
| 12:04 | Foxboron | bakingbread: if i am not wong, you can do as you wish? |
| 12:06 | bakingbread | Foxboron yes.. but I just wonder why they exist |
| 12:07 | Foxboron | bakingbread: http://stackoverflow.com/questions/2320348/symbols-in-clojure read that? |
| 12:11 | thalassios_xelon | bakingbread, symbols are used to represent something else, px a cant be 5,or a can be "hello",symbols are immutable but with them we can produce new thinks |
| 12:15 | anderson-c | hello all... i have a clojureclr quetion - i am having trouble interacting with COM and looking to get some advice |
| 12:16 | anderson-c | the quetion is: |
| 12:17 | anderson-c | when trying to access properties or methods on the COM object, I am getting back that the compiler is not able to find the member, but not for all members |
| 12:17 | anderson-c | sometimes, it will return a value |
| 12:17 | anderson-c | but it does not seem that the underlying object is another COM, or something I would need to additionally import |
| 12:18 | anderson-c | if anyone has immediate advice on that, i will take it, in the meantime, i will put together a concrete example |
| 12:21 | anderson-c | probably even more usefully, is how would one query a COM interface for its representations as seen from clojure? |
| 12:25 | noidi | unfortunately there are relatively few clojure-clr users, and those are very platform-specific questions |
| 12:26 | noidi | but let's hope some clojure-clr guru notices your question :) |
| 12:27 | noidi | anderson-c, have you checked out clojure.reflect? http://clojure.github.io/clojure/clojure.reflect-api.html |
| 12:27 | noidi | it seems to be implemented in clojure-clr |
| 12:32 | bakingbread | Foxboron: thanks, sorry. had a call. I read it. Also I was confusing Clojure's symbols and keywords (which is called symbols in Ruby) |
| 12:36 | Foxboron | bakingbread: ahhh. |
| 12:37 | noidi | bakingbread, there are several benefits to having a separate keyword type. first, they can be interned, which allows for more efficient comparisons. |
| 12:37 | noidi | second, keywords are functions, so you can do stuff like (map :first-name people) |
| 12:38 | noidi | ,(= (System/identityHashCode :foo) (System/identityHashCode (keyword "foo"))) |
| 12:38 | clojurebot | true |
| 12:49 | bakingbread | noidi: interned? |
| 12:51 | noidi | bakingbread, all keywords with the same value are actually the same object |
| 12:52 | noidi | even ones created dynamically using the `keyword` function |
| 12:53 | noidi | http://en.wikipedia.org/wiki/String_interning |
| 12:53 | bakingbread | noidi: ok, but aren't immutable strings are the same object? |
| 12:56 | noidi | not necessarily |
| 12:56 | noidi | ,(= (System/identityHashCode "foo") (System/identityHashCode (.toLowerCase "FOO"))) |
| 12:56 | clojurebot | false |
| 12:57 | noidi | ,(= "foo" (.toLowerCase "FOO")) |
| 12:57 | clojurebot | true |
| 12:58 | bakingbread | noidi: oh I see |
| 12:58 | bakingbread | thanks |
| 13:21 | lsdsl | Could someone explain to me why you can't (map .toUpperCase ["a" "b" "c"]), but you can (map #(.toUpperCase %) ["a" "b" "c"]) ? |
| 13:27 | mthvedt | lsdsl: .toUpperCase is a special form, not a fn |
| 13:28 | lsdsl | mthvedt: could you elaborate? I'm not much of a java guy. Could you explain why Clojure can't automatically turn .toUpperCase into an anonymous function? |
| 13:29 | mthvedt | i'm not really qualified to say |
| 13:29 | lsdsl | Like, internally, what is the barrier to dynamically making .toUpperCase an anonymous function? |
| 13:29 | mthvedt | my guess is the core language wants to be as magic-free as possible |
| 13:29 | mthvedt | rather, the core evaluation process |
| 13:29 | mthvedt | almost all "magic" in clojure is accomplished with macros |
| 13:31 | lsdsl | I guess I could just make a jmap or something that wraps the argument to map in an anonymous function which takes one argument |
| 13:31 | lsdsl | maybe that's why? arities? |
| 13:31 | lsdsl | hmmm |
| 13:49 | juhu_chapa | tpope: Hi, how to re-evaluate whole namespace with fireplace? |
| 14:01 | VFe | Anyone familiar with how to "connect" projects to the insta-repl in current versions of Light-Table? |
| 14:19 | augustl | is there a way to exclude a specific dependency from "lein uberjar"? |
| 15:26 | Foxboron | lsdsl, .toUpperCase IIRC is a method for the class string |
| 15:27 | SegFaultAX | Does anyone know if the new version of JoC will be released for Kindle as well? |
| 15:27 | SegFaultAX | Or some other digital pub format? |
| 15:28 | bbloom | gm |
| 16:00 | mindbender1 | . |
| 16:04 | danneu | is Lobos the community favorite for db migrations |
| 16:05 | mynomoto | VFe: You only need to evaluate a form (ctrl + enter) in a file inside a project. It connects automatically. |
| 16:10 | VFe | Thanks :) |
| 16:30 | bruceadams | augustl: you can exclude dependencies from your project overall with :exclusions. is that what you want? |
| 16:31 | augustl | bruceadams: I don't think so :) I tried various variations of excluding the dependency but it's still packaged into "lein uberjar" |
| 16:31 | augustl | the dependency is present in my "dependencies" list so I guess excluding it doesn't make much of a difference.. |
| 16:33 | bruceadams | augustl: does you project in fact need that dependency? and you just want to provide some other way that packaging it in the uberjar? |
| 16:34 | bruceadams | or does you project not need that dependency at all? (then why is it in your project's dependecies?) |
| 16:35 | augustl | bruceadams: the project needs the dependency in order to build. It's a java library I subclass from |
| 16:35 | augustl | but when my jar gets loaded in the environment it's made for, that dependency cannot be in the jar |
| 16:35 | bruceadams | augustl: ok. that makes sense to me now. thanks. |
| 16:36 | bruceadams | maven has a concept of "provided" a jar needed for build and test run, but not packaged into larger packages, etc. |
| 16:36 | augustl | ah, I'll look that up. I guess I'm better of building my own pom.xml |
| 16:36 | bruceadams | i don't know if leiningen/pomegranate has that concept. |
| 16:40 | bruceadams | augustl: for that dependency in project.clj, try adding this clause :scope "provided" |
| 16:41 | bruceadams | (i haven't tried it, but that snuggles in pretty close to the Maven concept of provided.) |
| 16:53 | bruceadams | augustl: nevermind. i tried it just now and :scope "provided" didn't do what i was hoping for (that dependency is still put into the uberjar) |
| 17:00 | holo | hi |
| 17:01 | holo | is it possible to catch multiple exceptions in the same catch block? |
| 17:05 | holo | I want to return the same expression for a couple of exceptions without having to repeat myself at each one. finally I would return a different expression for a specific exception |
| 17:14 | wei_ | anyone have an example of deploying http-kit on heroku? |
| 17:18 | smnirven | anybody have some experience with clojure.java.jdbc? |
| 17:18 | smnirven | *that would be willing to help me with something stupid |
| 17:20 | mynomoto | smnirven: Maybe I can help. |
| 17:20 | smnirven | ty |
| 17:20 | smnirven | I'm trying to add a "IN" condition to an update query |
| 17:20 | smnirven | update table set x=3 where y IN(1,2) |
| 17:21 | smnirven | ["id IN(?)" array-of-ids] |
| 17:21 | smnirven | mynomoto: know what im getting at? |
| 17:26 | smnirven | mynomoto: im trying to figure out how to the the sql string to build properly that allows me to do that |
| 17:28 | r00k | b |
| 17:30 | mynomoto | smnirven: I don't get. What are you trying to do? |
| 17:31 | mynomoto | smnirven: Are you trying to generate a query vector? |
| 17:31 | smnirven | yes |
| 17:33 | mynomoto | smnirven: That would be ["update table set x=? where y IN(?,?)" 3 1 2] |
| 17:34 | mynomoto | smnirven: Does that work? |
| 17:34 | smnirven | mynomoto: hmm, I guess that would work |
| 17:35 | smnirven | mynomoto: but if I had a vector of like 100 ids that I want to put in the IN() clause, I'd have to put 100 question marks in the sql string |
| 17:36 | smnirven | mynomoto: I guess I could build up that string programmatically - seems hackish though |
| 17:38 | mynomoto | smnirven: I think ["update table set x=? where y IN(?)" 3 [1 2]] also works. |
| 17:39 | smnirven | mynomoto: yeah I was trying that, didnt seem to work |
| 17:40 | mynomoto | smnirven: What's the error? |
| 17:41 | yacin | i only get one line of my stack trace in nrepl. where does the rest of it go? |
| 17:49 | smnirven | mynomoto: I get this: PSQLException Can't infer the SQL type to use for an instance of clojure.lang.PersistentVector. Use setObject() with an explicit Type |
| 17:56 | mynomoto | smnirven: what is exactly the vector you are passing? |
| 17:56 | smnirven | [2 3] |
| 17:57 | mynomoto | smnirven: And the query? |
| 17:58 | arrdem | clojurebot: ping |
| 17:58 | clojurebot | PONG! |
| 17:59 | smnirven | (clojure.java.jdbc/update-values :table_name ["id IN(?)" [2 3]] {:user_id 1}) |
| 17:59 | smnirven | mynomoto: that's basically it right there |
| 18:10 | gfredericks | what does github do if you force-push to a branch that a pull-request is based on? |
| 18:10 | gfredericks | smnirven: have you looked at the honeysql lib/ |
| 18:10 | Raynes | It dropkicks the pull requester in the manhood. |
| 18:11 | mdeboard | Anyone used cascalog with light table and gotten live eval working? |
| 18:12 | mynomoto | smnirven: I got the same error here. Not sure about the solution. |
| 18:12 | mynomoto | smnirven: Sorry. |
| 18:23 | smnirven | mynomoto: no problem, thanks for making an attemp |
| 18:23 | smnirven | *attemp |
| 18:23 | smnirven | *attempt |
| 18:25 | proctor | macro question, and if I am doing it wrong please let me know (I know the first rule of macros is don't write them, so I understand I might be premature) |
| 18:26 | proctor | I would like some functions for DSL-ish type of function calls for each key in a map |
| 18:27 | proctor | {:mills 1 :second 1000 :hour (* 1000 60 60)} |
| 18:27 | proctor | and i would like a function for each corresponding entry in the map |
| 18:27 | proctor | e.g. timestamp-millis, timestamp-second, timestamp-hour |
| 18:27 | gfredericks | you want them def'd? |
| 18:28 | proctor | I would like to |
| 18:28 | proctor | trying to not have to write the same "function" for each different key |
| 18:28 | gfredericks | and what would the functions look like? |
| 18:28 | proctor | (defn timestamp-minute [record] (timestamp-to-resolution record :minute)) |
| 18:29 | proctor | (defn timestamp-hour [record] (timestamp-to-resolution record :hour)) |
| 18:29 | gfredericks | okay so it doesn't involve the vals in the map at all |
| 18:29 | proctor | it does, delegating to a different function.... |
| 18:29 | gfredericks | but not directly |
| 18:30 | proctor | correct |
| 18:31 | gfredericks | k so what's the question? |
| 18:31 | proctor | (defn timestamp-to-resolution [record resolution] |
| 18:31 | proctor | (let [r (resolution timestamp-resolutions)] |
| 18:31 | proctor | (* r (quot (timestamp-in-millis record) r)))) |
| 18:31 | gfredericks | refheap.com next time |
| 18:32 | proctor | sorry… will do |
| 18:33 | proctor | https://www.refheap.com/paste/13603 |
| 18:33 | proctor | was hoping to have the timestamp-*** functions be generated from the keys of the timestamp-resolutions hash |
| 18:34 | proctor | so when I add a new resolution, I would not have to define a key each time |
| 18:34 | proctor | created a macro I could call to generate the function timestamp-millis if I pass :millis to the macro |
| 18:34 | proctor | and that works |
| 18:36 | proctor | didn't know how to trigger that macro for each key in the timestamp-resolutions |
| 18:37 | gfredericks | whelp |
| 18:37 | gfredericks | you could have a macro that takes a collection of keys |
| 18:37 | proctor | or am I crazy? |
| 18:38 | gfredericks | and use (cons 'do (for [k ks] ... the same body as before ...)) |
| 18:38 | gfredericks | well that wouldn't work actually |
| 18:38 | gfredericks | you'll probably just want a no-args macro |
| 18:38 | gfredericks | that reads the map itself |
| 18:38 | gfredericks | and then use the cons trick |
| 18:40 | proctor | I'll try that, thanks |
| 18:40 | proctor | part of me wanted to make sure I wasn't trying something crazy as well |
| 18:41 | gfredericks | deffing things that aren't explicitely named isn't the most idiomatic |
| 18:41 | proctor | that was part of it... |
| 18:42 | proctor | so general guideline would be just to write out each function declaration for clarity of where it is coming from |
| 18:43 | gfredericks | yeah; you could have a (deftimestampthing millis) macro call |
| 18:43 | gfredericks | and you'd have a series of those |
| 18:43 | gfredericks | I agree the repetition isn't very tasty |
| 18:43 | gfredericks | you might have a good case for this sort of thing, and could just be very explicit with comments perhaps |
| 18:44 | proctor | been playing with clojure on the side, so wanted to be as idiomatic as possible, and learn the idioms |
| 18:45 | proctor | I will probably just go the redeclaration route in the code then |
| 18:45 | proctor | although I will play with the macro iteration to get a better handle on macros though :D |
| 18:45 | proctor | thanks again |
| 18:45 | gfredericks | np |
| 18:51 | smnirven | mynomoto: by the way it looks like a limitation of jdbc |
| 18:51 | smnirven | mynomoto: http://stackoverflow.com/questions/178479/preparedstatement-in-clause-alternatives |
| 19:37 | wei_ | what's the best version of java to use with clojure? |
| 19:37 | wei_ | (on ubuntu) |
| 19:52 | callen | wei_: openjdk or Oracle JVM is fine |
| 19:52 | wei_ | callen: thanks |
| 20:26 | stompyj | is there a way to add a library to leiningen without having to restart the repl |
| 20:26 | stompyj | ? |
| 20:32 | n_b | stompyj: Does require not work? |
| 20:32 | scottj | stompyj: don't know, maybe something related to https://github.com/cemerick/pomegranate |
| 20:33 | stompyj | thanks guys, I'll look into those. |
| 20:34 | Raynes | require is not what you want. |
| 20:34 | Raynes | require is for using libraries already on the classpath. |
| 20:35 | stompyj | looks like pomegranate is the right path to go down |
| 20:40 | urlwolf__ | Is windows a tolerable platform for clojure? |
| 20:41 | scottj | urlwolf__: tolerable sure. |
| 20:42 | capcrunch | anyone works on jzos ? |
| 20:42 | urlwolf__ | appart from sucky command line, any other showstoppers? |
| 20:42 | capcrunch | jvm segfautls using clojure |
| 20:42 | capcrunch | ah i think is because i created a war , and i use slurp & spit to modify a file inside the jar at runtime |
| 20:46 | doug4704 | hoping someone can clarify access to java libraries from clojure |
| 20:46 | doug4704 | I have a jar file for reading outlook .msg files |
| 20:47 | gfredericks | and the jar is not already available on maven anywhere? |
| 20:47 | doug4704 | does any sort of a clojure wrapper need to be written or should I be able to access the classes in the jar as-is? |
| 20:47 | holo | urlwolf__, I use fish shell for shell scripting as a complement in my clj project. I gave up on clj as scripting language because of the bootstrap times. just checked, and there isn't any port of fish to windows. just a random remark hehe |
| 20:47 | gfredericks | java interop is super easy. the maybe harder part is if you're using leiningen and want a random jar to be on the classpath |
| 20:47 | urlwolf__ | holo: I love fish shell too |
| 20:48 | urlwolf__ | hear some people got it compiled on cygwin |
| 20:48 | holo | urlwolf__, that's great. get it tested first. if you see it's a show stopper, maybe you've got your answer there |
| 20:48 | bruceadams | capcrunch: IBM (aka J9) Java 1.7 prior to SR4 had issues with Clojure |
| 20:48 | bruceadams | https://github.com/technomancy/leiningen/issues/954 |
| 20:49 | doug4704 | I thought I would need to start clojure (in order to access the extra .jar ) like java -cp [path-to-clojure.jar]:[path-to-extra-jar] clojure.main |
| 20:49 | bruceadams | I don't specifically know about jzos, but it's pretty much the same code base. |
| 20:50 | capcrunch | thanks bruceadams, the thing always segfaults at slurp , i'll take a look at this |
| 20:50 | gfredericks | doug4704: if you're using straight java (rather than leiningen) then you should have no issue and it should work like you're describing |
| 20:50 | holo | urlwolf__, what do you use for string and list manipulation? I use pyp |
| 20:50 | bruceadams | capcrunch: can you check on exactly which version you are running? I'm curious... |
| 20:51 | bruceadams | that is, version of java. |
| 20:51 | capcrunch | 1.6 |
| 20:51 | doug4704 | gfredericks: I tried variations on this: (ns something (:import com.auxilii.msgparser MsgParser) |
| 20:52 | bruceadams | hmm.. i'm not aware of any issues with IBM java 1.6 (but have only done a little clojure on there) |
| 20:52 | gfredericks | doug4704: (:import [com.auxilii.msgparser MsgParser]) should work |
| 20:52 | urlwolf__ | holo: great find |
| 20:52 | urlwolf__ | I don't have a need for it right now |
| 20:53 | doug4704 | gfredericks: ok, I'll continue messing around with it. good to have it confirmed I was understanding it correctly on how it was supposed to work. thanks. |
| 20:53 | holo | urlwolf__, I use it in conjunction with fish. very easy to get things done |
| 20:53 | capcrunch | bruceadams , according to the stacktrace of the bug report is not the same issue |
| 20:55 | bruceadams | the issue i pointed to could be avoided by disabling the JIT compiler (but that was only seen in IBM Java 1.7) |
| 20:56 | capcrunch | i'll try that i had to move my development from zos to solaris on sparc |
| 20:57 | capcrunch | because of this |
| 20:57 | bruceadams | capcrunch: any chance you can open a problem report with IBM about the crash? |
| 20:58 | bruceadams | certainly a JVM segfault is a JVM issue (not a Clojure issue). |
| 21:01 | capcrunch | bruceadams , i cannot open a report at the time i'm finishing my development first , i hope it is sorted out on a next version of the jvm |
| 21:09 | bruceadams | capcrunch: my impression is there isn't much feedback to IBM JVM for Clojure triggered issues. i worry they won't know there is a problem that needs to be fixed. |
| 21:17 | capcrunch | bruceadams all mainframe guys i know just use cobol ,c,and jcl so i'm adding clojure to the scenario ,just a bummer it does not work on jzos but it is not a show stopper yet |
| 21:24 | bruceadams | capcrunch: FWIW i can do a simple Clojure (1.5.1) slurp using IBM Java 1.6 (SR13 FP1) on 64bit Linux. |
| 21:26 | bruceadams | (i don't have ready access to a zos system.) |
| 21:26 | capcrunch | bruceadams yeah slurp works fine on the repl , but i think the issue is that im using a war and trying to modify the contents inside the war , so as i don't have leingen on the mainframe i use tomcat to test |
| 21:36 | muhoo | capcrunch: you're not.... http://en.wikipedia.org/wiki/John_Draper are you? |
| 21:45 | capcrunch | muhoo nope |
| 22:35 | devn | ,(defmacro eval-wrapper [form] `(defn wrapper# [] ~form)) |
| 22:35 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 22:36 | devn | So, I was doing this: (defn -main (let [x (read)] (eval x))) |
| 22:36 | devn | But eval breaks criterium at the moment, so I'm trying to skip the eval and instead wrap the form inside a fresh defn, and then call the generated function |
| 22:36 | devn | Does that make sense? |
| 22:38 | devn | Does my "eval-wrapper" do what I think it does? Am I going to get meaningful benchmark results from calling the (let [x (read-string "(+ 1 1)"), wrapped-fn (eval-wrapper x)] (wrapped-fn))? |
| 22:40 | devn | the macroexpand looks right to me: (macroexpand-1 '(eval-wrapper (+ 1 1))) => (clojure.core/defn wrapper__7298__auto__ [] (+ 1 1)) |
| 22:42 | mynomoto | smnirven: Thank you for the link. I didn't know that it was not possible, but makes sense to prevent injection attacks. |
| 23:16 | hugod | devn (let [f (eval `(fn [] ~(read)))] ...) I would think |
| 23:16 | anderson-c | @noidi - thanks for the response, sorry, it has taken so long to get back to you on it. now that i have been away from the problem, and got a chance to come back, i was able the find the solution |
| 23:18 | anderson-c | the thing i need to do, was to type-hint the member call. essentially, i have defn'd a variable, say 'f' and was trying to call it with the likes of (.get_Name f), and getting the above errors, I was trying it without the prefix, etc. |
| 23:19 | anderson-c | what needed to happen, was the instance needed to hinted as to the interface it supports, which i have from examining the il, |
| 23:19 | anderson-c | and when acted upon in this way, with a call structured like (.get_Name ^COMClass f) |
| 23:19 | anderson-c | it would then return the proper response |
| 23:21 | anderson-c | so, thanks for even responding to me, i appreciate it, and i hope that bit of info helps someone out down the road |
| 23:27 | devn | hugod: did you get those msgs on that closed PR on criterium? |
| 23:27 | devn | hugod: im actually trying to do exactly what you proposed above, but im still getting very weird results from criterium |
| 23:28 | devn | Thread/sleep completes in 1ns, for example |
| 23:28 | devn | err (Thread/sleep 1000) |
| 23:31 | devn | hugod: Cleaning JVM Allocations...\nException in thread "main" java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IFn |
| 23:37 | carlw2 | hey what do people use for migrations? I tried getting ragtime going but I'm having some issues with it |
| 23:47 | mynomoto | carlw2: I'm using lobos. It's not perfect but does the job. |
| 23:48 | mynomoto | carlw2: But I never tried ragtime, can't say if it's better or worse. |
| 23:50 | danielglauser | carlw2: We use Migratus at work https://github.com/pjstadig/migratus |
| 23:51 | carlw2 | mynomoto: thanks I'll give that a go instead. I liked ragtime cause it used straight sql |
| 23:52 | chessguy | ,(clojure.core.unify/unifier '(red ?x) '(foo bar)) |
| 23:52 | clojurebot | #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.core.unify> |
| 23:52 | carlw2 | how do you handle having your database credentials duplicated? |
| 23:52 | carlw2 | do you have some single set of functions for that? |
| 23:52 | carlw2 | im using sql korma |
| 23:56 | mynomoto | carlw2: The connection map? I place it in a config file and refer it in the migration ns. |
| 23:57 | carlw2 | mynomoto: can please you gist an example of that config file and how you read it? |
| 23:57 | carlw2 | i'd like to see how you have it setup |