2012-06-08
| 00:17 | johnmn3 | are there any clj libs that make quick work of compressing and decrompressing zip files? |
| 00:18 | hiredman | johnmn3: the jvm comes with the java.util.zip package |
| 00:32 | johnmn3 | hiredman: yea, i've been reading the docs on it. Just seems like it could use a wrapper in clojure |
| 00:58 | muhoo | wow, a week of work, for 140 lines of code (google apps step2 auth workflow for friend) |
| 00:58 | muhoo | heh, of which 40 is just the (:import ...) block |
| 00:59 | brehaut | holy crap! |
| 00:59 | cemerick | for want of an import * ;-( |
| 00:59 | cemerick | er, ;-) |
| 01:01 | muhoo | should i make a github project for basically 1 file with 140 loc? |
| 01:01 | cemerick | been done for much, much less |
| 01:02 | muhoo | ok will do. cemerick: had a chance to look at that :session dissoc patch? |
| 01:03 | muhoo | i want to deploy an app using friend soon, early next week, and i'd like not to have to cook up my own friend jar |
| 01:04 | cemerick | muhoo: sorry, not yet. I killed my open source budget earlier in the week. But: why are you so keyed in on getting that slot dissoc'ed? |
| 01:06 | muhoo | paranoia, really. i don't like leaving java objects hanging around in session memory, or in couchdb if i use that backend |
| 01:06 | muhoo | when it comes to security stuff, i get really anal-retentive. |
| 01:06 | cemerick | ah |
| 01:06 | cemerick | well, that particular object is really innocuous |
| 01:07 | cemerick | I'm pretty anal myself in wanting to get that sort of thing cleaned up, but I want to make sure the solution is general enough to be applicable to any other post-workflow cleanup, etc. |
| 01:07 | muhoo | true. i'll have another look at it myself then. |
| 01:08 | cemerick | muhoo: Thanks for bulling through this step2 workflow; I think yours will be the first third-party friend workflow. :-D |
| 01:09 | muhoo | cool, i hope someone may find it useful. |
| 01:09 | muhoo | other than me, of course. |
| 01:10 | muhoo | is there a wiki for friend i could link it from, so that it could get found? |
| 01:11 | cemerick | I'll add all workflows to the main readme; the openid one will be broken out onto its own shortly, so the table will have at least two rows. ;-) |
| 01:12 | cemerick | muhoo: I'd like to eventually have something like: https://github.com/bnoguchi/everyauth#readme |
| 01:13 | cemerick | of course, with actual links to the implementing libraries, etc. |
| 01:14 | muhoo | btw, this step2 thing supposedly does oauth2 |
| 01:15 | muhoo | i like the idea of having an open source budget |
| 01:15 | cemerick | yeah, I saw that claim; I don't know what to make of it at all (i.e. openid + oauth = huh?) |
| 01:16 | cemerick | It's a new policy experiment on my part. I've been overcommitted w.r.t. open source projects in the past year or so. I'm refocusing business-wise, so certain things need to get trimmed back, at least nominally. |
| 01:17 | muhoo | sounds fair. you've done a lot. |
| 01:17 | muhoo | right now, when i need money, i go looking for work, then when i have enough, i study or do open source stuff, then when it looks like i might run out of money, or if someone calls me with stuff, i work some more :-) |
| 01:18 | cemerick | heh |
| 01:19 | cemerick | well, I don't do contract work, so I need to theoretically be unreasonably strict about time expenditures |
| 01:19 | muhoo | really? i thought you were a contract guy |
| 01:19 | cemerick | I've considered seeing what I could put together re: gigs, but it's perpetually uninteresting to me. |
| 01:19 | cemerick | muhoo: Nah; 100% product since ~2004: http://snowtide.com |
| 01:19 | muhoo | fantastic! |
| 01:20 | muhoo | that's where i want to go next: some kind of cloud service thing where i can get people to pay me $20/mo or something each. |
| 01:20 | cemerick | That's a lie actually; more like ~2006, but everything between 2004 - 2006 was product-related (tweaks, value-add, etc). |
| 01:22 | muhoo | the key to wealth is to make money while you are sleeping :-) |
| 01:23 | cemerick | The wealthy people aren't hanging in irc while grinding away at the next idea. :-) |
| 01:23 | cemerick | But, yeah. |
| 01:29 | muhoo | ah, what to *name* this thing. i refuse to name it clj-step2 |
| 01:31 | cemerick | may I suggest friend-step2? Or perhaps that's too presumptuous. :-) |
| 01:32 | muhoo | QQS! if github will let me do that |
| 01:32 | muhoo | that's the texas 2-step: quick-quick-slow |
| 01:32 | cemerick | *never* would have figured that one :-P |
| 01:33 | muhoo | i lived a few years in dallas, learned some things. |
| 01:35 | LoganLK | will a multiple core processor give a benefit (over a single core) to a large amount of futures running? |
| 01:37 | muhoo | well i could have named it bultitude but that's already taken |
| 01:38 | cemerick | LoganLK: yes, as long as each future is doing enough work to warrant the coordination overhead |
| 01:38 | LoganLK | the future is just a web request.. but i am sending out a lot of them |
| 01:39 | cemerick | yup, perfect |
| 01:39 | brehaut | IO counts as work |
| 01:40 | cemerick | LoganLK: you may want to create N * 4 agents, and send-off those requests instead of eagerly creating futures for your entire work queue, etc. |
| 01:45 | LoganLK | cemerick: i'll look into that. thanks. I'm relatively new to Clojure. I watched your screencast then bought your book. Loving it so far :) |
| 01:45 | cemerick | aw, thanks :-) |
| 01:46 | cemerick | LoganLK: There's an example in the concurrency chapter using agents to efficiently saturate CPU and network with web requests. |
| 02:10 | seanc | anyone tried to install lein-newnew lately? i just tried lein plugin install lein-newew 0.3.1 and got an exception about the ZIP file being empty... |
| 02:21 | seanc | went back to lein-newnew 0.2.2 and it worked, just fyi |
| 02:33 | cljnewb01234 | so I own a copy of "the art of the metaobject protocol:" |
| 02:33 | cljnewb01234 | now, I know that this book is important |
| 02:34 | cljnewb01234 | what I don't understand is -- what am I going to learn by reading it? |
| 02:34 | cljnewb01234 | (it looks litke the type of book that will take time, and I can't just skim) |
| 02:35 | muhoo | cemerick: http://github.com/kenrestivo/qqs |
| 02:36 | cemerick | muhoo: fabulous, will tweet tomorrow |
| 04:30 | kral | namaste |
| 04:31 | edoloughlin | kral: fáilte |
| 04:55 | bobry | hrm, I have a NullPointerException, resulting from an '(assert ...') in a cljs macro, is this a cljsbuild bug? |
| 04:56 | clgv | bobry: hard to tell without the code ;) |
| 05:10 | gfredericks | I get a maven error when depending on domina :/ |
| 05:10 | gfredericks | it says it can't find the clojurescript jar |
| 05:25 | clgv | gfredericks: this are the available versions on clojars: https://clojars.org/domina/versions |
| 05:30 | gfredericks | clgv: yeah, I'm using 1.0.0-beta4 |
| 05:30 | clgv | gfredericks: well that's strange then |
| 05:32 | gfredericks | indeed |
| 05:32 | gfredericks | computers: they don't work |
| 06:11 | muhoo | hmm, doesn't appear to be any way to force lein to grab the latest snapshot version of a jar, if there's no way to get access to the .m2/repository directly, i.e. if on heroku |
| 06:13 | clgv | muhoo: maybe you can use lein2 as a lib to get the resolve+download-from-clojars part for free |
| 06:13 | clgv | or is that maven already? |
| 06:14 | muhoo | i think it's a maven-ism |
| 06:15 | muhoo | note to self: snapshot means DAILY snapshot. no less. |
| 06:15 | clgv | oh. only dates are compared? |
| 06:16 | muhoo | only the day portion, not the time, it appears |
| 06:16 | clgv | ah kk |
| 06:25 | ejackson | huh, that's interesting |
| 07:18 | borkdude | did they really expect static typing would -improve- devtime? http://www.cs.washington.edu/education/courses/cse590n/10au/hanenberg-oopsla2010.pdf |
| 07:27 | ordnungswidrig | borkdude: i think that consequent static typing like in haskell or ocaml attracts better programmers that build better software. Which they would do in a dynamicaly typed language as well. |
| 07:32 | borkdude | Raynes yes, release a new version (does one get notified of closed issues on github)? |
| 07:33 | diso | Hi, in a REPL started with clojure-jack-in using (.println System/out "Hello, world!") returns nil but doe'snt print anything, whilst (println "Hello, world!") works as expected. Can somebody reproduce this? |
| 07:33 | borkdude | diso maybe the reply doesn't use System.out but some other stream? |
| 07:34 | borkdude | repl |
| 07:35 | ordnungswidrig | diso: slime/swank binds *out* to a different stream thatn System/out. This is to send the output to the slime repl. |
| 07:36 | ordnungswidrig | you can look in the buffer *swank* where System/out should go |
| 07:36 | diso | it uses *out*, yes but in a repl startet with java -cp clojure.jar clojure.main both statements print to the repl |
| 07:36 | ordnungswidrig | diso: swank rebinds *out* |
| 07:36 | diso | ah okay i will look there thank you. |
| 07:37 | ordnungswidrig | diso: evaluate *out* in the repl and you will see |
| 07:37 | diso | ordnungswidrig: sorry was typing and not looking to your answer |
| 07:38 | borkdude | ,(identical? System/out *out*) |
| 07:38 | clojurebot | false |
| 07:39 | diso | this will help debugging when using java-interop, since calls from the java lib i was using can then say something to me ;-) |
| 07:46 | diso | ordnungswidrig: after issuing clojure-jack-in i don't have a buffer called *swank*, did you mean the repl-buffer *slime-repl nil*? |
| 07:48 | ordnungswidrig | no, it is called *swank* but I just notices that stdout doesn't go there any more. |
| 07:49 | diso | so, searching for stdout output |
| 07:50 | clojurebot | Gabh mo leithscéal? |
| 08:46 | diso | ordnungswidrig: I'have found the following statement: "in swank, System/out is connected to the terminal of the swank server", so when i start the swank manually with lein swank and connect via M-x slime-connect then I can see my System.out.println output there. |
| 08:46 | ordnungswidrig | diso: hmm, i didn't know that. |
| 08:47 | ordnungswidrig | diso: jack-in behaves differently |
| 08:48 | diso | ordnungswidrig: another statement confirms, that it should go to the *swank* buffer |
| 08:48 | diso | ordnungswidrig: so i'll have to dig deeper |
| 09:44 | borkdude | "However, considering the plethora of JVM languages out there, Clojure’s quick capture of even 1% of the JVM developers is somewhat impressive." http://files.zeroturnaround.com/developer-productivity-report/zeroturnaround-developer-productivity-report-2012.pdf |
| 10:01 | jedmtnman1 | hey, anyone have a link to that heatmap of keyboard characters in clojure.core? google is failing me. |
| 10:01 | jedmtnman1 | or, i am probably failing google |
| 10:03 | TimMc | I'd blame it on Google. Their search stinks these days. |
| 10:03 | TimMc | Or rather, it has gotten very patchy. |
| 10:12 | sergey | do I get it right that it's better not to write recursive functions in clojure because there's no tail recursion optimisation in JVM? |
| 10:13 | sergey | and always replace them with either loop/recur or lazy-seq? |
| 10:13 | S11001001 | there are other reasons to be recursive than list building :) |
| 10:13 | S11001001 | but for those, better yet, the lazy sequence functions |
| 10:14 | Iceland_J | And for list building you rarely -need- to use explicit recursion I feel |
| 10:14 | sergey | for example I have a function which takes as an argument the number of times of its execution I call it recursively with the decremented argument each time, is that ok? |
| 10:15 | Iceland_J | You could zip it together with [n-1 n-2 ... 0] |
| 10:16 | S11001001 | sergey: perhaps (doseq [_ (range n)] (f ...)) for that; or for functional functions, nth and iterate |
| 10:17 | borkdude | recur |
| 10:17 | S11001001 | loop/recur is the worst |
| 10:17 | borkdude | why? |
| 10:17 | clojurebot | borkdude: because you can't handle the truth! |
| 10:17 | clgv | why??? |
| 10:17 | lazybot | clgv: Oh, absolutely. |
| 10:18 | clgv | ;) |
| 10:18 | borkdude | S11001001 what is wrong with loop/recur apart from the fact that you don't often need them because of higher order functions already present? |
| 10:18 | S11001001 | it's anaphoric and gets introduced all the time. Imagine writing all your macros using (if-let [~'it ...] ...). |
| 10:20 | borkdude | S11001001 do you mean it's too "low level"? |
| 10:20 | S11001001 | maybe if this problem hadn't been encountered and fixed before in other lisps it would be forgivable |
| 10:21 | S11001001 | in short, recur should require a symbolic label which refers to a lexical recur-target |
| 10:23 | clgv | S11001001: you are arguing for a goto? :O |
| 10:23 | Hodapp | goto and functional programming... hmmmm |
| 10:23 | S11001001 | clgv: the only difference is that the current recur is a goto (wherever; you pick one, compiler) |
| 10:24 | borkdude | S11001001 you mean like (recur [a 10, b 11]) ? |
| 10:24 | borkdude | S11001001 or (recur fn-foo) ? |
| 10:24 | S11001001 | (fn blah #_"intros ordinary lexical binding & recur-target binding" [x] do-stuff (recur blah (inc x))) |
| 10:25 | borkdude | S11001001 hmm, I don't see the problem really |
| 10:25 | borkdude | S11001001 if you could recur to different targets you could really get a goto-like messy effect |
| 10:25 | S11001001 | you *couldn't* |
| 10:26 | S11001001 | that's not what the feature is for |
| 10:26 | S11001001 | (fn [x] (macro-that-may-intro-recur-target (recur (inc x))) ; where does recur go? |
| 10:26 | S11001001 | that's the problem with anaphora |
| 10:26 | S11001001 | it's easy to just not use aif et al in your macros, because there's a non-anaphoric variant |
| 10:26 | S11001001 | if-let |
| 10:27 | clgv | S11001001: thats specified. it's always the first loop or function that encloses the recur |
| 10:27 | S11001001 | but there's no variant of fn that doesn't intro an anaphoric recur-target |
| 10:27 | Vinzent | how recur-target is anaphoric? |
| 10:27 | S11001001 | clgv: yes, and that's what's fixed by requiring a label |
| 10:27 | gfredericks | S11001001: I think any situation like you describe would make it ambiguous to the programmer that he's in the tail position |
| 10:27 | borkdude | S11001001 what would happen here? (fn foo [x] (loop [a 1] (recur foo 10))) isn't that a bit weird that you could do that |
| 10:27 | gfredericks | not much consolation though |
| 10:28 | joly | isn't 'lexical' a better term here than anaphoric since no new identifier is introduced? |
| 10:28 | S11001001 | borkdude: compilation failure |
| 10:28 | S11001001 | joly: it's an identifier namespace with only one identifier |
| 10:28 | borkdude | S11001001 so the only thing wrong with loop/recur is being explicit about its target? |
| 10:28 | borkdude | not being explicit |
| 10:28 | S11001001 | borkdude: yes |
| 10:28 | borkdude | S11001001 ok understood |
| 10:28 | clgv | S11001001: I just compiled a recur form and see that it is transformed into a for loop |
| 10:29 | S11001001 | yes |
| 10:29 | S11001001 | recurs would still compile into exactly the same thing |
| 10:29 | borkdude | so the message here is: don't use recur in a macro because you don't know what the target will be? |
| 10:29 | S11001001 | no |
| 10:30 | S11001001 | the problem is that you can't use fn or loop in your macros without affecting recur calls in bodies given to the macros |
| 10:30 | borkdude | yes I kind of meant that |
| 10:30 | clgv | S11001001: clojure tells me that 'recur is a special form |
| 10:30 | S11001001 | yes |
| 10:31 | borkdude | S11001001 ah, wait, you are saying don't write a macro that contains recur |
| 10:31 | S11001001 | a macro call |
| 10:31 | borkdude | S11001001 right |
| 10:31 | S11001001 | so, try to write some lisp without using any macros |
| 10:31 | Vinzent | I don't understand - if a macro expansion contains recur, then it also contains enclosing fn or loop. What's the problem? |
| 10:31 | clgv | recur is no macro |
| 10:32 | S11001001 | Vinzent: (fn [x] (macro-that-may-intro-recur-target (recur (inc x))) ; where does recur go? |
| 10:32 | borkdude | S11001001 Vinzent yes, I guess a good "bad example" would help here |
| 10:32 | borkdude | S11001001 what are the macros that could intro recur targets? only look? |
| 10:32 | borkdude | loop |
| 10:32 | S11001001 | fn |
| 10:33 | borkdude | is fn a macro? |
| 10:33 | S11001001 | yes, but even if it wasn't |
| 10:33 | S11001001 | any macro using fn to wrap a body would also intro a recur target |
| 10:33 | S11001001 | like future |
| 10:33 | borkdude | ok so (fn [x] (fn [x] … (recur …)) -> this will be clear to the writer what the target is |
| 10:34 | Vinzent | S11001001, well, if the doc string of the macro says that it introduces recur target, then to macro-that-may-intro-recur-target; otherwise, to fn. Ideally it should be like that :) |
| 10:34 | tmciver | S11001001: I think your example may be a little contrived; why would you write a recur as arg to a macro? |
| 10:34 | borkdude | (fn [x] (loop .. (recur ..)) also clear. have a good example where it really goes wrong? |
| 10:35 | Vinzent | tmciver, well, one could do that and no exception will be throwed, so I think the example is legal |
| 10:35 | S11001001 | tmciver: you would write a recur as an arg to if, or cond, wouldn't you? |
| 10:36 | clgv | S11001001: so what's your aim? what would you do with your recur issue? |
| 10:36 | S11001001 | clgv: I've said what the solution would be |
| 10:37 | joly | similar to Scheme's named let? |
| 10:37 | clgv | S11001001: lost in noise^^ |
| 10:37 | S11001001 | indeed, but with an assertion of tail position |
| 10:37 | S11001001 | clgv: require a label for recur |
| 10:38 | clgv | ah ok. dont know if that is an improvement for most of the programs to be written |
| 10:39 | joly | has there been discussion of what tail calls will look like to other functions once Java gets TCO? |
| 10:39 | borkdude | ok, so: (defn foo [x] (println "fun" x) (future (println "future" x) (println x) (recur))) |
| 10:39 | borkdude | one println too many |
| 10:40 | S11001001 | lazy-seq intros a recur target |
| 10:40 | borkdude | but this indeed has the future as the recur target |
| 10:40 | borkdude | and it doesn't print the arg provided to the function |
| 10:40 | borkdude | btw |
| 10:40 | borkdude | why? |
| 10:40 | clojurebot | http://clojure.org/rationale |
| 10:40 | S11001001 | delay, similarly to future |
| 10:41 | S11001001 | additionally, many body-taking macros can be written entirely in macro form |
| 10:41 | S11001001 | however, it is often more convenient and flexible to write most of the functionality in a function variant, and implement the macro by wrapping the body in a fn |
| 10:41 | S11001001 | that's all future is (it uses future-call) |
| 10:42 | S11001001 | at this time, binding is *not* implemented this way |
| 10:42 | S11001001 | but the decision is more-or-less arbitrary, and can change from version to version |
| 10:44 | S11001001 | interestingly, while binding does not make a recur-target, with-bindings *does* (following the strategy of future) |
| 10:46 | bordatoue | why is arguments passed as an arrayseq, is there a way to gain indexed access to an element in the arrayseq can i use (args 4) to get the fourth element |
| 10:48 | borkdude | (get args 4) |
| 10:48 | borkdude | but generally this isn't what you want I think |
| 10:48 | bordatoue | borkdude: can i use (args 4) |
| 10:48 | borkdude | bordatoue no |
| 10:49 | bordatoue | borkdude: why, i thought it was a collection |
| 10:49 | borkdude | bordatoue you can use destructuring though |
| 10:49 | borkdude | why only vectors, sets and maps behave as functions |
| 10:49 | borkdude | -why |
| 10:50 | gtrak | can you specify a particular recur target within a recur? |
| 10:52 | gtrak | http://stackoverflow.com/questions/8205209/why-argument-list-as-arrayseq |
| 10:53 | bordatoue | Is there any easier way to find out documentation for ArraySeq without using google |
| 10:53 | borkdude | gtrak yeh, that was me in november 2011… ;-) |
| 10:53 | gtrak | lol |
| 10:54 | gtrak | bordatoue: I think lein2 can jump to java sources, but I haven't verified |
| 10:59 | clgv | bordatoue: why? it is an implementation detail |
| 11:00 | clgv | bordatoue: if it's a seq you can use `nth` thats what destructuring do as well |
| 11:01 | bordatoue | clgv: how can i tell from a method signature which one implements ISeq and which one is a part of collections |
| 11:01 | clgv | ParsingException |
| 11:02 | bordatoue | is there an equivalent of type as in python |
| 11:02 | clgv | ,(type []) |
| 11:02 | clojurebot | clojure.lang.PersistentVector |
| 11:02 | clgv | ,(ancestors (type [])) |
| 11:02 | clojurebot | #{java.lang.Iterable clojure.lang.IPersistentCollection java.util.Collection java.io.Serializable java.lang.Comparable ...} |
| 11:03 | bordatoue | thanks |
| 11:05 | clgv | ,(g 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) |
| 11:05 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: g in this context, compiling:(NO_SOURCE_PATH:0)> |
| 11:05 | clgv | lol. nvm |
| 11:06 | bordatoue | ,(print *e) |
| 11:06 | clojurebot | #<Unbound Unbound: #'clojure.core/*e> |
| 11:06 | bordatoue | ah ah |
| 11:09 | nDuff | Hmm. |
| 11:13 | amalloy | *e, *1, and friends are only bound in a real repl, not in clojurebot's approximation |
| 11:14 | amalloy | gtrak: no, you can't specify a recur target |
| 11:15 | gtrak | 1.5 needs goto :-) |
| 11:17 | duck1123 | I bet you could do some amazing things with the inclusion of goto. And every one of them should be punishable by death. |
| 11:17 | nDuff | How can I temporarily unbind clojure.lang.Compiler/LOADER? |
| 11:18 | bordatoue | is the ISeq similar to yield in python |
| 11:18 | nDuff | (it's using a DynamicClassLoader bound to a classloader that can't actually access some things I'm trying to reach) |
| 11:18 | nDuff | bordatoue: ...given as yield is a language keyword and ISeq is a protocol, no? |
| 11:19 | nDuff | bordatoue: ...now, if the question is whether ISeq can be used to expose lazily-generated values, the answer is yes |
| 11:19 | nDuff | bordatoue: ...but it's used for much more than _only_ that. |
| 11:19 | bordatoue | nDuff: that was what i was alluding to |
| 11:19 | nDuff | bordatoue: ...sequences which aren't lazy at all can and do also implement ISeq |
| 11:20 | nDuff | bordatoue: ...by the way, Python also has an iterator protocol, which would be a closer match |
| 11:20 | bordatoue | nDuff: is there a way to reset this behaviour |
| 11:20 | nDuff | ...reset which behavior? |
| 11:21 | nDuff | ("reset"?) |
| 11:21 | bordatoue | generation of elements |
| 11:21 | nDuff | If you mean you want to go back to the head of a sequence, just don't lose the head in the first place. |
| 11:21 | nDuff | Sequences aren't stateful. |
| 11:21 | nDuff | ...so "resetting" them has no meaning. |
| 11:21 | nDuff | ...well... |
| 11:22 | nDuff | ...eh. "Don't lose the head in the first place" still holds. |
| 11:22 | nDuff | Basically -- iterating through a sequence doesn't change or invalidate a pointer to any other place in the sequence |
| 11:22 | nDuff | ...it just gives you new pointers to later locations |
| 11:22 | nDuff | so there's nothing that ever needs to be reset. |
| 11:23 | gtrak | bordatoue: no, you should really treat the contents as values and not use it for side-effects |
| 11:23 | bordatoue | how is this sequence implemented internally |
| 11:24 | nDuff | bordatoue: ISeq is an interface. Interfaces have no implementations. |
| 11:25 | nDuff | bordatoue: ...so different types implementing ISeq have separate implementations. |
| 11:27 | bordatoue | nDuff: I am refering to seq |
| 11:27 | nDuff | bordatoue: ...and (seq foo) does completely different things depending on what foo is |
| 11:27 | bordatoue | nDuff: why should seq be lazy, |
| 11:28 | gtrak | fp troll: (defn a [b] (label ::c (d b))) (defn e [f] (let [b f] (goto ::c))) |
| 11:29 | nDuff | bordatoue: ...because the interface is defined in such a way that it's possible for implementations to be lazy? Which is not to say that every one of them _is_, simply that they _can be_. |
| 11:29 | nDuff | bordatoue: If you're genuinely curious about implementation details, I'd suggest downloading the source to Clojure and reading through a bit. It's actually not that hard, and very much enlightening. |
| 11:30 | clgv | bordatoue: it seems to be time for an introductory clojure book, don't you think? |
| 11:30 | bordatoue | if seq is used on java arrays, why should it be lazy what advantage does it offer. If i have recursive method that uses seq then it will not work due to single pass behaviour |
| 11:30 | nDuff | bordatoue: that's not true. |
| 11:31 | nDuff | bordatoue: (that latter part, that is) |
| 11:31 | nDuff | bordatoue: ...you might _think_ it's true, because you expect Clojure sequences to behave like Python iterators, which are stateful |
| 11:31 | nDuff | bordatoue: ...but they aren't stateful, so you can use them recursively just fine. |
| 11:31 | nDuff | bordatoue: ...I'm inclined to agree with clgv here -- some dead-tree reading would be helpful. |
| 11:33 | nDuff | s/stateful/mutable/ (to be more accurate) |
| 11:34 | gtrak | actually I think it's possible to implement this goto thing |
| 11:34 | gtrak | I just have to add some indirection to the lexical bindings within a label |
| 11:35 | nDuff | I know it's possible to unbind a var's root definition using Var.unbindRoot(), but is there a sane way to push Unbound onto the stack (ie. to do so temporarily)? |
| 11:38 | amalloy | nDuff: i don't think so. i'm curious why you'd want to? |
| 11:39 | nDuff | amalloy: I want to temporarily unset clojure.lang.Compiler/LOADER, such that a new DynamicClassLoader is generated based on the current thread context classloader |
| 11:40 | nDuff | ...actually, thinking about that, it'd be better just to cache one, such that I don't have a bunch of un-GC-able classloaders sitting around in memory... |
| 11:40 | amalloy | nDuff: and you can't just bind it to nil because someone is checking whether the var is bound? |
| 11:40 | Hodapp | maaaan, some people really love their static type systems |
| 11:41 | amalloy | Hodapp: they're pretty cool! i'd be happy to have one like haskell's available in clojure |
| 11:42 | nDuff | amalloy: ...right, though I _can_ just call (RT/makeClassLoader) and rebind it myself. Going that route. |
| 11:44 | nDuff | Huh. clojure.lang.Compiler/LOADER evals to "#<Var: --unnamed-->", but (binding [clojure.lang.Compiler/LOADER (clojure.lang.RT/makeClassLoader)] true) yields "CompilerException java.lang.RuntimeException: Unable to resolve var: clojure.lang.Compiler/LOADER in this context, compiling:(NO_SOURCE_PATH:1)" |
| 11:46 | amalloy | nDuff: try with-bindings* |
| 11:47 | amalloy | bindings expects to be given a symbol which ns-resolves to a var; that's an expression which evaluates to a var |
| 11:47 | amalloy | or actually with-bindings is probably good enough |
| 11:48 | Hodapp | amalloy: well, it boils down to the assertion that the only code that should be written is code that is sufficiently constrained to be amenable to particular types of automated proofs of certain aspects of its behavior. |
| 11:50 | amalloy | Hodapp: that sounds like a strawman. why shouldn't i say the same thing about functions? life was better with GOTOs, when the compiler/assembler could trust me to decide what the instruction pointer should be, instead of proving that i only jump to designated "function begin" points |
| 11:51 | Hodapp | amalloy: How is this a strawman? This is precisely what static type systems are. |
| 11:51 | Hodapp | amalloy: More or less by definition. |
| 11:51 | Chiron_ | Hi, I want to use clojure to code storm transaction topology such as this one: https://github.com/nathanmarz/storm-starter/blob/master/src/jvm/storm/starter/TransactionalGlobalCount.java |
| 11:51 | amalloy | yes, but it's such a general statement that it's also what every other compiler does |
| 11:51 | Chiron_ | I thought about reify but not sure what about the instance variables |
| 11:51 | amalloy | anything more complicated than ASM falls under your criticism |
| 11:52 | Hodapp | amalloy: Calling that a criticism is a strawman. |
| 11:52 | amalloy | okay, bro |
| 11:52 | Hodapp | amalloy: So you're basically telling me that what I said is true, but it's not a valid criticism. |
| 11:53 | Hodapp | amalloy: That's fine. It wasn't meant as a criticism, so it not being a valid criticism isn't really relevant. |
| 11:54 | Hodapp | amalloy: The point is that it's just one form of constraining the code - in this case, constraining it to that which the type system may prove things about. There are multiple other ways of constraining the code, and multiple other ways of reasoning about the code whether through automated proofs (as in a static type system) or by hand. |
| 11:56 | Hodapp | The criticism is not that it's constraining the code, but rather that it's an assertion that that is the de facto correct way of doing it. |
| 11:56 | Hodapp | What if you need a level of dynamism it will not allow? |
| 11:56 | Chiron_ | sorry guys, any help? |
| 11:57 | amalloy | Hodapp: i don't think i would want clojure to have a required static-type system, agreed |
| 11:57 | Hodapp | amalloy: It would be within the realm of possibility to have macros be generated in a way about which similar automated proof is possible, for instance. |
| 11:57 | amalloy | Hodapp: what static-typing languages have you used? |
| 11:58 | Hodapp | amalloy: Well, C++, Java, C if that counts... and Scala and a little OCaml. |
| 11:58 | Hodapp | I quite like Scala's. OCaml I have not gotten into much detail with. |
| 11:58 | hyPiRion | Chiron_: If you receive no answer, chances are people either don't know or are busy doing other stuff :) |
| 11:58 | Hodapp | Haskell is on my list. |
| 11:59 | amalloy | *nod* the only one i've liked is haskell, but i haven't tried ocaml and have barely touched scala |
| 11:59 | Chiron_ | hyPiRion: sorry yes I know |
| 11:59 | Hodapp | in Scala it's like it's hardly there half the time; the type inference is quite good |
| 11:59 | amalloy | IME you don't actually need the "dynamism" you bring up, in a language like scala or haskell where the static typing isn't crap |
| 12:00 | Hodapp | I'm not sure that said dynamism can be ruled out in all cases. |
| 12:00 | hyPiRion | Chiron_: No worries, just sayin'. |
| 12:00 | gtrak | I can't help but think in terms of contracts anyway, I've had a little trouble adjusting to the looseness of it |
| 12:01 | Hodapp | I believe there are probably usages where you are either going to use something dynamic, or you're going to end up inventing your own with the same consequences but a bit uglier. |
| 12:01 | amalloy | could be |
| 12:02 | gtrak | like... 'function b calls input-stream on its arg' is a lot like 'function b expects this arg to be of the type of things that input-stream can be called on' |
| 12:03 | gtrak | I feel like I'm creating anonymous types in my mind when i read the code |
| 12:03 | Chiron_ | so maybe in another way, how to extend a Java class in Clojure and add some instance variables to the extended class? |
| 12:03 | nDuff | Hrm; there's something more than I thought going on here -- setting both the thread context classloader _and_ Compiler/LOADER still doesn't work. https://gist.github.com/dd7cfb33fdcf3a1d3e3a |
| 12:05 | hyPiRion | Chiron_: My usual way of doing it would be to create a java-file, compile it and refer to it through require or something like that. Leiningen makes it rather simple to do. |
| 12:06 | hyPiRion | Or is the goal to do it in Clojure? |
| 12:06 | Chiron_ | hyPiRion: i want to do it in Clojure |
| 12:07 | Chiron_ | if it is not possible to extend and add instance vars in clojure, maybe a better option to use another jvm language -scala/jruby- in this case |
| 12:07 | Chiron_ | extends sure is doable in clojure but what about adding instance vars? |
| 12:08 | hyPiRion | I haven't worked much with java-interop, but have you read http://clojure.org/java_interop#Java%20Interop-Implementing%20Interfaces%20and%20Extending%20Classes ? |
| 12:09 | hyPiRion | Look at http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/gen-class - it seems like there's some way of doing it there. |
| 12:09 | lazybot | Nooooo, that's so out of date! Please see instead http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/gen-class and try to stop linking to rich's repo. |
| 12:09 | hyPiRion | Sorry lazybot :( |
| 12:10 | rvgate | using webnoir sessions, im trying to change a value stored within the session... (+ (session/get :credits) 5), but for some reason this gives me a class cast exception... |
| 12:10 | S11001001 | Chiron_: in case this isn't clear, java classes are not the usual tool for modeling problems in clojure; they are avoided except where needed for interfacing with some bit of java |
| 12:11 | Chiron_ | Yes I know but I'm trying to code this in pure Clojure https://github.com/nathanmarz/storm-starter/blob/master/src/jvm/storm/starter/TransactionalWords.java |
| 12:11 | Chiron_ | as you see, KeyedCountUpdater define a couple of instance variables |
| 12:12 | S11001001 | Chiron_: so don't do a one-to-one translation; use clojure-appropriate abstractions instead, like maps to represent data structures |
| 12:12 | hyPiRion | rvgate: use session/swap! instead? |
| 12:12 | hyPiRion | (session/swap! :credits + 5) |
| 12:13 | Chiron_ | my problem is how to code KeyedCountUpdater in Clojure? no problem with extending/implementing other classes/interfaces . but what about defining new instance variables? |
| 12:13 | S11001001 | {:counts {} :collector (stuff here) :id (stuff here)} |
| 12:14 | S11001001 | don't extend any classes, don't implement any interfaces |
| 12:14 | rvgate | hyPiRion, same thing.. classcast exception |
| 12:14 | hyPiRion | Weird. You sure the value is a number? |
| 12:14 | S11001001 | if you need to capture data in the implementation of a thing that must be a java interface, the lexical context of a reify will satisfy that need |
| 12:15 | rvgate | hyPiRion, yes |
| 12:16 | technomancy | muhoo: if you need snapshots to update you should probably use frozen timestamped snapshots |
| 12:16 | technomancy | muhoo: unless you're not in production; then you can use lein2's :snapshots :always policy in project.clj |
| 12:16 | rvgate | hyPiRion, (if (nil? (session/get :credits)) (session/put! :credits 10)) |
| 12:17 | hyPiRion | And that doesn't work? |
| 12:17 | rvgate | hyPiRion, just showing that its a number |
| 12:18 | hyPiRion | Ah. Then I have no clue. |
| 12:19 | bordatoue | is anyone using counterclockwise eclipse plugin |
| 12:20 | bordatoue | I have included :gen-class but I can't see any class files generated |
| 12:20 | bordatoue | is there any other commands that needs to be specified |
| 12:24 | muhoo | technomancy: i've got a new problem now. the upstream maintainer of this library (ahem, google) doesn't do version numbering. it's just "1-SNAPSHOT". but lein is unhappy with that when making jars |
| 12:24 | muhoo | it's been 1-SNAPSHOT for 4 years now :-( |
| 12:25 | technomancy | good hell |
| 12:25 | muhoo | so, should i fork it and publish it with a new groupid? |
| 12:25 | muhoo | or should i put it up on clojars with the original groupid, but a proper non-snapshot number? |
| 12:25 | technomancy | first closure releases and now this; what is wrong with google? |
| 12:26 | technomancy | if they deploy correctly you should still be able to use frozen timestamped snapshots |
| 12:26 | technomancy | but I don't put a lot of hope into them getting that right |
| 12:26 | muhoo | is there a tut somewhere on dealing with frozen timestamped snapshots? |
| 12:26 | muhoo | also, will lein let me build a jar if i depend on one? |
| 12:26 | technomancy | definitely |
| 12:27 | technomancy | in lein1 you just do `ls lib` and you can find the frozen snapshot numbers |
| 12:28 | technomancy | in lein2 `lein deps :tree` will show the frozen version number |
| 12:28 | muhoo | oh, ok. so i depend on [foo "0.1.0-20120608.093814-4"] then? |
| 12:29 | technomancy | yeah that should do it |
| 12:32 | muhoo | that worked great for my lein-built library. as for my maven-built google library, not so much. it's literally "1-SNAPSHOT" in lein2 tree and in lein1 ~/m2/repository |
| 12:32 | technomancy | yeah, it means google screwed up their deploy |
| 12:32 | technomancy | I assume you've reported a bug? =\ |
| 12:32 | muhoo | well, i did the deploy. so i screwed it up |
| 12:33 | muhoo | i built it form their source. they screwed up the version non-numbering :-) |
| 12:33 | technomancy | oh, they don't even put it in a repository? |
| 12:33 | technomancy | eep |
| 12:33 | technomancy | that's several times worse |
| 12:33 | muhoo | it's in svn |
| 12:33 | muhoo | come on, this is google we're talking about: the IBM of the 21st cen |
| 12:34 | technomancy | bloody unprofessional |
| 12:34 | muhoo | afaict, this thing isn't in maven anywhere |
| 12:34 | technomancy | make some noise on the bug tracker; they should feel guilty about this |
| 12:35 | technomancy | if you use `mvn deploy` you should have numbered snapshots I believe |
| 12:36 | bordatoue | is it possible to check if :gen-class is working from the repl |
| 12:37 | muhoo | hahaha, mvn deploy does this: https://www.refheap.com/paste/3056 |
| 12:37 | muhoo | it wants me to sign in in order to deploy! presumably to their internal mvn repo |
| 12:38 | muhoo | whiskey. tango. foxtrot. |
| 12:40 | technomancy | oh yeah, you'd have to switch up the target repository |
| 12:41 | muhoo | i was in the target repo. there are several stacked targets, with a parent that is kind of a stub with common deps |
| 12:41 | muhoo | and... in a sub repo, same authentication message Authentication realm: <https://step2.googlecode.com:443> Google Code Subversion Repository |
| 12:42 | muhoo | oh nevermind |
| 12:42 | muhoo | there's got to be a maven way to tell it which repo to use. i'll have to read up on this |
| 12:43 | muhoo | technomancy: thanks, i think i got it now |
| 12:55 | muhoo | technomancy: wait, no, this sucks. if i'm depending on a library that is perpetually in 1-SNAPSHOT, then i'm always going to have to have people depend on my snapshot dated jars, i.e. "0.1.0-2012xxxx" |
| 12:57 | amalloy | i don't see why. you don't have to make your own library a snapshot version |
| 12:57 | technomancy | muhoo: pretty sure the alternatives are worse =\ |
| 12:57 | gfredericks | which tool is it that won't let you depend on snapshots unless your own lib is a snapshot? |
| 12:58 | gfredericks | there must be something because I defenitely had to push some else's lib up to clojars once so I could make a non-snapshot release |
| 12:59 | technomancy | gfredericks: you can make releases that depend on frozen snapshots with lein |
| 12:59 | diso | quit |
| 12:59 | technomancy | just not nondeterministic snapshots |
| 12:59 | gfredericks | ah okay; is it lein that makes that restriction? |
| 12:59 | gfredericks | or maven? |
| 12:59 | technomancy | lein |
| 12:59 | gfredericks | okay |
| 13:00 | gfredericks | (inc lein) |
| 13:00 | lazybot | ⇒ 1 |
| 13:00 | muhoo | ok, i think i got it. i can make my lib depend on a dated frozen snapshot. then my lib doesn't have to be a snapshot, it can be a release. problem solved, i think. |
| 13:00 | muhoo | the b0rken google lib can be a snapshot, i don't give a damn. as long as mine doesn't have to be. |
| 13:01 | technomancy | aye |
| 13:07 | muhoo | every minute that i have to deal with maven, i give thanks to leiningene |
| 13:08 | gfredericks | Abraham Lincoln felt that so strongly he made it a national holiday |
| 13:08 | Hodapp | muhoo: curiously, I was in #java and had an Ant question. They promptly chased me up a tree and lit it on fire to try to get me to not only use Maven but to swear allegiance to Maven. |
| 13:09 | muhoo | well maven > ant, but leiningen > maven, imho |
| 13:11 | nDuff | muhoo: ...depends on the use case. Building JIRA plugins, for instance, Leiningen isn't so much the right tool. |
| 13:12 | borkdude | if you guys like playing hangman on heroku programmed in clojure, some of my students just sent their link: http://clojurehangman.herokuapp.com/ |
| 13:12 | borkdude | =) |
| 13:13 | Hodapp | I liked the simplicity of Ant, really. |
| 13:13 | technomancy | borkdude: pretty cool =) |
| 13:13 | bordatoue | could anyone please guide me on how to create a fat jar using counterclockwise plugin |
| 13:14 | bordatoue | i can't imagine the number of steps required to attain simple things such as a executable jar |
| 13:14 | borkdude | bordatoue just "lein uberjar" from the console |
| 13:15 | bordatoue | borkdude: please can you tell me how to do it with eclipse |
| 13:15 | technomancy | IIRC task invocation hasn't been implemented yet in CCW? |
| 13:15 | borkdude | bordatoue I wouldn't know how to do it with eclipse, I never needed to |
| 13:15 | bordatoue | borkdude: lein seems to work , but i need to work with eclipse as well |
| 13:27 | josteink | about clojure and web |
| 13:27 | josteink | is noir considered the standard web framework for clojure or should I also look into other stuff? :) |
| 13:27 | ejackson | josteink: pretty standard |
| 13:28 | josteink | I must admit I didnt pay that much attention. NDC has a "overflow" room with projectors covering ALL sessions in paralell |
| 13:28 | josteink | so I was jumping between that, billy hollis on UX and async in C# |
| 13:29 | josteink | guess Ill go look for some more detailed samples |
| 13:29 | amalloy | josteink: noir is easiest. it's also popular to just use the layer underneath it (compojure) directly |
| 13:29 | josteink | while C# suffers from inability for language users to -extend- the language itself, the async stuff was pretty good |
| 13:29 | josteink | but would be neat to fool around with something which isnt my day to day language ;) |
| 13:30 | josteink | amalloy: thanks for the tip. I guess Ill start at the top and work my way down if things starts feeling icky ;) |
| 13:30 | borkdude | josteink noir is easy - I teached some students only 5 lessons of clojure and they already could come up with Hangman in noir: http://clojurehangman.herokuapp.com/ |
| 13:30 | ystael | Is there a general principle for what causes "IllegalStateException: Attempting to call unbound fn" at runtime in code that was perfectly happy at compile time? I don't think I'm doing anything clever with fn bindings. |
| 13:30 | josteink | borkdude: nice |
| 13:31 | borkdude | (others are building an irc client using seesaw) |
| 13:32 | S11001001 | ystael: look at the frame where the throw happens; the var get should be under where you use it |
| 13:32 | amalloy | well, for example (declare x) (defn y [] (x)) (...never define x...) |
| 13:32 | borkdude | have their ever been 500 people in this room at the same time? |
| 13:32 | amalloy | yes |
| 13:33 | josteink | borkdude: Ive written enough raw protocol level irc-code in enough languages to be very decided on the fact that Im not doing that again ;) |
| 13:33 | borkdude | josteink I saw a tweet about NDC/Clojure, but I'm curious who presented what |
| 13:33 | josteink | borkdude: some chick I have not heard about before. bodill stokke or something. |
| 13:33 | borkdude | josteink they keep it simple and probably unfinished proof of concept |
| 13:33 | josteink | borkdude: she was trying to overplay cool/humerous IMO |
| 13:33 | josteink | but ah well |
| 13:33 | josteink | she kept the code fairly managable |
| 13:34 | borkdude | at least clojure picks up chicks, maybe clojure is a brogrammer language? |
| 13:34 | borkdude | :P |
| 13:34 | josteink | https://twitter.com/#!/bodiltv |
| 13:34 | ystael | S11001001: I see the call that fails, I just don't understand why it fails... The fn in question is the ->Type of a defrecord which is required and properly namespace-referenced at the call site |
| 13:35 | borkdude | josteink cool tnx |
| 13:35 | Hodapp | curiously enough, I found out on date #2 that my current girlfriend is a Linux user. |
| 13:35 | pepijndevos | what does Clojure use to transform * to __STAR__ or something? |
| 13:35 | josteink | borkdude: NDC typically publishes videos of ALL sessions some time after the conference |
| 13:35 | Hodapp | she never thought much of it. Her brother put it on her netbook after her Windows install killed itself, and since she could still browse and play her music she didn't care. |
| 13:35 | S11001001 | ystael: check ->Type and (meta #'->Type) |
| 13:35 | josteink | borkdude: in case you are interested. but it was way more clojure talks last year |
| 13:35 | ystael | S11001001: ok, will do, thank you! |
| 13:36 | borkdude | Hodapp well that is how some linuxens are intended right |
| 13:37 | borkdude | josteink this looks interesting https://github.com/bodil/catnip |
| 13:38 | josteink | I mean... not linux itself, just the crappy desktop environments :P |
| 13:38 | josteink | borkdude: nice |
| 13:39 | Hodapp | borkdude: I just find it kind of hilarious since I have plenty of friends who, if they were asking about said girlfriend, the first question they'd get out of the way is "Does she use Linux?" |
| 13:39 | borkdude | Hodapp ah well |
| 13:39 | josteink | the first thing my GF asked when she saw my KDE machine was "That looks like a computer from the stone age" |
| 13:39 | josteink | cant say I blame her :P |
| 13:40 | Hodapp | when I lugged my newly-built computer into college, some people there had literally never seen a tower before |
| 13:40 | josteink | uh |
| 13:40 | Hodapp | Some thought it was from the stone age. Others thought it was a goddamn Gibson. |
| 13:40 | josteink | laptops havent been the standard for -that- long |
| 13:40 | josteink | unless you are 15 years old |
| 13:40 | borkdude | Hodapp I met my girlfriend/wife in a chatroom, we added each other on ICQ to continue our conversation about topology (math) |
| 13:40 | technomancy | josteink: pffft; that's nothing: http://p.hagelb.org/glasstty.png |
| 13:40 | borkdude | Hodapp math girls… |
| 13:40 | josteink | technomancy: heh |
| 13:41 | josteink | technomancy: is that like emacs OS or what? :P |
| 13:41 | technomancy | josteink: "emacs OS" is redundant =) |
| 13:41 | technomancy | it's just emacs in a full-screen terminal with the glasstty font |
| 13:41 | ystael | S11001001: interesting. the var metadata is {:ns #<Namespace the.ns>, :name ->Type} and (prn ->Type) prints as #<Unbound Unbound: #'the.ns/->Type> |
| 13:42 | Hodapp | technomancy: is this what the Overtone demo used? |
| 13:42 | ystael | This is an aot-compiled jar loaded into a groovy interpreter, I expect that has something to do with it |
| 13:42 | technomancy | Hodapp: I think that was a custom terminal program. this is just gnome-terminal with a fancy font. |
| 13:42 | Hodapp | ah, okay |
| 13:42 | borkdude | this is pretty cool, has anyone tried it? https://github.com/bodil/catnip |
| 13:42 | Hodapp | I did like that Overtone demo. Too bad I'm music-tarded. |
| 13:43 | septomin | there's some terminal for mac that distorts the screen like a CRT |
| 13:43 | amalloy | ystael: you have to init the clojure runtime, probably |
| 13:43 | Hodapp | why not just use a real CRT >:( |
| 13:43 | Hodapp | better color! |
| 13:44 | josteink | CRT :( |
| 13:44 | septomin | i actually considered looking for a CRT after buying my first atari 2600 recently |
| 13:44 | ystael | amalloy: before any non-aot-compiled call will work? |
| 13:44 | josteink | oooh. I tried hooking my old amiga 1200 up to me LCD 40" HDTV |
| 13:44 | josteink | let me just now NOT recommend that |
| 13:45 | Hodapp | if I had the desk space I'd get one of those old Sun or SGI ones that needed a forklift to move and set off car alarms outside when you turn them on |
| 13:45 | josteink | I think the LCD TV came out confused of that occation too. I mean... the odd interlacing and all :P |
| 13:45 | Hodapp | those had the best image and color I've ever seen |
| 13:45 | septomin | my tv was fine, it just seemed weird to have these perfectly defined rectangles |
| 13:47 | Hodapp | septomin: yeah, this is why things like scale2x were made I guess |
| 13:48 | Hodapp | or hq3x... https://en.wikipedia.org/wiki/Scale2x#hqnx_family |
| 13:48 | Hodapp | those techniques are neat from the standpoint of basically being LUTs, very easy to do |
| 13:48 | borkdude | I'll say it one last time ;-) : this is cool! https://github.com/bodil/catnip |
| 13:49 | josteink | so out of curiousity.... I saw this talk about hadoop today. saw it was JVM based and all |
| 13:49 | josteink | anyone tried clojure with hadoop? :P |
| 13:49 | Hodapp | borkdude: could you repeat whatever you just said? |
| 13:49 | borkdude | I'll say it one last time ;-) : this is cool! https://github.com/bodil/catnip |
| 13:49 | Hodapp | BAHAHAHA |
| 13:49 | borkdude | :P |
| 13:49 | technomancy | josteink: most people who need hadoop use cascalog |
| 13:49 | technomancy | you can do raw hadoop, but it isn't fun |
| 13:50 | S11001001 | ystael: try loading the clojure module before waking up the class |
| 13:50 | S11001001 | oh, n/m |
| 13:51 | ystael | I'm guessing I'm in some state where anything that requires the binding of a var to be found will fail? |
| 13:52 | pepijndevos | How does Clojure turn symbols with non-alphanumeric characters into something Java understands? |
| 13:52 | amalloy | pepijndevos: it's in Compiler somewhere |
| 13:53 | pepijndevos | amalloy, erm, ok, so not something I'm supposed to actually use I guess :( |
| 13:53 | amalloy | &clojure.lang.Compiler/CHAR_MAP |
| 13:53 | lazybot | java.lang.SecurityException: You tripped the alarm! class clojure.lang.Compiler is bad! |
| 13:53 | amalloy | ,clojure.lang.Compiler/CHAR_MAP |
| 13:53 | clojurebot | {\@ "_CIRCA_", \! "_BANG_", \" "_DOUBLEQUOTE_", \# "_SHARP_", \% "_PERCENT_", ...} |
| 13:53 | pepijndevos | I was hoping something like clojure.core/garble |
| 13:54 | pepijndevos | nice |
| 13:54 | amalloy | ,(clojure.lang.Compiler/munge "empty?") |
| 13:54 | clojurebot | "empty_QMARK_" |
| 13:54 | technomancy | so ring requires its session secret for encrypting cookie data be 16 bytes |
| 13:55 | ystael | this is extra interesting because it works from jruby but not from groovy |
| 13:55 | technomancy | would it be appropriate to use post-conditions to enforce that? |
| 13:55 | ystael | so some aspect of how things are getting initialized is different |
| 13:55 | pepijndevos | amalloy, thanks |
| 13:57 | technomancy | also, why is the issue tracker on ring disabled? |
| 13:57 | amalloy | pepijndevos: btw, you could find that just by searching for _QMARK_ in the clojure source |
| 13:59 | hyPiRion | One question there though |
| 13:59 | pepijndevos | amalloy, hm, true. I couldn't remember when clojure generated these, and which ones. |
| 13:59 | hyPiRion | would (def a_QMARK_ ...) and (def a? ...) conflict? |
| 14:00 | amalloy | hyPiRion: you can try that faster than you can ask the question |
| 14:01 | ystael | S11001001, amalloy: i think i figured it out, thanks for your help |
| 14:03 | hyPiRion | ,(fn a? []) |
| 14:03 | clojurebot | #<sandbox$eval27$a_QMARK___28 sandbox$eval27$a_QMARK___28@62d22770> |
| 14:04 | hyPiRion | ,(fn a_QMARK[]) |
| 14:04 | clojurebot | #<sandbox$eval55$a_QMARK__56 sandbox$eval55$a_QMARK__56@2375b4dd> |
| 14:04 | hyPiRion | They're equivalent without the gensym-append. |
| 14:05 | borkdude | hyPiRion try with defn, does it matter? |
| 14:05 | hyPiRion | Oh, I know their names refer to different objects in Clojure. |
| 14:06 | S11001001 | so even aoted you wouldn't get a conflict |
| 14:07 | borkdude | if I defn a_QMARK_: #<user$a_QMARK_ user$a_QMARK_@12b8501d> |
| 14:07 | borkdude | and defn a? #<user$a_QMARK_ user$a_QMARK_@1330b13c> |
| 14:07 | gfredericks | :/ |
| 14:07 | borkdude | so how does this work? |
| 14:08 | gfredericks | probably just "don't do that" |
| 14:08 | borkdude | gfredericks still I don't get a conflict in the repl |
| 14:08 | hyPiRion | It hides the gensym-number, I suppose. |
| 14:08 | S11001001 | ,first |
| 14:08 | clojurebot | #<core$first clojure.core$first@25a81332> |
| 14:09 | gfredericks | the gensym-number? |
| 14:09 | S11001001 | maybe not |
| 14:09 | S11001001 | ,(class first) |
| 14:09 | clojurebot | clojure.core$first |
| 14:09 | S11001001 | well now |
| 14:09 | S11001001 | make class, instantiate, replace class, instantiate |
| 14:10 | hyPiRion | ,[(fn a?[]) (gensym "a_QMARK_") (fn a?[])] |
| 14:10 | clojurebot | [#<sandbox$eval133$a_QMARK___134 sandbox$eval133$a_QMARK___134@6baacbb8> a_QMARK_139 #<sandbox$eval133$a_QMARK___136 sandbox$eval133$a_QMARK___136@67eb04cf>] |
| 14:10 | gfredericks | ah yeah |
| 14:10 | gfredericks | the two classes are not identical? |
| 14:11 | hyPiRion | the functions, you mean? |
| 14:11 | gfredericks | (identical? (class a?) (class a_QMARK_)) |
| 14:11 | S11001001 | ,(identical? (do (defn x[]) (class x)) (do (defn x[]) (class x))) |
| 14:11 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 14:11 | S11001001 | heh |
| 14:12 | borkdude | S11001001 false |
| 14:12 | hyPiRion | ,(class a_QMARK_) |
| 14:12 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a_QMARK_ in this context, compiling:(NO_SOURCE_PATH:0)> |
| 14:14 | gfredericks | it's odd the jvm allows it |
| 14:14 | solussd | is there a way to 'dump' your current namespace (in the repl) so you can restore require/use 'd libraries? |
| 14:15 | gfredericks | (ns user1234) |
| 14:15 | hyPiRion | just change from one ns to another |
| 14:16 | solussd | by dump I meant print out all the currently required/used namespaces, not 'get rid of'. :) |
| 14:16 | technomancy | it would be awesome if namespaces printed as their ns form |
| 14:17 | borkdude | so how does clojure distuingish between a defned function called a? and a_QMARK_ ? |
| 14:17 | solussd | one of these days I'll give consolidating all the nice things I want in my repl into a library.. (un-intern symbols, dump ns, etc) |
| 14:18 | hyPiRion | solussd: I'd probably look at the ns- functions |
| 14:18 | S11001001 | borkdude: because it doesn't use class names for stuff |
| 14:19 | technomancy | (defmethod print-method clojure.lang.Namespace [x writer] (print-method `(ns (.getName x) [...]) writer)) ; plz |
| 14:19 | borkdude | S11001001 clojure doesn't use the emitted classes? |
| 14:20 | technomancy | hm; I wonder if namespaces have enough info in their fields to reconstruct the ns form from them...! |
| 14:20 | amalloy | technomancy: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.lang.String |
| 14:21 | amalloy | or no, you were cleverer than that |
| 14:21 | amalloy | sneaky |
| 14:21 | solussd | hyPiRion: what's "ns-functions"? |
| 14:22 | borkdude | S11001001 when would this become problematic, only when calling these functions from Java or what? |
| 14:22 | amalloy | technomancy: i don't think they do |
| 14:22 | hyPiRion | ,(ns-imports *ns*) |
| 14:22 | hyPiRion | etc |
| 14:22 | clojurebot | {ProcessBuilder java.lang.ProcessBuilder, Enum java.lang.Enum, SuppressWarnings java.lang.SuppressWarnings, Throwable java.lang.Throwable, InterruptedException java.lang.InterruptedException, ...} |
| 14:23 | solussd | ah |
| 14:23 | technomancy | amalloy: yeah it looks like it has refer info but not require-as |
| 14:23 | technomancy | at least according to the slime inspector |
| 14:23 | S11001001 | borkdude: and you don't call clojure functions from java by referring to the class that happens to implement the function, particularly as it probably doesn't exist while you're compiling java |
| 14:24 | technomancy | oh, not true; ns-aliases |
| 14:24 | amalloy | technomancy: funny, i read it as the other way around. maybe it has both |
| 14:25 | technomancy | C-c S-i on a namespace instance shows the refers; on the class it shows the aliases |
| 14:26 | stuarthalloway | any org-mode users want to upvote this for me? http://dev.clojure.org/jira/browse/CLJ-1009 |
| 14:28 | gfredericks | stuarthalloway: yes. |
| 14:28 | gfredericks | I have a pile of code I could delete if that got in |
| 14:29 | technomancy | gfredericks: have you tried doric? |
| 14:29 | gfredericks | technomancy: nope |
| 14:29 | technomancy | IIRC it's org-compatible |
| 14:29 | nDuff | What's the point of building a stack of DynamicClassLoader instances? clojure.lang.RT.baseLoader() returns Compiler.LOADER if it's bound, and makeClassLoader builds a new DynamicClassLoader on top of the current baseLoader... but why? |
| 14:30 | gfredericks | technomancy: it looks orgy-mody-compatible-y |
| 14:31 | timvisher_ | would the right place to grab slime from related to clojure development be technomancy/slime on github? |
| 14:31 | technomancy | timvisher_: if you have to work from source for some reason, sure. |
| 14:32 | timvisher_ | i'm just trying to build an info manual for it |
| 14:32 | timvisher_ | but it would make sense for me to have docs for it related specifically to the version i care about |
| 14:33 | timvisher_ | i'm assuming your copy is the bundled copy |
| 14:34 | technomancy | oh sure; that makes sense |
| 14:53 | solussd | I'm using enliven w/ noir and it appears that I cannot use dynamic vars (e.g. *errors*) inside an enliven template selector handler function. The dynamic vars are unbound in the template. Supposedly there was a fix for this in v1.0.1, but it appears to still not work. :/ anyone else have any familiarity with this issue? |
| 14:53 | solussd | *enlive (damnyouosxautocorrect) |
| 14:56 | cemerick | solussd: it really, really should work. Are you certain you're using 1.0.1? |
| 14:56 | solussd | cemerick, I am. :/ at least my repl spits out the right source |
| 14:56 | solussd | e.g. (source net.cgrand.enlive-html/snippet*) |
| 14:57 | cemerick | hrm |
| 14:58 | cemerick | solussd: I'll see what I can see. |
| 14:58 | solussd | thanks |
| 15:08 | muhoo | cemerick, technomancy: bumped version to release, got maven squared away, fixed demo app so it actually works. *whew* |
| 15:08 | technomancy | cool |
| 15:09 | muhoo | technomancy: thanks especially for your help. |
| 15:09 | technomancy | no problem. I understand the build environment isn't always transparent, and we're working on improving that. |
| 15:10 | muhoo | google apps login in clojure/noir through friend on heroku http://young-cloud-3820.herokuapp.com/ |
| 15:10 | technomancy | there are OSS replacements for the entire build chain, but they're not quite polished and ready to become default yet |
| 15:10 | muhoo | (if you have a google apps account, that is) |
| 15:10 | cemerick | muhoo: I don't, but awesome that you have a demo app up too :-D |
| 15:11 | muhoo | maven isn't oss? it's from apache... |
| 15:11 | technomancy | muhoo: I mean for the heroku-specific parts |
| 15:11 | muhoo | oh, i had no trouble with the heroku parts |
| 15:11 | technomancy | well, you did have an issue with the build's cached .m2 dir |
| 15:11 | muhoo | it was google's openid that was giving me the shits |
| 15:12 | technomancy | where if it was local you could have just gone in and done rm -rf on the old snapshot |
| 15:12 | borkdude | muhoo what am I supposed to fill in? |
| 15:12 | nDuff | Whoa. |
| 15:12 | borkdude | my password is going straight into your db? ;) |
| 15:13 | muhoo | borkdude: that's not how opneid works :-) |
| 15:13 | borkdude | ah, I can just fill in google.com |
| 15:13 | cemerick | borkdude: google is asking, not muhoo :-) |
| 15:14 | borkdude | gmail.com |
| 15:14 | muhoo | gmail.com should work too |
| 15:14 | borkdude | Internal error. It has been reported. |
| 15:14 | cemerick | well, only if you have google apps gmail |
| 15:14 | amalloy | muhoo: pretty cool |
| 15:15 | amalloy | i don't really know what it's for, but hurrah |
| 15:15 | borkdude | cemerick I have a gmail address.. should it work? |
| 15:15 | cemerick | borkdude: gmail != google apps |
| 15:15 | cemerick | I don't have google apps either, but a fair number of others do. |
| 15:15 | technomancy | cemerick: turns out the oauth workflow I needed was too trivial for friend; I was overcomplicating it and it turned out to be like five lines of compojure+clj-http. |
| 15:15 | muhoo | i haven't tried that. my use caase is a corporate intranet with a google apps auth setup |
| 15:16 | amalloy | i have a few google apps accounts, and this works fine. now muhoo's app knows my first and last name! |
| 15:17 | kaoD_ | I can't believe this |
| 15:17 | borkdude | I have done oauth too, with http://whosnotfollowingme.heroku.com |
| 15:17 | kaoD_ | I'm generating an image and outputting it through Ring |
| 15:17 | kaoD_ | it doesn't work |
| 15:18 | kaoD_ | but when I run it using lein-ring |
| 15:18 | kaoD_ | and make any change to the namespace so it reloads |
| 15:18 | kaoD_ | it works |
| 15:18 | kaoD_ | what the hell is going on |
| 15:18 | kaoD_ | even if the change is adding a space or removing a newline! |
| 15:18 | cemerick | technomancy: presumably you had to learn about oauth? Sounds painful enough to want to use friend anyway ;-) |
| 15:19 | jedmtnman1 | is (defn- …) valid syntax - if it is, i dont know how it diffs from (defn ..) |
| 15:19 | gfredericks | defn- makes it private |
| 15:19 | cemerick | borkdude: that's cool, now I know who to not send holiday cards to! :-D |
| 15:19 | jedmtnman1 | ahh |
| 15:19 | technomancy | cemerick: the only complicated bit was actually registering my application with github and figuring where the tokens go: http://develop.github.com/p/oauth.html |
| 15:19 | gfredericks | == (defn ^:private foo ...) |
| 15:19 | borkdude | :-) |
| 15:20 | borkdude | Young-cloud-3820.herokuapp.com is asking for some information from your Google Account michielborkent@gmail.com |
| 15:20 | borkdude | Allow -> Internal error. It has been reported. |
| 15:20 | borkdude | should this not just work then? google has an openid provider thing |
| 15:21 | wink | openid is horrible in its own way |
| 15:22 | technomancy | worked for me |
| 15:22 | borkdude | ah wait, maybe it is a third party cookie thing |
| 15:23 | muhoo | internal error means a discovery exception i didn't catch :-) |
| 15:23 | muhoo | you don't have a google apps account, i bet |
| 15:24 | borkdude | muhoo it doesn't work with whatever openid provider? |
| 15:24 | borkdude | muhoo ok |
| 15:25 | muhoo | not my thing. the built-in openid workflow of friend does. |
| 15:25 | borkdude | muhoo I don't have google apps then I guess…. I do have a google appspot account |
| 15:25 | muhoo | mine is a special case, written and tested for google apps only |
| 15:25 | cemerick | I think a friend-demo webapp is called for. Include all known friend workflows. :-P |
| 15:27 | solussd | cemerick: if I wrap my call to the template in a 'doall', it works… not very elegant or intuitive for someone writing the body of a defpage though. :/ |
| 15:27 | josteink | borkdude: google apps is overrated. provides you with a vanity email, and no early access to any new google stuff :P |
| 15:28 | borkdude | josteink at least you can search in your mail properly and don't have stupid 1 GB mail limits I now have at my work |
| 15:28 | josteink | heh |
| 15:29 | josteink | i love the spam filter we have at work |
| 15:29 | nDuff | ...oh, you mean as opposed to a gmail.com account. |
| 15:29 | josteink | it has like 100% false positives |
| 15:29 | borkdude | I never think about spam filters since my gmail |
| 15:29 | nDuff | I like Google, but willing to lock my online identity into them forever? No thanks. |
| 15:30 | josteink | and whenever you whitelist something it has caught which it shouldnt, it says "OK dude!" and then promptly forgets about it and categorizes everything from that sender as spam also in the future |
| 15:30 | josteink | nDuff: fair enough |
| 15:30 | josteink | it means you owe your email identity, which can also be argued to be a oath identity |
| 15:31 | josteink | or openid identity or whatever |
| 15:31 | gfredericks | nDuff: why do you need your own domain when you could get a microblog on a transient app made by a hipster startup? |
| 15:31 | borkdude | josteink I remember doing those kinds of things as well, it was 2006 and we had a sysadmin installing special spam software and spam plugins in our outlook clients |
| 15:31 | josteink | yeah |
| 15:31 | josteink | I probably spent more time tuning spamassasin than reading mail before I gave up on doing my own email server |
| 15:32 | borkdude | josteink I think that was the software |
| 15:32 | cemerick | solussd: I dunno, some quick REPL tests with enlive 1.0.1 look good here. |
| 15:32 | cemerick | Using both snippet and deftemplate, bound vars appear to be used as I'd expect. |
| 15:32 | cemerick | solussd: can you boil it down to a small example? |
| 15:33 | cemerick | nDuff: that way lies madness :-) |
| 15:33 | nDuff | cemerick: ...by the way, I think I've had a message sitting in the moderation tool for clojure-tools for weeks. |
| 15:33 | cemerick | Oh? crap. |
| 15:33 | nDuff | s/tool/queue/ |
| 15:34 | cemerick | nDuff: no pending messages… |
| 15:34 | nDuff | ...hmm; bizarre. |
| 15:35 | borkdude | haha, I took a look at appspot and there's still an app I made once on there: http://borkent-app2.appspot.com/ (self tutoring for learning hebrew) |
| 15:35 | amalloy | maybe you accidentally sent it to rec.games.baseball, and they're still scratching their heads over it |
| 15:35 | nDuff | cemerick: ...on a related note, would you have any experience worth sharing on the madness in question, or would that be a good topic for a mailing list post? :) |
| 15:35 | cemerick | nDuff: do resend :-) |
| 15:36 | borkdude | unfinished though |
| 15:36 | cemerick | nDuff: ML, please. I'm vaguely aware of your struggling with classloaders and REPLs and atlassian kit, and god knows what else, but I've not been following closely. :-) |
| 15:38 | borkdude | I guess this page needs updating with respect to dynamic vars: http://clojure.org/lisps |
| 15:39 | solussd | cemerick: https://www.refheap.com/paste/4fd25367e4b0e13ddf181b31 |
| 15:39 | solussd | pardon the indentatino |
| 15:39 | muhoo | overall friend demo does sound like a good idea, but the workflows do have their differences |
| 15:43 | cemerick | muhoo: yeah, each workflow would have its own form, etc. |
| 15:45 | borkdude | technomancy issue 592 can be solved now just by changing one character in project.clj :-) |
| 15:50 | muhoo | well i won't promise anything, but i suppose i might hack something like that up at some point (using noir) |
| 15:51 | cemerick | muhoo: oh, I wasn't suggesting that you do it :-) |
| 15:52 | muhoo | i kinda got halfway there when i was trying to figure out how this stuff worked anyway |
| 15:52 | muhoo | i implemented interactive-form, openid, and now this step2. the only one i didn't do is basic |
| 15:52 | borkdude | ,(or "friend" "foe") |
| 15:52 | clojurebot | "friend" |
| 15:53 | muhoo | the mock_app.clj was clear enough |
| 16:11 | dnolen | getting close to optimizing away protocol dispatch in CLJS when we have type information ... |
| 16:16 | lpetit | nDuff: interested in reading you. We may have related problems: when working on Counterclockwise itself with live REPL, I have to do some tricks to get the code sent to nrepl server evaluated from the right class loader context. |
| 16:17 | lpetit | nDuff: I was thinking about adding some mechanism to deal with that, so I was reluctant to do it in an OSGi-specific only way |
| 16:21 | nDuff | lpetit: *nod*. Atlassian/Felix does things differently enough from Eclipse/Equinox that I haven't been able to use clojure.osgi directly, but it's been very useful reading. |
| 16:21 | lpetit | nDuff: so if you can bring a second use case to the table, then it'll help find the right abstraction to not hardwire things in Counterclockwise anymore. Currently, it relies on clojure.osgi providing some OSGi specific way of getting a bundle's class loader and injecting it before evaluation (System's context class loader, RT.baseLoader .. -out of my head). |
| 16:22 | lpetit | nDuff: it is certainly possible, tho, to decomplect (yeah, really) those 2 concerns from clojure.osgi to make it more general: mechanism to inject classloader, being passed either the class loader to inject, or a function to be called to return the class loader |
| 16:23 | Bronsa | i'm wondering why we have both `second` and `fnext` |
| 16:24 | lpetit | nDuff: the only "concern" is that with clojure.osgi, changing the class loader is side effect full, like changing the current ns is. Though it may not be a concern, after all. One must just understand that it's changed for the current thread (like is also the current ns, after all, lol) |
| 16:24 | dnolen | Bronsa: the reasons are mostly historical I believe. |
| 16:24 | lpetit | ,(source fnext) |
| 16:24 | clojurebot | Source not found |
| 16:25 | Bronsa | lpetit: they are exactly the same :) |
| 16:25 | Bronsa | dnolen: ok, thanks |
| 16:25 | lpetit | indeed |
| 16:27 | josteink | linked in, now last.fm |
| 16:27 | josteink | and then you have the whole "flame" malware with a whole new kind of md5 busting |
| 16:27 | josteink | this is a bad week for internet security |
| 16:27 | borkdude | o no, what if someone will scrobble a track of an artist I dislike! |
| 16:27 | Bronsa | lol |
| 16:28 | josteink | borkdude: you say that now |
| 16:28 | devn | lol lastfm got hacked too? jesus. another password i have to change. |
| 16:28 | josteink | borkdude: but when nicki minaj will be forever stitched to your last.fm profile, following justin bieber |
| 16:28 | neotyk | stuarthalloway: clj-1009, should keywords be printed in header, rather than it's name? |
| 16:28 | josteink | you WILL know better |
| 16:28 | borkdude | :-) |
| 16:29 | devn | This really needs to get changed: http://richhickey.github.com/clojure-contrib/ |
| 16:29 | lazybot | Nooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/ and try to stop linking to rich's repo. |
| 16:30 | stuarthalloway | neotyk: I don't understand... |
| 16:31 | neotyk | stuarthalloway: (print-table [{:a 1}]) |
| 16:31 | neotyk | | :a | |
| 16:31 | neotyk | +----+ |
| 16:31 | neotyk | | 1 | |
| 16:31 | stuarthalloway | is that desired, or current? |
| 16:31 | neotyk | current |
| 16:32 | amalloy | printing the name instead sounds disastrous, neotyk. if you want to print something other than a keyword, don't give it a keyword? |
| 16:33 | devn | re: stuart sierra's post on the list about additions to clojure.string -- would it not be possible make a clojure.string.format or something that lives out in the world as a "contrib" library? |
| 16:34 | stuarthalloway | devn: sure |
| 16:34 | stuarthalloway | neotyk: that looks right to me -- name cuts off options |
| 16:34 | neotyk | stuarthalloway: just asking |
| 16:35 | stuarthalloway | neotyk: np -- opinions most welcome |
| 16:35 | neotyk | amalloy: I see your point |
| 16:35 | devn | stuarthalloway: btw, too bad you had to take off after your talk at euroclojure, would have liked to chat |
| 16:35 | devn | oh well, the next clojure conf/j |
| 16:36 | stuarthalloway | devn: agreed -- my spousal travel vouchers expired :-) |
| 16:36 | devn | stuarthalloway: :D |
| 16:36 | stuarthalloway | devn: I will be at StrangeLoop |
| 16:37 | devn | stuarthalloway: Well then, see you there. :) |
| 16:38 | borkdude | "Clojure, the cool newcomer" -> http://files.zeroturnaround.com/developer-productivity-report/zeroturnaround-developer-productivity-report-2012.pdf |
| 16:47 | solussd | cemerick: do you know how to 'select' the sibling of an element using enlive templates? e.g. If I had <label …> <input .. >, how to select input right after label? |
| 16:50 | michaelr525 | he;;o |
| 16:50 | Raynes | h; ;here |
| 16:51 | michaelr525 | whats up? |
| 17:14 | zaka | Is there a way to create an (lazy)-sequence that adds the previous item from the sequence + 3. The result is for example: [1 4 7 10 13 16] or [2 5 8 11[ (doesn't matter if it return an array, list or something else, just as long it iterable) |
| 17:15 | nDuff | Is there an equivalent to RT.var(String ns, String name) that fails, rather than returning a new unbound var, if nothing exists in the desired namespace? |
| 17:15 | gfredericks | zaka: yes. |
| 17:16 | gfredericks | zaka: your example looks like you're just incrementing everything? |
| 17:16 | zaka | gfrederiks: yes |
| 17:17 | gfredericks | ,(map inc [1 4 7 10 13 16]) |
| 17:17 | clojurebot | (2 5 8 11 14 ...) |
| 17:17 | jaley | zaka: (defn foo [x] (iterate (partial + 3) x)) ;; something like that? |
| 17:17 | amalloy | gfredericks: he's asking for iterate, not map |
| 17:18 | gfredericks | amalloy: I must be drunk because I have no idea what's going on here |
| 17:18 | gfredericks | oh I see |
| 17:18 | gfredericks | ha yeah I misread that |
| 17:53 | cemerick | solussd: try [(left [:label])] |
| 17:53 | cemerick | solussd: Haven't had a chance to look at your paste yet, will have to wait until tonight/tomorrow. Maybe start a ML thread on it if you get impatient. :-) |
| 18:05 | gfredericks | man this monet library |
| 18:06 | livingston | if I'm trying to call a specific java function that I can pass a null pointer to but it wants a null X and not a null Y I tried type-hinting ^X nil in the call, but does that not actually work as I expect? |
| 18:07 | amalloy | livingston: you need to provide enough hints to resolve the entire thing statically, or all the hints get ignored (so specifically, you're probably missing a hint on the target object) |
| 18:07 | amalloy | (.foo ^Target target ^X nil) should work |
| 18:07 | livingston | OH I didn't know that |
| 18:08 | amalloy | or...can you put metadata on nil? you might need to do something wonky like (let [^X x nil] (.foo ^Target target x)) |
| 18:11 | livingston | hrm... that didn't work either. |
| 18:11 | gfredericks | amalloy: surely you can't put metadata on nil?? |
| 18:11 | lazybot | gfredericks: Definitely not. |
| 18:12 | gfredericks | ain't it java null? |
| 18:12 | livingston | basically I'm trying to call the airity 3 form of contains here: http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/rdf/model/Model.html |
| 18:12 | gfredericks | oh you mean the symbol |
| 18:12 | amalloy | gfredericks: i don't think nil is a symbol, is the point |
| 18:12 | amalloy | livingston: you shouldn't need any hint at all |
| 18:12 | amalloy | &(class (read-string "nil")) |
| 18:12 | lazybot | ⇒ nil |
| 18:13 | gfredericks | amalloy: ooh sorry you were questioning in the opposite direction |
| 18:13 | gfredericks | I should stop talking for the remainder of the evening |
| 18:13 | livingston | I wouldn't think so, the call is unambiguous, I think I'm getting the right call signature, but the library is complaining about the "type" of null thing I passed in. |
| 18:14 | amalloy | library sucks, bro |
| 18:14 | amalloy | if you get as far as calling the method, and something inside there complains, ain't nothing clojure can do to pass a nil that is somehow different |
| 18:14 | livingston | I hinted to the thing in the call signature ^RDFNode nil and it says null Literals not allowed (literals are a subtype...) |
| 18:14 | livingston | ok |
| 18:14 | gfredericks | surely the lib couldn't be examining the type of a null at runtime |
| 18:15 | gtrak | I don't have to use deref on a dynamic var do I, and why not? |
| 18:15 | livingston | that's what I figured |
| 18:15 | gfredericks | gtrak: cuz the value is always available so that'd be needless |
| 18:15 | gfredericks | or wait |
| 18:15 | gfredericks | no |
| 18:15 | gtrak | haha, right? |
| 18:15 | gfredericks | the reason is because that would be annoying |
| 18:16 | gfredericks | it shouldn't be changing out from under you also |
| 18:16 | gfredericks | at least not any more than any other var would |
| 18:16 | pepijndevos | Can you modify the play speed of a buffer in overtone? |
| 18:16 | gtrak | ah, indeed, since it's thread-local the value would stay the same for the execution of your function |
| 18:16 | gfredericks | yeps |
| 18:17 | livingston | luckily there is an arity 2 form of the function that is the same as nil for the third and that seems right. although the docs say I can do what I've tried so I was just trying to figure out why I couldn't. |
| 18:17 | livingston | thanks |
| 18:26 | livingston | if I want to release a maven-ified library, and open source it, what seems to the be the community preferred locations? code on github, and pom/jar where? |
| 18:26 | gfredericks | clojars |
| 18:28 | livingston | I just have to create an account and it'll let me push there, no questions? |
| 18:28 | technomancy | the current implementation accepts nearly anything |
| 18:29 | technomancy | in the future you will have to declare a license and stuff to push to the releases repo |
| 18:29 | livingston | i'll go EPL - so I'm compatible with clojure itself. |
| 18:31 | livingston | does the central repository mirror clojars now? I've notice clojure itself only publishes there now doesn't it? |
| 18:36 | amalloy | maven central does not now, and almost certainly never will, mirror clojars |
| 19:05 | dnolen | core.logic on CLJS has achieved Racket performance! |
| 19:06 | amalloy | you're some kind of superhuman, dnolen |
| 19:07 | dnolen | 12ms-15ms on V8 to solve zebrao |
| 19:08 | dnolen | fingers crossed that PHMs can get us to ~3-4ms |
| 19:35 | scottj | if you want to make sure you always have a copy of jars your projects use (in case they get removed from repos) is the best way to create a local maven repo? any special tools there people like or just follow general docs? |
| 19:41 | technomancy | scottj: probably best to run a nexus server |
| 20:06 | livingston | scottj: your local maven repo should keep them indefinitely, unless you instruct it to delete them. |
| 20:07 | aperiodic | scottj: you could also stick them in an s3-maven-wagon (I've found this to be less pain than running a nexus server) |
| 20:07 | livingston | if it's just you on one machine periodically backing up ~/.m2/repository is probably good enough, but like technomancy said a server would be even more convenient if you use a couple of machines etc. |
| 20:10 | livingston | huh, I've heard the term maven wagon before, but just always glossed over it, when did they start that? |
| 20:11 | aperiodic | i think wagon is the maven repo storage protocol? |
| 20:12 | livingston | right but I didn't know you could kind of off load them places, eh, that'll go back to the back of my brain to be forgotten again |
| 20:13 | aperiodic | yeah, i wrote this shell script that just apes what the s3-wagon-private plugin does to deploy things to an s3 bucket, and it seems to be sufficient |
| 20:14 | technomancy | nexus is more convenient in the long haul; just more pain up-front |
| 20:14 | frozenlock | Is there a command to open in another software? I would like to save an html file and immediatly after make it open in the user's default browser. |
| 20:14 | aperiodic | why's that? |
| 20:14 | technomancy | it caches transparently and lets you check only a single repo |
| 20:15 | technomancy | publishing a couple artifacts to an s3 repo is easy, but making sure everything your project depends upon is in s3 is more work |
| 20:15 | technomancy | frozenlock: try clojure.java.browse |
| 20:15 | frozenlock | Will do immediatly, thanks! |
| 20:16 | technomancy | sometimes it goofs up the browser selection, but it nearly always opens *something* |
| 20:16 | livingston | fishes through your history, picks a good one ... |
| 20:39 | johnmn3 | so, there is not already a clj wrapper for java.util.zip.* or some other zip variant? |
| 20:40 | johnmn3 | I see clj-msgpack, but that's not really zipping |
| 20:41 | johnmn3 | and I'd like to use a zip file as a database to persist clojure datastructures. Being able to open it with a unzip program would be neat, for my purposes, I think. |
| 20:43 | scottj | johnmn3: not sure if it helps, https://github.com/mikejs/ring-gzip-middleware/blob/master/src/ring/middleware/gzip.clj |
| 21:01 | frozenlock | johnmn3: I've done something that you might find useful: https://gist.github.com/2898908 |
| 21:01 | frozenlock | (spit-to-zip "test.zip" "test.txt" "asdfadsfas") will result in a zipped file named test.zip, with inside it a file named test.txt and with the content "asdfadsfas" |
| 21:02 | frozenlock | And to spit to a zip with more than a file: (spit-to-zip "test.zip" "test.txt" "asdfadsfas" "test2.txt" "adsfasdfdsa") |
| 21:03 | johnmn3 | frozenlock: that's fantastic. simple and works as advertised. |
| 21:03 | johnmn3 | going about making a slurp-from-zip, would it look relatively the same, but with .getNextEntry? |
| 21:04 | frozenlock | Probably. Might need ZipInputStream too. |
| 21:05 | frozenlock | Feel free to post a link here if you ever make this slurp-from-zip :) |
| 21:05 | johnmn3 | so for anyone who was here when I was talking about using Chris Granger's simpledb (not the amazon simpledb) for persisting clojure data |
| 21:05 | johnmn3 | https://www.refheap.com/paste/3063 |
| 21:06 | johnmn3 | I had the idea to just add a watcher to the atom and, whenever an event triggers, to write the atom to disk. |
| 21:06 | johnmn3 | but I realized that that doesn't work well with io |
| 21:06 | septomin | this is the flat file thing? |
| 21:07 | frozenlock | johnmn3: Y u no like congomongo? |
| 21:07 | johnmn3 | (map update-atom-with-write (range 0 10000000)) would be detrimental |
| 21:07 | johnmn3 | frozenlock: oh yea, I forgot about that. I should def look into that. |
| 21:09 | johnmn3 | So, I built some logic into it that basically says: "if there has been a write in the last second, wait another second and try again. If there is still contention, give up" |
| 21:09 | johnmn3 | and then there is also the original timer that persists automatically every 10 seconds (from granger's original 5 min) |
| 21:09 | septomin | eventual safety! |
| 21:09 | johnmn3 | :) |
| 21:10 | johnmn3 | but it's still not atomic |
| 21:11 | johnmn3 | and I was thinking about gaurding writes with a ref of some kinds... or maybe I could build some journaling into the atom's map, so that operations can be rolled back if they fail. |
| 21:11 | johnmn3 | but yea, I should check out congomongo |
| 21:12 | johnmn3 | one benefit I was thinking, with the current way, was that I could just crack it open with a zip utility and then there clojure datastructures are right there, easy to troubleshoot. |
| 21:12 | johnmn3 | I'm aware that I'm reinventing the rule.. but my needs are very minimal. |
| 21:13 | johnmn3 | er, s/rule/wheel |
| 21:13 | septomin | i mean if performance is an issue at all it seems like you should use something real |
| 21:13 | septomin | but this looks nice for very early stage stuff |
| 21:14 | septomin | are your files even large enough that you need to bother zipping them? |
| 21:17 | johnmn3 | it might just be one file.. that's all I need to persist a whole environment, right? Yea, the file could keep growing and growing to be a few megs, over time. |
| 21:18 | johnmn3 | though it might be more efficient to store in multiple files in the zip, so as to create a random access situation, rather than re-writing the whole thing every time. |
| 21:18 | johnmn3 | In which case, each write could be a delta and I could have versioning.. hey look, I just invented chouchdb |
| 21:19 | johnmn3 | yea, I might as well go with a simple but strong db lib like congomongo |
| 21:19 | frozenlock | I'm trying clojure.java.browse/browse-url. It works fine for... well a URL, but how can I make it work with a local file? |
| 21:20 | septomin | file:///path ? |
| 21:22 | frozenlock | No, it chokes on the path, saying it's not a URI |
| 21:52 | frozenlock | Damnit |
| 21:52 | frozenlock | I'm such an idiot |
| 21:53 | frozenlock | All this time I was trying to open a not-yet-existing file. |
| 22:10 | johnmn3 | congo mongo is giving me errors |
| 22:11 | johnmn3 | but I used pomegranate to load it... |
| 22:14 | johnmn3 | test2.core=> (insert! :robots {:name "robby"}) => Jun 08, 2012 10:07:37 PM com.mongodb.DBTCPConnector fetchMaxBsonObjectSize WARNING: Exception determining maxBSON size using0java.io.IOException: couldn't connect to [/127.0.0.1:27017] bc:java.net.ConnectException: Connection refused: connect |
| 22:20 | frozenlock | Is mongoDB running correctly? |
| 22:32 | johnmn3 | mmmm |
| 22:32 | johnmn3 | right |
| 22:33 | johnmn3 | so you're saying "(make-connection ... doesn't actually stand the server side up, and I have to go download mongo seperately? :/ |
| 22:35 | johnmn3 | I think I'm more inclined to just use the spit-to-zip you mentioned. That has the added benefit that I can peer into it as a zip file. |
| 22:52 | eslick_ | Anyone know of SF-area consulting firms with clojure experience / expertise? |
| 22:56 | semperos | https://groups.google.com/forum/?fromgroups#!searchin/clojure/clojurescript$20extend/clojure/-epqvr3pPPg/NPYztkPGWZEJ |
| 22:56 | semperos | ClojureScript has extend-type, but no extend |
| 22:56 | semperos | is there any equivalent mechanism for passing around default implementations for protocols? |
| 22:56 | johnmn3 | frozenlock: it looks like the contents are just being dumped into the *out*, rather than going into the zip file |
| 22:59 | semperos | johnmn3: *out* can be dynamically rebound to point where you want it |
| 22:59 | semperos | http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/*out* |
| 22:59 | lazybot | Nooooo, that's so out of date! Please see instead http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/*out* and try to stop linking to rich's repo. |
| 22:59 | semperos | there's also the built-in with-out-str when you just want to capture things sent to *out* as a string |
| 23:03 | johnmn3 | but I don't see a setter method on ZipEntry, so I'm not sure how to put the data in it. |
| 23:08 | johnmn3 | I think you have to call .write on the ZipOutputStream |
| 23:09 | johnmn3 | ugh, manually pouring bytes into arrays using offsets just feels so... uncivilized |
| 23:20 | aperiodic | yeah, it sucks to have to think about array indices |
| 23:20 | frozenlock | johnmn3: Sorry about that, I gave you an older version.. hang on |
| 23:21 | frozenlock | https://gist.github.com/2898908 try this one |
| 23:21 | frozenlock | (I spent almost a day trying to get this work the first time) |
| 23:21 | frozenlock | printer and buffer will be my death :) |
| 23:27 | johnmn3 | trying |
| 23:30 | johnmn3 | worked! |
| 23:30 | johnmn3 | fantastic |
| 23:31 | francis | is their a fix for the lein repl so when I use M-p it grabs the last definition I used rather than the line? Or am I going to have to write it |