2010-12-16
| 00:00 | joshua__ | Is there really not a macro? function in clojure? |
| 00:00 | joshua__ | omg... omg.. I could use find-fn quite possibly to answer that.. |
| 00:00 | amalloy | joshua__: i was about to say... |
| 00:01 | joshua__ | what are some good input outputs to try? |
| 00:01 | joshua__ | #'when true? |
| 00:01 | Lajla | chousuke, clojure on minun silmäkuopissani, ota sen niistä. |
| 00:01 | amalloy | the problem is so many things will return true for that |
| 00:02 | amalloy | you need a way to specify multiple constraints, like {[#'when] true, [#'inc] nil} |
| 00:04 | joshua__ | I think there might be a but (find-fn #'when true) returned nil |
| 00:04 | joshua__ | actually. |
| 00:05 | joshua__ | nvm |
| 00:05 | dnolen | ,(lazy-seq (lazy-seq (lazy-seq nil))) |
| 00:05 | clojurebot | () |
| 00:05 | dnolen | the bane of my existence. |
| 00:05 | technomancy | sounds like a nursery rhyme |
| 00:14 | joshua__ | What is the clojurey way to print the the first item of a vector in a list of vectors? |
| 00:15 | joshua__ | (map (fn [x] (println (first x)) vector-lists) ? |
| 00:15 | Raynes | (doseq [[x] vectors] (println x)) |
| 00:17 | joshua__ | amalloy: I reimplemented it in terms of filter. |
| 00:17 | amalloy | sweet |
| 00:18 | amalloy | Raynes's way is best, but for entertainment value: (dorun (map (comp println first) vectors)) |
| 00:18 | joshua__ | https://gist.github.com/743070 |
| 00:19 | joshua__ | is there a way I can load the function into sexpbot so you guys can see it in action? |
| 00:19 | joshua__ | hnparser.main> (find-fn [1 2] 3) |
| 00:19 | joshua__ | bit-or |
| 00:19 | joshua__ | bit-xor |
| 00:19 | joshua__ | + |
| 00:19 | joshua__ | unchecked-add |
| 00:20 | amalloy | joshua__: no, sexpbot is theoretically stateless |
| 00:20 | joshua__ | hnparser.main> (find-fn [[1 2]] 1) |
| 00:20 | joshua__ | first |
| 00:20 | joshua__ | rand-nth |
| 00:20 | joshua__ | omg omg hilarious |
| 00:20 | joshua__ | rand-nth |
| 00:20 | amalloy | hah |
| 00:20 | joshua__ | Going to be funny when your given that more complicated inputs and functions that have random results pop up in the list from time to time. |
| 00:22 | joshua__ | I want to try to work find-fn into a genetic algorithm at some point. |
| 00:22 | joshua__ | My mind keeps thinking that it would be a really cool thing to include, but its not clicking as to why so I want to investigate. |
| 00:23 | amalloy | joshua__: i don't understand why you want to use println at all here. just return the result of the filter (wrap it in a (set) if you like) |
| 00:24 | joshua__ | it will return [something #something-function] for each item |
| 00:24 | joshua__ | but I figure something-name is what people really want. |
| 00:25 | amalloy | (map (comp str first) (filter ... ))? |
| 06:03 | jk_ | i'm just starting to use agents and find the documentation confusing. it says that send will (apply your-func agent-state &args) |
| 06:03 | jk_ | but it looks like what actually happens is just (apply your-func &args) |
| 06:04 | jk_ | is that right? if i want to use the existing state i have to explicitly reference it ? |
| 06:04 | jk_ | or dereference it, rather? |
| 06:05 | jk_ | &(doc send) |
| 06:05 | sexpbot | ⟹ "([a f & args]); Dispatch an action to an agent. Returns the agent immediately. Subsequently, in a thread from a thread pool, the state of the agent will be set to the value of: (apply action-fn state-of-agent args)" |
| 06:07 | jk_ | oh nm, i see what i'm doing wrong. my function i'm passing is not solely a function of the existing state |
| 06:07 | jk_ | it's too late |
| 06:16 | auser | hola |
| 07:52 | mrBliss | technomancy: check your .gitconfig in your dotfiles repo on github |
| 08:26 | dsop | is there a way to reload jetty (compojure) instead of going through lein run all the time? |
| 08:28 | GOSUB | wow, Ken Wesson is apparently quite taken aback by the enhanced primitive support in 1.3.x |
| 08:30 | cemerick | I'm hoping Stuart's will be the last word on that one. |
| 08:40 | GOSUB | cemerick: yeah. I love the way he cleverly said "This argument is based on the (provably wrong) presumption that "still slow" means "equally slow". The difference is percentage points vs. order of magnitude. Test it for yourself." |
| 08:40 | GOSUB | I wonder what Ken would say now... |
| 09:17 | dsop | is there a let that I cna use to extract from a list, something like mlet [_ bla foo] ['to ignore' 'bla' 'foo'] so that bla is bound to 'bla' ? |
| 09:17 | chouser | the feature is called "destructuring" |
| 09:17 | dsop | thx |
| 09:17 | AWizzArd | ,(let [[_ a b _ c] '(1 2 3 4 5)] (println a b c)) |
| 09:17 | clojurebot | 2 3 5 |
| 09:32 | SergeyD | Hi, is there a way I can do constructor dispatch in Clojure for deftypes? For example: |
| 09:32 | SergeyD | (deftype Type1 [^double x ^double y]) |
| 09:32 | SergeyD | (deftype Type2 [^double x ^double y]) |
| 09:32 | SergeyD | (def constructor-dispatch Type1) |
| 09:32 | SergeyD | (new constructor-dispatch 1 2) |
| 09:32 | SergeyD | (def constructor-dispatch Type2) |
| 09:32 | SergeyD | (new constructor-dispatch 1 2) |
| 09:32 | SergeyD | Is using java reflection on deftype's host class is the simplest option? |
| 09:33 | Chousuke | you can't use new like that. |
| 09:33 | Chousuke | but you can make constructor-dispatch a function that creates either Type1 or Type2 depending on whatever. |
| 09:35 | SergeyD | Chousuke, then I have to repeat parameter list for every construction, right? "(if (cond1) (Type1. x y) (Type2. x y)" |
| 09:35 | Chousuke | you can make a macro for that. |
| 09:36 | Chousuke | could look something like (conditional-new [x y] cond1 type1 cond2 type2 cond3 type3) |
| 09:37 | Chousuke | where it expands to (cond cond1 (new type1 x y) cond2 (new type2 x y) ...) |
| 09:38 | SergeyD | Chousuke, thanks. I have the feeling there is a better way. I will think more |
| 10:11 | schitti | Can some help me install clojure |
| 10:11 | schitti | I'm using lein |
| 10:11 | schitti | I've checked out the git repo, and when I do lein self-install |
| 10:11 | schitti | I get this error: |
| 10:11 | schitti | WARNING: certificate common name `*.github.com' doesn't match requested host name `github.com'. |
| 10:11 | schitti | Failed to download https://github.com/downloads/technomancy/leiningen/leiningen-1.4.1-SNAPSHOT-standalone.jar |
| 10:30 | Raynes | technomancy: Ping |
| 10:36 | pjstadig | Raynes: probably not for a couple more hours |
| 10:36 | Raynes | pjstadig: I've got all day. :> |
| 11:33 | jcromartie | Would it make sense to build stateful UI components as compojure middleware? |
| 11:45 | Derander_ | is clojure-refactoring-mode broken? I can't seem to get it working on clojure 1.2 |
| 11:47 | jweiss | is there an easy way to test that all the keys from map1 are in map2 and the values also match? (map2 might have extra keys) |
| 11:53 | alpheus` | (= map1 map2) |
| 11:56 | mduerksen | jweiss, alpheus: (= map1 (select-keys map2 (keys map1)) |
| 11:56 | jweiss | mduerksen: ah thanks |
| 11:57 | alpheus` | I missed that you meant to ignore extra keys in map2 |
| 12:05 | ohpauleez | Raynes: ping |
| 12:05 | ohpauleez | does that kid even go to school? |
| 12:05 | ohpauleez | haha |
| 12:23 | GOSUB | ohpauleez: he is home-schooled. |
| 12:23 | ohpauleez | I was just pinged and reminded of that |
| 12:23 | ohpauleez | I totally knew that too |
| 12:24 | GOSUB | ohpauleez: Ok. |
| 12:24 | GOSUB | is headius Mr. Nutter? |
| 12:25 | headius | yes |
| 12:25 | GOSUB | headius: oh, it's great to see you on this channel :) |
| 12:26 | headius | I hover :) |
| 12:27 | GOSUB | headius: good, good! |
| 12:33 | GOSUB | that thread on the mailing list is a phenomenal waste of time. |
| 12:35 | technomancy | GOSUB: or erik naggum back from the graaaaaave? |
| 12:36 | GOSUB | technomancy: oh, please, Erik Naggum was not that bad :) |
| 12:37 | cemerick | Jon Harrop has actually turned into a pretty decent presence on the list, last I knew anyway. |
| 12:37 | GOSUB | technomancy: I believe Erik was the embodiment of XKCD #386 - http://xkcd.com/386/ |
| 12:37 | GOSUB | cemerick: I asked that John. he told me that he is not the same John. go figure! |
| 12:38 | GOSUB | I was quite surprised by that statement. (the flying frog signature is missing, so I kind of believed him) |
| 12:40 | cemerick | Holy crap that thread is a disaster. :-( :-( |
| 12:41 | GOSUB | completely |
| 12:41 | GOSUB | even Stu is pissed now. |
| 12:41 | cemerick | I'm surprised he hasn't gotten the banstick at this point. |
| 12:42 | cemerick | or, moderation bar, perhaps :-P |
| 12:43 | technomancy | it made me switch to reading by digest |
| 12:44 | GOSUB | cemerick: that will make it worse. let's try to persuade him into R-ing the FM :) |
| 12:44 | cemerick | "R-ing"? |
| 12:44 | GOSUB | cemerick: reading the fine manual. |
| 12:44 | cemerick | never gonna happen. |
| 12:44 | cemerick | There's no manual anyway. |
| 12:45 | GOSUB | cemerick: STFA (search the fine archives) |
| 12:45 | GOSUB | STFA or STFU. |
| 12:46 | cemerick | Well, he disagrees with the design decision that's been made, settled, and already bikeshedded to death. Reading isn't going to stop anything. |
| 12:46 | GOSUB | cemerick: I doubt if he understands the decision or its implications completely. |
| 12:49 | GOSUB | Clojure/core guys should release the video of Rich's talk about new features ASAP. |
| 12:55 | GOSUB | and the thread is alive again... |
| 12:56 | jcromartie | can I make a type callable? |
| 12:57 | chouser | jcromartie: implement IFn |
| 12:57 | jcromartie | what if it's a built-in type? |
| 12:57 | jcromartie | like regexes created with #"" |
| 12:57 | chouser | ah. nope, can't do that yet |
| 12:57 | jcromartie | it's probably not a good idea to enable that |
| 12:58 | technomancy | it's a great idea |
| 12:58 | jcromartie | maybe I should just suggest regexes implement IFn |
| 12:58 | technomancy | it just won't work =( |
| 12:58 | jcromartie | it's a terrible idea |
| 12:58 | jcromartie | because it enables monkey patching |
| 12:58 | chouser | no |
| 12:58 | jcromartie | protocols and namespaces are explicit in what they define |
| 12:58 | chouser | if IFn were a protocol instead of a Java interface, you could do it |
| 12:58 | chouser | without monkey patching |
| 12:58 | jcromartie | right |
| 13:00 | GOSUB | chouser: since IFn is a Java interface, what happens when a deftype implements it? where does the implementation live? |
| 13:02 | jcromartie | In the namespace where deftype was used? |
| 13:03 | GOSUB | jcromartie: how's that monkey patching then? |
| 13:03 | GOSUB | may be I misunderstood something... |
| 13:04 | jcromartie | I'm talking about extending existing types to implement IFn, but there's no clean way to do that. |
| 13:04 | jcromartie | like regexes |
| 13:04 | GOSUB | jcromartie: ah, right. |
| 13:06 | chouser | It think there's actually no way, without having #"" produce something that's not a regex.Pattern |
| 13:06 | technomancy | the problem is making IFn a protocol would slow things way down |
| 13:06 | chouser | technomancy: would it? |
| 13:06 | technomancy | chouser: I asked rich about it at emerging langs, that's what he said |
| 13:06 | chouser | oh. :-( |
| 13:07 | technomancy | it gets in the way of hotspot |
| 13:07 | technomancy | which made me very sad |
| 13:07 | chouser | yeh |
| 13:07 | chouser | yeah, me too |
| 13:07 | technomancy | I would actually be happy with an alternate reader syntax for clojure regexes that didn't work for interop but had other nicer features like IFn |
| 13:07 | technomancy | since I've never used regexes for interop |
| 13:07 | technomancy | but I don't think that would fly |
| 13:07 | pjstadig | you mean a ....*gasp* wrapper |
| 13:08 | technomancy | I've never liked #"" syntax anyway; we should make /foo.*bar/ be a clojure.lang.Regex |
| 13:08 | danlarkin | you use regexes for interop all the time, you just don't know it! |
| 13:08 | pjstadig | class ClojureRegex extends Regex implement IFn |
| 13:10 | danlarkin | pjstadig: Pattern is Final :( |
| 13:10 | pjstadig | nooooooooooo |
| 13:12 | jcromartie | awesome by the way: http://www.ibm.com/developerworks/java/library/j-clojure-protocols/index.html?ca=drs- |
| 13:12 | jcromartie | this really helped me understand why protocols are a big deal |
| 13:12 | jcromartie | and then I went to design something using them, and realized why it was a better way than classes right away |
| 13:13 | jcromartie | they seem like a more principled version of mixins |
| 13:17 | jcromartie | but what about inheritence? |
| 13:17 | jcromartie | if you had behavior that could truly be inherited, what would you do there? |
| 13:18 | chouser | jcromartie: mix it in |
| 13:18 | GOSUB | jcromartie: have the behavior tucked away in a map and the merge in your implementations inside the extend call. |
| 13:20 | LOPP | hm |
| 13:21 | LOPP | if I have a website where new articles are added contantly (which requires rebuilding indexes on DB to allow fast searches) which DB would you recommend |
| 13:22 | GOSUB | LOPP: you are on the wrong channel. Please try #mongodb |
| 13:23 | jcromartie | GOSUB: yeah, probably |
| 13:23 | bobo_ | LOPP: from that info only, any db |
| 13:23 | jcromartie | GOSUB: hah |
| 13:23 | jcromartie | GOSUB: what's wrong with Couch? :) |
| 13:23 | jcromartie | or how about FoxPro |
| 13:23 | GOSUB | jcromartie: dog slow :-P |
| 13:24 | chouser | Multinode Oracle cluster |
| 13:24 | GOSUB | jcromartie: plus, no ad-hoc queries, etc. |
| 13:24 | GOSUB | jcromartie: they should call it OuchDB. |
| 13:25 | GOSUB | jcromartie: I don't know why Damien Katz is now working on porting OuchDB to mobiles. doesn't make sense. |
| 13:26 | jcromartie | OuchDB eh? |
| 13:26 | jcromartie | I thought "dog slow" was relative |
| 13:26 | GOSUB | jcromartie: indeed. dog slow compared to MongoDB. |
| 13:26 | jcromartie | I'm looking at it for an accounting, where the data is highly denormalized |
| 13:26 | jcromartie | Mongo is fast but it comes at a cost |
| 13:27 | GOSUB | jcromartie: what's the cost? |
| 13:27 | jcromartie | nice |
| 13:27 | jcromartie | well maybe I shouldn't speak too soon |
| 13:27 | jcromartie | it's not as mature as CouchDB, and there have been data loss situations |
| 13:28 | jcromartie | google couchdb data loss vs. mongodb data loss |
| 13:28 | jcromartie | mongodb wins |
| 13:28 | GOSUB | jcromartie: I agree, but those happened with people who were not well informed. |
| 13:28 | jcromartie | 2x hits |
| 13:28 | jcromartie | hm |
| 13:28 | GOSUB | jcromartie: don't care about that because those blogs were written by clueless tinkerers. |
| 13:28 | GOSUB | jcromartie: they never cared to read the manual. |
| 13:29 | GOSUB | jcromartie: even at Foursquare, a huge mess. |
| 13:29 | jcromartie | I mean "First, there are many scenarios in which that server loses all its data no matter what." |
| 13:29 | GOSUB | jcromartie: the mongodb people have always cared to explain where the problem was. |
| 13:29 | jcromartie | yeah |
| 13:30 | GOSUB | jcromartie: we, for example, never lost any data because we cared to read. |
| 13:30 | dnolen | GOSUB: CouchDB gives you P2P replication. That's not even remotely in the scope of Mongo. |
| 13:30 | jcromartie | Mongo basically requires a cluster |
| 13:30 | GOSUB | jcromartie: granted that CouchDB has a lot of great features, especially replication. |
| 13:30 | GOSUB | dnolen: +1 |
| 13:30 | jcromartie | I'm not trying to rag on Mongo |
| 13:30 | jcromartie | I played with it and I liked it |
| 13:30 | dnolen | so CouchDB on mobile makes plenty of sense. |
| 13:30 | jcromartie | that was before Couch had the JavaScript interface |
| 13:30 | GOSUB | jcromartie: I am not trying to diss couchdb either. |
| 13:31 | GOSUB | dnolen: what about erlang? is it possible to run couchdb without erlang? |
| 13:31 | jcromartie | my big problem with both is the question of paging results |
| 13:31 | cemerick | CouchDB makes sense in a *lot* of scenarios. |
| 13:31 | jcromartie | Erlang can be tiny. |
| 13:31 | dnolen | data sync across heterogenous devices is painful task. CouchDB makes that much simpler. |
| 13:31 | GOSUB | jcromartie: how tiny can erlang be? |
| 13:32 | dnolen | GOSUB: erlang VM runs in about 40mb-50mb of RAM, that's not mobile unfriendly. |
| 13:32 | jcromartie | it would kill an iPhone app |
| 13:33 | jcromartie | GOSUB: I am wrong there |
| 13:33 | jcromartie | I guess mobile Couch is not Erlang |
| 13:33 | GOSUB | dnolen: what kind of devices are you talking about? iPhone has 256MB RAM |
| 13:33 | GOSUB | jcromartie: in that case, they will lose a lot of things that come free with erlang. |
| 13:34 | jcromartie | yeah |
| 13:34 | GOSUB | anyway, I really hope CouchDB shines. after all, CouchDB is the one which started this non-relational database revolution. |
| 13:35 | jcromartie | I am seriously considering it, though. The only issue is that lack of ad-hoc queries. |
| 13:37 | GOSUB | jcromartie: take a look at mongodb for that. it's been amazing. |
| 13:38 | jcromartie | but I do like the Couch HTTP interface, which seems like a real bonus too |
| 13:38 | jcromartie | and basically means there is no driver to speak of |
| 13:39 | dnolen | GOSUB: considering what most iPhone apps do (besides games), 206MB of RAM is plenty. But yeah, when the devices hit the next step, 512mb, will be a more realistic option. |
| 13:39 | jcromartie | I've just got to try it. |
| 13:39 | jcromartie | I guess... |
| 13:39 | GOSUB | dnolen: you are right. |
| 13:40 | jcromartie | I need to come up with a solution for serializing and deserializing defrecords |
| 13:40 | GOSUB | jcromartie: jsonify? |
| 13:41 | jcromartie | maybe |
| 13:41 | jcromartie | haven't looked into it |
| 13:48 | LOPP | yep mongo DB looks promising |
| 14:05 | dnolen | nice! thinking Clojure for Java programmers, http://blog.factual.com/devblog/aaron/thinking-in-clojure-for-java-programmers-part-1-—-a-gentle-intro/ |
| 14:08 | chewbran1a | anyone have any experience using cascading (or cascalog) with amazon's elastic map-reduce? |
| 14:10 | technomancy | chewbran1a: ohai |
| 14:10 | chewbran1a | technomancy: hey how's it going? |
| 14:11 | chewbran1a | I just saw this: http://www.cascading.org/2009/04/amazon-elastic-mapreduce.html |
| 14:11 | chewbran1a | very intriguing |
| 14:14 | chewbran1a | right now I'm looking into what's involved in saving data into simpledb, then spinning up elastic map-reduce with cascalog/cascading |
| 14:15 | chewbran1a | I was originally planning on dumping data into couchdb as an intermediary data store, and then transfering data over to aws to run jobs on, but this looks like a much more simplified architecture |
| 14:16 | technomancy | IME things involving hadoop are rarely simpler than the alternative |
| 14:16 | technomancy | but I haven't used cascalog |
| 14:17 | chewbran1a | well I was planning on using hadoop either way, but not having to migrate the data from a remote couchdb instance into aws for hadoop is much simpler |
| 14:20 | technomancy | ah, I see |
| 14:21 | chewbran1a | going to be generating a lot of small data I need to process |
| 14:22 | fliebel | chewbran1a: If you use couch, be sure to do mass updates in that case, otherwise the HTTP overheat will be prohibitive. |
| 14:26 | chewbran1a | fliebel: yeah I hear you, most of the requests will be coming in sporadically from different sources, so if I wanted to do a mass update I would have to queue up all the requests and then push them, which isn't necessarily a bad option, its just not how the actual data is coming in |
| 14:45 | jcromartie | is there any way to have interactive prompts from Clojure when using Slime? |
| 14:45 | jcromartie | like, (read-line) |
| 14:45 | jcromartie | (which doesn't work in a Slime REPL) |
| 14:46 | jcromartie | or at least not a swank repl |
| 15:01 | jcromartie | oh http://stackoverflow.com/questions/1113705/java-input-in-clojure-with-read-line-not-reading-properly-in-emacs |
| 15:13 | jweiss | what's the functional way to do this. i have a list of fn's, a pred, and an initial value. i want to pass the initial value to the first fn, and keep feeding the result back into the next fn in the list, as long as the result passes the pred. |
| 15:15 | fliebel | jweiss: I think -?> does that. |
| 15:15 | fliebel | kind of... |
| 15:15 | jweiss | fliebel: yeah but that's a macro |
| 15:16 | jweiss | and the pred is just null? :) |
| 15:16 | jweiss | i want my own :) |
| 15:23 | cemerick | ,(last (filter #(< % 10) (reductions #(%2 %1) 0 [inc (partial * 5) (constantly 50)]))) |
| 15:23 | clojurebot | 5 |
| 15:23 | cemerick | jweiss: ^^ |
| 15:24 | cemerick | hrm, that won't work if any of your fns return nil; it's a start, anyway |
| 15:24 | fliebel | cemerick: Why filter? |
| 15:25 | fliebel | cemerick: I'm thinking take-while suits better. |
| 15:25 | cemerick | that's ensuring that your predicate holds (in this case, (< % 10) |
| 15:25 | jweiss | cemerick: seems like take-while could work |
| 15:25 | cemerick | sure, either-or |
| 15:26 | fliebel | cemerick: But with filter, if it returns false, and then true again, it will still take the true value. or am I sleepy? |
| 15:26 | chouser | oh, I *really* want to be able to load/reload an arbitrary .class file at the repl |
| 15:26 | cemerick | fliebel: no, you're right. |
| 15:28 | chouser | I can use .defineClass of clojure.RT/baseLoader to load a class file |
| 15:29 | chouser | and I thought, because of the cache stuff mentioned in the code there, that if I then refer to that class by name, I would get the one I loaded. |
| 15:29 | chouser | alas, it is not so. |
| 15:29 | chouser | does anyone have any hints for me? |
| 15:31 | jk_ | chouser: what about using classloader tricks directly like: http://tutorials.jenkov.com/java-reflection/dynamic-class-loading-reloading.html |
| 15:31 | jk_ | that might break clojure itself though... |
| 15:37 | bobo_ | any *MQ or other library that has pub sub implemented? |
| 15:38 | chouser | jk_: hmm, thanks. |
| 15:50 | ohpauleez | I love the Clojure community, I just want everyone to know that |
| 15:50 | ohpauleez | I really appreciate all of you |
| 15:51 | ohpauleez | I don't think I've ever seen a thread on the mailing list like the one that's happening now, before this point |
| 15:51 | ohpauleez | and the best part is NO ONE is attacking that dude, everyone is TRYING to help |
| 15:51 | ohpauleez | and no one has done a one line response |
| 15:52 | bobo_ | you got me curious, what thread? im to bad at reading the mailing list |
| 15:53 | ohpauleez | bobo_: Only read this if you have an hour to spare: http://groups.google.com/group/clojure/browse_thread/thread/59a22dcbc6be628f/72e2141ab404e7e2 |
| 15:53 | chouser | and please resist any urge to add to it |
| 15:53 | ohpauleez | You'll notice I haven't already :) |
| 15:54 | bobo_ | is it worth an hour? =) |
| 15:54 | ohpauleez | The sooner that dies, the better off we'll all be |
| 15:54 | chouser | bobo_: no |
| 15:54 | ohpauleez | bobo_: no |
| 15:54 | ohpauleez | it isn't |
| 15:54 | bobo_ | ok, il pass then! |
| 15:54 | chouser | wise choice |
| 16:46 | dsop | hmm sometimes I wish when-let doesnt bind if the binded val is () |
| 16:53 | amalloy | cemerick: josh and i got that findfn thing from last night working, and integrated into sexpbot as a plugin: |
| 16:53 | amalloy | $findfn [#{3 1} #{6}] #{1 3 6} |
| 16:53 | sexpbot | [clojure.set/union clojure.core/into] |
| 16:56 | 36DAAVIGZ | $findfn [{:foo "abc" :bar 123} :bar] {:foo "abc"} |
| 16:57 | 36DAAVIGZ | What just happened there? |
| 16:57 | amalloy | 36DAAVIGZ: i don't know; i think there's some kind of network thing going on atm |
| 16:58 | amalloy | $kill |
| 16:58 | sexpbot | KILL IT WITH FIRE! |
| 16:58 | Raynes | I'm sshing in to find out. |
| 16:59 | amalloy | Raynes: no, it's working. but it isn't finding an answer to his question for some reason |
| 16:59 | Raynes | amalloy: Get out of my screen session, you stalker. |
| 16:59 | amalloy | Raynes: dude, i told you, i barely know how to use screen |
| 16:59 | ohpauleez | haha |
| 16:59 | joshua__ | $findfn [:bar {:foo "abc" :bar 123}] {:foo "abc"} |
| 16:59 | sexpbot | [] |
| 17:00 | Raynes | amalloy: I have *got* to find a way to shut this apache logging off. /me tries mattrepl's trick. |
| 17:01 | joshua__ | &(dissoc {:foo "abc" :bar 123} :bar) |
| 17:01 | sexpbot | ⟹ {:foo "abc"} |
| 17:02 | amalloy | joshua__, Raynes: we can debug this in #() without bugging #clojure |
| 17:02 | Raynes | Or #sexpbot |
| 17:15 | ohpauleez | Raynes: do you want a pull request for the clj-github stuff or do you just want to peek at the commit log first? |
| 17:15 | Raynes | ohpauleez: A pull request would be nice and tidy, if you have a moment. |
| 17:16 | ohpauleez | Totally |
| 17:17 | scottj | What's the official site of the chrono date library? Is there a better joda wrapper? |
| 17:18 | brehaut | scottj: clj-time is a decent joda wrapper |
| 17:18 | technomancy | chrono got renamed to clj-time. =( |
| 17:18 | brehaut | oh |
| 17:20 | scottj | technomancy: and abandoned? |
| 17:20 | scottj | brehaut: I don't think chrono/clj-time is the same as clj-sys/clj-time |
| 17:20 | technomancy | dunno |
| 17:21 | Raynes | clj-sys is the canonical page. |
| 17:21 | Raynes | http://github.com/clj-sys/clj-time |
| 17:21 | Raynes | Definitely not abandoned. |
| 17:21 | scottj | Raynes: I think that's another project that happens to have the same name |
| 17:22 | Raynes | If you're looking for a Joda wrapper, either way, that's the project you're looking for. |
| 17:24 | Raynes | ohpauleez: Ooh, tests! I like you already. |
| 17:25 | ohpauleez | :) |
| 17:26 | Raynes | ohpauleez: Going through the commits as we speak. |
| 17:26 | ohpauleez | awesome, thanks |
| 17:29 | Raynes | ohpauleez: Added you as a collaborator so you'll have write access to the repo. Your first order of business can be to pull your pull request if you like. <3 |
| 17:29 | ohpauleez | Raynes: Thanks man! I appreciate it |
| 17:52 | joshua__ | Where can I find a summary of changes in clojure from 1.1 to 1.2? |
| 17:53 | joshua__ | (especially with focus on changes to how namespaces work) |
| 17:53 | joshua__ | https://github.com/clojure/clojure/blob/1.2.x/changes.txt |
| 17:54 | joshua__ | I have a function that runs in 1.1 but doesn't run in 1.2 |
| 17:55 | amalloy | joshua__: see my comment in #sexpbot |
| 17:55 | amalloy | it looks like derive throws an assertion error if you call it with bad args, instead of something more polite |
| 17:56 | joshua__ | How do you catch an assert? |
| 17:56 | joshua__ | nvm |
| 17:56 | Raynes | (catch AssertionError e ...) |
| 17:56 | joshua__ | $source derive |
| 17:56 | sexpbot | derive is http://is.gd/iRPrX |
| 17:56 | amalloy | joshua__: fixed |
| 17:57 | amalloy | i'll push in a sec |
| 18:00 | clizzin | does anyone happen to know how clojure.contrib.json compares to jackson via clj-json in terms of performance when reading json strings into clojure maps? |
| 18:07 | dakrone | clizzin: a very non-scientific comparison: http://p.writequit.org/json-perf.html |
| 18:10 | clizzin | dakrone: excellent, thank you. this jives with my own even less scientific comparisons. |
| 18:12 | dakrone | clizzin: you're welcome |
| 18:13 | rata_ | hi |
| 18:18 | rata_ | has anybody found this error before? Var incanter.core/$data is unbound |
| 18:22 | clizzin | dakrone: btw, would you be able to point me to the source for those json tests? it'd be useful to read them. |
| 18:23 | dakrone | clizzin: lemme throw up a github project with it |
| 18:25 | dakrone | clizzin: https://github.com/dakrone/jsontest based off of https://gist.github.com/316675 |
| 18:25 | clizzin | dakrone: cool, thanks! maybe it can even become scientific over time. ;) |
| 18:26 | dakrone | it's very hacked up, so take it with a block of salt |
| 19:21 | krumholt | Hi. is there a page about the clojure in clojure compiler? |
| 19:23 | ohpauleez | krumholt: For the design and benefits, or do you want to see the project on github? |
| 19:24 | krumholt | a page about the plans and who is working or planning on working on it would be nice :) |
| 19:25 | ohpauleez | krumholt: All design docs and proposals are on here: http://dev.clojure.org/display/design/Home |
| 19:25 | ohpauleez | awesome reads, all of them |
| 19:25 | krumholt | very nice. thanks |
| 19:26 | ohpauleez | you're totally welcome |
| 19:40 | joshua__ | http://blog.factual.com/devblog/aaron/thinking-in-clojure-for-java-programmers-part-1-%E2%80%94-a-gentle-intro/ (enjoying this article) |
| 19:40 | joshua__ | (very basic though) |
| 20:14 | zemariamm | Hello veryone |
| 20:14 | zemariamm | I'm trying to write a simple webapp using ring and appengine-magic |
| 20:15 | zemariamm | however I can't find out how to use more than one ring handler in appengine-magic |
| 20:18 | joshua__ | brehaut, so you think defn should have been deffn? |
| 20:19 | brehaut | no i dont :) |
| 20:19 | brehaut | that would be ugly and annoying to type |
| 20:19 | joshua__ | Oh! I thought you were agreeing with him that it was a bad name for some reason. |
| 20:19 | joshua__ | My bad. |
| 20:19 | brehaut | ah true |
| 20:20 | brehaut | i should edit that, its ambiguous |
| 20:20 | amalloy | where is this ambiguous statement? |
| 20:20 | brehaut | hacker news |
| 20:20 | brehaut | amalloy: http://news.ycombinator.com/item?id=2014565 |
| 20:21 | brehaut | joshua__: clearer now? |
| 20:22 | joshua__ | yea |
| 20:22 | brehaut | cool |
| 20:22 | joshua__ | I'm not sure how I read it so wrong so many times in a row. It seems pretty clear what you meant once I knew what you meant. haha |
| 20:22 | brehaut | haha that was my blind spot too :P |
| 20:55 | zemariamm | just posted a question on st regarding handlers and ring |
| 21:13 | joshua__ | Considering trying to scrape all of delciious.. |
| 21:22 | joshua__ | Decided against it. |
| 21:36 | joshua__ | How do you delete all tagged text in emacs? |
| 21:36 | joshua__ | Like the stuff you've highlighted. |
| 21:39 | joshua__ | C-w for those that were wondering. |
| 21:44 | amalloy | joshua__: text between mark and point is called the region, btw |
| 21:44 | joshua__ | amalloy, thanks. I'll try to use the proper term in the future. |
| 21:44 | amalloy | there's an option to delete the region when you type something, emulating the behavior of more modern apps |
| 21:46 | amalloy | ah, there it is. it's called delete-selection-mode; you can customize it as usual with M-x customize-variable |
| 22:02 | joshua__ | ls |
| 22:02 | joshua__ | oops, this isn't my terminal |
| 22:03 | amalloy | src/ bin/ awesome.clj |
| 22:23 | duck1123 | If I run a lazytest watcher and a compojure app from the same repl, I find that the compojure app doesn't reflect the changes I make. Anyone know why? |
| 22:24 | joshua__ | Coolest application I've ever seen: (update :posts a-post (merge a-post {:id (second (re-matches #"item\?id=(\d+)" (:link a-post)))})) |
| 22:24 | joshua__ | oops |
| 22:25 | joshua__ | http://questvisual.com/ |
| 22:26 | _ato | wow |
| 22:30 | amalloy | joshua__: i have never been so sad to own an android |
| 22:31 | Raynes | joshua__, amalloy: I've never been so sad to not own... well.. anything. |
| 22:35 | m7d | i have a weird question for this forum, but someone might know the answer if they had to build tokyocabinet-java for OSX |
| 22:35 | m7d | i am trying to tell configure where to find jni.h and am having trouble with it |
| 22:36 | m7d | on os x, jni.h is located here: /System/Library/Frameworks/JavaVM.framework/Headers |
| 22:36 | m7d | and if i do export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework |
| 22:36 | m7d | and then ./configure it should pick it up, but alas it isn't |
| 22:37 | m7d | interestingly, sudo port install tokyocabinet-java fails for the same reason |
| 22:37 | m7d | i need it for jiraph, the clojure graph database |
| 22:37 | m7d | any ideas? |
| 22:37 | m7d | tokyocabinet is installed just fine |
| 22:38 | m7d | just need the java bindings |
| 22:59 | lancepantz | m7d: you're in luck |
| 23:00 | lancepantz | it's really easy if you're using cake master |
| 23:00 | lancepantz | from jiraph route, use cake install-native |
| 23:00 | lancepantz | *root |
| 23:44 | auser | um... so what does this error mean: Duplicate method name&signature in class file? |
| 23:44 | auser | rather, anyone know? |
| 23:45 | joshua__ | Where would you go for the best intro to using mongo db in clojure? |
| 23:45 | joshua__ | I don't know what it means, but it sounds like you have two methods that take arguments of the same type. |
| 23:46 | auser | well... I'm doing a (gen-class with :implements... |
| 23:46 | auser | so... in order to actually use the class I'm generating, it has to have the same signature, right? |
| 23:48 | auser | <~ confused |
| 23:48 | joshua__ | Don't know, I'm new to clojure too. I just know that when I took C++ a while back signature referred to the method name and the arguments types that method took. So I was sort of guessing. |
| 23:48 | auser | well, that's exactly right, that's the problem... I just am trying to fix ti |
| 23:48 | auser | it* |
| 23:49 | joshua__ | http://stackoverflow.com/questions/1627747/problem-extending-a-class-in-clojure-classformaterror-duplicate-field-namesign |
| 23:49 | auser | not entirely certain how to fix it though, 'cause it "needs" the methods named that way, otherwise... |
| 23:49 | auser | op |
| 23:49 | joshua__ | Hope that helps =). |
| 23:49 | auser | yeah, that's doesn't quite fix it though |
| 23:49 | auser | I saw it |
| 23:49 | auser | thanks for the link though |
| 23:54 | amalloy | auser: i'd guess you're not type-hinting the arguments |
| 23:54 | _ato | auser: this might be relevant: http://dishevelled.net/Tricky-uses-of-Clojure-gen-class-and-AOT-compilation.html |
| 23:56 | amalloy | joshua__: looking for anything in particular? sexpbot has several uses of mongo, of varying complexity you could steal from |
| 23:58 | joshua__ | A taggable post with threaded comments. The body of the comments should be a wiki. I should be able to link to one comment in particular within the the threaded comments. |
| 23:59 | joshua__ | I'm brand new to mongodb so I'm not sure how to accomplish all of that just yet. |