2009-11-26
| 00:00 | somnium | alexyk: for bootstrapping its probably faster to use java interop than congomongo, JSON/parse creates BasicDBObjects that you can pump straight into the collection |
| 00:00 | somnium | it must be faster, since congomongo just wraps it with a function call :p |
| 00:01 | alexyk | somnium: cool, will study |
| 00:04 | alexyk | _ato: about JIT, if you call things twice in repl, does it matter if it's the first time or second? |
| 00:05 | alexyk | 'cause the stuff was slow the first time and fast the second time |
| 00:05 | alexyk | somnium: I have a clojure-new and contrib standing by :) |
| 00:05 | _ato | yeah, it'll get fast the first few times you call it |
| 00:06 | _ato | cause the JIT doesn't optimise until it's seen a few runs through, as it does all this timing stuff to figure out how best to optimise it |
| 00:07 | _mst | isn't "a few" something like "a thousand" with -server? |
| 00:08 | _ato | yeah... "a few" means "a thousand" for a tight inner loop :p |
| 00:08 | _mst | heheh |
| 00:09 | _ato | as opposed to "a fair amount" which would be "a million" or "a lot" which would be "a billion" |
| 00:10 | _mst | so if I say "Hey _ato, could you lend me a few bucks"... |
| 00:10 | _mst | you'll probably refuse |
| 00:10 | zaphar_ps | is there a way to make private multi-methods? |
| 00:11 | _ato | zaphar_ps: (defmulti #^{:private true} my-multi ...} |
| 00:11 | _ato | there might be a nice macro to do it in contrib |
| 00:12 | _ato | nope looks like there's not |
| 00:12 | _ato | someone should add one |
| 00:12 | zaphar_ps | :-) |
| 00:13 | zaphar_ps | that works |
| 00:13 | _ato | _mst: it's all relative. I'd lend you a few won :-P |
| 00:13 | zaphar_ps | and your right someone should add one |
| 00:14 | _ato | I would, but it seems Rich still hasn't got my CA yet. :( |
| 00:14 | _ato | might have to send another one |
| 00:15 | _ato | maybe the Post couldn't read my terrible handwriting :p |
| 00:19 | alexyk | nice, 100M twit scan stabilized at 8 GB RAM |
| 00:20 | alexyk | somnium: so the branch is just "new", right? |
| 00:23 | somnium | alexyk yeah, if you cloned clojure from github you should already have it |
| 00:24 | alexyk | yep... then it's cooking, although with the old congomongo :) |
| 00:25 | alexyk | why does clojure CPU usage jumps to 300-500% in a single-threaded program? I mean, may be one thread is loading from mongo, but 300-500%? Is it parallel GC? |
| 00:26 | alexyk | it flips between 100% and 200-500% |
| 00:29 | somnium | alexyk: hmm, I seem to have misplaced it, but I should time to post it this weekend. It just mapped the coerce functions to protocols on IPersistentMap, ClojureDBObject, String ... seriously kills the function call overhead |
| 00:29 | alexyk | somnium: cool, let me know when you find/push it! |
| 00:31 | alexyk | still looks like clojure likes it RAM quite filling... 10 GB already for reducing into an update-in map with 5 million keys |
| 00:31 | alexyk | or is it GC not bothering |
| 00:32 | _ato | could GC not bothering if you've got a large max heap |
| 00:32 | alexyk | do you guys recommend some GC option? I like to set -Xmx50g for these works |
| 00:32 | hiredman | ther are options you can pass to the jvm so it will print out GC statistics |
| 00:32 | hiredman | ~google headius jvm flags |
| 00:32 | clojurebot | First, out of 249 results is: |
| 00:33 | clojurebot | Headius: My Favorite Hotspot JVM Flags |
| 00:33 | clojurebot | http://blog.headius.com/2009/01/my-favorite-hotspot-jvm-flags.html |
| 00:33 | _ato | if you've got 50G of RAM to burn, sure give it as much as you like |
| 00:36 | alexyk | hiredman: nice options, thx |
| 00:37 | alexyk | is using the "new" branch OK for everyday research coding? no deployment, no nothin' |
| 00:39 | somnium | it seems to work okay with compojure as long as everything is recompiled |
| 00:39 | somnium | though I'm not qualified to answer that question :p |
| 00:40 | alexyk | are the bug fixes merged from new to 1.1, or the other way? |
| 00:41 | _ato | bugfixes from 1.1 will be merged into new |
| 00:41 | alexyk | _ato: so the development is on 1.1, and new is for purely experimental stuff? |
| 00:42 | _ato | "new" is just for types and protocols and reify related features. Those features used to be called "new new" as they used to be implemented using the the "new" special form |
| 00:43 | _ato | (new ...) |
| 00:43 | hiredman | most developement seems to be on new these days |
| 00:43 | somnium | the way new is moving it feels like 1.0 could almost be deprecated |
| 00:44 | hiredman | within the last two days or so there has been renewed interest in pushing 1.1 out the door, so 1.1 should kind of settle down for bugfixing |
| 00:45 | hiredman | somnium: the new branch stuff will not be in the 1.1 release |
| 00:46 | notallama | i'm really liking protocols. |
| 00:46 | somnium | me too |
| 00:50 | alexyk | somnium: I'm pondering parallelization of mongo scan. Say I split my collection into 8, for the 8 cores I get. Or into 32, for the 32 actual ones (8 quad-cores). Then I create N threads, each opens a mongo connection to its collection, and they all start going. Possible? |
| 00:51 | alexyk | then in STM they all sync/merge their maps. |
| 00:51 | somnium | alexyk: its possible, but mongo is single threaded |
| 00:51 | somnium | alexyk: until 1.1.4 they say |
| 00:51 | somnium | alexyk: so they're all going to block while one talks to its cursor |
| 00:51 | alexyk | somnium: you mean one mongod will not serve more than one client thread?? |
| 00:51 | somnium | yep |
| 00:51 | alexyk | man... |
| 00:51 | somnium | on the brightside its very fast, but still, you have to created multiple mongods |
| 00:52 | alexyk | somnium: ah, I can do that. |
| 00:52 | alexyk | I wish I woudln't have to shard manually. |
| 00:52 | somnium | I haven't experimented with that to much, but they have some utilities I think |
| 00:53 | alexyk | When it becomes multi-threaded, I wonder how clojure can be used to do the split/merge I described automatically. E.g. creating N cursors into the same collection at offsets... |
| 00:53 | somnium | concurrent reads will help a lot, writes will always lock the whole collection they say |
| 00:53 | alexyk | somnium: I write once, then just read. I can write derivatve results into new collections. |
| 00:57 | somnium | create size-of-db/num-of-cores futures maybe? It's not guaranteed to be in 1.1.4 unfortunately, but its scheduled |
| 00:58 | somnium | I expect clojure's STM will make it relatively painless |
| 00:58 | alexyk | looked at protocols -- smacks of OO to me! :) |
| 00:59 | alexyk | I got tied up in Scala typesystem instead of doing work already once... :) |
| 01:00 | somnium | its kind of like a mix-in only compositional OO, very unique |
| 01:00 | somnium | I'm eager to see more examples of its use in the wild |
| 01:02 | alexyk | somnium: 100M twits done in 2800 secs, 13 GB max out of 20 GB allotted, not bad! :) |
| 01:02 | alexyk | mongod load was 7% max |
| 01:02 | alexyk | you're not banging hard enough on it :) |
| 01:02 | alexyk | or it's the java driver |
| 01:03 | somnium | should it be higher? |
| 01:03 | somnium | have to ask the mongodevs |
| 01:03 | alexyk | somnium: I dunno... I like high % :) |
| 01:04 | alexyk | I mean, if we read faster than it can serve, it should go to 100% CPU |
| 01:04 | somnium | its all c++ and they have to make concurrent |
| 01:04 | cark | well it's mostly doing io so i don't see why the processor would go crazy |
| 01:05 | cark | i bet the bottleneck is your clojure processing |
| 01:05 | alexyk | cark: true |
| 01:05 | alexyk | disk IO, forget 100%, 7% is good enough |
| 01:06 | cark | what's the charge on your java process ? |
| 01:06 | alexyk | cark: it was 100% CPU to 750% at some point |
| 01:06 | cark | there you go |
| 01:07 | cark | that's _you_ not banging hard enough =P |
| 01:07 | alexyk | cark: my first 2 lines of clojure doing work :) |
| 01:07 | alexyk | of 100 lines of scala before it |
| 01:07 | alexyk | under the banner of "screw types" |
| 01:08 | cark | anyways don't worry about performances quite yet |
| 01:08 | cark | just do what you want to do with this data |
| 01:10 | alexyk | cark: I have too much of it, so the test here was if clojure is up to it at all, with immutable maps and all that. Scala has mutable maps which I can update like Perl, almost, after doing all types right; I could use immutable ones, too, but it's easy to get the mutable ones, here I have to reduce over all data. |
| 01:10 | somnium | the real project is rewriting mongodb in clojure :p |
| 01:10 | alexyk | somnium: NO! |
| 01:10 | alexyk | I need my json fast :) |
| 01:11 | technomancy | http://twitter.com/yukihiro_matz/status/5959547376 <= "I got to look into metadata in Clojure." (from Matz, of Ruby fame) |
| 01:11 | somnium | if the jvm propaganda is true, it should be equivalent to c++ in raw speed |
| 01:12 | alexyk | how do I sort a map of {int int} by value descending? |
| 01:12 | somnium | technomancy: that is awesome |
| 01:12 | cark | aldebrn: what do you want to sort, keys or values ? |
| 01:12 | hiredman | somnium: the place it should shine in long running backends |
| 01:13 | cark | err alexyk i mean |
| 01:13 | alexyk | cark: values |
| 01:13 | hiredman | because the jvm start up time can be ignored and the jvm has time to optimize |
| 01:13 | cark | well you don't sort a map .... |
| 01:13 | cark | you may sort the values |
| 01:13 | alexyk | cark: I mean convert to tuples and sort those |
| 01:13 | alexyk | as a vector |
| 01:13 | _mst | alexyk: looking at your original example, it seems that you could save a bit of GC overhead by reducing into a (transient {}) assuming it's all single-threaded |
| 01:13 | cark | (sort (vals my-map)) |
| 01:14 | alexyk | cark: I need keys too |
| 01:14 | somnium | yeah, + I wonder what the codebase reduction size alone would be, no garbage-collection and manual locks ... |
| 01:14 | hiredman | ,(sort {:a 1 :b 2}) |
| 01:14 | clojurebot | ([:a 1] [:b 2]) |
| 01:14 | alexyk | _mst: just that, (transient {}) ? |
| 01:15 | alexyk | hiredman: and descending? |
| 01:15 | hiredman | alexyk: reverse |
| 01:15 | alexyk | hiredman: cheating :) |
| 01:15 | cark | that's sorted by key then value hiredman |
| 01:15 | hiredman | cark: so? |
| 01:16 | cark | he wants sorted by value |
| 01:16 | _mst | http://paste.pocoo.org/show/153006/ |
| 01:16 | hiredman | ,(sort-by (comp > val) {:a 1 :b 2}) |
| 01:16 | clojurebot | ([:a 1] [:b 2]) |
| 01:16 | hiredman | ,(sort-by (comp < val) {:a 1 :b 2}) |
| 01:16 | clojurebot | ([:a 1] [:b 2]) |
| 01:16 | _mst | something like that :) |
| 01:16 | hiredman | grrr |
| 01:16 | _mst | oh, without (get-twits)--my test version, sorry |
| 01:16 | hiredman | ,(doc sort-by) |
| 01:16 | clojurebot | "([keyfn coll] [keyfn comp coll]); Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item). If no comparator is supplied, uses compare. comparator must implement java.util.Comparator." |
| 01:17 | hiredman | ,(sort-by val > {:a 1 :b 2}) |
| 01:17 | clojurebot | ([:b 2] [:a 1]) |
| 01:17 | hiredman | ,(sort-by val < {:a 1 :b 2}) |
| 01:17 | clojurebot | ([:a 1] [:b 2]) |
| 01:17 | cark | ,(sort-by (comp < second) {:a 1 :b 2}) |
| 01:17 | clojurebot | ([:a 1] [:b 2]) |
| 01:17 | cark | ,(sort-by (comp > second) {:a 1 :b 2}) |
| 01:17 | clojurebot | ([:a 1] [:b 2]) |
| 01:17 | hiredman | forget the comp |
| 01:18 | alexyk | _mst: ah, so it's kinda reusing the map in a mutable way? |
| 01:18 | _mst | yep, building it up initially then making it persistent at the very end |
| 01:19 | cark | ,(sort (map (fn [[a b]] [b a]) {:a 1 :b 2})) |
| 01:19 | clojurebot | ([1 :a] [2 :b]) |
| 01:20 | cark | ,(into (sorted-map) (map (fn [[a b]] [b a]) {:a 1 :b 2})) |
| 01:20 | clojurebot | {1 :a, 2 :b} |
| 01:21 | cark | that's better ! |
| 01:27 | alexyk | cark: timings: 1st version: 52 sec , 2nd: 20 sec. Still *a lot* for just 7.5 million pairs! |
| 01:28 | alexyk | I added reverse to both to get descending order |
| 01:28 | cark | well it's constructing a tree |
| 01:28 | alexyk | how do I flatten the map first into a vector of pairs? |
| 01:28 | cark | a map is a seq, so you may consider it flattened |
| 01:29 | somnium | ,(seq {:a 1 :b 2}) |
| 01:29 | clojurebot | ([:a 1] [:b 2]) |
| 01:29 | hiredman | woa |
| 01:29 | hiredman | no |
| 01:29 | hiredman | maps are not seqs |
| 01:29 | hiredman | they are Sequable |
| 01:29 | cark | yeah sorry it's sequable ! |
| 01:29 | hiredman | so most sequence functions call seq on their arguments |
| 01:31 | cark | i beleive sort uses java sort and copies everything in an array or something, so that would make it slow as well |
| 01:32 | cark | did someone try making a merge sort in clojure ? |
| 01:33 | alexyk | (time (def us3 (sort #(> (%1 1) (%2 1)) (vec users)))) ; that's just 10 secs |
| 01:35 | cark | nice =) |
| 01:35 | alexyk | are vectors more suitable for sorting than lists? |
| 01:36 | cark | @def sort |
| 01:36 | cark | pff how did that work again hiredman ? |
| 01:37 | hiredman | ~def sort |
| 01:37 | cark | thanks |
| 01:37 | hiredman | clojurebot: source sort |
| 01:38 | hiredman | etc |
| 01:38 | alexyk | cute |
| 01:38 | cark | that last one is easy to remember |
| 01:38 | cark | anyways you may test it with seq instead of vec |
| 01:39 | hiredman | hmmmm |
| 01:40 | cark | should be faster no ? |
| 01:40 | hiredman | you might look at doing some kind of in place quicksort with a transient vector |
| 01:40 | alexyk | hah: http://twitter.com/yukihiro_matz/status/5883125759 |
| 01:42 | somnium | what happens if you send a potentially block action to agent with send instead of send-off? |
| 01:42 | rlb | somnium: you might block all the agent threads if you do it enough (I think) |
| 01:43 | cark | there is only a limited number of threads |
| 01:43 | somnium | ah, ok, send-off get its a dedicated thread |
| 01:43 | rlb | it's definitely not what you want to do. |
| 01:43 | rlb | somnium: send-off pulls from an expandable thread pool |
| 01:43 | alexyk | cark: seq is about the same is vec. if it's all sent off to Java, prolly doesn't matter much. |
| 01:44 | cark | vec does construct a vector, but it's very fast |
| 02:04 | defn | vec is faster than a seq |
| 02:05 | defn | alexyk: What does Matz mean "more conservative"? |
| 02:05 | defn | Maybe the word he was looking for was "slower" |
| 02:06 | alexyk | defn: probably) |
| 02:06 | alexyk | how do I sort a vec in place with transient? |
| 02:08 | hiredman | don't know that there is anything existing for that |
| 02:09 | defn | any estimates on how long this will take: (time (reduce + (range 1 1000000000))) |
| 02:10 | hiredman | a long time |
| 02:10 | hiredman | for future reference |
| 02:11 | hiredman | ,1e8 |
| 02:11 | clojurebot | 1.0E8 |
| 02:22 | defn | how the hell do i compile my .clj file |
| 02:22 | hiredman | why? |
| 02:23 | hiredman | anyway |
| 02:23 | defn | i dunno, my friend is giving me crap about using unix time versus (time) |
| 02:23 | hiredman | ~compile |
| 02:23 | clojurebot | the unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation |
| 02:23 | hiredman | defn: I fail to see what that has to do with compilation |
| 02:24 | defn | i need to run my clj file from the command line with `time` |
| 02:24 | defn | $ time java myfile |
| 02:24 | hiredman | you can do that without compilation |
| 02:24 | defn | oh? how? |
| 02:24 | alexyk | _mst: indeed, your ! version did it in 1900 secs, instead of the original 2800 secs |
| 02:24 | hiredman | time java clojure.main file |
| 02:25 | cark | but then you're benchmarking compilation |
| 02:25 | hiredman | which does not take much time |
| 02:25 | cark | depends on the program =/ |
| 02:25 | hiredman | unless you loading something complex, jvm startup time will drown out compile time |
| 02:25 | defn | (time (/ (* 1000000000 (inc 1000000000)) 2)) |
| 02:26 | hiredman | you are |
| 02:26 | defn | that's what im compiling |
| 02:26 | hiredman | defn: that is dumb |
| 02:26 | defn | i agree |
| 02:26 | defn | like i said, im humoring him |
| 02:26 | hiredman | so tell you friend to buzz off |
| 02:26 | hiredman | your |
| 02:26 | defn | if i tell him to buzz off, im down to 1 |
| 02:26 | defn | lol |
| 02:26 | hiredman | and go fork a github project or start one |
| 02:27 | hiredman | or ignore his jibs |
| 02:27 | cark | http://github.com/cark/clj-exe-jar |
| 02:27 | cark | that's a sample executable jar project |
| 02:30 | defn | god my friend is annoying |
| 02:30 | defn | this guy thinks C > * no matter what |
| 02:31 | hiredman | have you ever heard of fan death? |
| 02:31 | defn | no |
| 02:31 | defn | what's that? |
| 02:31 | hiredman | http://en.wikipedia.org/wiki/Fan_death |
| 02:32 | hiredman | a belief far stranger than "C > * no matter what" held by far more people |
| 02:32 | defn | haha |
| 02:33 | defn | i mean i can see why he'd believe that and all, but it doesn't change the fact that his 600 lines of gruelingly optimized C will only match my 100 lines of clj |
| 02:34 | defn | in short, this guy just absolutely despises it when he doesnt know something that someone else does, so he belittles it until he learns about it |
| 02:34 | defn | it's really annoying |
| 02:35 | defn | i try to humor him and explain things, but he has things condescending attitude towards things he doesn't grok |
| 02:35 | defn | this* |
| 02:36 | defn | i need to move, no one here gets it |
| 02:37 | hiredman | who is more silly, the man who throws pearls before swine? or the swine who ignore the pearls for their slop? |
| 02:37 | defn | the man |
| 02:37 | defn | he knows better |
| 02:38 | defn | or..was that rhetorical? :) |
| 02:38 | hiredman | I wasn't actually expecting an answer |
| 02:38 | defn | i mean, a pig ignoring some pearls seems plausible, an idiot throwing them in front of pigs, now that's silly |
| 02:38 | defn | IMO |
| 02:39 | cark | i think your friend is right, c is the best language for a lot of things. clojure is best for other things |
| 02:40 | defn | yeah and ive totally offered that, but the difference is i know some C, and he knows nothing of clojure |
| 02:40 | defn | he calls some of the things ive explained to him about clojure "magic" |
| 02:40 | cark | anyway why do you need to convert him ? |
| 02:40 | defn | "impossible", etc. |
| 02:40 | defn | i dont |
| 02:41 | defn | it's just discussion that comes up about projects we're working on, and he gets all "go more low level" on me |
| 02:41 | defn | but he does this without any knowledge of clojure whatsoever |
| 02:42 | defn | i think that's the main thing that aggravates me: he knows absolutely nothing about clojure and talks about it like he's an authority |
| 02:42 | cark | i can understand that point of view, it sometimes amaze me to see how much memory or cycles i'm using with higher level languages |
| 02:42 | cark | then i think at developement time, and i feel better =) |
| 02:43 | defn | cark, yeah, i dont know, i wish you could have a conversation with the guy -- it's not so much the content of what he says, it's his lack of perspective that makes it all so suspect |
| 02:43 | cark | hehe i'd rather leave the guy to you =) |
| 02:44 | defn | haha *stab* |
| 02:46 | defn | sorry for airing out the dirty laundry here, but this guy pisses me off when it comes to code, he thinks because he got his undergrad that he knows everything there is to know about CS, very arrogant with absolutely no public projects, no experience outside of his comfort zone, etc. |
| 02:46 | defn | i think he's in for a rude awakening |
| 02:46 | defn | s/think/hope ;) |
| 02:47 | cark | i don't think having public projects is a good measure of a programmer's worth |
| 02:47 | cark | it only makes it visible |
| 02:48 | defn | i get the sense that he has no projects |
| 02:48 | defn | other than critiquing other people's projects |
| 02:49 | defn | cark, you're right to play devil's advocate, i am probably being too harsh, but i'm reminded of Alan Kay's quote: |
| 02:49 | defn | Perspective is worth 80 IQ points. |
| 02:49 | cark | =) |
| 02:52 | defn | so cark, what's up? |
| 02:52 | defn | how goes the clojue? |
| 02:53 | defn | clojure* |
| 02:53 | cark | heh well currently doing the last touches to a clojure application that's already running at a customer's |
| 02:53 | cark | still using 1.0 |
| 02:54 | defn | nice. 1.1.0 is looking pretty promising |
| 02:54 | cark | i want new ! |
| 02:54 | defn | what sort of app> |
| 02:54 | defn | ?* |
| 02:54 | cark | that's a web app, talking to telephony equipment |
| 02:55 | cark | and managing customer/agents/pricelists all that stuff |
| 02:55 | defn | like muxes? |
| 02:55 | cark | like voip switches |
| 02:55 | defn | ahhh |
| 02:56 | defn | touchy stuff |
| 02:56 | defn | SLA's and all of that |
| 02:56 | cark | pretty boring actually ! |
| 02:56 | defn | yeah but if it goes down... |
| 02:56 | cark | hehe yes, we have lots of testing going on |
| 02:56 | defn | oh man, black friday |
| 02:56 | defn | dont get me started |
| 02:57 | defn | clients are losing their minds, conference bridges for 4-12hrs per day |
| 02:57 | defn | massive testing, etc. to get ready for xmas |
| 02:57 | cark | mhh i'm pretty well insulated from end-users |
| 02:58 | cark | i have the filter of my direct customer |
| 02:58 | cark | he takes care of interaction with end-users |
| 02:58 | defn | *nod* |
| 02:58 | cark | that's very convenient believe me =) |
| 02:59 | defn | I am not so lucky -- living where I do I'm stuck providing support |
| 02:59 | defn | Like I said before, I need to move... |
| 02:59 | defn | are you W. coast? |
| 03:00 | cark | i'm from europe =) |
| 03:00 | defn | ah, wherabouts? |
| 03:00 | cark | belgium |
| 03:00 | defn | beautiful country |
| 03:00 | defn | I visited there in 2003 |
| 03:00 | cark | nice, where are you from ? |
| 03:00 | defn | The states, WI |
| 03:00 | cark | that's quite a trip ! |
| 03:01 | defn | :) |
| 03:01 | defn | Have laptop. Will travel. |
| 03:01 | defn | http://en.wikipedia.org/wiki/Have_Gun_–_Will_Travel |
| 03:01 | cark | i've spent a couple months in texas working for a small telco |
| 03:02 | cark | that remains a great memory |
| 03:02 | defn | where in TX? |
| 03:03 | cark | San Antonio, that year the spurrs won |
| 03:03 | defn | haha, Dennis Rodman! |
| 03:03 | cark | though i don't know a bit about basketball, it was fun to see the poeple go crazy =) |
| 03:04 | defn | that was what? 1997? 98? |
| 03:04 | cark | i'm not quite sure |
| 03:04 | cark | was before 2000 |
| 03:04 | defn | Do you guys still refer to telcos as PTTs? |
| 03:05 | cark | it has been a while since i heard that =) |
| 03:05 | defn | hehe |
| 03:05 | cark | we sy providers, carriers etc |
| 03:05 | cark | say |
| 03:05 | defn | I worked with a German guy who refused to call them anything but PTTs |
| 03:06 | defn | as if our teclos provided telegraph service |
| 03:06 | defn | lol |
| 03:06 | defn | telcos* |
| 03:06 | cark | erm well they did not so long ago |
| 03:06 | defn | yeah i think they stopped in the late 90s |
| 03:06 | defn | but still, pretty ancient tech. :) |
| 03:06 | cark | hehe yes |
| 03:06 | cark | i think we catched up tho |
| 03:08 | defn | sure you did! |
| 03:08 | cark | you know what, while in texas, i was working on a web site interfacing with telephony switches .... looks like i am time warping =/ |
| 03:09 | defn | the infrastructure is there i suppose |
| 03:09 | defn | it's easier now |
| 03:09 | defn | that's for sure |
| 03:10 | cark | im' really not much in infrastructure/cable stuff. customer wants something i get it done, i'll never touch the telephony/networking stuff |
| 03:11 | defn | i get the firehose of alerts and alarming for all of the telephony/networking for my company |
| 03:11 | defn | and need to develop monitoring systems to distribute that info appropriately |
| 03:11 | cark | ah man, that must be sometimes annoying |
| 03:11 | defn | very. |
| 03:12 | defn | but it is rewarding also |
| 03:12 | cark | i changed direction when i first received a call on new year's eve |
| 03:12 | cark | that day i decided it wouldn't do |
| 03:12 | defn | i will eventually move in a different direction |
| 03:12 | cark | ah sure when you save the day, it's very rewarding |
| 03:13 | defn | im slowly learning about concurrency and and parallelism and all of that business |
| 03:13 | defn | my goal is to make that sort of thing my du jour |
| 03:13 | defn | move away from the reactive stuff |
| 03:13 | defn | and go more towards the proactive development side |
| 03:13 | defn | that's where my passion is |
| 03:14 | cark | well there's always a reactive part, and pressure from customers and such |
| 03:14 | defn | parse 1,000,000,000 log entries in 10min, that sort of that |
| 03:14 | defn | yeah im sick of that TBQH |
| 03:14 | cark | that never goes away =) |
| 03:14 | defn | our customers dont know how good they have it, i am frequently abused |
| 03:15 | defn | what got you into the PTT stuff? |
| 03:15 | cark | man that's quite a story |
| 03:16 | cark | i've always played with computer, and programming |
| 03:16 | cark | but never thought about making it my job |
| 03:16 | cark | my brother the same |
| 03:16 | cark | one day some guy calls my brother and ask him to do a "quick software" for him |
| 03:17 | cark | he says, i won't do that, talk to my brother ... i spent 10 years writing and perfecting that software |
| 03:18 | cark | it sold quite well too =) |
| 03:18 | cark | and there i was in the loop |
| 03:18 | defn | hehe, that is quite the story! :) I felt the same way when I realized I could make money from programming |
| 03:19 | defn | I was studying music, guitar performance, jazz guitar, and then I realized that all of the time I wasn't playing guitar I was spending on my computer doing XYZ, tinkering |
| 03:20 | defn | guitar is my love that should be protected from financial gain |
| 03:20 | defn | and programming is my passion which ought to be exploited! |
| 03:20 | cark | hehe |
| 03:21 | cark | then you have programmers that don't touch a computer excpet between 8:00 and 16:00 |
| 03:21 | defn | come one, come all! exploit me! |
| 03:21 | defn | yeah i dont understand that |
| 03:21 | defn | and i never will |
| 03:21 | defn | to me they are phonies |
| 03:21 | cark | or maybe we're monomaniacs =) |
| 03:21 | defn | hahaha |
| 03:22 | defn | *maybe* |
| 03:22 | defn | I mean, if you had to choose the person writing you software where you have an agreement with a client to guarantee 99.99% uptim |
| 03:22 | defn | uptime* |
| 03:23 | defn | would you want a 9am-5pm guy? or would you want a 24/7 guy? |
| 03:23 | defn | it seems like a no brainer |
| 03:23 | cark | right, but what they want is not 99.99% |
| 03:23 | cark | they want it cheap and for yesterday |
| 03:24 | cark | unless you're working for google i guess |
| 03:24 | defn | that's a dilemma as well, I suppose |
| 03:25 | defn | but even in that scenario, it is implied that 99.99% uptime is a requirement |
| 03:25 | defn | AND that they wanted it yesterday, for free |
| 03:25 | cark | =) |
| 03:25 | cark | there's the famous "cheap, quick, quality : pick 2 of these" |
| 03:27 | defn | sometimes you will meet someone with vision though |
| 03:27 | defn | someone who has some long term vision who can justify spending more to get what he needs for 5 years |
| 03:27 | defn | versus what he needs tomorrow |
| 03:28 | defn | those are the good managers |
| 03:28 | cark | i had not much chance in that regard i guess |
| 03:29 | defn | ive had 2 |
| 03:29 | defn | they understood that what i did was important to me, and that i worked hard to make it good |
| 03:30 | defn | and they told the customer to piss off when they rushed me |
| 03:30 | defn | unfortunately it seems like those guys move around a lot |
| 03:31 | cark | i don't think that this is a good survivalbility skill for a manager these dys |
| 03:31 | cark | days |
| 03:32 | cark | it's all about quick time to market |
| 03:33 | cark | anyways, it's time for me to go |
| 03:33 | cark | good err nnight i guess |
| 03:33 | cark | nice talking to you |
| 03:35 | defn | you too cark -- good night :) |
| 07:07 | esj | alright - too quiet in here. I'll ask a question: In the docs the performance of the collection datastructures is spec'd like "Vectors support access to items by index in log32N hops." Am I correct to understand that this is log_32(N), and not log(32*N), and that by hops we're talking about the lookup to go down a level in the trie ? |
| 07:14 | Chousuke | yeah, it's log_32 |
| 07:14 | esj | thanks, this makes more sense now. |
| 07:16 | Ringding | I have a related question: given two huge trees which differ by exactly one element, is it possible to find this element efficiently? |
| 07:17 | Ringding | I.e., can I access the trie's internal structure? |
| 07:24 | _ato | Ringding: that's an interesting idea |
| 07:24 | AWizzArd | Was suggested several times. Currently it is not decided how to output such information. |
| 07:28 | the-kenny | hm strange.. I have jsr166y.jar in my classpath, but if I do (import 'clojure.parallel), I get an exception. |
| 07:29 | the-kenny | ClassNotFound: jsr166y.forkjoin.ParallelArray |
| 07:29 | AWizzArd | Is this class in the .jar file? Can you check (System/getProperty "java.class.path") and see if it *really* includes this .jar? |
| 07:31 | the-kenny | AWizzArd: It's included in java.class.path. I'll have a look into the .jar.. |
| 07:31 | the-kenny | hm.. I see no classfile for ParallelArray. |
| 07:33 | the-kenny | If I look at the source it's in /jsr166/src/extra166y |
| 07:43 | AWizzArd | the-kenny: maybe the .jar was not the right one? Perhaps there is a more complete version somewhere. |
| 07:43 | the-kenny | AWizzArd: hm.. It's the .jar mentioned on clojure.org |
| 08:07 | AWizzArd | Yesterday the NEW branch (git) was merged so that it now also includes the updates of the Master branch. Now when I compile (defn #^bytes foo [] ...) I get an error message that bytes is already defined in clojure.core. |
| 08:07 | AWizzArd | How can I type hint that a function returns an array of (native) bytes? |
| 08:07 | the-kenny | AWizzArd: That should be #^bytes |
| 08:08 | the-kenny | AWizzArd: (defn #^bytes foo ...) is working for me. |
| 08:08 | AWizzArd | In the repl or in a .clj file? |
| 08:09 | AWizzArd | ok, so I assume this error message comes from somewhere else |
| 08:10 | SergeyDidenko | hi. Could anybody suggest a shorter way to write (not( nil? arg)) |
| 08:11 | the-kenny | AWizzArd: In a REPL |
| 08:12 | SergeyDidenko | oh, I see probably there is no such way, because it's nothing to gain in space |
| 08:12 | the-kenny | SergeyDidenko: Just arg? Or (boolean arg), if you want a boolean. |
| 08:12 | the-kenny | ,[(boolean 42) (boolean nil)] |
| 08:12 | clojurebot | [true false] |
| 08:13 | SergeyDidenko | thanks Kenny, I see |
| 08:17 | AWizzArd | seems that contribs http-agent is broken |
| 08:18 | AWizzArd | yup |
| 08:18 | AWizzArd | it defines the function bytes which now was introduced into core |
| 08:29 | the-kenny | AWizzArd: I think that has been fixed in one of the latest commits to contrib |
| 08:29 | the-kenny | AWizzArd: Ha! http://github.com/richhickey/clojure-contrib/commit/5055f41c8bc99747392396d622f17f723470858e |
| 08:34 | AWizzArd | the-kenny: yes, that fix makes http-agent compile. But when you (use http-agent) in your ns then you will also have to exclude bytes. |
| 08:38 | chouser | AWizzArd: don't 'use' namespaces :-P |
| 08:39 | chouser | at least not without listing the specific vars you want to bring in |
| 08:43 | the-kenny | (use [clojure.contrib.http-agent :as hagent]) :) |
| 08:43 | Chousuke | the-kenny: I think in that case you're supposed to use require :P |
| 08:47 | the-kenny | Heh, ok |
| 08:47 | the-kenny | I have to go to school now... second time today ;) I'll be back later |
| 08:50 | AWizzArd | chouser: often I require them. It just sometimes is more convenient to simply use a ns. |
| 09:02 | chouser | seems more convenenient, but it's a lie. :-) |
| 10:44 | ambient | so if i want to have an up to date Clojure dev environment in emacs, is there a list anywhere what do I need? swank-clojure-project... what else? |
| 10:44 | ambient | it's a bit hard to keep up with all new stuff |
| 10:45 | the-kenny | ambient: clojure-mode is helpful too ;) |
| 10:45 | ambient | yeah, i know that one too :P |
| 10:45 | the-kenny | ambient: swank-clojure and clojure-mode is enough... I don't know if there is anything else. (But I never searched for more) |
| 10:45 | ambient | integrating all the pieces together is what's hard |
| 10:46 | ambient | because there are so many ways that how things are, they could be done in a more convenient manner, and I bet somebody has already done that, but it's somewhere deep inside the web where I can't find it |
| 10:46 | ambient | there's no reason that starting a new project and loading third-party libraries should be so difficult |
| 10:47 | ambient | perhaps what I'm asking is hand-holding so I digress and will dig some more |
| 10:48 | ambient | usually the answer to a question is as good as the question and my question is very vague :) |
| 10:49 | hoeck | ambient: if you're on windows, you can try clojurebox, and then replace the installed packages with newer ones from github or so |
| 10:49 | ambient | currently on ubuntu 9.10, the drivers actually work now and I'm exstatic :) |
| 10:50 | ambient | i installed with emacs-starter-kit and swank-clojure |
| 10:50 | ambient | but how to manage my libraries and projects, that's whole another thing |
| 10:50 | the-kenny | ambient: Just check out one or two clojure projects on github. |
| 10:51 | hoeck | ambient: yeah, at home I'm on Ubuntu too and I was amazed that everything (including suspend to ram) worked out of the box : ) |
| 10:51 | Chousuke | well, there's the build tool leiningen, which probably works well with swank-clojure-project as they're written by the same person :P |
| 10:51 | Chousuke | though I'm not sure if there's any real integration yet. |
| 10:51 | ambient | the-kenny: well i've already done that, installed and even used penumbra. it's just the management and convenience, letting the computer do the boring stuff for me |
| 11:06 | Ringding | the-kenny: I've setup my Emacs/Clojure environment last week and found that all tutorials and HOWTOs out there did not work... |
| 11:07 | Ringding | I've got a running setup now, but it took a lot more time than I had expected |
| 11:07 | Ringding | Oh sorry, I meant ambient |
| 11:07 | ambient | have you documented any of your work? |
| 11:08 | Ringding | Unfortunately, I have to leave now. Will be back in ~15 hours |
| 11:08 | Ringding | ambient, sorry, no |
| 11:08 | ambient | heh, ok |
| 11:08 | Ringding | I can jot it down for you if you're patient till tomorrow :) |
| 11:09 | ambient | i just need the final steps |
| 11:09 | ambient | i already know how to install the bare essentials |
| 11:35 | churib | stupid beginner question: why doesnt (deref (future (println "hello"))) prints anything? |
| 11:35 | ambient | ,(print "foo") |
| 11:36 | clojurebot | foo |
| 11:36 | ambient | hmm |
| 11:36 | ambient | print should return nil |
| 11:36 | churib | yeah, thats printed at the repl, but no "hello" |
| 11:37 | ambient | ,(deref (future "foo")) |
| 11:37 | clojurebot | "foo" |
| 11:38 | krumholt_ | churib, do u use emacs? |
| 11:38 | churib | yes |
| 11:38 | krumholt_ | churib, look in the *inferior-lisp* buffer |
| 11:38 | krumholt_ | the hello should be there |
| 11:39 | churib | aah, there it is |
| 11:39 | churib | wow, thanks! |
| 11:39 | krumholt_ | churib, np |
| 11:40 | AWizzArd | How can I type hint the return type String[] ? |
| 11:41 | krumholt_ | AWizzArd, i think you can't because String is not primitie, but i might be wrong |
| 11:42 | krumholt_ | primitie = primitiv |
| 11:44 | Chousuke | hmm |
| 11:44 | Chousuke | ,(make-array String 0) |
| 11:44 | clojurebot | #<String[] [Ljava.lang.String;@bea6af> |
| 11:45 | Chousuke | so use #^"[Ljava.lang.String" |
| 12:11 | qed | I had a dream about clojure last night, something about #^ |
| 12:12 | dysinger | I had a dream about clojure too - only I was just up at 3am writing code - oh wait - that was work |
| 12:12 | qed | lol |
| 12:47 | ambient | when i try swank-clojure-project and input the correct project root with correct directory structure it just spams message "Polling "/tmp/slime.11785".. (Abort with 'M-x slime-abort-connection'.)" and nothing seems to happen :\ |
| 12:49 | the-kenny | ambient: Take a look at *inferior lisp*. |
| 12:49 | the-kenny | That mostly means that swank-clojure has failed to start |
| 12:49 | ambient | no class found: clojure/main |
| 12:50 | the-kenny | Oh, and you can stop the polling with M-x slime-abort-connection |
| 12:50 | the-kenny | ambient: Looks like clojure.jar isn't in your classpath ;) |
| 12:51 | ambient | one would think that swank-clojure knows where to find it because it's in .swank-clojure and it automatically installed them all |
| 12:51 | the-kenny | swank-clojure is hard to install, yes, but it gets better with every release. |
| 12:53 | ambient | if i manually created my project with maven it would perhaps be easier to attach swank-clojure into that? |
| 12:53 | the-kenny | Yes, I use this alot |
| 12:53 | Knekk | cd /var/www/virtual/jorge.hotoldermale.com/app |
| 12:53 | Knekk | err |
| 12:53 | Knekk | haha |
| 12:53 | the-kenny | Just make sure the files for swank-clojure are in the classpath |
| 12:54 | the-kenny | then (require 'swank.swank) (swank.swank/start-server "/tmp/swankport" :port 4242) and do a M-x slime connect |
| 12:54 | the-kenny | M-x slime-connect |
| 12:55 | Knekk | sorry about that |
| 12:55 | the-kenny | If you supply :dont-close true to start-server you can connect with multiple repls from emacs |
| 12:56 | ambient | thanks, i shall try that |
| 13:49 | alexyk | what does @ mean in: (@shelves shelf-name) ? |
| 13:50 | the-kenny | alexyk: it's a synonym for deref |
| 13:50 | the-kenny | Used by agents, refs etc. |
| 13:50 | esj | probably that @shelves is an atom or such being deref'd |
| 13:50 | esj | to a map |
| 13:50 | alexyk | a ok |
| 14:36 | dysinger | ambient: |
| 14:37 | dysinger | if your project was started with maven - just run "mvn depenency:copy-dependencies" and restart swank-clojure-project |
| 14:37 | dysinger | we have swank setup to look for jars in target/dependency |
| 14:38 | dysinger | "mvn dependency:copy-dependencies" |
| 14:38 | dysinger | typo 1st time |
| 16:15 | hiredman | lisppaste8: url? |
| 16:15 | lisppaste8 | To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste. |
| 16:16 | lisppaste8 | hiredman pasted "fn minus" at http://paste.lisp.org/display/91148 |
| 16:50 | miltonsilva | Hi |
| 16:51 | jevgeni | hello. just wonder - is there a possibility to do reversible debugging with clojure? |
| 16:52 | miltonsilva | is it possible to do something like (defmethod xxx "/join" [] (println "joining")) and what fn would I pass to the multimethod ? |
| 16:54 | ordnungswidrig | miltonsilva: you whant to dispatch on the string value? |
| 16:54 | miltonsilva | exactly |
| 16:58 | miltonsilva | I could map the strings to keywords.. but that would defeat the purpose.. what I what is to dispatch on value without adding unecessary code, but I have no idea what fn I would put in the multimethod in order to achieve that |
| 16:58 | ordnungswidrig | miltonsilva: i'll pastebin sth |
| 17:02 | lisppaste8 | ordnungswidrig pasted "multimethod dispatch on value" at http://paste.lisp.org/display/91150 |
| 17:02 | ordnungswidrig | miltonsilva: there you go |
| 17:02 | ordnungswidrig | http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples/Multimethod |
| 17:04 | miltonsilva | thanks (to late) |
| 17:05 | qed | hmmm |
| 17:06 | qed | ((read-json (PushbackReader. (InputStreamReader. (get-stream)))) "text") |
| 17:06 | qed | how do i turn this into a lazy-seq? |
| 17:07 | qed | This gets one tweet from the twitter stream, I want to (take n coll) from it, which I am guessing will require making it a lazy-seq |
| 17:09 | hiredman | making it a lazy seq like that would be pretty horrible |
| 17:10 | hiredman | a single http connection per tweet |
| 17:11 | qed | (take 5 (lazy-seq (repeatedly #((read-json (PushbackReader. (InputStreamReader. (get-stream)))) "text")))) would work, but yeah, you're right, this ain't gonna work the way it currently stands |
| 17:11 | hiredman | dmesg |
| 17:12 | qed | the unix application? |
| 17:14 | miltonsilva | :( I still dont know how to dispatch on string values... there is no coerce to string :p |
| 17:23 | qed | hiredman: not sure i see what you're getting at with "dmesg" |
| 17:27 | ordnungswidrig | re |
| 17:28 | miltonsilva | ordnungswidrig: thanks but I still don't know how to dispatch on string values |
| 17:28 | ordnungswidrig | is there a way to alias a namespace like (ns (:require x [foo :as bar])) does? |
| 17:28 | ordnungswidrig | miltonsilva: so it didn't work for you? |
| 17:29 | miltonsilva | ordnungswidrig: it works.. just not for strings for ints you put int chars.. char etc... but strings :S |
| 17:29 | ordnungswidrig | saw my example at paste.lisp.org ? |
| 17:29 | _ato | eh? |
| 17:30 | _ato | why would you ints or chars to dispatch with? |
| 17:30 | hiredman | qed: wrong window |
| 17:30 | miltonsilva | I would like to dispatch on strings for the sole reason of not doing (cond etc etc etc ) |
| 17:32 | _ato | right... but what does coercion have to do with it? You don't have to coerce anything to use a multimethod |
| 17:33 | lisppaste8 | ordnungswidrig annotated #91150 "add missing defmulti" at http://paste.lisp.org/display/91150#1 |
| 17:33 | miltonsilva | I know hence the :p what I would like is something like (defmulti tes str) |
| 17:33 | ordnungswidrig | lisppaste8: there you go |
| 17:33 | ordnungswidrig | miltonsilva: argh. the paste was for you |
| 17:33 | miltonsilva | yes thats what I need thank you very much |
| 17:36 | ordnungswidrig | miltonsilva: I think you where confused by the pattern to use "int" to dispath on integer values like the fib example does |
| 17:36 | Guest15038 | Hi there, i'm trying to do an http request that requires http authentification |
| 17:36 | Guest15038 | what would be the best way to do that with clojure ? |
| 17:37 | miltonsilva | ordnungswidrig: one more question the fn this code passes to defmulti return the same value it receives... it seem a bit counter intuitive |
| 17:37 | _ato | miltonsilva: it returns the first value it receives |
| 17:37 | _ato | assuming that's the one you want to dispatch on |
| 17:37 | _ato | if you wanted to dispatch on the second arg you could make it return the second arg it receives |
| 17:37 | _ato | etc |
| 17:38 | _ato | if there's only one arg to your methods then you could just use "identity" instead of that functin |
| 17:39 | lpetit | Hi |
| 17:39 | ordnungswidrig | hi |
| 17:39 | lpetit | Where is it specified in the docs that the regexp pattern literal syntax does not need to double anti-slashes ? |
| 17:40 | _ato | Guest15038: I'd first try doing: http://user:pass@host/path |
| 17:40 | Guest15038 | oh :( i didn't even know this could work with http |
| 17:40 | the-kenny | Guest15038: Wait, I gave some sample cod |
| 17:40 | Guest15038 | thank you very much gonna test that |
| 17:41 | the-kenny | Guest15038: http://gist.github.com/243175 That's an example for twitter. The interesting part is the .setRequestProperty |
| 17:41 | qed | http://gist.github.com/243698 : Could anyone give me a hint as to how I can treat the stream of tweets as a lazy-seq? |
| 17:41 | qed | the-kenny: is it you that gave me this code? :) |
| 17:41 | the-kenny | There is another way to identify with HttpUrlConnection through java.net.Authenticator, useful if you don't have direct access to the connection-object |
| 17:42 | the-kenny | qed: Yesterday? Yes |
| 17:42 | qed | hehe, im playing with it now, see comment above |
| 17:42 | Guest15038 | the-kenny: well i kind of hoped i could get away with http.agent in clojure contrib, and not use any java stuff directly |
| 17:42 | Guest15038 | taking a look at your code thank you very much |
| 17:43 | the-kenny | qed: I don't know, sorry. |
| 17:44 | Guest15038 | nice it looks quite simple |
| 17:44 | qed | the-kenny: ah, bummer, right now that line 24 works, but it creates 5 separate http connections i think |
| 17:44 | the-kenny | Guest15038: Yes, looks like you can get away with http.agent |
| 17:44 | _ato | qed: they're what one per line right? |
| 17:44 | the-kenny | Guest15038: Take a look at the doc of the function http-agent, there is a parameter :headers |
| 17:45 | qed | _ato: the "tweets"? |
| 17:45 | the-kenny | Guest15038: Identifying in http isn't more than just a header |
| 17:45 | _ato | yeah |
| 17:45 | the-kenny | _ato: Yes, one tweet per line |
| 17:45 | _ato | (take 5 (map read-json (line-seq (PushbackReader. (InputStreamReader. (get-stream)))) "text")) |
| 17:45 | qed | ((read-json (PushbackReader. (InputStreamReader. (get-stream)))) "text") -- That gives me the text of what someone wrong in their tweet for one tweet |
| 17:45 | qed | ahhhhh! |
| 17:46 | _ato | or does read-json not work from a string? |
| 17:46 | qed | it does work from a string |
| 17:46 | qed | ,(doc read-json) |
| 17:46 | clojurebot | "clojure.contrib.json.read/read-json;[[] [s] [stream eof-error? eof-value]]; Read one JSON record from s, which may be a String or a java.io.PushbackReader." |
| 17:46 | Guest15038 | the-kenny : thanks it seems to be working :) |
| 17:46 | Guest15038 | with http.agent |
| 17:46 | Guest15038 | i'm so lost when it comes to http, didn't even know authentication was a header |
| 17:47 | the-kenny | Guest15038: You're welcome :) |
| 17:48 | _ato | also since you're pulling duck-utils you could probably cleanup the ugly reader stuff too: (take 5 (map read-json (line-seq (reader (get-stream))))) |
| 17:48 | _ato | or some such |
| 17:48 | the-kenny | _ato: It's a continuous stream which doesn't end (except for maintenance etc) |
| 17:49 | the-kenny | Oh wait.. forget what I've said |
| 17:49 | hiredman | _ato: that won't work |
| 17:49 | qed | it does work |
| 17:50 | hiredman | _ato: that may or may not working depending on the format of the json you recieve |
| 17:50 | _ato | hiredman: it's one {...} per line |
| 17:50 | _ato | it's not a json list |
| 17:50 | qed | I keep getting 401s |
| 17:51 | the-kenny | qed: You have to enter your twitter username and password ;) |
| 17:51 | qed | haha yes |
| 17:51 | hiredman | _ato: sure, for this particular instance, but you are depending on being serverd not just valid json, but valid json in a particular format |
| 17:51 | qed | it will work one time, and continue to work for a minute, and then it will start giving me 401s |
| 17:51 | hiredman | qed: twitter only allows a certain number of api requests per hour |
| 17:52 | hiredman | or something, I forget exactly |
| 17:52 | _ato | "Each account may create only one standing connection to the Streaming API. Subsequent connections from the same account may cause previously established connections to be disconnected. Excessive connection attempts, regardless of success, will result in an automatic and temporary ban of the client's IP address." |
| 17:52 | hiredman | you need to batch your queries |
| 17:52 | _ato | so a good thing you're not doing that one connection per tweet thing anymore :p |
| 17:52 | qed | hahaha |
| 17:53 | the-kenny | hiredman: He's using a new feature of the api, a continously open stream where the server "pushes" new tweets. He doesn't do real "queries" |
| 17:54 | qed | well, when i create a connection im querying |
| 17:54 | qed | so all my testing is what's causing the problem |
| 17:54 | qed | not the number of tweets i take in a given connection |
| 17:55 | the-kenny | hm.. I never had problems during early testing |
| 17:56 | qed | _ato thanks for the java cleanup |
| 18:01 | the-kenny | qed: Your defn on Github, right? |
| 18:03 | qed | yessir |
| 18:03 | the-kenny | qed: Is this your real twitter password in your gist? |
| 18:04 | qed | annddd deleted |
| 18:05 | qed | you can post as me if you like, the-kenny, lol |
| 18:05 | ordnungswidrig | qed: you'd better change your password, not :-) |
| 18:05 | ordnungswidrig | s/not/now/ |
| 18:05 | ordnungswidrig | qed: or your account will be sold on eBay... |
| 18:05 | the-kenny | qed: heh, I won't do something like this |
| 18:06 | qed | lol, im not too worried about my twitter pass |
| 18:06 | qed | but thanks for telling me :) |
| 18:07 | qed | (defn take-tweets [#^int n] |
| 18:07 | qed | is that a valid type hint? |
| 18:07 | ordnungswidrig | qed: someone who pastes ones password on a ghist is suspect of using the same password everywhere ;-) |
| 18:07 | qed | ordnungswidrig: lol, i invite you to find out where else that pass is used :) |
| 18:08 | the-kenny | qed: Can I try too? :) |
| 18:08 | Chousuke | qed: functions can't have primitive arguments |
| 18:08 | Chousuke | they're always boxed |
| 18:08 | qed | Chousuke: so would I even use a type hint there? |
| 18:09 | Chousuke | probably not |
| 18:09 | qed | if it was #^Integer that'd be different though, yes? |
| 18:09 | _ato | qed: there's not much point using a type hint there, connecting to the server etc is going to much slower |
| 18:09 | Chousuke | maybe if you call some methods of Integer you can typehint it as #^Integer |
| 18:09 | ordnungswidrig | from time to time I thought of a service that will check _all_ web services for a given user / pw combination. I was a lazy boy, too, and I'm sure there a some i-forgot-about services where my former default user/pw combination would work. |
| 18:09 | Chousuke | but I doubt it's going to make a difference:P |
| 18:09 | qed | k, I was sort of under the assumption that it was good practice |
| 18:10 | qed | but i guess clojure then needs to find out where I use that variable in my fn every time i call it |
| 18:10 | _ato | it's good practice to only do it when necessary (or when you get a warning from *warn-on-reflection*) |
| 18:10 | _ato | most of the time type hints aren't going to make the slightest bit of difference |
| 18:10 | qed | ordnungswidrig: there's a service out there like that |
| 18:10 | qed | IIRC |
| 18:10 | the-kenny | qed: I think it's a bit ugly sometimes... I try to avoid it. However, I had one point in my code where I was forced to use it |
| 18:10 | ordnungswidrig | qed: you name it? |
| 18:11 | qed | its been awhile, it basically checks a bunch of services for a valid login, cant remember the pass :\ |
| 18:11 | qed | errr if it does pass |
| 18:12 | qed | but no i dont remember the name |
| 18:12 | qed | itd be real evil if they did it for bank accounts :) |
| 18:12 | Chousuke | hmm :P |
| 18:13 | ordnungswidrig | qed: hehe, as long as the use their account number and not the same username |
| 18:13 | qed | haha sure |
| 18:13 | Chousuke | my bank account password is actually pretty weak but you wouldn't be able to log in even if you knew it. |
| 18:13 | qed | yeah my bank has little questions you have to answer |
| 18:13 | Chousuke | or well, you could but all you could do is look at my saldo ;( |
| 18:14 | qed | i once forgot my password and they wanted me to recite my secret phrase |
| 18:14 | Chousuke | which is not very impressive. |
| 18:14 | ordnungswidrig | after the last leaks of customer data with bank account numbers, birthday and so on I'm sure there is abuse |
| 18:14 | ordnungswidrig | qed: at my cell phone provide I need a customer password. It makes the people laugh every time. I thought it was for web only. |
| 18:14 | qed | my secret phrase was: inside-out cocoons in a monsoon filled with baboons bending silver spoons |
| 18:15 | Chousuke | Most banks here use a key card. they give you a number and you look up the corresponding one on the key card. |
| 18:15 | ordnungswidrig | qed: +1 |
| 18:15 | qed | i got about halfway and she's liek "OKAY OKAY" |
| 18:15 | qed | lol |
| 18:15 | the-kenny | My bank here forces everyone to use a 5 letter password for online banking. |
| 18:15 | ordnungswidrig | qed: I wonder that the cobol application was able to store such long value |
| 18:15 | ordnungswidrig | qed: for a passphrase |
| 18:15 | qed | haha |
| 18:15 | Chousuke | the-kenny: anything besides that though? |
| 18:15 | Chousuke | the-kenny: because username/password is *not* enough for online banking |
| 18:16 | Chousuke | it's too weak. |
| 18:16 | ordnungswidrig | I like the mobile tan (sms) transaction authorization |
| 18:16 | qed | agreed |
| 18:16 | ordnungswidrig | It's the sth you know + sth you have thing. |
| 18:16 | the-kenny | Chousuke: They use pin/tan if you're logged in etc... but for logging in there is just username/password. (I'm in Germany) |
| 18:16 | _ato | most banks here SMS you with a code to confirm any transaction and some of them you can apply for a code generator dongle thing |
| 18:16 | _ato | yah |
| 18:16 | qed | i wonder if anywhere that delivers food is open on thanksgiving... |
| 18:17 | ordnungswidrig | qed: anywhere in germany for sure |
| 18:17 | Chousuke | my bank uses username/password + one time password |
| 18:17 | qed | haha ordnungswidrig |
| 18:17 | ordnungswidrig | Chousuke: paper otp? |
| 18:17 | qed | Chousuke: RSA? |
| 18:17 | Chousuke | ordnungswidrig: a key card kind of thing. |
| 18:18 | qed | ive never seen those |
| 18:18 | ordnungswidrig | qed: I think the only delivery turkeys, right? |
| 18:18 | qed | it looks like that's the case |
| 18:18 | Chousuke | ordnungswidrig: the bank application asks for a password corresponding to a certain index and you look it up on the card, type it in then it's used up |
| 18:18 | ordnungswidrig | qed: paypal did send RSA tokens for shipping cost about 2 years ago. never used it but it still keeps generating numbers. |
| 18:19 | qed | really? that's pretty cool |
| 18:19 | qed | those keys arent that cheap |
| 18:19 | ordnungswidrig | Chousuke: that's the standard tan method in germany. I think it's call I-Tan (for indexed TAN) |
| 18:19 | qed | IIRC |
| 18:19 | Chousuke | ordnungswidrig: yeah. I think it's a fairly good system |
| 18:20 | qed | i think they're about 50$ |
| 18:20 | ordnungswidrig | qed: a quick google told me they tokens would be about 60 USD per User. |
| 18:20 | ordnungswidrig | qed: :) |
| 18:20 | qed | still, not very cheap for what they do |
| 18:21 | ordnungswidrig | qed: I think the process at the manufacturer and keeping the secret think secret it what makes the price. The hardware will be some dollars, I suppose. |
| 18:21 | qed | so, while we're talking about things i lug around at work all day (RSA Fob), i recently found out my boss had an RFID tag implanted into the skin between his thumb and index finger |
| 18:22 | ordnungswidrig | qed: scary. How did you find out? Are you wardriving on RFIDs? |
| 18:22 | _ato | does that mean he has to wear tin foil gloves all the time to prevent being tracked? ;-) |
| 18:23 | ordnungswidrig | ha ha |
| 18:23 | qed | hahaha nah, a guy i work with who has been there longer told me about it, and i looked it up, and it's apparently not that uncommon, well, i mean, he's not the only one, it's DEFINITELY uncommon |
| 18:23 | qed | you go to a tatoo parlor where they do ball bearings in your arm, and wear stuff like that |
| 18:23 | qed | and you get them to wrap it in some medical coating, and pop it in |
| 18:24 | ordnungswidrig | qed: but why? Ball bearings I can understand, but RFID? |
| 18:24 | qed | you can put stuff on it i guess, like store a tiny bit of data IIRC |
| 18:24 | qed | he set it up to act as his badge |
| 18:24 | ordnungswidrig | but why :-) |
| 18:25 | qed | so he waves his hand in front of our card scanners, and walks in |
| 18:25 | ordnungswidrig | better they steal my card than my hand, I think. |
| 18:25 | qed | haha |
| 18:25 | qed | idk, it's the only sort of tatoo i think id be up for |
| 18:26 | qed | it'd definitely solidify my nerdiness, if that hasnt been done already |
| 18:26 | the-kenny | Yeah, it's pretty cool. |
| 18:26 | ordnungswidrig | qed: but only in combination with a pin code. and a second card you can hand out to a robber |
| 18:26 | qed | i think qed as a nick, hanging out in #clojure pretty much sealed the deal |
| 18:26 | ordnungswidrig | #clojure is nerdy? |
| 18:26 | qed | :X |
| 18:27 | qed | i should qualify that i dont buy into that crap about nerd vs geek terminology, i use them both interchangeably, and with pride |
| 18:28 | ordnungswidrig | hmm, what if your boss changes the job. can his token be used at the new job or will he have to get another one :-) |
| 18:28 | the-kenny | ordnungswidrig: Aren't these chips writable? |
| 18:29 | _ato | I dunno, I'm only getting implants when they actually do something useful like IRC |
| 18:29 | _ato | Oh wait... that's probably not useful |
| 18:29 | ordnungswidrig | the-kenny: if they talk the same protocol |
| 18:29 | qed | yeah you can write it |
| 18:29 | _ato | You may as well just get a ring with an RFID tag in it instead of sticking it in your hand with chance of infection etc |
| 18:29 | qed | now there's an idea |
| 18:29 | ordnungswidrig | _ato: that sounds nice. |
| 18:30 | ordnungswidrig | ringfid |
| 18:30 | qed | it has to be a cool looking ring though |
| 18:30 | the-kenny | http://xkcd.com/644/ :) |
| 18:30 | ordnungswidrig | one ring to identify them... |
| 18:30 | ordnungswidrig | the-kenny: :-) |
| 18:30 | qed | i think this is probably what my boss got http://www.hvwtech.com/products_view.asp?ProductID=605&utm_source=Google&utm_medium=Product+Search&utm_campaign=Product+Search+(Nov09) |
| 18:30 | qed | something like that |
| 18:31 | ordnungswidrig | * Not a medical tag – not for implanted use in humans or animals |
| 18:31 | qed | if it broke that would /suck/ |
| 18:32 | ordnungswidrig | there exist injectable rfid tags for animals |
| 18:33 | qed | ahhh yeah, good point |
| 18:33 | _ato | yeah, it's quite common here to get pets tagged in case they lose their collar and someone finds them |
| 18:33 | qed | but umm, i doubt there are strict standards for rfids injected into pigs |
| 18:34 | qed | i suppose if we're chopping our animal's genitalia off, we may as well implant them with gadgetry as well |
| 18:34 | _ato | http://www.flickr.com/photos/nadya/54670483/ |
| 18:34 | qed | i want my cat to hum 2600 |
| 18:35 | the-kenny | That's a fairly big needle in my opinion |
| 18:36 | qed | i dont see what the concern is with privacy for rfid, there are so many ways to disrupt something like that |
| 18:36 | _ato | ahh.. here we go, a video of tag being injected into someones hand: http://www.youtube.com/watch?v=mr0ozY2HWdM |
| 18:37 | qed | http://www.youtube.com/watch?v=fhOSV84RbVk&NR=1 |
| 18:37 | qed | next step, heroin |
| 18:37 | qed | "My First Self-Injection" |
| 18:38 | _ato | yeah, I hit up with 5 RFID tags a day |
| 18:38 | qed | lol |
| 18:38 | qed | tie the belt around my bicep |
| 18:38 | qed | time to get my fix |
| 18:39 | the-kenny | It'd be funny if you get the tag into a vene... "Wait, I have to search where it is now..." |
| 18:39 | the-kenny | s/vene/vein/ |
| 18:39 | qed | yeah that'd be awesome until it gets stuck in your heart |
| 18:39 | ordnungswidrig | the-kenny: lol |
| 18:40 | ordnungswidrig | http://www.youtube.com/watch?v=vsk6dJr4wps |
| 18:40 | ordnungswidrig | the self-injection variant. |
| 18:41 | qed | http://www.youtube.com/watch?v=TcPOLRAfQOA&feature=related |
| 18:41 | qed | hahahaha |
| 18:41 | qed | ExxonMobil Speedpass using his implant |
| 18:47 | ordnungswidrig | will sleep now. hibernate or like that. cu tomorrow |
| 22:32 | burny | Any clue's on how I can fix this stackoverflow, I think I need to make the evaulation lazy? |
| 22:32 | burny | http://pastie.org/716780 |
| 22:33 | cark | use recur |
| 22:34 | cark | in the if : (recur (functor ...)) |
| 22:38 | cark | err (recur (/ iu 2) ... |
| 22:38 | cark | and (recur (+ (* .... |
| 22:38 | burny | gotcha |
| 22:40 | hiredman | no coments on fn minus (http://paste.lisp.org/display/91148) all day |
| 22:41 | cark | huh what's this thing ? |
| 22:44 | hiredman | it's a fn replacement built on deftype |
| 22:44 | hiredman | well, fn* |
| 22:44 | cark | but what's the goal ? |
| 22:45 | lisppaste8 | hiredman annotated #91148 "add ignored symbols" at http://paste.lisp.org/display/91148#1 |
| 22:46 | hiredman | cark: well, there is no goal per se |
| 22:46 | hiredman | the fn stuff is currently in written in java |
| 22:46 | cark | did you check performances of this version ? |
| 22:46 | hiredman | nope |
| 22:47 | hiredman | it was just something that popped into my head when I woke up this morning |
| 22:48 | cark | there is a bunch of missing ancestors tho |
| 22:49 | hiredman | cark: yeah, Callable and Runnable are the main ones |
| 22:49 | hiredman | but that's easily done |
| 22:49 | hiredman | you want to replicate all of AFn |
| 22:50 | cark | clojure in clojure ... =) |
| 22:50 | hiredman | exactly |
| 22:51 | hiredman | AFn could be a protocol |
| 22:51 | hiredman | cd |
| 22:56 | notallama | hiredman: i was just looking at that hydra thing you pasted. how does that "future" part work? it looks like it throws away the value. |
| 22:57 | hiredman | notallama: the future part just spins up another thread that takes care of moving values from the input queue to the output queues |
| 22:57 | hiredman | I think there is an extra delay in the imlementation on lisppaste |
| 22:58 | JAS415 | oh cool |
| 22:58 | JAS415 | so fn- holds onto the source |
| 22:58 | hiredman | oh yeah |
| 22:58 | hiredman | I forgot about that part |
| 22:59 | notallama | ah yes, i now see what future actually does. i thought it did the body the first time it was deref'd. |
| 23:04 | JAS415 | i figured out how to combine yaws and clojure :-D |
| 23:04 | JAS415 | need to write some macros or something now |