#clojure logs

2012-02-27

00:17Raynescallen: Raynes made refheap.
00:17RaynesYou were correct.
00:17callenRaynes: I'm 1 for 2 then. About the same as my grades in school then.
00:24shaolynnSo I've created a project based on noir-async (https://github.com/andrewvc/noir-async), but I'm having trouble running it with "lein ring server"
00:25shaolynnI keep getting the following error:
00:25shaolynnjava.lang.IllegalArgumentException: No implementation of method: :consumer of protocol: #'lamina.core.channel/ChannelProtocol found for class: nil
00:25shaolynn"lein run" works fine, but I'd like to compile it into a war and deploy it to AWS beanstalk
00:31shaolynnOk, let me rephrase that - what's the best way to deploy a noir-async (https://github.com/andrewvc/noir-async) project to AWS beanstalk?
00:56shaolynnOk, so I'm able to compile a war file, and it runs on my local tomcat server, but for some reason I get only 404s.
00:56shaolynnhere's my server.clj:
00:56shaolynnhttps://gist.github.com/1921781
00:56shaolynnany advice?
01:03devn(doseq [f list-of-files] (for [parsed-and-filtered (scrape-html-file f)] (swap! an-atom conj (:key-from a-map))))
01:04devnthis feels wrong...
01:05bbloomuse in-to {} ??
01:05lazybotbbloom: What are you, crazy? Of course not!
01:06bbloom*sigh* thanks lazybot
01:06devni think ive spent too much time in imperative land lately
01:08bbloomactually, i have no clue whatsoever what that line you pasted is trying to do :-P
01:18RaynesI see an atom.
01:18RaynesI assume the worst.
01:18devnbahaha
01:19devncut me some slack. i've been off on a farm somewhere for the last 6 months or something
01:20devnRaynes: I'm scraping a a log that is HTML. I extract the nodes I want and put them into a map {:nick "fred" :content "heyo!"}
01:21devnthe issue is that sometimes :nick is nil because it is a continuation of the previous thing "fred" said
01:21callendevn: are you using clojure.xml or tree-seq?
01:21devnso I'd like to populate the next nil with the current nickname
01:21devncallen: neither, enlive
01:21callenthat'll do.
01:22callenpretty good idea. :)
01:22Raynesdevn: I don't understand why you need an atom for this. I guess I'd have to see the rest of the code.
01:22devnso my thinking is: as I walk through the html file i constantly am setting the atom to be the current nickname, and when i encounter a nil, i assoc that
01:24ibdknoxanyone know if there's a way in lein to prevent .class files from being generated for a specific namespace?
01:26bbloomdevn: treat your walk over the html file as a lazy sequence traversal
01:26bbloomthen use reduce to compose your map
01:27devnRaynes: it's something like: (map parse-nodes logfile) => ({:nick "fred" :content "hello"}, {:nick nil :content "and good morning!"}, ...)
01:28devnmeh, im just being confusing by not showing code, but ive made a big mess
01:28devni need to make some commits
01:29RaynesI guess I just don't understand the concept of side effects anymore. Even my I/O is pure these days. ;P
01:29devnlol
01:30callenI'm not sure if I want to trade Raynes or not.
01:30RaynesMovie time.
01:32humbleZtest
01:33callenhumbleZ: icles
01:41spoon16why are many things in https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc/internal.clj named with a * suffix?
02:03humbleZdoes anyone know of any other resources like the clojure-koans?
02:05shaolynnI'm having trouble deploying a noir app to a tomcat server. Is there a more specific IRC that I should try, or is this my best bet?
02:05amalloyhumbleZ: 4clojure?
02:06amalloyyou could try #noir, but this is probably your best bet
02:06shaolynnthx amalloy! I'll check it out
02:06humbleZthanks ammoloy, will take a look
02:12devnhow can I turn this: ({:nickname "Chouser", :content "Hm. Not exactly packed in here. Anyone paying attention?"} {:nickname "rhickey", :content "hi"} {:nickname "Chouser", :content "hi!"} {:nickname nil, :content "I'm still just reading the docs, but I have a quick question."}) into a seq of maps where the nils are replaced with the last non-nil nickname?
02:13devnso {:nickname nil ...} becomes {:nickname "Chouser" ...}
02:13devn(btw chouser sorry for all the nick hilights;)
02:14shaolynnFuck - when I google my error message, the top result is my unanswered question on this IRC from earlier tonight D:
02:16devnshaolynn: what message?
02:16shaolynnThe main issue is that I'm having trouble deploying a .war to a tomcat server
02:17shaolynnThe specific message that I was searching for was this:
02:17shaolynnjava.lang.IllegalArgumentException: No implementation of method: :consumer of protocol: #'lamina.core.channel/ChannelProtocol found for class: nil
02:17shaolynnwhen I run "lein ring server"
02:18shaolynnI can run the app just fine with just "lein run", but when I run "lein ring uberwar" and run the war on a tomcat server, All I get are 404 pages.
02:18shaolynnRight, I tried that with no luck.
02:20devnshaolynn: fwiw i know that ztellman is in the middle of a pretty big rewrite, not sure which version you're running, he has a clj-1.3 branch and a perf branch
02:20aperiodic~contrib
02:20clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
02:20devnone of them is 32 commits ahead of master, the other is 83
02:20shaolynnthx devn, I'll check it out
02:21shaolynnI'm currently using noir-async "0.1.2"
02:21devnshaolynn: np, if all else fails (and it might), then id suggest looking at A) projects that rely on lamina to see if anyone is doing something similar to you, and B) asking on the clojure mailing list
02:21ibdknoxtomcat is a server, I'm not sure how something like aleph could interoperate with that
02:21devnshaolynn: either way, if you can provide steps to reproduce and you ping the mailing list, I can almost guarantee you'll get a response
02:22shaolynndevn: I'll be sure to do that, thx :)
02:24devnibdknox: can i trouble you with what im thinking must be a noob question?
02:24devn({:foo "ABC, :bar "baz"}, {:
02:24devngrr
02:25devn({:foo "abc", :bar "baz"}, {:foo nil, :bar "another"}, {:foo nil, :bar "and more"})
02:27bbloomdevn: let me know if i understand what you're asking for
02:27devnI'd like to keep the value of foo around, so the next nil value I find can be changed to "abc" over and over again, so the above becomes ({:foo "abc", :bar "baz"}, {:foo "abc", :bar "another"}, {:foo "abc", :bar "and more"})
02:27bbloomyou have a table, represented as a list of maps
02:27bbloomthe table is represented with a sort of excel "fill down" for nil values
02:27devnprecisely
02:27bbloomand you want to fill in the nil with the non nil above it?
02:28bbloomi'll take a crack at that :-P
02:29devnyes, it's late and ive been doing some ridiculous stuff. i highly doubt i need anything like a ref or an atom, it seems like partition or something might be just fine, or maybe I could just have a seq like: ("foo" nil nil "bar" nil "baz" nil nil nil) => ("foo" "foo" "foo" "bar" "bar" "baz" "baz" "baz" "baz")
02:29devnand then zipmap with the seq of values?
02:29duck1123using a ref or atom was going to be my suggestion
02:29ibdknoxfilter to get the first non-nil value, map (fn [cur] (update-in cur [:foo] #(or % my-backup-foo)))
02:30devnyeah, that seems wrong, but maybe not
02:30bbloomno need for a ref or atom at all
02:30ibdknoxalternatively you could use reduce
02:30devnyeah i was looking at that, i guess i can conceive of how it's possible, but im not sure how to roll my own reduce fn to achieve my goal here
02:30bbloom(defn fill-down
02:30bbloom ([rows] (fill-down rows {}))
02:30bbloom ([rows values]
02:30bbloom ...))
02:30bbloomstart with that
02:31bbloomwrite it recursively from there
02:31devnthat's good thinkin', mister.
02:31bbloomvalues is a map of current values
02:31ibdknoxwhat's wrong with the filter/map solution?
02:31devnibdknox: im not grokking, sorry
02:31bbloomnothing
02:32devni was busy typing and didnt give it a full "think"
02:33devn&(filter #(not (nil? (:foo %))) ({:foo "bar"} {:foo nil}))
02:33lazybot⇒ ()
02:33duck1123if you have [{:foo "A"} {:foo nil} {:foo "B"} {:foo nil} {:foo nil}] should it be [{:foo "A"} {:foo "A"} {:foo "B"} {:foo "B"} {:foo "B"}]
02:33ibdknox,(let [vals [{:foo "cool"} {:foo nil} {:foo "blah"}] fill (first (filter :foo vals)) final (map (fn [cur] (update-in cur [:foo] #(or % fill))) vals)] final)
02:33clojurebot({:foo "cool"} {:foo {:foo "cool"}} {:foo "blah"})
02:33ibdknoxhm
02:33devnduck1123: yes
02:34ibdknox,(let [vals [{:foo "cool"} {:foo nil} {:foo "blah"}] fill (:foo (first (filter :foo vals))) final (map (fn [cur] (update-in cur [:foo] #(or % fill))) vals)] final)
02:34clojurebot({:foo "cool"} {:foo "cool"} {:foo "blah"})
02:34ibdknoxtada
02:35devnthanks ibdknox
02:35devnthanks duck1123 bbloom as well
02:35devnbbloom: i do sort of like the recursive variadic thing though
02:36devnibdknox: in other news im sad to admit that I didn't know you could (filter :foo vals) like that
02:37ibdknox:)
02:39bbloomah, i assumed you wanted it to work for multiple columns
02:39devnibdknox: that is annoying in how nice it is. i was doing some pretty horrible stuff
02:39bbloomcolumns / fields… whatever
02:39ibdknoxthe multiple column solution isn't much different
02:40bbloomyeah, but i was starting with that which was harder & i'm not as fast as you ;-)
02:40devnibdknox: let me ask you a crazy question: what was your thought process to arrive at that solution?
02:41devni found myself all of a sudden back in imperative land, i was looking at stateful stuff, acting like a fool
02:41devni was thinking i'd do some sort of (partition 2 1 ({:foo 1 :bar 2} {:foo nil :bar 3})) sort of thing
02:42devnand then for each group I would propagate :foo's value forward
02:43devnbut that started to feel ridiculous because of all the comparison i needed to do, so i was thinking id just store it in an atom or a ref, but that felt horribly, horribly wrong
02:43amalloyibdknox's solution looks like it grabs the first non-nil ever and fills all subsequent nils, regardless if something comes in the middle. not really what you wanted
02:43ibdknoxah didn't know that
02:44devnamalloy: here i am congratulating him, shaking the man's hand, but yeah, you're right
02:44ibdknoxreduce is the simple solution then
02:44devndamnit.
02:45amalloyi think it works a lot better with reductions, really. easier *and* lazier
02:46bbloombreak the problem down
02:46bbloomif you process the rows linearly, you don't actually need to look further back than the previous row
02:48bbloom(defn fill-from [row from]
02:48bbloom (into {} (map (fn [[k v]] [k (or v (k from))]) (seq row))))
02:48bbloom(fill-from {:x 1 :y nil :z 3} {:x :a :y :b :z :c})
02:48amalloydevn: https://gist.github.com/1922332, for example
02:49devnamalloy: reductions comes up now for the 3rd time in 24 hours. I had never even used it prior to yesterday when we were chatting about 4clojure golf.
02:50amalloyon the other hand, why not just get a set of logs that don't have this stupid nickname omission
02:50clojurebotNo entiendo
02:50devnamalloy: because i know of no one who has logs that go back to the first day chouser joined the channel
02:50bbloomooo reductions is cool.
02:51devnamalloy: and i want to make a markov chain for rhickey, and he's never on irc anymore. :(
02:51amalloyhaha
02:51devn"This is orthogonal."
02:51amalloydevn, the secret master-mind between @FakeRichHickey
02:52amalloybbloom: this kinda feels like an abuse of reductions, but i guess i don't really have a feel for how it's "intended" to be used
02:53bbloomamalloy: well it's a clever way to get access to "prev"
02:53devnI have a coworker who is working on generative knots, algebraic knots
02:53devnHe was looking for exactly what reductions offers the other day
02:54devnbbloom: well said
02:55devnit feels like there should be a way to unroll and name history, no?
02:56bbloomif you combine my fill-from
02:56bbloom(defn fill-from [row from] (into {} (map (fn [[k v]] [k (or v (k from))]) (seq row))))
02:56devnsort of like scheduling with at-at in overtone
02:56bbloomand that use of reductions:
02:56bbloom(rest (reductions (fn [prev next] (fill-from next prev)) {} '({:x 1 :y 2} {:x nil :y 3} {:x 4 :y nil})))
02:56bbloomyou get multi-column filling ({:x 1, :y 2} {:x 1, :y 3} {:x 4, :y 3})
02:56devnlike (at (- t (now)) (:foo m))
02:57bbloomi'm sure there is a cleaner way to implement fill-from....
02:57devnor (at (- (transformations 3) (now)) (:foo m)))
02:58bbloomah, you can omit the "(seq"
02:58devnamalloy: btw, didn't get the chance, but thanks for the help there. much appreciated.
02:58bbloomis there some kind of easier way to map over a map?
02:58amalloyi wish i could understand other people's solutions to the really-hard problems on 4clojure. i feel like there's a lot of interesting approaches to learn there that all go over my head
02:59amalloywhich i guess is what we get for encouraging brevity
03:00devnamalloy: this problem is part of bringing walton back from the dead, i have roughly 18,000 examples of clojure code from IRC alone. I need to start running expressions and subexpressions from pastebins etc. in clojail and amass a truly epic list of examples
03:01devnthe plan from there is to allow people to rate a few different aspects of a given example: idiomatic? 3/5, concise? 4/5, etc.
03:01devnand finally, id like to roll the "winners" into clojuredocs automatically
03:02devnamalloy: i have a feeling there is a lot of opportunity to do something similar with all of the data 4clojure has amassed
03:05aperiodicamalloy: your solution to one of the early 4clojure problems (i think reversing a sequence) that employed into blew my mind
03:05callennow I want to look it up.
03:05amalloyhaha. i was not the first to come up with that
03:05amalloyman, that was the really early days of 4clojure
03:05amalloyalmost a year ago, now!
03:05aperiodicamalloy: i felt like i was hot shit cause i had some haskell-ish 5-line solution
03:06callenaperiodic: you mean into ()
03:06aperiodiccallen: yeah
03:06callenaperiodic: I've come up with some good ones in the past couple days :)
03:06callenaperiodic: you should follow me on 4clojure!
03:06callenaperiodic: and I'll follow you.
03:07aperiodiccallen: sure! maybe it'll give me motivation to do more of them ;)
03:07callenaperiodic: my account name is bitemyapp
03:07bbloomso i'm attempting something that is far above my skill level…. but so far it's going relatively well
03:07callenbbloom: vut?
03:07bbloomI am building a clojurescript macro for defining dom trees
03:08callenaperiodic: what's your account name and how do I find you?
03:08devn(inc callen)
03:08lazybot⇒ 1
03:08devn[for sayign vut]
03:08aperiodiccallen: mine is same as this one
03:08devnsaying*
03:08callenamalloy: how do I follow people that aren't in the top users list?
03:08bbloomand the macro uses the clojurescript compiler's analyze function to figure out what to data bind to by looking for calls to deref
03:08amalloyhttps://4clojure.com/user/aperiodic
03:09aperiodicamalloy: that's the one
03:09callenamalloy: thank you thank you, would you consider making a more obvious link to something like "my profile" so people can know it off the bat?
03:09callenaperiodic: hey, I've even gotten more done than you. Wanna race?
03:09aperiodici don't think i've seen this user page before
03:10callenI definitely haven't, there's no obvious link to it anywhere.
03:10devnfollow me if you'd like
03:10callenit's useful though.
03:10callendevn: done!
03:10callendevn: you're further ahead of me :)
03:10amalloyyeah, now that following (the only user-based action anyone ever takes) is possible from the user-list, the links to profiles aren't very prominent
03:10amalloybut you can also just look at the list of all users instead of the top 100
03:11callenI wasn't able to easily find that list
03:11callennor was it obvious how to search by username
03:11callenamalloy: this is on github right?
03:11callenright.
03:11callenh/o
03:11aperiodiccallen: i'm not one for speed, myself. i will try to fit doing some in to my daily routine, though, in a token effort to outstrip you
03:11callenaperiodic: I will load up on coffee
03:11aperiodicwould probably be a good way to get the brain working in the morning
03:12callenaperiodic: mayhaps. I keep hearing about writers experimenting with trying to get some words written just as the day has begun.
03:12devncallen: beat me!
03:13callenI don't know if I can catch up to you, you have like double the questions on me :(
03:13devnaperiodic: it's sort of the exact opposite for me honestly. sometimes i get a little...how shall i say this...obsessed with finding a more elegant solution
03:13callendevn: 80 to my 45. It'd be a helluva haul.
03:13bbloom4clojure is fun, but i found that it seems to jump around a bit
03:13bbloomskipping ahead
03:13devnif i get focused on it in the morning sometimes im at work and cant think about anything else
03:13callenbbloom: aye.
03:13aperiodicdevn: you get nerd-sniped
03:14bbloomwhen you finish some "elementary" problems, it basically jumps you to medium
03:14bbloomi keep going back to the problem list and clicking the first one :-P
03:14bbloom(after sorting by difficulty)
03:14devndifficulty is just flat out wrong for some of the problems in there
03:15devn"elementary" my left foot -- honestly some of those categories should be changed so people new to clojure dont go: "holy shit, i can't even solve this elementary problem"
03:16amalloybbloom: eh? the default sort order is pretty good IMO. sorts mostly by "number of times solved" IIRC
03:16amalloyon the assumption that easier problems are solved most often
03:16bbloomeither way — the issue is the "now try" links presented to you when you solve one
03:17amalloyoh yeah, i bet those aren't nearly as smart
03:17devn*nod*, sometimes they just keep calling you back to a problem you don't want to work on anymore
03:18devnamalloy: maybe 4clojure should not try to class problems and do something like project euler does
03:18devnnew problems are new. old problems are old. number of times solved is the default sort order. suggestions are made based on the next problem you havent solved which has the highest number of people who have successfully solved it.
03:19devnmainly im advocating 4clojure drop the "easy, elementary, medium, hard" thing
03:20devni run a meetup group and people freak out a little bit when it says it's easy and they can't figure it out. it's sort of discouraging to newbs IMO.
03:20bbloomdevn: agreed. i was kinda saddened when i struggled on an "easy"
03:21bbloomi thought i'd at least get to mediums before panicing :-)
03:22devnyeah, bbloom -- you're not the first person, trust me. someone who is new to clojure and starts getting their parens in order hits an easy problem on 4clojure and suddenly feels like: "oh my god, there's no way I'll ever be good at this."
03:22devnit's sort of the exact opposite of what the site was designed to do
03:22bbloomthe problem for me is i don't know the std lib
03:22bbloomwould really like to see more links to the docs
03:22bbloomor relevant doc strings already in the right margin
03:23bbloomi'm pretty good at thinking recursively and solving the problems
03:23bbloombut sometimes i just write waaaay more code than i have to b/c i have no idea what tools are available to me
03:23devnbbloom: docs in general need improvement. tooling around docs, etc. people are talking about predicate dispatch for google summer of code.
03:23devnwe should be getting people in school to make the docs awesome.
03:23bbloompredicate dispatch?
03:23callendevn: I sort by solve numbers, but there are still some jumps in difficulty, but not as severe as difficulty sorting.
03:23AimHerebbloom > Real lispers can solve ALL their programming problems just using lambda and nothing else ;)
03:24callenwe're doing Church Numbers again?
03:24devnhaha
03:24bbloomAimHere: Yeah, you *can* but that doesn't mean you want to :-P
03:24aperiodicanyone who brings that up should be forced to use a turing tarpit for a week
03:24devncallen: i think it's more natural for someone just starting on the site to sort by difficulty
03:24devneither way, difficulty sorting is fucked, pardon my french
03:25devnit's a category that just doesn't need to be there
03:25callenI learned pretty quickly that it wasn't a good idea.
03:25callenI have experience with Euler, so I gravitated towards that anyway.
03:25devncallen: im a masochist, what can i say?
03:25callenI'm working on the interleave one right now.
03:25callenscouring the API for something that will inspire me.
03:26devncallen: if you want a fun challenge I enjoyed http://www.4clojure.com/problem/solutions/128 recently
03:27devncallen: honestly, pop open core.clj and just read the whole damned thing like 3-5 times.
03:27callendevn: no, don't mess with my mojo, I'm still an idiot and struggling with elementary/easy problems.
03:27devnthen set.clj, zip.clj
03:27callenI'm not sure if that's cheating or not.
03:27devnit's absolutely not cheating. it's learning. :)
03:29devncallen: sometimes you can hunt in core.clj for subtle references to your problem, for instance: it must result in a lazy sequence
03:29bbloomlike i just did "Last Element"
03:29devnyou can regex across core.clj for lazy-seq and get a nice private tour of lazy-seq usage as a result
03:30bbloomi knew about "rest" but didn't know about "next" which returns nil instead of '()
03:30bbloomamalloy's solution was like cheating :-P
03:30amalloyhaha is that one (comp peek vec)?
03:30bbloomi mean looking at ti was like cheating
03:30devnheh, but maybe yours was easy to read? understand?
03:31bbloomwell clearly (comp first reverse) is easy
03:31bbloombut inefficient
03:31devnamalloy has absolutely terrorized me ever since I started doing 4clojure problems
03:31devni finish one, his is better
03:31devnsuch is life
03:31bbloomi had (fn [xs] (let [x (first xs)
03:31bbloom xs (rest xs)]
03:31bbloom (if (empty? xs)
03:31bbloom x
03:31bbloom (recur xs))))
03:32bbloombut next & if-let simplifies that greatly
03:32bbloomand i didnt need to let x at all
03:32devnyou could destructure also
03:33bbloomah, destructuring returns nil instead of '()
03:33bbloomgotcha.
03:33muhoonom nom nom! java hungry! java want ALL my swap and ram! om nom nom!
03:33devn(fn [x [f & r]] ...) or something
03:33devnmuhoo: heh
03:34bbloommuhoo: I assume that means destructuring is ram hungry? haha
03:34muhoonothing to do with destructuring, just in general running clojure
03:35bbloomthe price you pay for so many damn extra maps, vectors, and functions being generated all over the place :-/
03:35muhooi was so happy when i figured out (defn foo [& {:keys [bar baz]}] .. though
03:35devnmuhoo: i have an old gist...1 sec
03:36muhooin general destructuring is one of those generally-useful things i'll use everywhere, like when i first learnd python and first discovered list comprehensions
03:38devnmuhoo: https://gist.github.com/439139
03:39devnerr not that one
03:39devnthis one: https://gist.github.com/438897
03:39bbloomyeah, destructuring is awesome
03:39bbloomalthough i wish there was nicer syntax for map destructuring
03:39bbloomthe :keys thing seems weird to me
03:39bbloomi wonder why not use the #{} set reader syntax?
03:39devnbecause a map isn't a set?
03:40devnbbloom: honestly, you could go back in the irc logs and read exactly why
03:40devnmap destructuring was discussed at length a couple of years ago IIRC
03:41bbloombut the keys to extract are a set ;-)
03:41bbloomi have no idea how you'd begin to find that in the logs
03:41bbloomgoogling for it produces a TON of results from the logs
03:42devnbbloom: go to n01se.net, click the clojure logs link, and use the search in there, google "map destructuring"
03:43devnhttp://clojure-log.n01se.net/date/2008-04-23.html
03:43bbloomyeah… i did that
03:43bbloom10 pages of results
03:43bbloomlol
03:44devnso read from 2008 on, get manly about it -- those are logs of your forefathers chatting about map destructuring, sonny
03:44devn:D
03:44devnrich and chouser at length talking about it -- if you want to get at the root of why things are the way they are, those logs are what you're actually looking for
03:45bbloomfound it
03:45bbloomthanks
03:46devnnp. it's pretty awesome those logs are around. there aren't too many languages you can read that give you as much insight as the #clojure logs do
03:46devnat least in terms of language design
03:46callenthe first time I came in here, hickey helped me.
03:46callen:)
03:47devni think i already said this tonight, but I wish he'd hang out in here more often, then again maybe it's for the best that he doesn't. this channel had like 25-50 people in it and it was mostly composed of LtU afficionados.
03:48bbloomheh.. apparently rich's first suggestion chouser's first implementation used sets for destructuring
03:48bbloomi don't feel so dumb ;-)
03:48devnthese days not so much -- and that's a good thing, but it seems like a terrible burden to always be on the hook like that
03:48devnbbloom: haha
03:48devn(inc bbloom)
03:48lazybot⇒ 1
03:49callen(inc devn)
03:49lazybot⇒ 2
03:49callenjust for spreading the love.
03:52bbloomi'm not sure i really follow why the ruled out sets tho...
03:52bbloomit seems like it ruled out the :as keyword
03:53bbloomb/c the set is already constructed before the macro sees it
03:53bbloomi guess that's it then...
03:53bbloomit's a shame b/c i reaaaaaally like CoffeeScript's destructuring
03:54bbloomhttp://coffeescript.org/#destructuring
03:54bbloomoh well
03:56devnbbloom: work through the source for let
03:56devnbbloom: coffeescript shmoffeescript :)
03:57bbloomcan't help it — started building my startup before clojurescript existed :-P coffeescript was a really good call
03:57devnbbloom: it's a lot of sugar with some really useful bits IMO
03:58bbloomthat's what's great about it: it's basically a 1:1 mapping
03:58bblooma lot less typing and a lot less silly mistakes
03:58bbloomif you have to write js, you might as well write coffee :-P
03:58devnbut! does it do dead code elimination? :)
03:59devnjs apps grow and grow and grow and grow and...you get the picture
03:59bbloomwe don't have any dead code ;-) modulo a forgotten utility function or two and the unused parts of jquery
03:59devnclojurescript kills needless cruft by default
04:00RaynesLuckily I don't have to write much of it.
04:00bbloomnothing stops you from using the google compiler on coffeescript
04:00ibdknoxI'm uploading my video :)
04:00ibdknoxsupposedly 2mins left
04:00devnbbloom: im talking about advanced mode compilation
04:00Raynesibdknox: What video?
04:00bbloomwe used to run advanced compilation on our coffee
04:01ibdknoxRaynes: I built bret victor's live-editable game in CLJS
04:01bbloombut it wasn't worth the trouble b/c it only saved 4 or 5%
04:01devnbbloom: you can minify your coffeescript, you won't get an iota of benefit in advanced mode
04:01bbloomafter gzipping, it was inconsequential
04:01bbloomb/c we dont have a lot of external libs
04:01devnbbloom: read more about what advanced mode does -- i struggle to believe your source was annotated for advanced mode compilation
04:02bbloomi used to work at Google… I used closure before it was publically available ;-)
04:02bbloomthe problem is that jquery DWARFS our codebase
04:02devnbbloom: so you annotated constructors and all of that business in coffeescript?
04:02bbloomso even if we spent a ton of time panstakingly annotating, it wasn't providing more than a few kb of savings
04:03devnbbloom: fair enough
04:03bbloomi mostly avoid coffeescript's class construct....
04:04bbloomadvanced optimizations make a *ton* of sense for cljs
04:04bbloomand i totally support the decision to build on top of the closure compiler
04:04bbloomit was a great call
04:04bbloombut i don't advocate the closure compiler for *most* people writing rich js client apps
04:04ibdknoxI wouldn't either.
04:05ibdknoxhttp://www.chris-granger.com/
04:05ibdknoxCLJS video there ^
04:05ibdknoxrather, post pointing to it. Direct link: http://www.youtube.com/watch?v=7XUWpze_A_s&feature=youtu.be
04:06accelsuppose I am writing a OSX app store app in (1) clojure and (2) opengl [thus no clojurescript]; what is the best target language to compile my clojure code to?
04:06accelI'm thinking objective-C/C, but I don't know if there is something with better matching of clojure primitives (concurrency / persistent data structures)
04:07bbloomibdknox: that is super cool.
04:07ibdknoxdid you get to the projection thing?
04:07devnibdknox: i want your .emacs.d
04:07ibdknoxthat's by far the coolest
04:07bbloomstill watching
04:07devnibdknox: how the hell did you get that in a split buffer?
04:07ibdknoxdevn: that's a webpage :p
04:07devnw3m?
04:08ibdknoxI use vim ;)
04:08devnokay, then i want your .vimrc
04:08devnnow.
04:08devn:)
04:08bbloomw00t fellow vimmer :-)
04:08bbloomwhooaaaa that projection is bad ass.
04:08devni use both. i like my SLIME, but I use vim at work, emacs and home. that's sort of my default.
04:08accelI use vim too
04:08accelwhere is this m agical screen shot?
04:09Raynesibdknox: Did you ever figure out the new vimclojure haskell nrepl stuff?
04:09ibdknoxno
04:09RaynesDamn it.
04:09ibdknoxI know nothing about haskell. I didn't even try :p
04:09RaynesIs he allergic to docs?
04:09ibdknoxlol
04:09ibdknoxI don't think it's ready for "the public" quite yet
04:09RaynesHe commits "Basic gradle building of Haskell stuff" as if anybody in the world actually uses gradle.
04:10RaynesOr, I guess knows *how* to use gradle.
04:10ibdknoxlol
04:10bbloomhmm interesting… games tend to have (loop render update input) like a REPL
04:10accelanyone have sample code for: this is a piece of clojure code, that using only java libraries, pumps out a sine curve? (for playing a basic pitch)
04:10bbloomso redefining functions that are used on the next frame is neat
04:10devnibdknox: that video is awesome.
04:11bbloomi'm trying to make a dom-building library that intelligently re-renders subtrees when functions are redefined
04:11bbloomhence why i needed to implement Var in cljs, so I could use add-watch :-)
04:11ibdknoxhaha neat
04:11callenman. Clojure fanatics have it bad.
04:11bbloom?
04:11callenmainline people have to write Java to support their favorite language, cljs people have to write JS to support their favorite language.
04:12callenat least Java people mostly get to write Java to support Java.
04:12bbloomheh
04:12RaynesI… have no idea what you just said.
04:12callenRaynes: I have a harder time wrapping my head around (lazy-seq ...) than you do, surely you can tease it out!
04:12ibdknoxnow that I can compile cljs on the fly... no more js ;)
04:13bbloomhttp://vimeo.com/36579366 vimeo i skinda borked css right now
04:14ibdknoxI wonder if I'm the first to have replicated his thing
04:14ibdknoxalso I want to know how he got the graphics for braid
04:14bbloomdude, super nice work on that thing, very cool
04:15devnibdknox: the artist for braid made his slides :)
04:15devnbtw ibdknox WHY'D YOU HAVE TO POST VIDEO IN HERE? I LIKE TEXT AND IMAGES.
04:16ibdknoxhah
04:16callendevn: how many kidneys?
04:16ibdknoxthat guy is retarded
04:16ibdknoxthat thread made me sad
04:16ibdknoxlol
04:16devnit makes me happy. it recovered quickly
04:16ibdknoxhis loss
04:16devnit's not like the ken wesson threads of old
04:16devnthose would rage on for a week
04:17ibdknoxheh yeah
04:17callendevn: ken wesson threads?
04:18accelwhat does sconv do in clojure?
04:18ibdknoxalright guys. Way past my bedtime :)
04:18devnsame
04:18devnnight all
04:18RaynesLightweights.
04:19ibdknox:p
04:20ibdknoxRaynes: did you watch the video?
04:20RaynesNope.
04:20ibdknoxunfortunately we can no longer be friends then
04:20ibdknox~guards
04:20clojurebotSEIZE HIM!
04:21RaynesI'm sure gonna miss you.
04:21ibdknoxhaha
04:21ibdknoxG'nite!
04:21RaynesNight
04:43gtuckerkelloggjust tried my first lein. Works fine except for the shell-wrapper, which throws an exception
04:44gtuckerkelloggit complains "Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main"
04:45gtuckerkelloggbut i'm using (I believe) tha main in my project namespace
04:45gtuckerkelloggi clearly don't understand lein
04:59gtuckerkellogganyone out there?
05:01DyresenWho knows?
05:01DyresenNasa has found planets that can be habitable though.
05:04gtuckerkelloggexcellent
05:10ljosHi - I remeber reading about a distributed programming platform written in clojure, but I cannot remember the name or where I read it. Any tips?
05:12echo-arealjos: Storm?
05:16ljosecho-area: I don't think that was it. They where claiming something about not using eval, and the code written for storm looks a bit differnt than what i remember.
05:17vijaykiranljos: avout ?
05:17vijaykiranoh wait that's distributed state
05:19ljosI was just a bit interested in that platform I read about, but it is not that important, what I need is a simple way to distribute load over multiple machines. Any recommendations?
05:27ljosI was looking at ZeroMQ, but if there exists something that is native Clojure I would like that better.
05:31lucianthere are lots of things for java
05:32lucianlike hadoop and such
05:43ljosHadoop seems a bit overkill for my use.
05:49lucianthere are lots of other similar things too
05:50luciani'm having trouble understanding why this doesn't terminat with n >= 4 https://gist.github.com/1923053
05:52bohlHello everyone, this is my first attempt at writing a servlet in clojure. My starting point is yogthos / clojure-maven-examples, which does not work out of the box. After removing dependency on broken "json" maven package, I'm still getting "error opening zip file" for clojure-contrib-1.1.0.jar, which was imported by maven, on tomcat startup. Is there either a working servlet example, or where to get a functional clojure-contrib-1.1.0.j
05:52ljoslucian: that is why I am asking for recommendations :P
05:53lucianljos: for some tasks, Cassandra could be a simpler replacement
05:57ljoslucian: the database? I don't want a database. What I want is an easy way to set up distributing computational load over several machines. Basically I want to pass some data to another process on another machine that does part of the calculation.
05:58luciansince Cassandra has map-reduce, it could do that, but only for some tasks as i said
05:59luciani don't know of an established java thing other than hadoop
05:59luciantry #java or something?
06:00lucianactually there's cajo http://java.net/projects/cajo/pages/Home
06:01ljoslucian: I would prefer that it is in Clojure though.
06:05raekbohl: the "error opening zip file" error sounds like the downloaded jar got corrupted. try removing the .m2 directory in your home
06:05raekbohl: there is a library for interfacing with servlet based servers: ring
06:06raekit eliminates the need to generate a custom class that implements the servlet interface and lets you program handler functions purely in clojure
06:06raekhttps://github.com/mmcgrana/ring
06:07raekthis describes the basic concepts: https://github.com/mmcgrana/ring/blob/master/SPEC
06:08raekbohl: anything that uses clojure-contrib is basically outdated
06:08raekand clojure 1.1 is pretty old by now
06:09raekbohl: the json library that used to be in contrib is now its own project (and should work fine): https://github.com/clojure/data.json
06:09raek[org.clojure/data.json "0.1.2"]
06:10raek(I also assume you know what Leiningen is. If not, don't do anything until you have checked it out.)
06:11ljoslucian: btw, your problem. It is because the list doesn't grow. So if l is supposed to be longer then 3 it never grows to that size.
06:12ljoslucian: when n is 3 it creates this list: (1 3 1), and n = 4 this list (1 4 1)
06:12lucianljos: right, good point
06:25yesudeepThat video about Inventing on Principle by Bret Victor was perhaps the most awesome talk I have heard. Thank you for sharing it here. I like moving pictures. Thank you!
06:26yesudeep@ bbloom
06:27G0SUByesudeep
06:27yesudeephey G0SUB =)
06:35G0SUByesudeep, howdy!
06:36yesudeepG0SUB: doing great bro. =)
06:36G0SUByesudeep, cool. what brings you to #clojure? have you been playing with it?
06:36yesudeepG0SUB: yep. i have just begun playing with it. =)
06:37G0SUByesudeep, awesome.
06:37yesudeepI find clojurescript extremely fascinating.
06:37bohlraek: thanks
06:38G0SUByesudeep, indeed, it is.
06:41gtuckerkellogga simple "hello world" drawn directly from the Leiningen tutorial works find, but for some stupidity of mind I can't get the :shell-wrapper behaving
06:41gtuckerkelloggstupidity of *mine* that is.
06:54lucianljos: heh, it was a simple case of using partition 2 1 instead :) thanks
07:26y3didoes notp and p imply p?
07:27gtuckerkelloggi am still stumped
07:33raeky3di: yes. not-p and p implies anything. http://en.wikipedia.org/wiki/Principle_of_explosion
07:35y3dithats what i figured, just sounds weird when said aloud to me.
07:44timonv_y3di its simple, notp and p cannot hold, it produces a falsum, so anything can be true
07:48bohlNone of the "ring" examples from github use maven, does anyone know how to produce a .war file from them?
08:19raekbohl: you can use the "lein-ring" Leiningen plugin to generate WAR files
08:20raekbohl: the majority of Clojure projects use Leiningen as the build tool (which uses Maven internally for dependencies)
08:46tsdhWasn't there a seq function which is a shorthand for [(filter p coll) (remove p coll)], or did I just dream it?
08:47raekin the old contrib, yes
08:47raek(I think it was called "separate")
08:48raekyou can use (juxt filter remove) instead
08:48tsdhraek: Oh, yes. I use juxt far too seldomly anyway. :-)
08:53mdeboard&(docs juxt)
08:53lazybotjava.lang.RuntimeException: Unable to resolve symbol: docs in this context
08:54mdeboard&(doc juxt)
08:54lazybot⇒ "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"
08:54mdeboardhuh. I think I got juxt and comp confused :\
09:28michaelr525hello!
09:59arkhI'm not able to do a 'lein uberjar' with a dummy project and I followed the instructions in the leiningen tutorial. Error is "Exception in thread "main" java.lang.RuntimeException: No such var: clojure.core/genclass"
10:00arkhI declared a :main in my project.clj, a :genclass in my asdf.core namespace and defined a -main function
10:00arkhlein version comes back with "Leiningen 1.6.1.1 on Java 1.6.0_26 Java HotSpot(TM) Client VM"
10:02tsdharkh: Hm, there's indeed no clojure.core/genclass but only a clojure.core/gen-class...
10:04arkhtsdh: omg - you're awesome. I had that as a typo ... I changed :genclass to :gen-class and now it's happy. Thank you.
10:06tsdharkh: :-)
10:07babilenarkh: btw -- Your leiningen is slightly outdated and you might want to install the current version. That can be done with "lein upgrade" (if you installed it manually) or via your package manager (if you use Debian).
10:08arkhbabilen: thanks for the heads up
10:32lnostdalseems agents "picks up" thread local bindings
10:33lnostdal..is there some option or something that makes it not do that?
10:45r4viis there a march clojure-nyc meet? I'm going to be in town 15-20th and nothing shown on the meetup page yet.
10:47dnolenr4vi: not that I'm aware of, I think the folks that normally organize it are pretty swamped w/ work.
10:48benares_98would upgrading leiningen also update clojure to 1.3.0?
10:50TimMcbenares_98:Depends what you mean.
10:51TimMclein repl outsid eof a project uses lein's own clojure dependency, but inside a project you can use whatever you want
10:51TimMcalso, lein 1.x or lein 2?
10:51benares_98that's what I meant, thanks
10:59mdeboardI guess I don't get clojure packaging quite yet... I'm trying to import a module I wrote last night into another project, but getting an ExceptionInInitialization error. I tried both `(use 'icarus.core)` and :require'ing it in the ns definition, but either way I get an exception (the latter gives me a NoClassDefFound error). Can anyone spot what I'm doing wrong? https://github.com/mattdeboard/Icarus/blob/master/src/i
10:59mdeboardcarus/core.clj
10:59mdeboardhttps://github.com/mattdeboard/Icarus/blob/master/src/icarus/core.clj
11:00TimMcmdeboard: I think the error is going to be foudn in your relying project.
11:01mdeboardReally? Weird...
11:01mdeboardWhy do you say this
11:01TimMcBecause the lib itself looks fine.
11:01mdeboardDarn
11:02TimMcAlso, I've gotten the errors you describe when I've messed up dependencies on other projects.
11:02mdeboardI can (use) and (require) korma just fine in the same thing so idgi
11:02mdeboard100% at a loss
11:02TimMcmdeboard: Have you saved your project.clj file to disk?
11:02TimMc(Distressingly frequent failure mode.)
11:03mdeboardTimMc: Indeed I have
11:03TimMcDoes `lein classpath` include the icarus jar?
11:03mdeboardTimMc: It does indeed
11:04TimMcHow about (loaded-libs) from inside the REPL?
11:04mdeboardNot in there
11:04TimMc(Although maybe that depends on require having been used)
11:05mdeboardEverything -- including dependency of Icarus, clojure-solr -- is loaded except Icarus.
11:05TimMcFascinating.
11:07mdeboardnew and exotic ways of screwing something up
11:07TimMcIt's going to be something stupid.
11:07mdeboardyeah
11:09TimMcMmm, I think you have the error wrong.
11:09mdeboardorly
11:10mdeboardhttp://ubuntuone.com/3iEmF8XJV8UBYPz93lpYE3 is the error
11:10TimMchttps://refheap.com/paste/869
11:10TimMcOh, stupid SLIME.
11:11mdeboardneed more hand-holding toward the problem
11:13mdeboardis it the filter collision?
11:14TimMcAh! Could be.
11:14TimMcYou're not excluding clojure.core/filter from refer, and it is a multimethod that is causing the problem...
11:19ibdknox|awaydnolen: as requested http://news.ycombinator.com/item?id=3639441
11:19dnolensweet!
11:21ibdknox|awayfor those interested, I wrote one of bret victor's demoes in cljs. The video is only 5 mins and I think it might be one of the coolest things I've worked on. :) Check it out!
11:22TimMcmdeboard: require gives a different error in Clojure 1.2.1 and 1.3.0
11:23TimMcibdknox|away: THat looks fantastic.
11:23ibdknoxTimMc: it's so cool
11:23ibdknoxthe projection thing is ridiculous
11:23dnolenibdknox: dude, that is AWESOME
11:23mdeboardibdknox: Can you re-link please
11:24ibdknoxmdeboard: hm?
11:24mdeboardibdknox: To the HN submission
11:24mdeboardclosed emacs and lost it
11:24ibdknoxhttp://news.ycombinator.com/item?id=3639441
11:24mdeboardTimMc: Renamed filter and it works fine now
11:26TimMcibdknox: Holy shit.
11:27ibdknoxhehe
11:27ibdknox:D
11:27ibdknoxlike I said, definitely one of the coolest things I've worked on. :)
11:32y3dichris ganger on his game!
11:32mdeboardliterally
11:33jimdueyibdknox: nice work.
11:33TimMcibdknox: Can you edit the code while the piece is moving? (Theoretically.)
11:33jweiss_is there a straightforward way to get the namespaced qualified symbol for a var?
11:33ibdknoxTimMc: yes
11:33TimMcsweeet
11:34ibdknoxTimMc: I had him originally moving by himself back and forth
11:34y3diibdknox: how long have you been working on it?
11:34ibdknoxI did it yesterday
11:34rlbibdknox: what was the link again? (erc crashed)
11:34ibdknoxtook about 7-8ish hours?
11:34ibdknoxhttp://news.ycombinator.com/item?id=3639441
11:34rlbthx
11:34y3diso beast... gj
11:35ibdknoxmost of my time was spent dealing with some stupid AOT issue
11:35ibdknoxit would've been faster
11:36dnolenibdknox: yeah that sounds weird, does lein run trigger that?
11:36jonasenException in thread "main" java.io.FileNotFoundException: Could not locate crate/macros__init.class or crate/macros.clj on classpath: , compiling:(box.clj:22)
11:36ibdknoxdnolen: I dunno, basically it would work the first time and not anytime after that
11:36jonasen^^ I get this when running "lein run" on cljs-live
11:37ibdknoxjonasen: one second, I forgot I had those as checkouts
11:37jonasenibdknox: ok
11:37TimMcibdknox: Posted to reddit: http://www.reddit.com/r/programming/comments/q88yc/connecting_to_your_creation_as_illustrated_by_a/
11:39ibdknoxdnolen: I dunno, but it seems that if .classes exist for the compiler, it no longer works
11:40ibdknoxTimMc: cool :)
11:40dnolenibdknox: me hates AOT, it's a massive pain to debug
11:40mdeboardibdknox: I got the error jonasen has as well
11:40ibdknoxmdeboard: jonasen: pull
11:40TimMcBANG
11:41mdeboardlol
11:41mdeboardI thought about typing that but wanted to make sure it worked :P
11:42ibdknoxwell
11:42ibdknoxtechnically you can't rebuild the cljs with that
11:42ibdknoxit took a modifed version of monet to make this work
11:42ibdknoxthe core cljs that runs it
11:42TimMcclojurebot: pull is <reply>*BANG*
11:42clojurebotIn Ordnung
11:42ibdknoxI'll clean up my changes to monet a little later and push it
11:45ibdknoxmdeboard: it work?
11:45mdeboardibdknox: Yeah was just playing with it, that's awesome
11:45ibdknoxgood :)
11:46mdeboardI can always rely on you to make me wonder why I'm such an underachiever
11:46mdeboard:P
11:46ibdknoxlol
11:46ibdknoxtechnomancy: is there some way to prevent lein from creating .class files on run?
11:48gtrak``,(Long/maxValue)
11:48clojurebot#<CompilerException java.lang.NoSuchFieldException: maxValue, compiling:(NO_SOURCE_PATH:0)>
11:48ibdknoxI'm glad I didn't end up trying to put it up live
11:49ibdknoxHN likes it and it would've been toast by now
11:51dnolenibdknox: it's a pretty stunning demo. nice looking ClojureScript too.
11:51clojurebotGabh mo leithscéal?
11:51ibdknoxdnolen: eh, I'm sure I did some really gross things
11:51dnolenibdknox: heh well I didn't see anything too offensive on the first pass :)
11:51tmciveribdknox: I tried your code as well. Not sure what I'm doing wrong but I get a "can't recur here" error: https://refheap.com/paste/870
11:52ibdknoxtmciver: rm -rf classes/cljs/
11:52ibdknoxI'll add the error text to the Readme
11:53tmciveribdknox: that did it. Thanks.
11:54tscheiblibdknox: just out of interest, did you know of https://github.com/teropa/hiccups when you started "crate"? .. I stumbled over crate when I was taking a look at waltz
11:55lucianibdknox: that's really awesome
11:55ibdknoxtscheibl: yes, it goes to an html string, which doesn't let me do all the cool things I can do.. like embed jQuery objects and such
11:55ibdknoxtscheibl: also, pinot was first :)
11:55tscheiblibdknox: ah, ok... that's a good reason :)
11:57gtrak``ibdknox: oo pretty
11:57ibdknoxapparently redit people don't like it
11:57ibdknoxwonder why
11:59beffbernardCan someone repost the link? I wanna see too :(
11:59Bronsaibdknox: how to draw new blocks?
11:59ibdknoxBronsa: click on the canvas once it has focus
11:59ibdknoxbeffbernard: http://news.ycombinator.com/item?id=3639441
11:59Bronsatried that, it's not working
11:59Bronsamaybe it's vimperator
11:59ibdknoxah, could be
11:59ibdknoxI only tried it in Chrome
12:00ibdknoxsince it needs some pretty ridiculous JS horsepower
12:00gtrak``do you keep track of all the state to get the jump trajectory?
12:01tmciveribdknox: yeah, I'm on FF and clicking to add bricks does not work for me.
12:01Bronsaheh, workds fine on chromium, doesnt on firefox
12:01Bronsa*works
12:01ibdknoxI'll add that to the readme lol
12:01Bronsalol
12:01ibdknoxgtrak``: the last 100 ticks
12:01gtrak``nice
12:13ibdknoxoff to real work :(
12:13mdeboardGOOD RIDDANCE
12:14gtrak``haha
12:21wiseenis there a better way to do : `(foo ... ~@(when x [x])) - where x is a value or nil and I don't want nil and the result should be expanded only when not nil - wrapping x in list seems hackish so maybe there is a better way ?
12:30tscheibl,(flatten (seq {:a 1 :b 2}))
12:30clojurebot(:a 1 :b 2)
12:36tscheibl,(let [m {:a 1 :b {:x 42}}] (interleave (keys m) (vals m)))
12:36clojurebot(:a 1 :b {:x 42})
12:36tscheiblthe interleave version is 10 times faster
12:37Scriptoryou're not flattening it, though
12:38Scriptorare nested hashes supposed to stay as hashes?
12:38tscheiblI just want to flatten with depth 1
12:38tscheibl,(flatten (seq {:a 1 :b {:x 42}}))
12:38clojurebot(:a 1 :b {:x 42})
12:38tscheiblsee it's the same
12:39tscheiblI must use something like that when I wrap functions with keyword arguments... because apply does not support hashmaps
12:41TimMctscheibl: Just write mapply
12:41TimMcYou really don't want flatten for this, it will screw you over.
12:42tscheiblmapply?
12:42TimMc&(flatten (seq {:a [1 2], :b 3}))
12:42lazybot⇒ (:a 1 2 :b 3)
12:42TimMctscheibl: Yeah, apply that takes a map as a last param.
12:42Scriptortscheibl: map apply
12:42tscheiblTimMc: yep.. but that's not part of clojure core ..?
12:43Scriptortscheibl: right, just write it yourself
12:43tscheibl:)
12:43tscheibl,(let [m {:a 1 :b {:x 42}}] (interleave (keys m) (vals m)))
12:43clojurebot(:a 1 :b {:x 42})
12:43tscheibllike that
12:43tscheibl..or is there something better?
12:43TimMcclojurebot: mapply is (defn mapply [f & args] (apply f (apply concat (butlast args) (last args))))
12:43clojurebotIk begrijp
12:44TimMcthen (mapply f a b c some-map) works like apply and some vector or list
12:47tscheiblTimMc: righty... concat does the trick :)
12:58technomancyibdknox|away: so with your video
12:58technomancyonce you get the turtle in there
12:58mdeboardJesus am I an idiot or is korma like a grillion times easier to use than SQLAlchemy
12:58technomancyyou need to be able to define the bounciness of the turtle as a function of gravity and the target height
12:58technomancyI was disappointed that he didn't do that in the video
13:09ibdknoxtechnomancy: lol
13:10ibdknoxok, I'm officially annoyed by HNs voting ring bullshit
13:10ibdknoxtechnomancy: I'll try harder next time ;)
13:11ibdknoxmdeboard: it's a lot easier ;)
13:11technomancyibdknox: no, I mean that's what annoyed me about the original
13:11ibdknoxoh
13:12ibdknoxah I see, I misread that
13:14dnolenibdknox: yeah it's kinda annoying that's kicked in for such a cool post
13:15dnolenback to the usual boring HN crap
13:19ibdknoxdnolen: yeah :(
13:19ibdknoxoh well, a fair number of people saw it I think
13:19ibdknox:)
13:19dnolenibdknox: yeah 80 points in 2 hours is pretty good
13:28oakwisering voting?
13:28gfredericksif I run jruby and it calls a clojure lib, is it expected that the clojure code would use a different classloader than the jruby?
13:29TimMcoakwise: Presumably some sort of protection against groups of people always voting for each other's links in order to game the system.
13:30hiredmangfredericks: it can
13:30oakwiseah, the clojure cabal eh?
13:31TimMcYeah, I imagine it is easy for it to misfire on things that are interesting to well-defined subsets of the userbase.
13:31gfrederickshiredman: k, thanks
13:41gtrak``what does the voting ring do to the post?
13:42ibdknoxit destroys the rank of the post
13:42ibdknoxbasically subtracts n-ranking points from the post
13:42ibdknoxusually it's almost immediate removal from the front page
13:43ibdknoxIt stayed on there for a little bit
13:43ibdknoxbut now it's off
13:43TimMcHow can you tell it is activated?
13:43ibdknoxyou don't go from #2 to #28 in 5 mins
13:43TimMcgot it
13:43gtrak``oh, lame, maybe I shouldn't vote for your stuff next time :-)
13:43ibdknoxI'm not sure how to fix it really
13:43ibdknoxI post stuff about Clojure mostly, and Clojure people are going to vote on it
13:43ibdknoxthe mechanism is busted
13:44ibdknoxbasically I'll just have to get one of you guys to post it for me next time :)
13:44gtrak``we could have a reverse voting ring, don't vote for it until enough others have seen it?
13:45hagnaso I'd like to call a protected method in clojure 1.3; maybe wall-hack-method would help, but where is it?
13:45ibdknoxwell
13:45ibdknoxthat should've been the case here
13:45ibdknoxit had 80 before it got bumped
13:46ibdknoxnot sure what more was necessary to prove it wasn't artificially put up there
13:46ibdknoxI might email PG and ask
13:46mdeboardibdknox: Just finished up a module to reconcile our database (using Korma) and our Solr index, since we've got a problem with docs not being deleted reliably
13:47mdeboardovershare
13:47ibdknoxsweet
13:51y3diibdknox: you converted someone to clojure!
13:54ibdknoxy3di: haha, Noir has actually gotten a fair number of people :)
13:58ibdknoxdoes reddit just have really terrible eventual consistency?
13:59arkhthat's how you get scalability and reliability, right? ; )
13:59gtrak``lol, why 17 down votes?
13:59gtrak``haters?
14:00TimMcgtrak``: Could also be ghost votes.
14:00TimMcGhost-banned users get their votes cancelled out by incrementing both values. :-P
14:00gtrak``ah
14:01ibdknoxthat's annoying
14:02TimMcAnd then there are people who downvote instead of clicking "hide" because they are idiots (and also have the "hide things I've seen" feature enabled)
14:02m0smith`hello?
14:02clojurebotBUENOS DING DONG DIDDLY DIOS, fRaUline m0smith`
14:02gtrak``i was wondering what was so offensive about it :-)
14:02ibdknoxgtrak``: me too
14:03arkhI'd like to count the number of items in a list - what's a clojure-y way to do that? ["one" "two" "two" "three" "three" "three"] as {"one" 1, "two" 2, "three" 3}
14:03m0smith`ibdknox: I am giving noir a try and I have a question
14:03ibdknoxarkh: ##(doc frequencies)
14:03lazybot⇒ "([coll]); Returns a map from distinct items in coll to the number of times they appear."
14:03arkhibdknox: thank you
14:03ibdknoxm0smith`: sup?
14:03TimMcibdknox: Really popular posts usually settle down to about 80%, middling ones to about 66%.
14:04ibdknoxTimMc: I see. At least it doesn't have the damn voting ring nonsense ;)
14:04m0smith`ibdknox: I have several checkboxkes with the same name and I was expecting a vector of the checked values, instead I only get one. Is that expected?
14:04TimMcibdknox: Oh, I'm sure there's some of that too. Reddit is very private about their anti-cheating algorithms, of course.
14:04ibdknoxm0smith`: name="blah[]"
14:05ibdknoxTimMc: hah, I guess that would make sense :)
14:05m0smith`<input name="blah[]" value="one"> <input name="blah[]" value="two">?
14:06ibdknoxI think so
14:06m0smith`hmm
14:06ibdknoxactually.. I may not add the nested-params middleware
14:06ibdknoxlet me check
14:07ibdknoxm0smith`: yeah it's there
14:08ibdknoxm0smith`: https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/nested_params.clj#L48
14:09m0smith`ibdknox: that explains it. I am still trying to get familiar with the stack
14:09ibdknoxm0smith`: no worries
14:09ibdknoxm0smith`: btw there's a #Noir
14:09ibdknoxerr #noir
14:09ibdknoxnot sure if IRC is case-sensitive
14:10m0smith`ibdknox: thanks I will keep that in mind
14:10TimMcibdknox: Same thing.
14:10ibdknoxk
14:10TimMcI wonder what locale it uses for casefolding. :-P
14:11TimMc/join #noır
14:11TimMc(Turkish dotless i)
14:11ibdknoxhaha
14:12mdeboardy3di: Nah he didn't convert me, but Korma definitely makes it easy to sneak some Clojure into our source repos :)
14:13y3dii was referring to jisaacstone on hn
14:13mdeboardoic
14:17ibdknoxI was kinda hoping bret vector might comment
14:17y3dimaybe he will
14:17zmarilWhat's datomic mean?
14:17y3diDAT OMIC
14:17y3diidk sorry
14:19mdeboardzmaril: Context?
14:19ibdknoxdid you mean Diatomic?
14:20amalloyno, rhickey is increasing the mystery by tweeting a single non-word without explanation
14:20ibdknoxif you did that's a molecule made of two atoms :p
14:20zmarilYep, twitter
14:20TimMccat on keyboard
14:20mdeboardd'atomique
14:21mdeboardfragrance for geeks, by rich hickey
14:21ibdknoxlol
14:21TimMc>_<
14:21Bronsalol
14:21zmarilWhat if he really meant to say diatomic and is stuck with datomic now
14:21zmarilI guess that is the hazard of single word tweets.
14:22mdeboardSimilar thing happen when he misspelled complex as "complect"
14:22mdeboardj/k j/k
14:22TimMclulz
14:22ibdknoxdatomic isn't a very good name if that's what it is :/
14:22ibdknoxlol
14:22zmarilIt's pronounced with a silent d
14:32benares_98data atomic?
14:32ibdknoxstill a bad name :p
14:33mdeboardExtremely atomic and incredibly atomic?
14:33mdeboardI got nothing, also, how did this conversation get started?
14:33mdeboardwhere did he see datomic
14:34jolythere's apparently a "Coming soon" page at http://datomic.com
14:34mdeboardoh nm
14:34ibdknoxmost likely some sort of distributed proessing thing
14:34dnolenstuartsierra: so is there anything that triggers cutting CLJS releases? :)
14:34stuartsierradnolen: ME triggers a CLJS release
14:34dnolenstuartsierra: hah
14:34mdeboardhttp://www.networksolutions.com/whois-search/datomic.com I'm a creeper
14:35ibdknoxmdeboard: already been there ;)
14:35TimMcAre we playing Alternate Reality Games now?
14:36ibdknoxwell that rules out some product teaching clojure stuff :)
14:37redingeribdknox: That's all you!
14:37redinger:)
14:37ibdknoxhaha
14:37ibdknoxredinger: need more time :)
14:38ibdknoxI'm excited to see what it is. My money's on some form of distributed processing thing.. a more general purpose wolframalpha like service or something
14:40TimMcOr integration with external transactions?
14:41TimMcor some sort of functional database system (like Accumulo)
14:41ibdknoxI was thinking it likely related to avout somehow
14:42pipelinejust by the by
14:42pipelinethe newest mathematica has some WA integration
14:42ibdknoxthe new wolframalpha stuff is really cool
14:43ibdknoxuploading a sound file and getting an analysis of it and all
14:43mdeboardneat
14:45ibdknoxdnolen: what's this deps.cljs thing?
14:45dnolenibdknox: I don't know anything about that. To be honest I'm less familiar with the tooling aspects of the CLJS compiler
14:47y3diwow yur post is not longer on the front page ibdknox
14:47ibdknoxy3di: voting ringed about an hour ago :(
14:47ibdknoxit would've been up there for a while based on its velocity
14:48y3diwhat does it mean that voting ringed
14:48mdeboard^
14:49ibdknoxHN has some anti-cheating detection that determines if someone is trying to game the system. Unfortunately its pretty simplistic and will often mark things incorrectly. I write about clojure and so clojure people vote on it consistently
14:50ibdknoxcausing it to get flagged because the same people are voting on it
14:50mdeboardibdknox: You need to get some node.js and mongodb articles in
14:50ibdknoxlol
14:50mdeboardeverybody'll upvote that shit
14:50ibdknoxespecially since node is my favorite thing in the world ;)
14:51ibdknoxthough I guess I do keep competing in the nodeknockout...
14:51antares_ibdknox: hi. Is this a good place for korma and noir questions?
14:51ibdknox#noir is probably better
14:52amalloyibdknox: i did my part, by not getting to the article in time to vote for it
14:52ibdknoxhaha
14:53dnolenibdknox: sadly you've been superseded by more important news - Tower.js, Rails in JS
14:53ibdknoxdnolen: that pained me
14:53emezeskeI flagged it with all 7 of my accounts, to confuse the anti-cheat detection
14:53ibdknoxof all the things
14:53ibdknoxhaha coffee makes that code look so ugly too
14:54ibdknoxemezeske: lol
14:54emezeske^_^
15:03jcrossley3wow, the bar for "database-agnostic" seems so much lower now: http://towerjs.org
15:04mdeboardHow do you lower the bar on binary fact? it's either agnostic or not
15:05TimMcnah
15:05TimMcStuff always leaks through the "abstraction barrier".
15:05mdeboardI reckon
15:05TimMc"Oops, MySQL doesn't support milli-precision timestamps."
15:06mdeboardor full UTF-8 support
15:06TimMc"Huh, why does this same query run really fast on MySQL but really slow on SQLite?"
15:06TimMcetc.
15:07ibdknoxthere is no such thing as database-agnostic
15:07ibdknoxlol
15:07hiredmandatabase oblivious
15:07mdeboardlol
15:09ibdknoxwell that sucks. live-cljs counts as a JS project
15:10jcrossley3hiredman: :)
15:10ibdknoxI wish there was a way to explicitly set that in github
15:11clj_newbHi, to generate and parse small xml (less that 1000 chars) will clojure.xml do?
15:12clj_newbto generate using emit eg
15:13TimMcibdknox: You could be sneaky and move all the JS to ./vendor
15:14TimMcibdknox: They really should be scaling their counts, though.
15:14ibdknoxI guess it's somewhat of a hard thing to be deterministic about
15:18`fogusibdknox: Marginalia is a JS project too. :-)
15:18ibdknox`fogus: haha, is it really mostly JS?
15:18TimMc`fogus: That's ridiculous. Syntax-highlighter?
15:19amalloyhaha, scaling their counts? you mean like, "well ten lines of lisp probably took more thinking than a thousand lines of JS"?
15:19ibdknoxamalloy: hahaha
15:19ibdknoxthat would be awesome
15:19ibdknoxby that metric, I've written a lot of software :D
15:19TimMcamalloy: s/took more thinking than/expresses as much as/, yes
15:20`fogusTimMc: Yep
15:20ibdknoxah it's got jquery and all in it too
15:20TimMc`fogus: In that case you really *do* have a reason to move the highlighter JS to ./vendor, where it won't be counted.
15:20`fogusI will do that one day yes
15:20`fogusPtaches welcomed. :p
15:20`fogusPatches even .
15:21ibdknox`fogus: I know you were a big fan of Bret Victor video, did you play with the live-cljs thing yet? :)
15:21RaynesIf I want to avoid the whole "ur project is js lololol cuz jquery" stuff, I write a script to pull down my js deps.
15:21RaynesAlso, what the hell. Why is it acceptable to download and put js libraries in repos?
15:22RaynesEvery other decent language has some sort of dependency management solution.
15:22`fogusibdknox: I have not looked at it deeply yet. I watched the video however and am till stunned. Fantastic work man!
15:23ibdknox:)
15:24`fogusRaynes: It's retro dontchaknow?
15:24Raynes:p
15:24`fogusMy source control is a rotating pile of floppies... not that you have any idea what those are ;-)
15:25ibdknox`fogus: I actually use tape
15:26Raynes`fogus: I actually do. :>
15:26RaynesI had a computer with one of those drives.
15:26ibdknoxthe actually floppy ones?
15:26RaynesYes.
15:27ibdknoxwe used to have a commador 64
15:27ibdknoxplayed the original ultima on that thing haha
15:27Bronsamy pc still has a working floppy reader
15:30ibdknoxhm, I need to come up with some good summer of code projects
15:39dnolenibdknox: please do!
15:40mdeboardibdknox: 1). delicious clone, in clojure
15:40ibdknox:p
15:40mdeboard2). pyclojure
15:40RaynesI don't understand book mark sync sites.
15:40ibdknoxit seems like something related to what I just did would be really fun for someone
15:40RaynesI don't even bookmark things these days -- I send them to evernote.
15:40mdeboard3). clojurepy
15:40RaynesThat's basically all I use evernote for.
15:41RaynesI'd support clojurepy.
15:41RaynesAs a matter of fact, I'd down right endorse it and contribute.
15:41ibdknoxclojurepy? Clojure that compiles to Python?
15:41mdeboardibdknox: Also yes a multiplayer game where you manipulate code to "move your guy" (or whatever mechanic) would be amazing
15:41mdeboardibdknox: Sure
15:41ibdknoxcool
15:41mdeboard(sarcasm)
15:41ibdknoxeh, lots of people are interested in other targets now
15:41clj_newbHi, (str "blah\ "\"/>") outputs \"/> unsupported character, is the \" not a valid scape character
15:42amalloyyou have a space after the first \
15:42clj_newbsorry I meant
15:43clj_newbHi, (str "blah" string_var "\"/>") outputs \"/> unsupported character, is the \" not a valid scape character
15:43RaynesI want Clojure on Parrot.
15:43amalloyno it doesn't. that code cannot produce that error message
15:44clj_newbok, I will review my string_var then
15:44amalloy&(let [string_var "test"] (str "blah" string_var "\"/>"))
15:44lazybot⇒ "blahtest\"/>"
15:44clj_newbthank you amalloy, the problem must be somewhere else
15:48phillchey guys. i have a service which fires off around 3 tasks serially. ie download an image from a url, crop it, identify EXIF data. i can do each and every task easily with java
15:48phillci have this service implemented in nodejs and having nice experience with it
15:49phillcfor academic purposes i'd like to do the same thing in clojure.. so if in nodejs i do these things async, what would be the answer in clojure?
15:50clj_newb&(let [string_var "var"] (str "a\"" string_var "\"/>"))
15:50lazybot⇒ "a\"var\"/>"
16:08TimMcphillc: Is async important? Just spawn more threads.
16:09TimMcIf you're worried about heavy, slow traffic -- Clojure has closures too. :-)
16:09phillcwell its important in a sense, i'd just like to learn what would be the common idiom with clojure
16:12stuartsierraphillc: futures
16:20technomancynathanmarz: how's lein-scalac working out for you?
16:24cemerickibdknox|away: well done with noir; you have won the HN quorum handily :-)
16:25Raynescemerick: I've totally got commits in there too. My ego is hungry -- feed it.
16:27cemericknoir would be *nowhere* without you, Raynes
16:27RaynesIt's true.
16:29ibdknoxcemerick: hm? :)
16:29phillctechnomancy, is lein-scalac good replacement for sbt?
16:30technomancyphillc: depends on your needs =)
16:30cemerickibdknox: http://news.ycombinator.com/item?id=3640241
16:30phillctechnomancy, i need my sanity back.
16:30technomancyit doesn't do any incremental compilation, so I understand that would rule it out for some use cases since the scalac compiler is very slow
16:30ibdknoxcemerick: haha I see
16:30phillcscrew incremental compilation.. i need something maintainble, simple.
16:30cemerickit was 5/5 for noir, so I had to add a fair-and-balanced comment. :-P
16:30technomancyphillc: give it a try then =)
16:31phillctechnomancy, definitly will!
16:31technomancyI should note that I haven't actually used it for anything but the 5-line example file checked into the tests
16:32ibdknoxcemerick: all paid advertising. ;)
16:34simardwhat was the website with clojure problems to solve ?
16:34phillccemerick, loving the TOC on your new book. makes tons of sense for experienced developers
16:35cemerickphillc: glad it looks good to you. Yup, was aiming for the intersection of experienced devs + clojure noobs.
16:36cemericki.e. no bullshit, but accessible.
16:36aperiodicsimard: 4clojure
16:37phillclooks like it, even code build and organization is given attention, which is one of the things i look at first in new languages (often doesn't get that attention)
16:37phillcrough cuts is complete? should i take that or wait for april?
16:38ibdknoxcemerick: added my own thoughts there :)
16:38accelwhat is mini-kanren, and why is it awesome enough for core.logic to implement it (from the sounds of it, mini-kanren sounds like a toy, not a full fledged standard)
16:38Raynesamalloy: You need to register thewebsitewiththeclojureproblems.com and point it at 4clojure.
16:39accelI have a recommendation for 4clojure. The input is a DNA strand. The output is the protein it induces + folds into.
16:41ibdknoxhah
16:41ibdknoxapparently my implementation is more general than Bret's was
16:41clj_newbHi, there is something I cannot work out what is wrong with this code http://pastebin.com/aQs2GnAf it works in repl but not when compiling nor running with lein
16:42cemerickphillc: Yeah, if you buy now, you'll be reading our final draft. Only differences between it and the published version will be super-minor edits and nicer illustrations.
16:42clj_newbany idea?
16:42phillccemerick, great, thanks
16:43TimMcaccel: Done, and I golfed it down to 10954823598 characters!
16:44ibdknoxlol
16:47raekclj_newb: you are missing a double quote
16:47raekit shouldn't work in the repl
16:48raek,(let [cookie "abc"] (str "<logout cookie=\" cookie "\"/>"))
16:48clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unsupported character: \"/>>
16:48raek,(let [cookie "abc"] (str "<logout cookie=\"" cookie "\"/>"))
16:48clojurebot"<logout cookie=\"abc\"/>"
16:49raekclj_newb: replace cookie=\" with cookie=\""
16:49raekclj_newb: an editor with syntax highlighting will help you catch errors like these
16:54gtrak``datomic, pods possibly?
16:55ibdknoxgtrak``: it's a product
16:55mdeboardDoes clojure.xml/emit-element require the value of :content keyword to only be another struct? or am I doing it wrong or what?
16:55gtrak``ah
16:55TimMcdatomic: A data structure for multi-thread concurrency in JS.
16:55ibdknoxlol
16:55TimMc</troll>
16:55mdeboard&(struct element :field {:name "city"} "Indianapolis")
16:55lazybotjava.lang.RuntimeException: Unable to resolve symbol: element in this context
16:56mdeboard&(struct clojure.xml/element :field {:name "city"} "Indianapolis")
16:56lazybot⇒ {:tag :field, :attrs {:name "city"}, :content "Indianapolis"}
16:56cemerickTimMc: should have left off the end-tag to see what chaos ensued.
16:56mdeboard&(clojure.xml/emit-element (struct clojure.xml/element :field {:name "city"} "Indianapolis"))
16:56lazybotjava.lang.NullPointerException
16:56mdeboardWhy
16:56mdeboardDoes that happen
16:56ibdknoxcemerick: TimMc: I had my pitchfork ready.
16:57mdeboardNot clear where in https://github.com/clojure/clojure/blob/master/src/clj/clojure/xml.clj#L95 that error would be generated
16:57Raynes$max
16:57lazybotThe most users ever in #clojure is 376
16:57RaynesHe lies.
16:58cemerickThat's wrong.
16:58cemerickRaynes: bash that up to 401, unless you know it's been higher.
16:58Raynesamalloy: ^ You know, that plugin has been broken for at least 8 months.
16:58cemerickoh, 404 now :-P
16:58TimMc~max
16:58clojurebotexcusez-moi
16:58mdeboard&(doc doseq)
16:58lazybot⇒ "Macro ([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil."
16:59TimMcclojurebot: max is <reply>Most users ever in #clojure: 404
16:59clojurebotAlles klar
16:59TimMc~max
16:59mdeboard&(clojure.xml/emit-element (struct clojure.xml/element :field {:name "city"} '("Indianapolis")))
16:59clojurebotMost users ever in #clojure: 404
16:59lazybot⇒ <field name='city'> Indianapolis </field> nil
16:59mdeboardff
16:59TimMcThere, now it is correct and yet nicely ambiguous.
16:59mdeboard16:57 <mdeboard> &(clojure.xml/emit-element (struct clojure.xml/element :field {:name "city"} '(20)))
16:59mdeboard&(clojure.xml/emit-element (struct clojure.xml/element :field {:name "city"} '(20)))
16:59lazybotjava.lang.NullPointerException
16:59mdeboard:-\
17:00TimMcmdeboard: Funky.
17:00Raynescemerick: It's supposed to keep track of the number of users to measure the highest. Unfortunately, it's teh broke.
17:00cemerickindeed.
17:00amalloyisn't struct supposed to be making a map? you gave it one key/value pair, and then a value floating off by itself
17:00wiseenis there a equivalent macro in core.match to this : https://gist.github.com/1927369
17:00mdeboard&(emit-element 20)
17:00lazybotjava.lang.RuntimeException: Unable to resolve symbol: emit-element in this context
17:01mdeboardamalloy: This is of course just a small snippet of a large struct map mapping my Solr schema
17:01amalloybut it's not a map
17:01mdeboardDunno, I'm trying to fllow the example here http://clojuredocs.org/clojure_core/clojure.xml/element if I'm doing it wrong I'm all ears :P
17:02mdeboardTrying to figure out how it works, is all.
17:04amalloywell structs are...dreadful and old. so a lot of people (eg, me) don't really know how to use them
17:05ibdknoxI didn't even know clojure had structs..
17:06amalloythey're like records, but from the jurassic
17:07clj_newbis there any other option to make mdeboard example with no struct? wondering
17:07amalloywell, don't use clojure.xml
17:08amalloyuse org.clojure/data.xml instead, which thank god has an official release now
17:09clj_newbdidn't know about it, thank you!
17:19bguthrieHi all. I'm trying to use Clojure to execute a shell process, and as part of that I'd like to hook up the input stream of the process to something so I can read from it asynchronously periodically. Any tips?
17:20bguthrieI can't use the default Clojure shell fn because it's synchronous, which is nice but doesn't help me much.
17:21emezeskebguthrie: Most likely, you'll want to look at the "sh" source, and use that as a basis
17:21emezeskebguthrie: With a little java-interop to get the out and err streams where you want them
17:22ibdknoxbguthrie: https://github.com/raynes/conch
17:22emezeskeOr, somebody could suggest a way better solution
17:23ibdknox:)
17:23bguthrieHaha
17:43clj_newbthe leiningen dependency in the web does not work for me, which is it?
17:44clj_newbdone
17:50technomancyclj_newb: parse error
17:59cemerickamalloy: that gzip middleware should optionally memoize gzipped static resources…
18:01ibdknoxwhich gzip middleware?
18:01amalloyyuck. make another middleware for that if you desperately need to avoid disk accesses. but really just using Not Modified responses liberally should solve most of the problem
18:01Raynesibdknox: You are like my PR guy or something.
18:01ibdknoxRaynes: I try.
18:01RaynesIt's like you just sit there and recommend my projects.
18:04cemerickibdknox: https://github.com/amalloy/ring-gzip-middleware
18:04aperiodicoh god, the nickcolors are slightly different now
18:04aperiodici'm not gonna recognize *anyone*
18:06cemerickamalloy: sure, ok. If you're loading static resources from the classpath though, looking for a resource isn't just a stat.
18:11emezeskeaperiodic: yeah, that's the worst!
18:15mdeboardamalloy: Thanks re: data.xml
18:15amalloythat's true enough. but if you skip the step of looking around and just serve up a memoized tarball, you can't really handle it if the resources change out from under you
18:17mdeboardamalloy: What's the official release # though? I see a 'data.xml-0.0.3' tag in the github repo
18:17amalloyyep
18:21gtrak``doesn't the mmap'd file and disk cache take care of it for you?
18:22cemerickamalloy: when would static resources on the classpath change in production?
18:22amalloy*shrug* serving up a log file as a web resource? just an example off the top of my head
18:23hiredman*static*
18:23cemerickgtrak``: I'm over-optimizing. :-P
18:23cemerickright, you'd want to be careful about applying the memoizing middleware around the right part of your routes.
18:23gtrak``does mmap-ing not work within a jar?
18:24cemerickwho knows
18:24cemerickor, I should say, outside of an implementation detail, no.
18:25stuartsierramdeboard: http://search.maven.org/#search%7Cga%7C1%7Cclojure%20data.xml
18:25mdeboardstuartsierra: Thanks sir
18:25gtrak``cemerick: let's write an OS in clojure then :-)
18:29mdeboardchrist i think i own every book on clojure and still suck
18:29mdeboardClearly all the books are bad
18:30gtrak``I've been feeling like I need a good lisp book to not suck as much, maybe "On Lisp"
18:31amalloythat book. there are some sentences i wish i could just cuddle up with next to the fire
18:32mdeboardJoy of Clojure and Practical CLojure are both good, I'm just dumb
18:32gtrak``what's missing for you to be good?
18:33mdeboardexperience & hours
18:33gtrak``err, i mean in terms of clojure?
18:33mdeboardonly 9,990 left
18:33mdeboardtime
18:33gtrak``I find I reimplement a lot of things that exist
18:34mdeboardI like how almost the entire comment section of the HN post for cemerick's book is about which clojure web library is best
18:35mdeboardok, almost half.
18:37brehauthalf of all programming is probably web programming, so not a huge surprise ;)
18:39gtrak``brehaut: I got my site on hiccup, it's nice, but stringtemplate is soooo much faster
18:40gtrak``not to-the-eye noticeable, but benchmark-wise :-). If I memoize static pages it's better than before.
18:40brehautgtrak``: interesting. i'm curious how enlive compares
18:40brehautgtrak``: i run my site in an embeded jetty behind an nginx with huge proxy caching ;)
18:41brehautit doesnt really matter how slow the rendering is either, but i'd be curious about comparisons.
18:41gtrak``yea, I'm just messing around, nothing so serious, but I was thinking of writing a macro do make them at compile-time if they're truly static
18:41brehautgtrak``: you might find tinsel possibly interesting?
18:41dsantiagobrehaut: I was just gonna say… :)
18:42brehauthttps://github.com/davidsantiago/tinsel
18:42gtrak``oh :-) perfect
18:42brehautindeed :)
18:43gtrak``the other thing is, clojure's reader sucks for pasted snippets, I might have to drop back to stringtemplate for that
18:43gtrak``not fully, but just to have a snippets map
18:43brehauti dont understand what you mean sorry
18:44gtrak``like, this is a pain to write in a .clj, I have to escape all the quotes: https://gist.github.com/1927948
18:44gtrak``and getting hiccup to generate it also looked painful
18:44brehautdsantiago: i didnt notice that you had benchmarks in the tinsel docs, thats great
18:45dsantiagobrehaut: Yeah, the linked benchmarks actually include Enlive as well, but I haven't updated those benchmarks in a long time.
18:46brehautdsantiago: how did enlive compare?
18:46dsantiagobrehaut: Last time I ran it, not that well.
18:46gtrak``dsantiago: tinsel looks much more well-conceived than what I was contemplating
18:47dsantiagogtrak``: Thanks. It's been pretty solid for me, but I don't know of anyone else using it.
18:47brehautdsantiago: interesting, thanks
18:49gtrak``I did some profiling with hiccup, and a lot of the time was spent in MultiFn, do you know what that's about?
18:49gtrak``it claims to do some compilation, so maybe it wasn't hiccup causing the slowdown but something else
18:50dsantiagoIt does do compilation, but it can't always apply those optimizations.
18:50dsantiagoIf it can't figure out statically what something is going to be, it has to insert code to run it and convert it to a string at runtime.
18:50gtrak``i did have one doseq in there, was it string concatenation maybe?
18:52dsantiagobrehaut: So I just re-ran it, and keeping in mind this is on clojure 1.1 still and I didn't update the Enlive version from 1.0.0-SNAPSHOT, what tinsel does in about 2 msecs, Enlive does in about 50.
18:53brehautdsantiago: huh. ouch
18:53dsantiagoOr more, actually. There's several tests.
18:54brehautdsantiago: how old is tinsel‽ 1.1 was quite a while ago
18:55dsantiagobrehaut: It's about a year old.
18:56dsantiagoI haven't updated it only because, well, it works for me, I'm not sure what else to add, and I haven't had any bugs in my own work or reported to me.
18:56dsantiagoHaven't moved my stuff to 1.3 yet though.
18:58dsantiagoClojure 1.3 seems to work just by changing the dep in project.clj.
18:58dsantiagoAssuming you don't try to rebind the option vars.
18:59dsantiagoBetter fix that.
19:00tmciverdsantiago: tinsel looks interesting. It looks similar to enlive, yes?
19:00dsantiagotmciver: Yep. It's like Enlive but works on HTML or Hiccup input, and it doesn't have the vector-based CSS-like syntax.
19:00dsantiagoLets you write your own ways of selecting and modifying the nodes of the HTML tree instead.
19:01tmciverI've been looking at enlive recently to do some html->xml transformations; is that something tinsel could do as well?
19:02dsantiagotmciver: I'm not sure what you mean by an html->xml transformation.
19:02tmciverdsantiago: like XSLT
19:03dsantiagotmciver: You want to read in HTML and then print out equivalent XML? Or you want to do transformations on it?
19:03tmciverread in some html, pull out specific content, use that to create some xml
19:03tmciverdsantiago: transformations.
19:04mdeboardI can confirm that clojure.data.xml emits xml
19:05tmciverhiccup could also be used directly to produce arbitrary xml.
19:05dsantiagotmciver: I'm not sure if tinsel is a good fit for that. Tinsel does everything it can at compile time, it's optimized for fast rendering. If these input files are going to be different every time, you wont' get any advantage.
19:05dsantiagoProbably a disadvantage, in fact.
19:05tmciverdsantiago: Yeah, that's why I was asking. A quick look at the readme seemed to indicate that.
19:05tmciverdsantiago: still, tinsel looks very cool.
19:06dsantiagotmciver: Thanks!
19:06mdeboardOh, didn't realize people were talking about XML
19:14cemerickThere's been so much clojure on HN today, the trough of disillusionment must be near.
19:14Scriptortrough of disillusionment?
19:15ibdknoxcemerick: in general there's been a lot lately
19:15cemerickScriptor: https://en.wikipedia.org/wiki/Hype_cycle
19:15cemerickibdknox: yeah, and watching #clojure on twitter has been interesting
19:16Scriptornah, I think it's just a minor fluctuation
19:16cemerick"all the cool kidz are using clojure, I need to get on that", etc.
19:16Scriptornode's trough is coming soon
19:16technomancyif it hasn't already hit
19:17cemericktechnomancy: stop with the wishful thinking
19:17Scriptoras a nyc resident, I can assure you it has not
19:18ibdknoxpeople are realizing slowly that they're creating maintenance disasters
19:19cemerickif you assume node is the new php, then it's got a *lot* of headroom
19:19technomancywhat we need to do is figure a way to channel the large upcoming node-rescue-project consulting market into clojurescript.
19:19ibdknoxooo
19:19ibdknoxconsulting money sounds good
19:19ibdknox;)
19:19technomancyibdknox: all I ask is a 5% commission for coming up with the idea
19:19ibdknoxcemerick: I think it's a little different of a situation
19:20hiredmanuh, eitherway you are still using js
19:20Scriptorit's closer to what rails was like
19:20hiredmanI think you'd do better replacing node with anything on the jvm
19:20Scriptorsomeone should make rhinode
19:20technomancyhiredman: maybe a gradual transition with rhino or something
19:20y3diwow ibdknox: that ringing shit is mad whack.. your submission could have gotten so much visibility
19:20hiredmanI bet even groovy would out perform it
19:21ibdknoxy3di: yeah, based on its reception on Reddit, probably would've been in the 20k range
19:23ibdknoxI'm mostly sad that it didn't seem to generate any interesting discussion
19:23ibdknoxthough I was surprised to find out that my implementation is probably more robust than his demo's. I had assumed he built something similar
19:24ibdknoxI kinda hoped he would've said something too, but oh well :)
19:25cemerickibdknox: I'm crudely assuming similar skill levels of new entrants.
19:26ibdknoxcemerick: I think the barrier is much higher for node than it ever was for PHP
19:26cemerickjavascript is the minimum entrance requirement for software development; just imagine all the HTML/js/css jockeys now building server-side
19:26technomancyPHP had every shared host in the world supporting it
19:26ibdknoxinstalling node, until recently, was not easy
19:27ibdknoxdoing templating is *far* simpler in php
19:27ibdknoxrunning php was stupid easy with things like mamp and xamp
19:27cemerickI'll be happy to be totally wrong.
19:27ibdknoxI just don't think it'll be *as* bad lol
19:27Scriptorit's also much easier to grasp in your head, every time your page is requested the script runs and whatever you echo() is what you see
19:27Scriptornone of that callback nonsense
19:28ibdknoxyeah, PHP is about as simple as it gets for websites
19:28ScriptorI don't think the people behind node are beginner programmers, for the most part
19:28ibdknoxit's also a maintenance disaster, but at least it's easy ;)
19:28ibdknoxI can't say much
19:28ibdknoxI built a lot of php programs
19:30ibdknoxI'd like to think we've learned a lot since then
19:30Scriptorheh, I just attended a talk by a tumblr guy
19:30Scriptorfrom what he said, at least they haven't
19:33callenScriptor: I think the people behind Node went PHP => Rails => Node.js and never learned about evented programming until they discovered Node.
19:34callenScriptor: further, I'm not sure any of them, save for Dahl himself, are aware Erlang exists or what CPS is.
19:34brehautibdknox: given how much HTML templating is still using greenspun string bashers, id say we havent learnt enough since then
19:34ibdknoxbrehaut: haha fair enough
19:34muhoocallen: this
19:35callenbrehaut: sometimes a separation of concerns and lack of power is desirable. Can't teach the designers Clojure.
19:35ibdknoxI'm not entirely sure that's true
19:35callenThey just need to know where the data is going to go and build up a framework around that.
19:35brehautthis again? geez
19:35Scriptorcallen: hah, exactly, I wonder how much the lack of an idea of what CPS is is muddling the whole issue with Coffeescript and other efforts trying to find ways to "straighten out" async style code
19:35callenyou're the one that bashed string-injection templating :)
19:35ibdknoxit's pretty brute force
19:36ibdknoxI have a hard time believing that's the best solution to the problem
19:36callenthe best solution is to have a team of ubermensch who can both code and design
19:36callenthen your approach is perfectly acceptable
19:36callenmeanwhile back on planet Earth, we have designers who cannot code and mechanisms for enabling them to work smoothly with the engineers is desirable.
19:36ibdknoxI don't think I've seen a great approach yet to be honest
19:36callenthe easiest way to do that, that I'm aware, is Rails/Django style separation of concerns
19:36muhooibdknox: is there a link to your cljs implementation of that talk?
19:37callennot necessarily MVC, but templates that are independent of logic.
19:37ibdknoxmuhoo: hm? like on github? https://github.com/ibdknox/live-cljs
19:37ibdknoxmuhoo: the full text is on http://www.chris-granger.com
19:38ibdknoxthe easiest way that exists today, sure
19:38ibdknoxrather, that is mainstream and exists today
19:38ibdknoxmoreover, why not have the designers hand you PSDs if it's that big of a deal?
19:39callenibdknox: miserable way to work, some of them are "web designers" and their job is to make CSS that is cross-browser compatible.
19:39ibdknoxI did it for a couple years, it was a fantastic way to work
19:39callenibdknox: there are varying levels of expertise in said designers, some are only good for PSDs, some can do some basic HTML and CSS, some are CSS wizards, some can even slap jQuery around a bit.
19:39ibdknoxnever had to fix any dumb html :)
19:39muhooibdknox: yes, thanks
19:39callenibdknox: I'm personally incapable of producing CSS blank-slate from a design.
19:40callenibdknox: if you can tell me how to develop such skills, I'd be grateful.
19:40brehautibdknox: nah, you only have to fix your own dumb html ;)
19:40ibdknoxcallen: take a picture of a site and recreate it :) It's simply a matter of doing
19:40ibdknoxbut no one said it had to be you.
19:40ibdknoxI can't program a rocket
19:40ibdknoxprobably never will
19:41mdeboardYOu wouldn't download a rocket, would you
19:41devnmy clojure completion is not working in my source buffer, but it works in my slime buffer, any ideas?
19:41ibdknoxI think the best setup I had was when I was backend guy, I had a front end guy and we had designers feeding us psds
19:41ibdknoxwe built shit so quickly
19:42ibdknoxbrehaut: me? dumb html? pfft... never :p
19:42brehautlol
19:42ibdknoxspeaking of.. I need to fix my damn horizontal scrollbar
19:42ibdknoxforgot about that
19:44devnanyone have any ideas for discovering what is/isnt triggering when I hit tab or M-tab?
19:45emezeskeI'm of the opinion that if someone "can't code", they shouldn't be writing HTML or CSS, as those are both coding
19:45ibdknoxemezeske: I've been of that opinion as well
19:46harrisonthat sounds right
19:46harrisoni haven't done those two things
19:47brehautand even if they are able to produce HTML, i dont really want them worrying about data models (or having to translate my datamodel into some half arsed intermediate form just for the template to consume)
19:47harrisonbut writing web pages is coding, however demeaning it may be
19:47harrisoncompared to raytracing
19:48emezeskeTo me, it's easy to make a boring task like writing HTML interesting: just always try to be coming up with the most awesome way possible to do it
19:48ibdknoxI've built all sorts of stuff, worked at many levels of the stack. I don't generally believe that any branch of software is easier/harder than any other
19:48harrisonyou sound like a coder
19:49harrisoni said "demeaning" not "trivial"
19:49emezeskeibdknox: Same here! It's all as hard as you make it (and you should try to make it hard!) ^_^
19:49emezeskeharrison: Why would it be demeaning?
19:49harrisoni wasn't serious
19:50harrisonno offense intended
19:50emezeskeNone taken! I just didn't pick up the /s :P
19:51harrisonsarcasterisk needed
19:51harrisonactually, i am not proud that i haven't done web coding
19:51harrisonnot ashamed but not proud
19:51harrisonit might come in ahndy
19:51harrisonif this internet thing becomes the next popular sensation
19:52harrisonandy
19:52harrisonhandy
19:52ibdknoxlol
19:52ibdknoxall apps will be webapps ;)
20:00devnsorry to bother, but i cannot figure out why emacs wont do completion in the buffer -- could anyone with working emacs completion in their source buffers jump to a source buffer of clojure and C-h k TAB and let me know what it is bound to?
20:00mdeboarddevn: Did you M-x clojure-jack-in /
20:00clojurebotI don't understand.
20:00devnmdeboard: yes
20:00amalloyit's bound to reindent, surely
20:00amalloyuse M-/ or C-c TAB, iirc
20:00amalloyor autocomplete-mode
20:02devnamalloy: just install the autocomplete-mode?
20:02amalloyi like it, but it's not for everyone
20:02devnamalloy: M-/ is my hippie expand, C-c TAB didn't work
20:03amalloyC-c TAB is bound to slime-complete-symbol, for me
20:03devnamalloy: is the package all i need, or do I need something else? what about ac-slime? is that what im looking for by any chance?
20:03lancepantzdevn: hippy expand?
20:03amalloy*shrug* depends what you want
20:04amalloyi just use autocomplete and it's fine. ac-slime seems like unnecessary complexity but some people like it
20:04lancepantzi use ac-slime
20:04devnlancepantz: http://www.emacswiki.org/emacs/HippieExpand
20:04lancepantzi like it
20:04lancepantzbut i don't know the api as good as you amalloy
20:04devnamalloy: you just solved my problem. i just didnt know what the damned function was to complete the symbol at point -- I can bind slime-complete-symbol
20:04clojurebotNo entiendo
20:05devnbut i think id be interested to try ac-slime
20:05mdeboardlol, love coderwall's clojure achievement logo http://cdn.coderwall.com/assets/badges/narwhal3-3a1b9493a5dc3575952340f0b740c9ea.png
20:05lancepantzmdeboard: i know, why a narwhal?
20:05mdeboardWhy NOT a narwhal
20:05lancepantzi hope that doesn't stick
20:06ibdknoxI'm confused by that site
20:06ibdknoxI signed up to see what it is
20:06lancepantzi think we should get like a dragon or something
20:06devnthe expansion of the site is sort of a bummer
20:06mdeboardI mean, why did they make Python's animal a sna-- oh
20:06mdeboarda dragon, lol
20:06devni like the idea of coder achievements, but not a platform for viewing other people's achievements
20:06mdeboardA flaming penis with missiles and swords
20:06brehautnarwhales are pretty awesome
20:06mdeboard^
20:07brehautunicorns of the sea
20:07lancepantzactually, the perfect logo for clojure would be a spork
20:07Scriptoror werewolf
20:08lancepantzmaybe a wizard, or does scheme get that?
20:09Rayneslancepantz: There should be a 'friends with lancepantz' achievement.
20:10RaynesEverybody gets it.
20:10lancepantzofcourse they would! :D
20:10Scriptorman, lein still won't work with git-bash
20:10Scriptorand cmd's autocomplete is just...astonishingly bad
20:13Scriptorooh, but clojure-jack-in works now
20:23callenwhat's the general pattern or idiom for examining intermediate values in the execution of a function?
20:24callennormally in Python I'd be able to leave an ipdb line in there, or set a breakpoint
20:24callenI'm bouncing between a buffer and a repl and I'm not sure how to pause execution and see what's going on.
20:26technomancycallen: in swank?
20:26callentechnomancy: da.
20:26technomancycallen: just insert (swank.core/break)
20:26callenright now I'm leaving println's in the code...
20:26callentechnomancy: I'll give that a whirl, thanks.
20:27callentechnomancy: break just seems to throw an exception, how do I examine values?
20:27technomancyyou can also turn on slime's tracing if you want all args/return values in the repl
20:28technomancycallen: while the debugger window is open, the repl should switch to an in-context repl that has access to locals
20:28callentechnomancy: the REPL is just waiting on me to resolve the exception.
20:28callentechnomancy: how do I turn on slime's tracing?
20:28technomancyare you sure the repl is waiting?
20:28technomancyit might just not be prompting you
20:28callenwait weird, it's not prompting me
20:28technomancyslime tracing is C-c C-t or something like that
20:28callenbut it seems to be working.
20:29callentechnomancy: well the REPL seems to be working, I'll have to figure out slime traicng.
20:29callentechnomancy: thank you.
20:29callentracing*
20:30weavejesterI've never actually tried the slime debugger
20:30Scriptorin sldb, why does expanding an entry in the backtrace always say "no locals"? What's considered a local?
20:31technomancyScriptor: I think you have to have a call to swank.core/break for it to be able to emit locals
20:31technomancyScriptor: in general slime has lots of features designed for CL that don't necessarily make sense in Clojure though
20:32Scriptorhmm, makes sense
20:32technomancyweavejester: swank.core/break can get you a long way. I've only needed CDT once, (for a bug in Clojure itself) but I was really glad to have it when I did.
20:33weavejestertechnomancy: Do you know if there's any emacs plugins for toggling a (swank.core/break) line?
20:33Scriptorcan I put (swank.core/break) anywhere inside an expression or does it have to be on its own "line"?
20:33Scriptorwould (foo (if a b c) (swank.core/break) other-arg) work?
20:34technomancyScriptor: I think it evals to nil
20:34technomancyweavejester: pretty sure there is'nt
20:35Scriptorhmm, damn, the problem I have with breakpoints in lisp is that code is often nested like that, rather than line-oriented as in imperative languages
20:39callentechnomancy: https://refheap.com/paste/874 this is what my backtraces in Slime look like
20:39callentechnomancy: I enabled tracing on my function, no dice.
20:40technomancytracing prints to the repl buffer, not the debugger
20:40callensure, so why are my backtraces borked?
20:41callenI need to see the locals :(
20:41weavejesterRich Hickey's latest tweet is enigmatic.
20:41callenweavejester: do you know what he means by Datomic?
20:41brehautweavejester: i was thinking inscrutable
20:41ibdknoxhah
20:41Scriptormysterious
20:42weavejestercallen: Well, he just tweeted "a new kind of database"
20:42weavejesterSo, my guess would be some kind of persistent distributed data store.
20:42ibdknoxI know someone who is likely a direct competitor if I'm correct about what he's making
20:42callenright, wondering if Datomic or something is what he's talking about.
20:42Scriptorwould it be atomic in reference to clojure's atoms or just atomicity in db's in general?
20:42weavejestercallen: I figure it must be. Datomic sounds like a database.
20:43callenhas anyone had a problem in slime with all of their backtrace frames being [No locals]?
20:44brehautis he going to tweet like this till his clojure/west keynote do you think?
20:44Scriptorcallen: yea, I just asked about it
20:44Scriptorapparently you need to use swank.core/break
20:44weavejesterbrehaut: I guess so :)
20:44weavejesterI figure it'll be something like a persistent Erlang, or at least fill in some of the same areas.
20:44Scriptorfor a particular frame to show its locals
20:46callenyeah but I'm still getting that.
20:46callenwith swank.core/break
20:46Scriptorhmm
20:46callenoh bugger all, it just started working.
20:46Scriptorhaha
20:46callenlet me repeat what I did.
20:46BostXhi all
20:47callenI think I know what's happening
20:47callenit's trying to evaluate values, and the eval is triggering more exceptions
20:47BostXI have a call of static java method:
20:47Scriptorso, is there any way in clojure to do something like (foo (first-arg) (no-arg-breakpoint) (second-arg))
20:47BostX,(. java.net.URLEncoder encode "bar & baz" "UTF-8")
20:47clojurebot"bar+%26+baz"
20:47BostXAnd I'd like to do:
20:47BostX,(defn foo [x] (. java.net.URLEncoder x "bar & baz" "UTF-8"))
20:47clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
20:47BostX,(foo encode)
20:47clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0)>
20:48BostXbut it does not work. does anyone know why?
20:51amalloyScriptor: no
20:51mdeboardI have discovered the (very very very nsfw) reason why Clojure's achievement picture on codewall.com is a narwhal. (Seriously, this is NSFW, and probably nsfyou if you have any kind of taste or the slightest shred of maturity) https://www.strongspace.com/postfarm/public/postfarm/uploads-2.0/u/umwli.jpg
20:51clojurebotc'est bon!
20:51mdeboardPlease don't ban me.
20:51amalloywell, now clojurebot has that in his database
20:51Scriptorclojurebot approves
20:52Scriptoramalloy: any chance at all of this happening, or whether it's even possible, or not a dumb idea?
20:52amalloyis not possible. you need a different approach
20:53amalloyeg, (breakpoint-after-arg 1 (foo (first-arg) (second-arg)))
20:55Scriptormaybe
21:06sgarrettHello again #clojure. I'm working on recreating a simple pong program to clojure that I wrote in java. When using java classes like "java.util.Random" is there an idiomatic way to use them without the "new" keyword? Seems like using new a bunch in clojure isn't proper implementation.
21:07weavejestersgarrett: Add a "." to the end, e.g. (Integer. "10")
21:07weavejester&(Integer. "10")
21:07lazybot⇒ 10
21:07weavejester&(new Integer "10")
21:07lazybot⇒ 10
21:07brehaut,(apropos 'rand)
21:08clojurebot(rand rand-int rand-nth)
21:11sgarrettweavejester: Thanks. :)
21:16amalloy&(macroexpand '(Integer. 10)) ;; just to emphasize
21:16lazybot⇒ (new Integer 10)
21:26echo-arealjos: Did you find the project yesterday
21:26echo-arealjos: What's it?
21:27TimMc~NSFW
21:27clojurebotI don't understand.
21:28TimMcmdeboard: I'm really not sure why that has anything to do with anything other than narwhal porn.
21:42gtrakbrehaut, ibdknox, https://gist.github.com/1928815 did I do a bad thing just now?
21:44TimMcgtrak: Kinky.
21:45TimMcWhen I see ((eval b)) I know I'm in for a good time.
21:45brehautlol
21:45gtrakI'm still teething on the macros
21:45brehautyou've gone further down the hiccup rabbit hole than i have sorry
21:45gtrakwell, the defpartial originally is from noir
21:47gtrakbut that's just defining a function with a prerendered hiccup html as its return value, which can then be composed with more defpartials, in theory
21:47gtrakif you know it'll be static... I suppose it saves some cpu?
21:47TimMcand I/O, maybe?
21:47gtrakyea
21:48gtraksince you can pass in any sexps
21:48brehauti wonder if its a complicated way of doing a memoize?
21:48gtrakit is
21:49callenhttps://refheap.com/paste/875 this more or less exemplifies the brain damage I have re: clojure.
21:49gtrakthough it moves it to compile-time, those lines are blurry
21:49callenthe first solution obviously being mine.
21:50gtrakbrehaut, though string literals referenced by code don't live on heap, right?
21:50brehautgtrak: way deeper java than i can answer
21:51gtrakat least in java source code, literals are automatically interned into permgen
21:51brehautoh right. interesting
21:52gtrakbut yea, memoize was the first thing I did, this is pretty much a restricted compile-time memoize
21:52brehautsure. totally reasonable. enlive does something like that i think
21:53TimMccallen: That's how you learn! Initial flush of victory, huge bucket of cold water.
21:53callenTimMc: I knew my solution was going to be massive, the problem I guess is that I don't yet think in idioms like partial and mapcat.
21:53gtrakis there any way to avoid the eval? I did a lot of trial and error.
21:53callenTimMc: I was particularly irritated this time because mapcat briefly occurred to me.
21:55TimMccallen: I probably would have done (fn [s r] (for [x s, y (repeat r x)] y))
21:55TimMcwhich of course is a perfect case for mapcat
21:55brehautgtrak: i think if you want a form computed at compile time you probably do want an eval?
21:56TimMccallen: ...and now that I check, that's exactly what I did!
21:56callenTimMc: what's your account name on 4clj? I need to add you.
21:56TimMccallen: TimMc
21:56Scriptorhmm, vars created with def don't count as local bindings?
21:57gtrakI was trying to do it inline like ~(fn-partial [] ~@body) in place of value, but that was all sorts of broken
21:57TimMcMy solutions are a mix from rather early on in my Clojure "career" and fairly recent ones.
21:57callenTimMc: thx.
21:57callenunderstood.
21:57callenI'm a past the earliest of questions, so I think it will be instructive.
21:57TimMcScriptor: vars are disjoint with locals
21:58Scriptorgot it
21:58TimMclocals are like... registers or something.
21:58TimMccompiler can do all sorts of fancy footwork with those
21:59Scriptorhow are vars treated?
22:00brehautthey are global to a namespace
22:01TimMcvars are globally named mutable cells that the compiler knows about
22:02TimMcSo when you do (count foo), the compiler knows that count is #'clojure.core/count, a var -- and will go and look at the metadata on the var for optimizations.
22:23gtrakbrehaut, there's gotta be a general static-fn macro like that, no?
22:23brehautgtrak: no idea sorry
23:01zcaudateibdknox|aw
23:01zcaudatewould anybody have an rss feed of this channel?
23:03zcaudatei know there is a log @ noise.net but i want to follow the conversation on my iphone
23:07gtrakrss feed of irc?
23:18TimMcthat's a new one
23:21choffsteinAnyone use AquaMacs? I find it to sometimes be incredibly slow. Trying to do a swank.core/break and pull up the inspector on any variable can take an absurd amount of time... I don't know if that is just me, or that is more common...
23:21ibdknox|awayI think the general word of wisdom is to stay away from aquamacs
23:21ibdknox|awaybut I'm a vim guy... soo...
23:22choffsteinfair enough
23:22amalloyanyone using aquamacs is on their own
23:22callenchoffstein: you don't want to go there. Just get "Emacs for OS X", you'll be able to google it just fine.
23:22choffsteinYeah. I've got it.
23:23choffsteinAquaMacs just allowed me to stay in this beautiful, crippled land where I can still have a file dialogue ;0
23:23choffstein;)
23:23callenchoffstein: you should learn to use Emacs.
23:24choffsteinWell, then I shall.
23:24rlbI thought that emacs brought up a file dialog if you used the menus...
23:25gtrakmenus-disabled is the way to go
23:25rlbhmm, maybe not (at least not with emacs23-lucid)
23:25technomancybest to pretend they don't exist; they're kind of embarassing
23:25rlbmaybe emacs23-gtk does (dunno -- or care much)
23:25choffsteinThis is a pretty random question, but maybe someone has a good answer. One of my biggest gripes with clojure is when I want to poke around with a new library, my process is to create a new lein project, add the dep, perform a lein deps, then do a lein repl. Then I have to delete the temp project. That just seems like a lot of wasted effort. Does anyone have a better way to go about it?
23:26gtrakcreate one project, and don't delete it?
23:26rlbchoffstein: if you do go without the dialogs, I recommend enabling/learning iswitchb-mode.
23:26technomancychoffstein: you could just check out the project itself
23:26technomancyor keep a scratch project around
23:26technomancythis will be easier in lein2 with pomegranate
23:26technomancy(if you're not tired of hearing me say that yet, you will be soon)
23:27callenI'm at about 50% of the way there.
23:27choffsteinHaha. Yeah ... those seem like horrible solutions, to be quite frank.
23:27callentechnomancy: you're an excellent propagandist though.
23:27choffsteinBut I'll keep my eye on lein2
23:27calleniswitchb-mode is lordly.
23:27technomancyyeah, ideally you shouldn't even have to restart your project
23:27callenlive and die by my ido-mode and iswitchb-mode
23:28technomancycallen: I thought ido is a superset of iswitchb?
23:28gtraktechnomancy, that would be great
23:28callentechnomancy: aye, but I use iswitchb for my buffers.
23:28callenyou don't have to.
23:35technomancyhaha; the build tool for F# is called fake
23:35ibdknox|awaywow
23:35ibdknox|awayI just got this email
23:35technomancyand it apparently has two orders of magnitude more LOC than leiningen? http://www.ohloh.net/p/fake-fsharp
23:35ibdknox|awayHi Chris, We (also) want to convert our small Django based system to just static pages and the DB contains 3 year worth of employee records which we want to try to dynamically migrate to google spreadsheets. Would you be interested in taking this up?
23:35ibdknox|awayI feel like I'm getting trolled.
23:36Scriptorthat was one issue I had with naming a build took in pharen
23:36Scriptorfunny to see F# didn't give a damn
23:36callentechnomancy: 165k LOC?!
23:36callentechnomancy: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGH
23:36technomancycallen: it's got to be a bug in how they're measuring it
23:36technomancyI don't think that's actually possible
23:37aperiodicit also says that 65k of those lines were added in the last month
23:37callentechnomancy: I'm pulling it now to measure it myself.
23:37callenno earthly way it could be that big.
23:39callencloc says 84k
23:39muhoowhat's this codewall people are talking about?
23:39muhooi went to codewall.com and it apparently is some .NET security software
23:39ScriptorF#'s build tool
23:39Scriptoroh
23:39ibdknoxmuhoo: coderwall
23:39muhooah
23:39technomancycallen: still; disturbing
23:40callentechnomancy: I don't actually trust that number.
23:40callentechnomancy: I'm resolving it now.
23:40muhoofunny. "Unlock achievements". why must everything be a game?
23:40muhoopost a new project on github and get a powerup
23:41callentechnomancy: nope, it's mis-including package lists and the dependencies.
23:41technomancymuhoo: oh man, once you get triple shot it changes everything
23:41callentechnomancy: it's only 1314 lines of code.
23:41callenit doesn't do a whole helluva lot IIRC
23:41technomancyok, that's more like it
23:42callenthere's a lot of XML and shit too
23:42callenit's a pretty ugly project IMHO, but it's not that big either.
23:42callenthis was a healthy reminder of why I abandoned the .NET world early in my career.
23:42technomancyI like the idea of ocaml with libraries and concurrency
23:42callenwhenever you need the fax and only the fax, just call callen.
23:43technomancybut then again, part of the draw of ocaml is that it doesn't use a VM
23:43callenright, which is why I find the fascination with F# puzzling.
23:43callenthe only reason I looked into OCaml was because it wasn't on a VM.
23:43technomancyI mean, the draw of ocaml for Clojure users
23:43technomancyI have no idea how C# users think
23:44callenwho knows. I try not to remember those days.
23:45callenI spent most of my time in C# muttering to myself about how much I hated it.
23:45callenmuhoo: coderwall.com
23:46technomancyif coding were really like a game you'd have to unlock stuff like ido-mode and the slime inspector
23:47callenastute.
23:48talioswoo - seems I've gained a few coderwall achievements since I last looked :) http://coderwall.com/talios
23:49Scriptorah, nice, expedited access with twitter access
23:49Scriptorhaving a twitter I don't actually use comes in handy once again
23:50technomancyI'm still annoyed that coderwall accused me of having an original C++ project
23:50technomancybecause I uploaded znc rather than forking it.
23:53callentechnomancy: didn't you want the option of eliminating the timestamps from the replay?
23:53technomancycallen: I thought it would be easy to get them collapsed into erc's timestamps where it only shows them once per minute
23:54technomancybut I realized that's nontrivial since those are generated internally to erc
23:54callenright, as is the case with most IRC clients.
23:54callenyou can't fake it unless you have a cooperative web client or custom script that subsumes the output.
23:56callentechnomancy: I was planning on writing not because of that particular annoyance, but because I wanted a foundation to build things like hubot on top of, and because I want to be able to stash IRC history in a common accessible database that multiple services/bots could utilize.
23:56callenwriting it*
23:56technomancycallen: did you take a look at subrosa?
23:57callentechnomancy: yeah, not really sure how to hook into it.
23:57technomancyright... especially when you're getting started there's this weird dynamic where it's easier in some ways to start from scratch than build on an existing codebase
23:58callentechnomancy: it has a bunch of shims for common-case IRC-usage type stuff but I don't see anything fundamental like what I would need.
23:58callentechnomancy: that
23:58callenthat's precisely the problem. I'm too nubcakes.
23:58technomancylike it's quantitatively more work to start from scratch
23:58technomancybut it's easier work in a way
23:58callenthis wouldn't be a problem in a language I was comfortable with, obv.
23:58callenClojure does a tip-top job of making me feel like a moron though, so there it is.
23:59accelI have written a clojure app with crappy algorithms, and it's about 100x slower than it needs to be. I don't know where the bottlenecks are. What is the equivalent of gprof but for clojure?
23:59callenI found his hooks setup, I could...try using that. I don't see any examples though.