#clojure logs

2011-03-26

00:00amalloytomoj: my point is that the asymptote here is at N=64, because there are no more bits available
00:01amalloybut in real life i am wrong
00:01amalloysorta
00:02tomojsurely the distinction between log32 and 1 will become apparent before you run out of bits?
00:03amalloytomoj: not really. so it's ten times slower; that's just a constant factor - it will never be *more* than ten times slower than O(1), so it's O(1)
00:04tomojwordplay
00:04amalloys/wordplay/definition of big-O
00:04tomojno that's my point
00:05tomojthat 32 is big enough that 10x is as high as it goes doesn't change the mathematical fact that it's NOT O(1)
00:07amalloyhttp://en.wikipedia.org/wiki/Big_O_notation#Formal_definition - i claim that, because we define the range of x as 0..2^64, f(x) is at most C*g(x), where f is vector access, g is array access, and C is a constant
00:08tomojbut the very first thing there breaks
00:08amalloybecause we're not taking the limit as x goes to infinity?
00:08tomojyeah
00:09amalloyperhaps. the formal definition is unclear about what the "subset of the reals" means
00:09amalloydo they mean to imply that O-notation is meaningless for any finite-domain functions? it is, of course, which is why i'm able to get away with this trickery
00:10tomojisn't _anything_ O(1) if you set a maximum for x?
00:10amalloyyeah
00:11amalloyi'm just saying, the log32(some 32-bit-number) won't come to a multiple larger than like five, which will be completely swamped by the constant factors involved in the rest of the computation
00:12tomojright "practically constant"
00:13tomojmy objection was to using O-notation willy-nilly for practical considerations
00:14CaffeineOh that's surprising... creating a table of 25M #{} is faster than 25M nil ..
00:16tomojis your table mostly empty?
00:16CaffeineThey're all empty at first
00:16tomojhow full do they get
00:16amalloyCaffeine: a "table of foo" meaning what in this context?
00:16tomojit may be more efficient to use maps
00:16Caffeinethey're stay empty for now
00:17Caffeine[] of []
00:17tomojI had a significant speedup switching from vectors to maps for 1800 element 1-d vectors
00:17tomoj(that were mostly sparse)
00:17Caffeine[[nil nil nil][nil nil nil][nil nil nil]] would be a table of 9
00:18tomojthe problem of how to make sparse and dense play together and convert to dense when it's more efficient still bothers me
00:18CaffeineI could probably do it with a map... argh that's driving me crazy, changing the way I think my stuff every couple of hours haha
00:18amalloy&(time (let [row (vec (repeat 5e5 nil))] (vec (repeat 5e5 row))))
00:19sexpbotjava.lang.OutOfMemoryError: Java heap space
00:19amalloyhm. made it smaller but not small enough
00:19tomojif they're all empty maps will certainly be more efficient
00:19amalloy&(time (let [row (vec (repeat 5e3 nil))] (vec (repeat 5e3 row))))
00:19tomojjust {} :D
00:19sexpbotjava.lang.OutOfMemoryError: Java heap space
00:19amalloy&(time (let [row (vec (repeat 5e2 nil))] (vec (repeat 5e2 row))))
00:19sexpbot⟹ "Elapsed time: 1.174534 msecs" [[nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ... failed to gist: Broken pipe
00:20amalloy&(time (let [row (vec (repeat 5e2 #{}))] (vec (repeat 5e2 row))))
00:20sexpbot⟹ "Elapsed time: 0.895433 msecs" [[#{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} #{} ... failed to gist: Broken pipe
00:20amalloythat's weird. it actually is a liittle faster
00:20Caffeineoh haha it's trying to display it... I do a (def) to save the display part
00:20CaffeineYeah, that's weird.. I noticed a little lag on 25M nil, nothing at all on #{}
00:21amalloyi can't imagine any reason #{} would be faster
00:21amalloyCaffeine: btw, note i'm reusing the row object rather than creating a new one over
00:21amalloythat should enable structural sharing and reduce memory/copying load
00:22amalloythough of course {} is smaller still as tomoj says
00:22CaffeineHmm true
00:22CaffeineI think I'll use a {} yeah...
00:23Caffeinehoping hashes of (Number Number) are reliable
00:23amalloyhah
00:23Caffeine(Because it still has to act like a 2D table in the end...)
00:24amalloy&(let [i (int 10) L (long 10) m {i i}] (get m L))
00:24sexpbot⟹ nil
00:25amalloyCaffeine: be careful of that: the types have to match
00:25CaffeineOh.... these are coordinates (latitude, longitude)
00:26CaffeineI guess I should cast them to double to make sure
00:26amalloyif any of them aren't already doubles, that's a good plan
00:26amalloy&(.equals (long 1) (int 1))
00:26sexpbot⟹ false
00:27CaffeineYeah, it makes sense since everything is supposed to be an Object in Clojure.. if I remember well it doesn't use primitive types
00:27Caffeinethey're automagically boxed
00:30tomojwhoa ##{(long 1) 2 (int 1) 3}
00:30sexpbot⟹ {1 2, 1 3}
00:30tomojthat's fucked up
00:30amalloyCaffeine: that's kinda-sorta-almost true
00:30amalloyand a lot less true in 1.3
00:31amalloy(should i start calling it 2.0? how did that discussion turn out?)
00:31Caffeineoh, really? I guess it could be much more efficient using primitives ... maybe not.. hmm
00:34amalloy1.2 allows you to work with primitives, but they can't cross function boundaries: all functions cast args and return values to boxed objects
00:35amalloywhere "cast" here is used in a totally inappropriate way because i needed a verb
00:38cemerickamalloy: "boxed" is a verb too :-)
00:38amalloyyeah i know. but i'd gotten past that part of the sentence and my ^H key is broken
00:38CaffeineAhh ok, didn't know that. Saves the object manipulation inside functions
00:38amalloy#atrociouslie
00:39amalloyCaffeine: you have to *ask* for that behavior
00:39amalloytomoj: just noticed someone brought up this "int/long as map key" problem again on the google group a few hours ago
00:40Caffeinealright
00:40Caffeinemust happen very frequently ..
00:40tomojI don't think I can even think about it
00:40tomojthat just disturbs me
00:40amalloyhaha tomoj call me next time you get drunk, this is great
00:40tomojI don't want to have to care what type numbers are when I'm sticking them into a map
00:42tomojI can imagine very subtle bugs
00:42CaffeineI can even make some :)
00:44amalloyCaffeine: "must happen very frequently" is not really true. people complain about chunking all the time because it can have surprising side effects, but i can't find anyone who's had actual issues with it in real life; i think this long/int dichotomy is similar, though not identical
00:46amalloyand it's fixed in 1.3
00:46amalloy"fixed"
00:47amalloyin that the clojure hashmaps now break the j.u.Map interface in a way that is clearly right :)
00:49tomojgiven a leaf in a tree, crawl upwards/outwards/downwards to find the context of the leaf. this sound like a good fit with zippers?
00:50amalloyyes
00:50amalloyalso aphids
00:51tomojhar har
00:53amalloyi saw the movie. wasn't a huge fan
00:54amalloyis the book better?
00:54tomojhaving watched it for the first time on dxm my opinion is probably skewed far in the positive direction
00:55tomojthat substance-d was little red capsules is surely irrelevant!
00:56technomancythe book is always better, of course
00:57technomancyexcept for the Princess Bride; I guess there is some debate there.
00:58technomancyand fight club
00:59technomancyISTR the author of Fight Club saying he prefers the movie.
00:59amalloyheh
01:00technomancyPKD tends to translate pretty decently to the big screen
02:25amalloy#cvs is a deserted wasteland. how will cvs users ever find out they're supposed to use something else?
02:30tomojI heard about "microsoft source safe" recently
02:30amalloytomoj: it's just a fad
02:30tomojapparently if you wanted to edit a file you took out a lock on the file
02:30amalloywe'll be back to good old rcs before long, no worries
02:31tomojthen no one else could change that file until you checked in
02:31tomojrcs?
02:31amalloyyou only heard of this recently, really?
02:31tomojreally
02:31tomojgit was really my first
02:31tomojused svn a few times but only really to check out
02:31amalloywell i've never used mss, thank god
02:32amalloybut i have a cvs repo from college hanging around somewhere
02:32tomojat my first job they just used a network share and made .copy .copy2 .copy3 files :D
02:33amalloyi did some of that in school
02:33amalloywas fortunate to have a prof who took tools seriously
02:34tomojgreat way of putting the problem
02:36amalloyhad one project where it was like, "your team has to do weekly ant builds, persist data using mysql, share source with cvs, using ssh access to the repo on my server, and the final project has to work on my machine"
02:36amalloyoh and javadoc everything
02:36amalloythis was back when ant was cool
02:37amalloywhich apparently it still is, but what can you do
02:39amalloytomoj: anyway rcs is what came before cvs. most cvs features are implemented on top of rcs
02:41amalloyand svn is basically just cvs with different version-numbering schemes and different optimization tradeoffs
02:46waxrose>.>
02:53amalloywaxrose: eh?
02:55waxroseamalloy, Just kind of responding to what you typed @ the team statement
02:56amalloythat is...less of a response, more of a "vague eyes looking sideways" thing
02:56waxroseYeah, sorry... I'm a bit vague. :P
03:00waxroseI find this REPL for Android interesting.
03:36cnatarentechnomancy: ping.
04:28angermanbindings are thread local right?
05:12fliebelHas anyone ever implemented a quad tree in Clojure?
05:25Dranikmorning!
05:25Dranikhow to transform a vector to map?
05:31morphling,(apply hash-map [:a 1 :b 2])
05:31clojurebot{:a 1, :b 2}
05:44fliebelHow can I use version ranges to get the latest Clojure alphas? Can I just do [1.3,) or something like that?
05:52fliebel"[1.3.0-alpha5,)" gets me a snapshot :(
05:53Dranikmorphling, thanks!
06:34DranikI'm trying to build an uberjar but my source depends on external jars
06:34Dranikhow to add the extrnal jars to the uberjar?
06:38fliebelDranik: Add them to your local maven repo and declare them as dependecies in your project.clj
06:39Dranikfliebel, sounds a bit comples, but I'll give it a try
06:39Dranik*complex
06:40fliebelDranik: Well, easier would be to find out if they exist in a maven repo already somewhere, or jst put the source files under your src and let cake or lein-javac take care of compiling them.
06:45angermanhow can I test if a clojure object is serializable?
06:46fliebelangerman: (implements? obj Serializable)?
06:47angermanhmm where's implements/
06:53fliebelCan anyone advice me on the ref/agent/atom decision? I have some shared state, but I just need to push data on there, so I don't need synchronicity or management. So I'd say an agent is appropriate, but I have a watch fn, and I'll be calling it from a thread pool, so I had the idea that I could run the watcher less by using dosync, and I feel like agents are a bit heavy. For some reason, the spinning of an atom feels inappropriate for this task.
06:53Dranikfliebel, thanks, that succeed
06:53fliebel:)
06:54angermanfliebel: could not find impelements? so far :/
06:54fliebelangerman: I'm sure it's there, but not sure I got the name right… let me see...
06:55fliebelangerman: instance?
06:55angermanfliebel: hmm.
06:56angerman,(instance? {} java.io.Serializable)
06:56clojurebotjava.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.lang.Class
06:56angerman,(instance? (class {}) java.io.Serializable)
06:56clojurebotfalse
06:56angermanhmm maybe I've got it wrong.
06:56fliebel,(instance? java.io.Serializable {})
06:56angerman,(instance? java.io.Serializable {})
06:56clojurebottrue
06:56clojurebottrue
06:56angermanahh.
06:56fliebelhah
07:26opqdonutyeah, those are the only operators I have problems with
07:26opqdonutin prefix notation
07:26fliebelOh, but with prefix notation, I might be able to combine a few of them into one, but that'll hur my brain.
07:27xkb is there a standard function for the max of a list?
07:28angermanyikes. I needed an AOT
07:28fliebelxkb: No, but you can use reduce.
07:28xkbfliebel: thanks, that's what I did now.
07:31fliebel$findfn [1 4 2 6 2] 6
07:31sexpbot[]
07:31fliebel$findfn max [1 4 2 6 2] 6
07:31sexpbot[clojure.core/reduce clojure.core/apply]
08:03fliebelHey, cool, what is this? I made a recursive function that should never end, but it ends almost instantly and produce the expected result.
08:03arbschtfliebel: you must have a fast computer ;)
08:04fliebelarbscht: Yea, Intel core^2 duo ;)
08:05fliebelcheck this: https://gist.github.com/888223
08:05fliebelI'd say overlaps? should run forever, but it does not.
08:06fliebelit runs only twice.
08:06fliebelI mean, fine with me, but why? how?
08:10mduerksenfliebel: just took a quick look - is it quaranteed that all contains?-queries will always be false? otherwise, the or-statement won't evaluate the recursive call
08:11fliebelmduerksen: No, the statement returns true, so something at least returned true.
08:12fliebeluser=> (overlaps? {:x 50, :y 50, :height 1, :width 1} {:x 50, :y 10, :height 100, :width 100})
08:12fliebeltest
08:12fliebeltest
08:12fliebeltrue
08:12fliebelso what you;re saying is that if it'd return false, it'd never return?
08:13fliebelyea, right :)
08:14mduerkseni'm not sure that's what i wanted to say :) just wanted to make you aware that the or-statement only evaluates it's last parameter if all others are falsy
08:15mduerksenand that's what seems to happen if i understood you correctly
08:15fliebelmduerksen: Yea, forgot about that.
08:16mduerksenah, ok - mission accomplished :)
08:44fliebelWriting data structures is hard :(
08:46angermanfliebel: very true. And even more saddening is that it's still far from a shippable product once the datastructure is in place.
09:45TimMcfliebel: Are you just trying to test for overlapping of axis-aligned rectangles?
09:48TimMcfliebel: If so... https://github.com/timmc/CS4300-HW4/blob/master/src/timmcHW4/core.clj#L43
09:49fliebelTimMc: Well, checking if 2 boxes overlap is not hard at all, what is hard is determining which boxes to check.
09:51fliebelTimMc: Ah, this is your solution to the rabit rendering you showed a few days back?
10:17TimMcHow many boxes do you have to check?
10:17TimMcYeah, this is the 3D renderer.
10:19fliebelTimMc: Don't know… I might get away with checking them all, but I like the exercise. I'm trying to make a quadtree now.
10:19TimMcah
10:19TimMcThere's another algorithm for checking a bunch of aarects.
10:19fliebeloh, tell me :)
10:20TimMcTechnically, it's for checking if the projections of polygons onto a line (line segments) have intersections. Let me find it.
10:21fliebelTimMc: That's never going to be faster than just checking the 4 points of my squares, is it?
10:21TimMchttp://stackoverflow.com/questions/3324880/axisaligned-rectangles-intersection
10:22TimMcfliebel: Wait, are these actually squares?
10:24fliebelTimMc: Yea, I'm drawing sprites in 2D, not triangles from weird files ;)
10:25fliebelOkay, I admit the sweep and prune looks a lot easier than these trees.
10:41fliebelOn second thought, For moving items, I really only need to know their nearest neighbor, and for the ground, I need to make sure items are over transparent pixels.
10:53TimMcCode management question! Our next assignment (HW5) builds off the last one. I currently have "HW4" and "timmcHW4" references sprinkled throughout my build files and namespaces. Should I just leave it as that and only change the user-visible references to HW5?
11:31fliebelHow do I use defrecords from another namespace? Do I use the full class name, or what?
11:32Raynesfliebel: IIRC, you import the Java class corresponding to the record.
11:33fliebelRaynes: With all the _STAR_ stuff and underscores?
11:34Raynesfliebel: No clue. Haven't had to import many records.
11:35fliebelOh, sure, logical… it has a underscore int eh ns and a dash in the class.
11:56thorwilenlive question: how do i select an element by a name attribute?
12:04thorwilah, [(enlive/attr= :name "title")]
12:05TimMc$findfn 0 5 7 5
12:05sexpbot[]
12:05jlf`hi all -- i'd like to have stdout redirected to my slime repl. there is emacs' slime-redirect-inferior-output, but i'm launching swank from -main and connecting via slime-connect. anyone know a solution?
12:06TimMcI keep writing (defn clamp [min max v] (Math/min max (Math/max min v))) -- I can't believe there isn't already something like this.
12:21mduerkseni have a question concerning "ensure". die docs say: "Protects the ref from modification by other transactions. [...] Allows for more concurrency than (ref-set ref @ref)". what does the last sentence mean? that the transaction won't fail if the competing transaction sets the ref to the same value?
12:22TimMcmduerksen: Does this help? http://clojuredocs.org/clojure_core/clojure.core/ensure#comment_73
12:23CaffeineTimMc: Clojure provides his own min/max, why use Math's?
12:23Caffeine(Honest question, not a critique.)
12:24TimMcCaffeine: critique would be fine too. :-) Let me take a look.
12:24Caffeinehaha okay :P
12:24Fossiwhy is it not possible to lein install ring?
12:24TimMcHuh. I don't actually know why I did that.
12:25CaffeineTimMc: You'll save 10 characters each time you type your clamp defn ^^
12:25Fossilein says: a.io.FileNotFoundException: $MY_HOME_PATH/ring/src (No such file or directory)
12:27TimMcCaffeine: Yeah, but now I have to come up with new names for the interval endpoints. :-(
12:28Caffeineyup... noticed that.. :S .. I kinda like lisp 2's for that .. haven't really thought of the cons
12:28Caffeinemn mx
12:29Caffeineor m M :o
12:29TimMcminv maxv
12:29TimMc(min maxv (max minv v))
12:30Caffeinethat's clear enough
12:30TimMcI still think there ought to be a clamp function.
12:31TimMcCaffeine: It's clear if you're familiar with the idiom. WHen I first derived it, I kept thinking "max min? min max? this can't be right..."
12:31CaffeineDon't know.. I wrote my own in Java too... the search was going to take longer than writing it I guess...
12:44thorwilis there something like a non-lazy concat?
12:49Caffeinenoob question: can't we just force concat to fully evaluate if there isn't one non-lazy version?
12:53thorwilwell, none of eval, dorun or doall help in my case
13:09TimMcthorwil: Why do you want eager concat?
13:12thorwilTimMc: i'm fighting with Enlive's "[selector] transformation [selector] transformation" syntax, where the lack of () around each pair is nice until i want to assemble stuff
13:14krlany pointers what this error is about?
13:14krllein swank -> java.net.BindException: Cannot assign requested address (NO_SOURCE_FILE:1)
13:16angermankrl: looks like you are prevented from binding the swank server to a local address.
13:17angermankrl: is one already running? do you have enough priviledges to bind an address?
13:18gfrlogI really miss clojure's immutable data types when I'm programming in JavaScript. Does anybody know if there is a library of similar types in JavaScript anywhere? Or should I write my own?
13:19krlangerman: hmm. 4005 right? does not seem to be bound
13:19angermangfrlog: what do you miss about them?
13:20angermankrl: I think you can try lein swank 8888
13:20gfrlogangerman: writing functional code
13:20angerman$ lein swank 8888 and see if that works.
13:21angermangfrlog: so you are missing the rich set of datastructures? or explicitly the immuability?
13:21gfrlogangerman: I want to be able to take a large data structure, pass a slightly mutated version to a function but still be able to use the old version
13:21gfrlogso the immutability and the efficient sharing of structure
13:22gfrlogof course having sets and hash maps would be nice too. Prototype has a Hash, but it's not all that good :-/
13:22angermangfrlog: I guess you are on your own then. Maybe take a look at clojurejs(?) ?
13:23gfrlogangerman: k, thanks
13:30thorwili'm pretty sure my article is a map with a :title, but (let [article (models/retrieve-article path) title (article :title)] ...) leads to tlog.models.Article cannot be cast to clojure.lang.IFn !?
13:32krlthorwil: shouldn't that be (:title article)?
13:33thorwilkrl: yes, indeed 0.o
13:33thorwilwhy do i think i saw it the other way round, and what would the reason be?
13:34mippymoeHey guys, I'm given a set of arrays of doubles (all of equal length). I'm trying to figure out a good way to hash them. Any ideas? (for example, given an array, I could sum up all its elements and then mod it by the number of elements in the hash table, but this would be a bad function because addition is commutative)
13:35hugodthorwil: maps work either way round, but defrecord doesn't implement IFn
13:36thorwilah! thanks hugod, krl
13:36KirinDavemippymoe: They're arrays?
13:36mippymoeKirinDave: yep
13:36KirinDavemippymoe: Why not just use binary signature as input to a real hash algorithm?
13:36KirinDaveThere are plenty of fast, low overhead algorithms
13:37mippymoeKirinDave: I gotta create my own, it's part of a project I'm working on for school
13:37KirinDavemippymoe: Oh.
13:37KirinDavemippymoe: Hope you're a math major.
13:37opqdonutheh
13:37KirinDavemippymoe: Designing good hash algorithms is hard work, and only partially in a computer science domain.
13:38mippymoeKirinDave: haha well I am fortunately, but actually, it's not a big deal
13:38KirinDavemippymoe: In any event, reduction to its binary signature is probably a good move, if only to get out of insanity of double representations.
13:38mippymoeKirinDave: its an undergrad course, so the hash can be fa rfrom perfect
13:40mippymoeKirinDave: hmm ok
13:40opqdonutmippymoe: have a look at string hashing algorithms
13:41KirinDaveyeah
13:41opqdonutyou might find some nice ideas there
13:41KirinDaveJust treat it as a byte string.
13:41opqdonutmhmm
13:41mippymoeso like concatenate all the doubles in the array?
13:41mippymoeand then do some operation on that?
13:42opqdonutwrap the double array into a DoubleBuffer, and turn that into a ByteBuffer
13:43KirinDaveopqdonut speaks wisdom.
13:44opqdonutthen go through the bytes and do something like hash=(hash+byte)^17
13:44opqdonutor whatever
13:44mippymoethanks guys
13:45KirinDavemippymoe: Good luck.
13:45KirinDaveopqdonut: Is 17 more magic than 11? I usually use 11.
13:45KirinDaveI guess more hot bits.
13:45opqdonutI've seen 17 used quite a bit
13:45opqdonutthat's all I know :D
13:45KirinDave :)
13:46opqdonutsomewhat related: http://stackoverflow.com/questions/299304/why-does-javas-hashcode-in-string-use-31-as-a-multiplier
13:49KirinDaveugh
13:49KirinDaveSO.
13:49KirinDaveWill Never Click.
13:49KirinDaveWoo scala 2.9 is out.
14:01CaffeineKirinDave: Why?
14:01Caffeine(SO)
14:01KirinDaveCaffeine: I do not believe in SO's model or mission.
14:02KirinDaveCaffeine: To bite Heinlein, you don't understand a beach by understanding each grain of sand.
14:02CaffeineIt often fails, but it also very often help me go on with many tasks.
14:03opqdonutit can have interesting trivia/nuggets of information from well-informed people
14:04KirinDaveIt's sorta like straining your local sewer for lost jewelery
14:04KirinDaveYou can find great stuff
14:05KirinDaveBut only after going through a lot of poop.
14:05opqdonutI don't browse so, I merely have a look when somebody (eg. google) points me there
14:15CaffeineYeah, I'm not searching it much... I'm posting my problems, and IF someone comes in with something good (which I must admit happens in no more than 1/3 of my threads), yay, else.. hmm.. I eventually answer my own problem.
14:18sleekyakhi all; if i'm just jumping back into clojure after 9mos or so, should i start with 1.3alphas or 1.2?
14:25devnsleekyak: i'd say jump in with both feet to the latest 1.3 alpha
15:01symboleI'm adding a directory to my classpath using -classpath, and this directory contains x/y/z.clj. I'm trying to require using (require 'x.y.z), however, I get the file not found exception. Does clojure recognize what's being passed to -clsspath?
15:05raeksymbole: yes, it's supposed to work that way.
15:06raeksymbole: are you sure that any hyphens in the namespace names are replaced with underscores in the file name?
15:06raeke.g. (ns x-y.foo-bar) should be in x_y/foo_bar.clj
15:07raekalso, note that if you use the -jar option, the -cp/-classpath option is _ignored_
15:07raek(silently)
15:07symboleI am using the jar option.
15:09symboleIs this JVM behavior, or clojure?
15:09raekJVM
15:10fliebelAnyone fancy helping me out finding a bug in a 30 line long function, or thinking about ways to trim it down?
15:11raekfliebel: paste?
15:11symboleSo if I do want to start it from the command line, the alternative is unzip the clojure jar?
15:11fliebelraek: Moment...
15:12raeksymbole: no, you can still do java -cp lib1.jar:lib2.jar:src/:clojure.jar clojure.main
15:12raeksymbole: have you heard about leiningen or cake?
15:12Caffeinesymbole: no, I think you can just -cp yourpack.jar:.:anotherpack.jar the-class-to-start no?
15:12Caffeineyeah what raek says
15:12symboleraek: I have, but I want to make sure I understand how it lower level details work.
15:12fliebelhttps://gist.github.com/888545
15:13fliebelThe problem is that quads do net get the proper offset, I think.
15:14symboleraek: You said that using the jar method of launching clojure ignored? Isn't that what you're doing?
15:14symboleUgh. I meant, ignores -classpath.
15:15CaffeineWe're not providing -jar option
15:15Caffeineso it doesn't ignore -cp
15:15raeksymbole: what I said only applied to the "-jar" command line option, not using jar files in general
15:15symboleOh, I see.
15:15raek-jar is for the case when you only have one jar file, and want to use its default main class
15:16raeklein uberjar produces those jars too
15:17CaffeineI'll have to seriously check that lein thing soon
15:18symboleThanks. That worked.
15:21david`I saw someone with a clojure conj shirt on at lunch yesterday
15:22NameNodeFive inches came and went, as did six. Slowly, his hard-on got
15:22NameNodethicker and longer as his tiny balls began to swell. It was like watching
15:22NameNodea long, thick balloon slowly fill. The pressure was growing more and more
15:22NameNodeintense as seven inches neared. His balls were almost an inch and a half
15:22NameNodeacross now as the pressure swelled and suddenly, released.
15:22NameNode With orgasmic shock, Curt watched himself spray an arc of cum
15:22NameNodeacross the shower room to the opposite wall, six feet away. Each spasm
15:23Caffeinelollll wtf
15:25dnolenfliebel: do you have some input that gives the wrong out?
15:26Clintegerhahahaha
15:29fliebeldnolen: No, it seem rather random, but them , I'm using a random input :D I'll fix the bugs myself, but comments on code organization are appreciated :) (I pane to use Logos for that AI of my game btw)
15:30fliebel*plan
15:30raekfliebel: so a node in the quad tree is either nil, a quad object (which contains four nodes), or some data?
15:30dnolenfliebel: cool! the disequality stuff is going a little slower than planned. I have an idea for a better implementation than the one presented in Byrd's thesis.
15:31fliebelraek: Yea, so I drill down untill I find a nil, in which case I replace it, or I find another object, in which case I make a new quad and put both in htem.
15:31fliebeldnolen: Cool :) That monkey banana example really got me thinking.
15:34dnolenfliebel: heh, yeah it's pretty neat. once the disequality stuff is in I'll start converting more Bratko examples.
15:34fliebeldnolen: What is Brakto about?
15:34devnfliebel: what'd you find out with structmaps yesterday btw? you end up going with defrecord?
15:35fliebeldevn: Yea, defrecord, don't know about the CG for sure, but it works.
15:36devni was thinking maybe a structmap would be worth looking at, but maybe not too...
15:36dnolenfliebel: it's just a good introduction on Prolog. It's a good idea to have many examples on solving common problems w/ Logos, even better to have them based on a text that people can easily get their hands on.
15:36fliebeltrue
15:37fliebelIs this cheating for optional arguments? & [pidx parent]
15:37Chousukenah
15:38fliebelthats good enough for me.
15:43TimMcfliebel: I thought each node in the quadtree would have a coll of items and optionally also 4 children.
15:44dnolenresurrecting delimited continuations for Clojure, https://github.com/swannodette/delimc
15:45dnolenbut now in terms of Scheme's shift/reset
15:45fliebelTimMc: Uh, oh, that's not how I understood it. I think you;re supposed to split up the children untill ther is only one point per square.
15:45TimMcAh, you have points, not shapes?
15:46Raynesdevn: Is clj-shoes what I think it is? :O
15:46fliebelTimMc: No, much to complicated for me :P
15:46arohneris there a way to force clojure to ignore .class files, and always recompile?
15:47arohnerI'm dealing with a jar that was compiled against an older version of clojure, and I'd rather not recompile it
15:48raekwell, in a perfect world libs should not contain AOT compiled source at all
15:49raek...or does the lib need AOT?
15:49arohnerraek: I agree, most of the time. i think this library has a good reason for compiling one ns, but it precompiles all functions it needs in the AOT ns
15:50arohnerand then I'm requiring one of the dependent ns-es, and clojure loads the .class file
15:51raekis the AOT essential for the lib (i.e. does it not work without it)? if not, the user of the lib should do the AOT, or the lib author should release one version of the lib for each stable clojure version
15:51fliebelyay, I haz a quadtree, now I want to visualize it :(
15:52raekbut to answer the question: no, I don't think you can turn off loading class files like that
15:53raekuntil the version compability of compiled code issue is solved in some way, source-only is the only real option for libraries
15:56arohnerraek: I think part of the problem is AOT compiles every function loaded, when this probably just needs to generate one class file
16:00raekwell, you'd still have the clojure version incompability problem
16:00raekbut yes, that bug/feature in the clojure.core/compile is a bit odd
16:08devnRaynes: I'm not sure...
16:08devnRaynes: What do you think it is? :D
16:08danlarkindnolen: exciting!
16:08dnolenhttp://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port
16:34Raynesdevn: Shoes!
16:36devnRaynes: yes, but since you aren't a ruby guy im asking if you know what shoes is :)
16:37fliebeldevn: That's some gui stuff by a guy who disappeared, right?
16:37Raynesdevn: Yes.
16:37Raynesdevn: I'm a fan.
16:37devnfliebel: yes
16:37Raynesdevn: To be fair, I'm a fan of any Clojure GUI tools.
16:37TimMc_why
16:37devnRaynes: ah, cool -- yeah what is in that repo is a little...not shoesey...yet
16:38fliebelRaynes: Is your 2035 project going to be like shoes?
16:38Raynesfliebel: Heh, no. I've never actually used Shoes. I'm only excited at the prospect of Clojure GUI tools.
16:39fliebelRaynes: Oh, you're not a big fan of Swing? :D
16:39RaynesNot particularly.
16:40RaynesGood work.
16:40Raynesdevn: What's in that repo is not much of anything. Yet.
16:41fliebelhttps://github.com/abhijith/clj-shoes
16:47Raynesfliebel: I was dead serious though. We are wrapping Swing.
16:53lucianis *anyone* a fan of swing, really?
16:55fliebelRaynes: I realize, and sympathize with your pains :(
17:02dnolenhmm is it possible to avoid reflection w/ proxy?
17:03ssiderishello
17:03ssiderisI've written this macro: http://pastebin.com/ZvxGcNtQ
17:04ssiderisI tried removing the second parameter and changing (actionPerformed [~event] ... to (actionPerformed [event] ...
17:04ssiderisbut I get an error about qualified names which I don't understand
17:04ssiderisshouldn't that work?
17:06raekssideris: syntax-quote will namespace qualify the addActionListener and actionPerformed symbols
17:06raekwhich you don't want in this case...
17:07raekif you use .foo instead of (. foo ...), syntax quote will not do that
17:07raekfor the actionPerformed case, you simply need to write ~'actionPerformed
17:08raek(you can do that in the first case too)
17:10ataggartdnolen: sometimes you hit reflection in proxy due to the implicit 'this not having a tag
17:11raek,`(proxy [java.awt.event.ActionListener] [] (actionPerformed [foo#] nil))
17:11clojurebot(clojure.core/proxy [java.awt.event.ActionListener] [] (sandbox/actionPerformed [foo__5792__auto__] nil))
17:11ataggartdnolen: if you provide your own typehinted (binding [^Foo this this]...) it will take care of some reflection cases.
17:11ssiderisraek: ~'actionPerformed seems to have done the trick, but .~component doesn't seem to make a difference
17:13raekssideris: change `(. ~component addActionListener ...) into `(.addActionListener ~component) or `(. ~component ~'addActionListener ...)
17:13ssiderisoh that's what you meant
17:13ssiderissorry, i'm just starting with macros :-)
17:13ssideristhanks
17:14raekdnolen: you can do it if you build the proxy using get-proxy-class, construct-proxy and init-proxy, something like this: https://gist.github.com/877894
17:14raekssideris: eh, sorry for the broken foo example...
17:15raek(in the gist I also made the method call a var rather than a fn)
17:15dnolenraek: ataggart: here's what my code looks like.
17:15dnolenhttps://gist.github.com/888637
17:16raekhrm.
17:17ataggartwrap the call to compute with (binding [^RecursiveTask this this] ...)
17:17raekdnolen: what does the RecursiveTask interface look like?
17:17raekbinding?
17:17clojurebot:|
17:18dnolenraek: http://download.oracle.com/javase/7/docs/api/java/util/concurrent/RecursiveTask.html
17:18raekbinding only works on vars, right?
17:18ataggartit'll work
17:18ataggart'this is provided by the proxy code
17:18dnolenataggart: wrap (.compute ...) ?
17:18ataggartyarp
17:18dnolenlame.
17:19ataggarthmm you're doing wierd stuff so I'm not sure where it should go
17:20dnolenataggart: heh, why is it weird? I'll gladly not do it if there's a better way.
17:20raekI think the reflection is cause by the fact that the method is protected
17:20ataggartI'm guessing RecursiveTask is from java7
17:20dnolenataggart: yes, fork/join
17:20ataggartwhat's the reflection warning say?
17:20raekso maybe the reflector skips it
17:21dnolenreference to field compute can't be resolved.
17:22ataggartdnolen: ok, I'm probably wrong about the 'this being the culprit
17:23ataggartdoes that warning happen when the recursive-task function is read, or when you run the code inside the comment?
17:23dnolenwhen I compile the whole file
17:23ataggartso, not anything to do with the code inside the comment.
17:23dnolenwhen run .compute 1e6 times it takes 1.6s, which seems ridiculously slow for method calls.
17:23dnolenataggart: no.
17:31ataggartdnolen: does the call actually work?
17:31dnolenataggart: yes
17:35ataggartdnolen: I'm inclined to agree with raek. I'm not clear on what magic is being used to make a protected method publicly callable.
17:40Sunil01Is Clojure better suited for working with Big Data than Haskell?
17:41sritchietbatchelli and I are working on a hadoop configuration tool, using pallet, that will make that pretty easy
17:41sritchieSunil01: I've been having a wonderful time working with hadoop in clojure, using nathanmarz's cascalog... can't say anything for the haskell side of the debate
17:43ataggartdnolen: ok I think I figured it out. While RecursiveTask has a protected compute method, thus typehinting doesn't buy you anything. When the call actually is made, the type is not RecursiveTask, but a proxy class that has a *public* compute method, thus the call works.
17:43Sunil01sritchie: Thank you. Were you working with Clojure before this project? Was there a steep learning curve?
17:43dnolenataggart: yes, totally
17:44sritchieSunil01: actually, I wasn't
17:44sritchieworking with clojure before
17:44dnolenataggart: I switched to .invoke, 2ms now
17:44dnolenfor 1e6
17:44ataggartnice
17:44sritchieI'd worked my way through http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/0262560992, but that was about it, for lisp
17:45Sunil01I have 'The little Lisper' and am working through SICP.
17:45dnolenataggart: raek: thx for the insights.
17:45Sunil01What did you use to get started with Clojure?
17:46ssiderisis there a built-in way to create a proxy for a java interface where the provided methods are implemented and all the rest are just empty?
17:46sritchieI'm an emacs user, so I started with leiningen, with swank-clojure to access the REPL with SLIME -- https://github.com/technomancy/leiningen
17:47sritchiewhat editor do you like?
17:47Sunil01sritchie: Thank you for the info. I am a vim and Textmate guy
17:47sritchieI use cake now -- https://github.com/ninjudd/cake -- as a couple of guys on my team aren't into emacs, yet, and cake has some nice tools for textmate
17:47sritchiehttps://github.com/swannodette/textmate-clojure
17:48sritchiehere's a fun way to get started right now, if you're interested -- https://github.com/relevance/labrepl
17:48Sunil01awesome, thank you.
17:49sritchiemsg me, or head into the pallet channel if you decide you want to go the hadoop route, I'd be happy to help you get set up
17:49raekssideris: if you leave out a method definition in proxy, it will be implemented by throwing an UnsupportedOperationException
17:49sritchiesorry to barrage you with info, but here's the last link you'll want to check out, on cascalog -- http://nathanmarz.com/blog/introducing-cascalog-a-clojure-based-query-language-for-hado.html
17:50ssiderisraek: yeah, I saw that, but is it a good thing throwing all those exceptions?
17:50sritchieSunil01: good luck
17:50sritchie!
17:50Sunil01sritchie: No you are not barraging....thank you for being so helpful.
17:50sritchieno problem, everyone in here's been so wonderful, it's nice to see a question I can answer ;)
17:52raekssideris: at least it's something that you always can do. otherwise, what value should the method return? you can't return null if the return type is a primitive...
17:53raekthat exception is also used in the java collection interfaces for destructive operations on read-only collections
17:53ssiderisraek: good point didn't think about return values
17:54raek...and also, is it a good thing to just silently ignore the method call?
17:54ssideriswell, I'm trying to emulate what "adapters" do in Swing
17:55ssiderissay you have a MouseListener, the MouseAdapter provides empty implementations of all the methods of the Listener interface for convenience
17:55raekin that case it makes more sense...
17:55ssiderisso that you can override only the relevant ones
17:56raekthankfully, we can do something like (add-listeners {:click fn-1, :move fn-2}) in clojure :)
17:56ssiderishow???
17:56raekwell, in pure clojure
17:57ssiderisare you referring to clojure.contrib.swing-utils ?
17:57raeksince in clojure, you don't have an interface for each possible use of an anonymous function
17:58raekah, no. this was just a java rant :)
17:58raekpseudo-code
17:58ssiderisoh sure
17:58ssideristhat's what I'm trying to build more or less
17:59ssiderismy code looks like that: http://pastebin.com/e3mMwJ6A
18:00raekneat
18:00ssiderisalthough I'm a bit concerned about the wasteful creation of object that this might lead to if I start adding on-mouse-clicked etc
18:01ssiderisbecause the MouseAdapter has methods for various mouse-related events
18:01ssiderisand the way I'm doing it, it would create one mouse adapter per "on-" handler
18:02ssiderisI mean that MouseAdapter can handle mouse clicked, mouse over, mouse out etc
18:03raekif you have a proxy like (defn make-mouse-listener [fnmap] (proxy [MouseListener] [] (mouseClicked [e] (when-let [f (:clicked fnmap)] (f e))) (mousePressed [e] (when-let [f (:pressed fnmap)] (f e))) ...))
18:04raekyou could use the same proxy
18:04ssiderisyeah, I should reconsider my syntax a bit
18:05ssiderisI liked your add-listeners pseudo-code
18:05raekthen it would be easy to have something like (button "test" {:clicked (fn [_] ...)}), or maybe make a macro to make that prettier
18:06raekthinking of it, I would probably separate the adding from the creating of the proxy
18:06ssiderissure, but in many many cases it's convenient to have a way to add listeners in-place
18:06ssiderisbecause in some cases the listeners are shared
18:07raekyou can always add a macro for that later
18:07ssiderisbut in a lot of cases they are unique for a component
18:07raeknot having a macro that does everything makes testing *a lot* easier
18:08raekto quote cgrand: "Syntax is icing, add it later!"
18:08ssiderismakes sense
18:08ssiderisI do Swing for my day job and I hate the verbosity
18:09ssiderisso as therapy, I'm trying to make something in clojure that will express the same thing is as few keystrokes as possible
18:09ssideris:-)
18:10raekyou will most certainly succeed with that :-)
19:19dnolenhuh, anybody familiar w/ the ForkJoin stuff know what advantage the RecursiveTask has over the standard ForkJoinTask?
19:34livingstonif you use a namespace that has a record in it you don't get access to that record by default? you have to then separately import the record too to get it's constructor?
19:35livingstonI basically need to do this: http://tech.puredanger.com/2010/06/30/using-records-from-a-different-namespace-in-clojure/
19:46dnolenfork/join is sick, https://gist.github.com/888733
19:47livingstondnolen: you mean in a good or a bad way?
19:49dnolenlivingston: good
20:29ossarehhow dependable will ##(< (.hashCode [2011 1]) (.hashCode [2012 2])) be?
20:29sexpbot⟹ true
20:29ossarehI just through a bunch of vectors into a #{} like that and they were in the correct order, I was expecting to have to use (sorted-set-by).
20:30ossarehs/through/threw/
20:30sexpbot<ossareh> I just threw a bunch of vectors into a #{} like that and they were in the correct order, I was expecting to have to use (sorted-set-by).
20:38dnolenusing fork/join to make Logos parallel should be fun
20:43tomojossareh: you want lexicographic?
20:48tomoj[] hashes to 1, nonempty v hashes to (+ (* 31 (.hashCode (pop v))) (.hashCode (peek v)))
20:48tomojof course relying on that would be pretty evil
20:49ossarehtomoj: nope, that is a year and week number in the vector. Checked the APersistentVector .java and and it's hashcode delegates to the values within it. Since they're numbers, they'll sort correctly
20:49ossarehs/it's/its/
20:49sexpbot<ossareh> tomoj: nope, that is a year and week number in the vector. Checked the APersistentVector .java and and its hashcode delegates to the values within it. Since they're numbers, they'll sort correctly
20:53danbell"IllegalArgumentException: Key must be integer" could only possibly refer to a vector being called as a function somewhere, right?
20:54tomojossareh: hmm
20:55dudlyevenin'
20:57dudlySo, I have this text file with somewhat unstructured data.
20:57dudlysay:
20:57dudly1. Did you do your laundry? Yes 2. did you take out the trash? No 3.Did you bring in the milk? yeS
20:57dudlyThere are any number of new lines or spaces or tabs after the respective "Yes" and "No"s
20:59dudlyI'd like to generate a map of yes and no corresponding to the number. So I can look up by :1 :2 :3 etc.
20:59brehautdudly: why would you use keywords for numbers? why not integers?
20:59dudlybrehaut: hmm, I could use numbers as keys.
21:00tomojossareh: ##(< (.hashCode [2010 50]) (.hashCode [2011 1]))
21:00sexpbot⟹ false
21:01dudlythen I could do math with them etc, true... anyway, whats the shortest path to my solution? Indexing? and how would I get the index of a clause?
21:01dudlyre-find and friends are only validating that the string exists, not returning location... what I really need is the tail of the string returned
21:02ossarehtomoj: fair play.
21:02dudlyI'd like to be able to lazily pull in the string until there is an entire match of the clause, then hand me the rest of the string so I can extract the Yes or No
21:03tomojI'm glad, because even if it had worked you shouldn't have used it :)
21:04brehaut,(into {} (map (fn [[_ k v]][(Integer/parseInt k) v]) (re-seq #"(\d)+.[^?]+\?\s*(Yes|No)"
21:04brehaut "1.aba c?\n\nYes2. dfgdfgdfgdfgs fdg sdf\n\nsdg? No")))
21:04clojurebotEOF while reading
21:04brehautbah
21:04sritchiehey all, I'm blanking on an idiomatic way to get a subset of a map
21:04brehaut,(into {} (map (fn [[_ k v]][(Integer/parseInt k) v]) (re-seq #"(\d)+.[^?]+\?\s*(Yes|No)" "1.aba c?\n\nYes2. dfgdfgdfgdfgs fdg sdf\n\nsdg? No")))
21:04clojurebot{1 "Yes", 2 "No"}
21:05dudlywtf
21:05brehautdudly: thats what you wanted right?
21:05dudlyyup
21:05sritchiehaha, you just freaked him out
21:05dudlyI'm going to have cut and paste this into a text file to study for a moment
21:05brehautsorry about regexp, also its not case insensitive because i forget those details
21:05tomojsritchie: given what?
21:06ossarehtomoj: true dat. /me slaps his wrists for being tempted by dodgy solutions
21:06sritchieso, if I have {:tag :sometag, :phase thephase, :somekey someval}, I want to be able to apply a function and get a new map with {:tag :sometag, :phase thephase}
21:06tomojgiven what?
21:06sritchie(f orig-map keys)
21:07tomojah
21:07tomojthey keys you want to keep?
21:07sritchieyes
21:07tomoj$findfn {:foo :bar :baz :bing} [:foo] {:foo :bar}
21:07sexpbot[clojure.core/select-keys]
21:07sritchiewoah, that's pretty cool
21:08sritchie$findfn [1 2 3] [2] [1 2 3 1 2 3]
21:08sexpbot[]
21:08sritchiebummer
21:09sritchieif only if would output code for functions not written yet!
21:09sritchietomoj: thanks a lot
21:09tomojheh
21:09dudlyOh, I see how that works. that's neat
21:09dudlyregexes are confusing though
21:09brehautdudly: add (?i) to the start and it'll be case insensitive
21:10dudlybrehaut: like #"(?i)(\d)+.[^?]+\?\s*(Yes|No)" ?
21:10brehautdudly its any number of digits (captured) one or more thing that isnt a questionmark, any amount of whitespace, ayes or no
21:10brehauti think so yes
21:10brehaut,(re-matches #"(?i)foo" "FOO")
21:10clojurebot"FOO"
21:11brehaut(re-matches #"foo" "FOO")
21:11brehaut,(re-matches #"foo" "FOO")
21:11clojurebotnil
21:12dudlybrehaut: so the question mark is being used?
21:12brehautits am agical java regexp option thing
21:13dudlywhat if the line was "4. gave the kids lunch money? (not too much: yes"
21:13dudly* much):
21:13brehautthen you have a problem
21:14brehautdudly: use (fn [[_ k v]][(Integer/parseInt k) (-> v .toLowerCase first (= \y))]) as your map function; you'll get a bool back as the value
21:15brehautor if you want to get #clojure points (comp (juxt #(Integer/parseInt %) #(-> % .toLowerCase first (= \y))]) rest)
21:15brehautwait no i want the not-juxt
21:16tomojI have at least a fraction of a point for #{\y}
21:16brehauttomoj: absolutely
21:16tomojer, no
21:17tomojthe whole point is to get a bool :)
21:17brehautoh
21:17brehauthah
21:17dudlytheres a closing ]
21:17brehautdudly: that was a typo in anotherwise broken expression
21:18dudlydoes it do the same thing as the (fn.. above?
21:19brehautno because i used juxt in the wrong place
21:21dudlyI could partition the line into lines that start with #period
21:22dudlybut sometimes this document has headings prior to a given number, like sections
21:23dudlynot often.. I could customize it, I could even get the index of each character, but I'm worried people will change the document before they submit it.
21:23dudlyit's basically a checklist in my organization that people submit
21:24dudlyI mean, if people accidently add a space near the top of the document, it will change the indexes of all the yeses and nos
21:30dudlyah, one more constraint.. there is always at least one \newline before and after the yes or no
21:31dudlyand the whole clause is always part of one line.. so I can partition the whole document base on lines...
21:32brehautdudly: sorry i dont have time to do any more for you sorry
21:33dudlyyou've done enough already, brehaut. I'm smarter now.
21:33brehautdudly: cool :)
21:34tomojI feel like the why stack needs to be popped
21:34tomoja few times
21:38flying_sheepwhat is the correct way to return an unchanged data structure passed as a parameter to a function?
21:38brehaut,(identity 1)
21:39clojurebot1
21:39tomojwhy aren't seqs stacks?
21:39flying_sheepthanks brehaut :)
21:40brehautflying_sheep: if i understood you properly, otherwise (fn [x] x)
21:41flying_sheepyup, identity is what I needed
21:52devnhm
21:52devnanyone else here a daily reader of the clojure google group list?
21:52devnI'm somewhat perturbed by the /lengthy/ discussion following "Jesus, how the heck to do anything?"
21:53dudlysomebody feeding a troll?
21:53devnSome of the Java bashing and so on is getting a bit counter-productive
21:53devnIt's subtle but it would discourage me if I had used Java in any serious capacity in the past and didn't yet "despise it"
21:54devnIt's emotional, I guess... That's what bothers me so much about it.
21:55dudlyit's cultural though... deeply ingrained
21:55devnThere is no room for emotional discussions. The majority of the things that happen on the list are incredibly objective, but when some of those same topics veer off towards the emotional, they turn into "reasons you shouldn't join this community"
21:55devnthere is plenty of room for opinions, but they ought to be objective
21:55devn;)
21:56dudlyyea, I haven't read the list in many months
21:56devndudly: im back on it now -- i screwed up and chose the digest
21:57devni like reading the threads -- so many great things hidden 28 messages deep in some of those threads
21:57dudlyyea, I just have a few feeds on my feed reader and poignant mail list topics float up usually.
21:57dudlyyea, I do miss those nuggets
21:59dudlyplanet clojure, clojure pipe, disclojure, and clojure reddit are on my feed's clojure folder
21:59dudlylotta dups but hits most of the pertinent news
22:01devni havent ever read clojure pipe, link me?
22:01devni usually just hit disclojure and planet clojure because there are dupes between those two as it is
22:02dudlyhttp://pipes.yahoo.com/pipes/pipe.run?_id=4cc8ebb9ae0b852d6ab7d94956ce2638&amp;_render=rss
22:02dudlyyea, it's probably redundant
22:03devnspeaking of yahoo pipes
22:03devnwhat an incredibly cool idea that they never chose to monetize
22:03dudlyhmm
22:04devnor rather, they could have done a much better job of marketing it to the general public
22:05devnit's such a cool tool and IIRC they were the first to make a GUI like Yahoo Pipes for muxing data together like that
22:05dudlyyea, I expected more to be built on top of it
22:05dudlymaybe the should have built more semantic web smartness into it.
22:06devnit was built at a time when no one gave a damn about the semantic web
22:06devnonly now do you see people even reasonably interested in paying to RDFify their entire site and so on
22:08devnanyways...
22:08dudlyimagine a website frontend, built on top of yahoo pipes, pulling in semantic web components other websites
22:34devnthe underlying tools exist
22:53dudlywhat other functions go with partition and group-by, that let you mess with the order of things
22:54dudlyor better put, that let you arrange the categorization of things
22:54no_mindusing enlive, I want to define a snippet for input type="text" only. How do I do it ? Examples on net handle generic [[:input]] only.
22:56devndudly: filter, remove, conj, concat, distinct, partition-all, partition-by, split-at, shuffle, sort-by, reverse
22:56devnand some more
22:57dudlythat'll do, thanks.. something in there will be it
23:05tomojno_mind: use attr=
23:05tomojlike [[:input (attr= :type "text")]] I believe
23:39sritchiehey all, here's a really simple one... how can I convert a series of 2-vectors into a hash-map?
23:42sritchie,(apply hash-map (flatten [[:key "word!"] [:another "test!"]]))
23:42clojurebot{:key "word!", :another "test!"}
23:42sritchiethat works, just wondering if there's a more idiomatic way
23:50hugod,(into {} [[:a 1][:b 2]])
23:50clojurebot{:a 1, :b 2}
23:50no_mindhow can I iterate over a map ? I want to print the keys and corresponding values
23:53sritchiehugod: cool, thanks
23:54sritchieno_mind: ,(for [[k v] {:a 1, :b 2}] (println "key: " k ", val: " v))
23:54sritchie,(for [[k v] {:a 1, :b 2}] (println "key: " k ", val: " v))
23:54clojurebotkey: :a , val: 1
23:54clojurebotkey: :b , val: 2
23:54clojurebot(nil nil)
23:55sritchie,(doseq [[k v] {:a 1, :b 2}] (println "key: " k ", val: " v))
23:55clojurebotkey: :a , val: 1
23:55clojurebotkey: :b , val: 2
23:55sritchieno_mind: that's better