#clojure log - Jul 01 2012

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:46 pdk: hi, are there any known guidelines for dealing with null pointer errors on source lines during compilation?

0:47 i've got one function in a source fule that fails to compile with a null pointer on an unusual line

0:49 adu: null?

0:49 what's the line?

0:49 pdk: i'll pastebin

0:51 http://pastebin.com/6ef5s6Ax this is the function in the source that fails to compile, i get CompilerException: NullPointerException on the location of line 17 in the actual file

0:51 so it seems to be throwing a null pointer on the binding list of the doseq of all odd places

0:54 michaelr525: pdk: do you also get warnings?

0:54 pdk: nope, compilation stops right there when i (load-file) into a repl

0:55 should note it's the same story with 1.3 and 1.4

0:56 wingy: what server do i have to run if i choose noir over aleph

0:56 jetty?

1:04 adu: wingy: I love noir

1:04 wingy: all of the error messages that noir gives seem to contain the word Jetty

1:06 pdk: ok my stack trace doesnt show anything related to the source either it seems

1:07 just traces typical compiler funcionts

1:07 functions

1:12 wingy: adu: so if i run noir it will be jetty?

1:12 i have heard netty perform far better

1:12 and is a fit for web servers handling a lot of requests

1:12 i guess i should just try them both out and see for myself

1:16 guess i should read this one: http://brehaut.net/blog/2011/ring_introduction

1:18 xeqi: wingy: noir is independent of the server

1:18 by default the noir templates use jetty

1:19 but since ring has several adapter, you can run it with jetty, as a war in a servlet container, using aleph for netty, etc

1:19 wingy: right

1:26 ibdknox: netty does not perform better than jetty

1:26 unless you're doing long polling

1:26 wingy ^

1:27 adu: wingy: that's my guess

1:29 ibdknox: in general, threaded servers are very, very good at serving short-lived requests

1:30 Raynes: ibdknox: I need to talks to yous

1:31 lynaghk: What's the story with dynamic vars in cljs? I should be able to use one as a simple variable pretty much, no?

1:31 ibdknox: Raynes: what's up?

1:32 Raynes: ibdknox: I added the middleware from refheap to lib-noir and released an alpha of 0.2.0. I considered having a 'noir.utils' namespace with the middleware because none of it is at all complex and it is all very small, but I went ahead and gave each middleware its own namespace because that's how ring itself does it. Feel free to veto this since it is only an alpha (I made it an alpha for the sole purpose of letting you veto this :p).

1:32 ibdknox: hm

1:32 they're so small

1:32 Raynes: I'm stuck between 'modularity is good and weavejester wont hate me' and 'jesus, they're so small'.

1:32 ibdknox: I dunno that having them in their own namespaces makes sense

1:33 amalloy: each middleware having its own namespace is annoying in ring, don't copy that

1:33 ibdknox: yeah

1:33 I agree

1:33 Raynes: I agree.

1:33 lynaghk: thirded.

1:33 Raynes: I'll change it tonight or tomorrow.

1:33 ibdknox: noir.utils or something else?

1:33 ibdknox: hm

1:33 Raynes: amalloy: BTW, you should see if there is any middleware in 4clojure we should move to lib-noir, since 4clojure uses it too.

1:34 lazybot: I am revealing my sentience just to agree with amalloy on this.

1:34 Raynes: Hurr

1:34 kovasb: lol

1:34 ibdknox: lol

1:35 amalloy: $logout (...nothing to see here...)

1:35 lazybot: You've been logged out.

1:35 amalloy: there are a few neat middlewares but i don't know how generally-applicable they are

1:35 kovasb: is there a way to backchannel commands to lazybot?

1:35 amalloy: kovasb: only if you own him

1:35 kovasb: make sure it agrees with you :)

1:35 haha

1:35 lynaghk: kovasb: Your distrust of automatically-adding-watches to atoms is well placed. That stuff has been catching up with me the past few hours.

1:35 amalloy: anyone can make him agree with you, though, or shoot down your opponents

1:36 Raynes: amalloy: I'll take a look myself when I do the other stuff. ibdknox gets decide what goes in in the end anyways.

1:36 gets to decide, even

1:36 kovasb: lynaghk: getting too complicated, or something else?

1:36 amalloy: we have wrap-strip-trailing-slash, which is simple and probably useful

1:36 Raynes: amalloy: That was in refheap. Already moved to lib-noir.

1:36 ibdknox: yeah, that is really useful

1:37 lynaghk: kovasb: Been going in some debugging circles. I finally believe I've tracked it down, but I haven't been able to replicate in a minimal test case, so I could be way off

1:37 Raynes: ibdknox: So noir.utils?

1:37 noir.utiddlware.

1:37 amalloy: wrap-debug, though you'd want a version that doesn't depend on useful

1:37 kovasb: lynaghk: ouch

1:37 ibdknox: noir.util.middleware?

1:38 Raynes: ibdknox: Ah! Excellent.

1:38 ibdknox: I used to have one with the wrap-utf8 thing, before that got included in ring by default

1:38 kovasb: lynaghk: 24 hours later, I've finished migrating to build 1424 :)

1:38 Raynes: ibdknox: I tried to get noir.session in ring, but weavejester didn't want it.

1:38 kovasb: the horrors

1:38 Raynes: Understandable I guess.

1:38 ibdknox: yeah

1:39 lynaghk: kovasb: if you look at how reflex is implemented, it captures deref'd atoms by having them register with a global when they're derefed. The issue is that this also catches atoms that are derefed in the watchers (which can have no effect on the state anyway).

1:39 kovasb: did you figure out what that index out of bounds thing was about?

1:39 amalloy: the client-side-caching features are pretty cool, actually, but maybe a little too complex to make part of lib-noir

1:39 kovasb: lynaghk: yes, the compiler was breaking in the worst possible way

1:39 * Raynes goes and does stuff.

1:40 kovasb: lynaghk: apparently was choking on innocuous stuff in some file

1:41 amalloy: ibdknox: there's a middleware that serves static files for git-version 1.2.3 (for example) as foo__123.js instead of as foo.js, and then sends the client a "cache this for as long as you want" header

1:41 lynaghk: kovasb: what was it? If you ran into it, we probably have some lil' time bombs waiting around too.

1:41 ibdknox: amalloy: oh neat

1:41 amalloy: that is also very useful stuff

1:41 amalloy: but it requires some cooperation from your hiccup or whatever, the way it's currently written. which is why i hesitate to suggest adding to noir

1:42 antares_: hey Raynes

1:42 kovasb: lynaghk: my way of instantiating high charts was the culprit, was a hack due to some other limitation

1:42 Raynes: antares_: Sup?

1:42 antares_: I saw your beta.

1:42 Cool stuff.

1:42 I'll add it tomorrow.

1:42 amalloy: perhaps you could take a look and suggest improvement? https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/version_utils.clj#L8 and https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/ring.clj#L37

1:43 kovasb: lynaghk: i don't know what exactly about the syntax it was

1:43 antares_: Raynes: you can just add me to the refheap repo instead, I will break things for you

1:43 Raynes: Haha

1:43 Sec

1:43 kovasb: lynaghk: I'm not understanding what a " atoms that are derefed in the watchers" is

1:44 you mean the downstream guys?

1:44 Raynes: antares_: Added.

1:44 Break away

1:44 How can I now add the Monger maintainer to my Monger app?

1:44 ;p

1:46 lynaghk: kovasb: I wasn't distinguishing between atoms derefenced "on purpose" and those "by accident". E.g., imagine an atom A with a watcher that dereferences and prints atom B whenever A changes.

1:46 kovasb: i see

1:47 and what happens when b is derefed?

1:47 something bad?

1:47 antares_: Raynes: migrate to monger, get the maintainer for free

1:47 sort of

1:47 lynaghk: kovasb: potentially, yeah. I got some infinite loops out of it.

1:48 kovasb: its registering globally so you can have the dependency list?

1:48 lynaghk: kovasb: It's all a bit muddied in my head, still, which means I need to sit back and think more about this stuff. Especially that I can't reproduce the problem in a minimal example makes me think I'm seriously missing something.

1:48 kovasb: lynaghk: i was having the same problem today for about 3 hours

1:48 lynaghk: then i rebooted the browser, and it worked

1:49 lynaghk: kovasb: yeah. Monkey-patching the Atom type is the only way I could think of picking up atom derefs automatically

1:49 kovasb: since @ is an unchangable reader macro that expands into cljs.core.deref, so I can't do a namespace-specific protocol thing.

1:49 kovasb: lynaghk: is the fact that B is making a side-effect irrelevant?

1:49 to the example

1:50 right

1:50 you pretty much have to roll your own atom to do this

1:51 Raynes: antares_: It's nice for me just because I can ask you for help.

1:51 lynaghk: kovasb: I'm not sure if that would fix this particular problem.

1:51 Raynes: The work you're doing is a huge plus.

1:52 kovasb: lynaghk: yeah, if you can simplify the issue then you can look at what knockout did

1:52 simcop2387: are there any recommended tutorials/guides online for learning clojure? I'd love something that walks through starting a project and putting all the pieces together to making something more complex than "hello world"

1:52 lynaghk: kovasb: how do you mean?

1:52 kovasb: it would seem semantically correct for B to be a dependency

1:53 lynaghk: you are doing the same strategy as knockout?

1:53 lynaghk: kovasb: yeah, that's where I got the idea of implicitly registering in the first place.

1:54 kovasb: that project has really nice design-level documentation explaining how/why the internals work.

1:54 kovasb: lynaghk: if infinite loops are the problem, i imagine it had those too

1:54 lynaghk: until they figured out how to fix it

1:54 lynaghk: kovasb: that's the thing, I can't replicate in a minimal example so I'm wondering if it's some weird namespace issue or some such.

1:55 kovasb: lynaghk: but it is repeatible?

1:55 lynaghk: kovasb: I'll give it another crack tomorrow, because I although I wrote some code and no longer have this problem it's a bit unsatisfying to leave this open.

1:55 kovasb: yeah for sure

1:55 lynaghk: kovasb: between cleaning out lein cljsbuild caches and stuff? Yeah.

1:56 kovasb: lynaghk: js/alert ftw

1:56 sophisticated tools for sophisticated languages

1:56 lynaghk: I think I just need to suck it up and put metadata on all of these atoms so I can actually piece together the dependency graph

1:57 kovasb: lynaghk: that could be useful

1:57 lynaghk: instead of printing out 20-levels deep implementation details of cljs.

1:57 kovasb: lynaghk: also, I'm personally breaking down and resolving to learn to use the analyzer

1:57 lynaghk: get get to the bottom of what's going on

1:57 lynaghk: kovasb: I'll break down and buy you a bottle of scotch next time I run into serious shit then =P

1:57 kovasb: lol

1:58 it will be a function in session

1:58 so it can be easily repeatible

1:58 analyze this

1:59 adu: I read a book on clojure today

1:59 kovasb: give some nicely tooltiped/hilighted source representation

1:59 adu: I think it was called "The joy of Clojure"

1:59 kovasb: adu: you read the whole thing in one day??

1:59 lazybot: kovasb: Uh, no. Why would you even ask?

1:59 adu: I had a lot of fun reading it :)

2:00 kovasb: glad it delivers on its title

2:00 adu: kovasb: I spent the day at a book store because I have no electricity

2:00 kovasb: cool

2:00 adu: but now I'm running a generator for my milk, meat, lettuce, and cheese, so I plugged my laptop and router into the fridge

2:01 kovasb: lol

2:01 i see you like simplicity then

2:01 * adu <3 internet

2:01 adu: yes, as long as I have cheese and internet I am a happy man

2:03 so I've been slowly realizing that clojure is everything I could ever want

2:03 I've been building a webserver in it

2:03 kovasb: its like a combination of cheese and internet

2:04 adu: yesssss

2:04 my webserver is currently using noir+cheshire+clostache

2:04 and I'm realizing that clostache and noir don't work well together

2:05 you have to use {{{x}}} to substitude html in mustache, and then it works

2:05 kovasb: I'm a fan of hiccup myself

2:05 adu: I really want to separate my content from the logic

2:05 kovasb: hiccup is content

2:05 adu: and mustache has a zillion implementations

2:06 kovasb: i see

2:06 adu: so if I wanted to port my site to intercal, I could

2:06 kovasb: right

2:06 adu: but I probably won't

2:06 kovasb: you should be able to take from noir what you want, and use moustache

2:06 adu: the prototype for the site was in django, but I'm starting to hate django

2:06 kovasb: yes, once you've realized clojure is all you can ever need

2:06 adu: and I'm starting to love clojure

2:06 kovasb: why not just go native

2:07 adu: so you're saying I should write my templates in huccup, not clostache?

2:07 kovasb: my position is

2:07 i think templating languages are like child-programming

2:08 i really don't like non-universal sublangauges

2:08 adu: what I don't like about template languages is that they're one-way

2:08 kovasb: clojure can represent everything you need

2:09 yeah, theres that problem. but its just a consequence of it not being a real programming construct

2:09 adu: I've also been looking into Perl6, and they've made a language that makes parser easy to write, and there are people working on inverse parsers, i.e. templates

2:09 kovasb: its a interesting field, lots of efforts at interesting stuff

2:10 adu: imagine, parser = G.parse(), template = G.inverse()

2:11 the possibilities

2:11 my at-work efforts are all about webde

2:11 v

2:11 my at-home efforts are all about my function database

2:12 I truely believe in it

2:12 that it could become a compiler-compiler-compiler

2:12 my friends tell me that's too "meta"

2:12 I don't case

2:12 s/case/care/

2:18 antares_: Raynes: how can I delete a paste in refheap?

2:20 amalloy: Raynes: i think i hate browserid. refheap asks me for an email address, and then after i sign up it wants a username. can't use amalloy, though, because i used that last time i signed up with whatever different email address. and afaik i can't sign in using a username, so i can't figure out what email address i used?

2:31 wingy: what does the #' mean in: run-jetty #'app {:port 8080 :join? false})

2:33 adu: wingy: I don't know

2:34 wingy: in Common Lisp it means something, I don't know about Clojure

2:34 napping: #'app returns the Var that app refers to in the namespace, rather than looking up the value of app

2:34 that means if you redefine app, run-jetty can see the new value through the var

2:37 wingy: napping: i see thx

2:37 napping: since everything is immutable right?

2:37 if we passed the app value instead it would still keep the old one even if we changed the var

2:40 napping: Yeah, if it's not picking up changes, forgetting that could be why. seems like run-jetty could be a macro to avoid that

2:42 Raynes: antares_: You can only delete pastes when you're signed in and created the paste while signed in. You click the 'delete' button in the upper left of the paste.

2:42 antares_: Raynes: I figured why I cannot sign in

2:42 I actually can

2:43 but then something fails to authenticate as an SSL peer

2:43 and fails

2:43 Raynes: amalloy: mmarczyk had a similar problem, his username had somehow become null.

2:43 amalloy: i'm probably just using a different email address

2:44 antares_: Raynes: also, when I hit Command on any page, Refheap asks me to go to line…, it is super annoying because I can't easily navigate away from Safari

2:44 to a different window

2:44 Raynes: antares_: That doesn't happen to me.

2:44 amalloy: Oh, wait, you're complaining about something different.

2:45 amalloy: You shouldn't sign up with an email address you can't remember.

2:45 antares_: I'll try it in safari.

2:45 amalloy: well i'd rather not sign up at all. i was just trying to sign in to confirm for antares_ that there's a delete option

2:46 Raynes: amalloy: Anyways, I can change your account email for you if you want.

2:46 amalloy: meh. if i desperately need to sign in, i'll just find a way to hack your heroku account

2:47 antares_: ah, wait

2:47 amalloy: probably by starting some kind of heroku-api project and convincing you to commit your password

2:47 Raynes: antares_: Yeah, I can't reproduce in any browser. mmarczyk had some issues like this though. Problem is, the js that handles the hotkeys is pretty complex and written by a guy who seems to have disappeared off the face of the planet.

2:47 antares_: I think browserid redirects to an HTTPS page

2:47 Raynes: antares_: If you know js and want to take a look, feel free to punch it in the face and fix that issue.

2:48 *shrug*

2:48 antares_: Raynes: ok, I will take a look, I am trying to sign in somehow first

2:49 Raynes: antares_: I can't reproduce that either. I can sign in in any browser just fine. :|

2:49 Or do you mean locally?

2:49 antares_: locally

2:49 Raynes: In safari?

2:49 antares_: in any browser

2:49 Raynes: Going to try.

2:50 antares_: Also, that private yes no toggle button is off in safari. That js guy who disappeared did that too and was supposed to fix it. :\

2:50 Looks fine in every other browser.

2:50 I need to look at it/get a css guy to look at it.

2:50 Not necessarily you, just pointing it out in case it looks weird for you.

2:51 * Raynes hasn't cared because he doesn't use Safari and it is functional regardless.

2:51 * Raynes is moderately selfish.

2:52 Raynes: antares_: Btw, does Monger have a special function for updating records?

2:52 antares_: updating records?

2:53 it has everything that mongo shell has

2:53 like monger.collection/save coll document

2:53 if that document has :_id, it will be saved

2:53 updated

2:53 if not, inserted

2:53 Raynes: Then that's probably what I'm talking about. congomongo has an update function that updates a document.

2:54 Anyways, does it return a write result?

2:54 antares_: yes, but we can add save-and-return

2:54 but so far I have only seen you use regular updates

2:54 Raynes: Regular updates was what I was talking about.

2:55 antares_: I found out what fails

2:55 Raynes: Sorry, I don't understand mongo that well. I'm probably sounding like a lunatic.

2:55 antares_: http/post to "https://browserid.org/verify"

2:55 Raynes: So, refheap isn't working at all for me.

2:56 https://www.refheap.com/paste/3397

2:56 That's what I get when I try to go to /

2:56 antares_: ok, things work better on oraclejdk 7 which has a differnt set of SSL certificates

2:56 yes, I am now seeing the same

2:57 I think collection is passed as a keyword somewhere

2:57 monger uses strings


2:57 :p

2:57 antares_: but I am also redirected to /paste from the root

2:57 Raynes: I've got to take off. Do you need anything before I run?

2:58 antares_: yeah, it's in the session store

2:58 no, I think I am all set

2:58 Raynes: Cool. I'll mess with all of this stuff tomorrow. I'm going to hack until my fingers bleed tomorrow.

2:58 Laters

2:58 antares_: Raynes: wait, one question

2:59 Raynes: Sup

2:59 antares_: Raynes: do you know what may be passing keywords instead of strings to the session store?

2:59 I will probably just support keywords as collection names in monger but it is not immediate from the trace

3:00 Raynes: Good question.

3:00 antares_: (monger-store :sessions)

3:00 antares_: *immediately obvious

3:00 Raynes: server.clj, last line.

3:00 antares_: ahh, yeah

3:00 ok, thanks

3:00 Raynes: :)

3:01 wingy: is there a good way to look inside the deps my project is using

3:01 to see what namespaces and functions i can use

3:02 and their source code .. at the moment they are all .jar:s in .m2/ folder

3:02 amalloy: open up the jars in emacs

3:02 antares_: tab completion in the REPL, it is also not hard to write a function that will list all namespaces under the given one

3:02 listing functions is also not hard but some namespaces have quite a few

3:02 wingy: damn not using emacs

3:03 antares_: wingy: no need to opening jars in emacs, that's too hardcore

3:03 *open

3:03 wingy: i forgot i could look at their github repos

3:06 amalloy: antares_: what's hardcore about it? using emacs? reading the source?

3:07 antares_: amalloy: asking newbies to do both

3:07 adu: github++

3:07 antares_: reading the source is very important but is also not an option early on

3:07 and if you need to do it, like adu says, it is easier to browse the repo on github

3:08 adu: wingy: I've been trying to keep up with your questions

3:08 amalloy: reading the source is going to be easier than writing a function to list namespaces/functions

3:11 wingy: adu: i ask a lot dont i :)

3:12 adu: asking questions is good

3:12 * adu <3 questions

3:17 wingy: "lein repl" starts my server immediately which makes me unable to use the repl

3:18 antares_: wingy: lein repl compiles your code

3:18 wingy: what should i do to regain the repl

3:18 antares_: this means that you are starting your server in the top-level ns code

3:18 which is wrong

3:18 start it in -main

3:19 wingy: i do

3:19 in my project.clj there is : :main yobistore.core

3:19 antares_: anything that blocks cannot be used in the ns code

3:19 otherwise lein or anything else that compiles that namespace will be blocked

3:19 wingy: it may be one of the dependencies, too

3:20 wingy: (def -main

3:20 antares_: quartzite once had this problem when it started the scheduler in the top level code

3:20 wingy: (run-jetty #'app {:port 8080 :join? false}))

3:20 i run it in the -main .. so the repl must behave like "lein run" it runs the -main immediately thus blocking the repl?

3:21 ok ill look into it

3:21 i should follow a guide

3:24 antares_: wingy: lein repl does not invoke -main

3:24 I am in the refheap's repl right now, for example

3:25 but both of them compile your code

3:25 so if there is anything in the namespace body and not functions, it will be executed after compilation

3:26 amalloy: wingy: (defn -main [& args] ...), not (def -main ...)

3:28 wingy: wii

3:28 amalloy: :D

3:28 that was the problem

3:30 ns-publics is quite good for listing everything

3:31 but github was better .. no ns-publics, then doc, then source etc

3:39 coming from node.js its pretty simple to get middleware and stuff

3:39 lein is like npm with superpower

3:49 amalloy: isn't npm just the package manager? that's only one of lein's tasks, and it delegates to maven/aether to do most of it

3:56 antares_: wingy: most of that comes from sitting on top of a very large mature ecosystem that solved many problems many years ago

3:57 wingy: amalloy: yeah .. lein is package manager + build system?

3:58 amalloy: mostly it's a build system

3:58 wingy: cool

3:58 antares_: yeah i start to like using java now and looking at their std lib

4:00 antares_: wingy: there are very poorly done parts in the JDK, too, but when it comes to various plumbing parts like security, sync and async I/O and especially concurrency, JDK is probably the most solid thing out there (that is open source)

4:01 wingy: for example, dates in the JDK are only good if you want to get current date (instantiate java.util.Date). For anything else, use clj-time which uses a 3rd party date library (Joda Time) internally.

4:01 so you can do things like (-> 2 months ago)

4:02 wingy: wow

4:03 amalloy: dates aren't even that good for the current date :P

4:03 antares_: amalloy: I agree :)

4:03 wingy: i start to like jvm .. except the boot time

4:04 "the power of the sun in the palm of my hand"

4:05 clj/jvm that is

4:08 do you prefer enlive's or hiccup's way of doing templating?

4:09 feels that hiccup conform with clj very naturally since it's a DSL and enlive is cleaningly separating template from code

4:10 you have your .html files and then code that manipulates it

4:10 antares_: I use stencil (a Mustache implementation)

4:11 hiccup is fine but frontend developers probably won't like it

4:11 mustache typically raises no issues, in fact, some really likei t

4:12 wingy: antares_: what about enlive?

4:12 wouldn't frontend devs like it

4:12 antares_: I haven't tried it

4:12 possibly, stencil works well for me and I am happy with it :)

4:16 wingy: seems not very up to date

4:16 8 months ago

4:16 7

4:17 clojure 1.3

4:17 ibdknox: stencil is solid

4:17 it hasn't needed updating

4:18 since the mustache spec doesn't change much :)

4:23 antares_: wingy: stencil is very solid

4:24 wingy: another thing about Clojure and JVM is that if something isn't updated for 7 months, it does not mean it is abandoned

4:24 people just do not rush to add features. Clojure 1.3 does not matter, specify 1.4 for your project and it will work just fine

4:24 all http://clojurewerkz.org projects are on 1.3, even though most apps that I use them with are on 1.4

4:24 wingy: i like how light weight things are in clojure world

4:24 antares_: we test against 1.4 and 1.5-master-SNAPSHOT

4:25 but the default version will be 1.3 for probably at least 1.6 release

4:25 wingy: ok

4:25 antares_: why? because some folks use 1.3

4:31 amalloy: ibdknox: dsantiago was complaining about proposed changes to the mustache spec this morning

4:31 which tbh look pretty horrible

4:35 dsantiago: amalloy: Like I (and Chris) said, the spec doesn't change much ,despite all the discussion.

4:58 otfrom: seancorfield: are you around?

5:02 wingy: for those of you that are using clojure with heroku, what server is heroku using to serve the clojure app?

5:02 or is it using whatever server (tomcat, jetty, netty) you are using yourself?

5:03 antares_: wingy: with Heroku it is typically Jetty because it is embedded

5:03 but I don't think Heroku provides you a container like tomcat

5:03 wingy: antares_: is netty embedded as well?

5:04 is jetty good for production?

5:04 antares_: and netty is typically used as an I/O library, I don't think many projects use its HTTP server as is

5:04 wingy: Jetty is at 8.0 or so

5:05 wingy: antares_: i mean is it fast/reliable enough for many concurrent conncetions in production mode?

5:05 antares_: and is one of the fastest Web servers on the JVM, mostly because it is very small compared to Tomcat, JBoss AS and so on

5:05 wingy: Yammer's production services run Jetty

5:06 wingy: and they have gazillions users and $MSFT bought them out for 1.1 billion

5:06 wingy: good enough for you?

5:06 wingy: wow

5:06 hm

5:06 yeah it'll do

5:07 antares_: in general, just about anything should yield several thousands requests per second on hello world-ish apps

5:07 people choose jetty because it is really easy to just embed and never worry about it

5:08 wingy: yeah

5:08 ill just use that then

5:08 and see where it gets me

5:08 in my ears embedded sounded weaker than stand alones

5:08 otfrom: heroku have nginx -> jetty, so the jetty isn't directly exposed to the internet

5:09 which is also something you need to be aware of if doing SSL

5:09 as the SSL is between nginx and the world, but the nginx -> jetty is normal http

5:10 antares_: wingy: how? node.js' hyped HTTP server is embedded

5:10 wingy: embedded just means "used as a library". Of course frontend Heroku is Nginx

5:12 wingy: antares_: i c

5:12 using things as a library is awesome

5:13 hate having to start things separately

5:13 or bind things through the shell

5:13 instead of in code

5:18 noidi: is there an equivalent of interface inheritance for protocols?

5:19 I'd like to state that my Connections (protocol) are java.io.Closeable

5:20 antares_: noidi: no, any protocol can be implemented for any type, there is no hierarchy

5:33 Finally got to documenting Monger's core.cache and Ring session stores, including a Noir integration example: http://clojuremongodb.info/articles/integration.html

5:46 wink: so it seems my one running clojure instance didn't choke on the leap second \o/

7:10 wingy: do you feel i should use noir or compojure and hiccup directly in my ring app?

7:12 noidi: how can I call a protected method of a Java class? there seems to have been clojure.contrib.reflect/call-method. any idea if something like that is available on 1.4?

7:16 wingy: think i will go with noir

7:16 keep boilerplate code out of my app

7:26 is it ok to specify plugins in project.clj?

7:29 aperiodic: yes

7:30 only if it's really needed to do some sort of build/test/run thing, though

7:31 if it's just for development convenience (e.g. lein swank) then stick it in ~/.lein/profiles.clj

7:35 wingy: i would rather want everything in project.clj

7:39 hyPiRion: wingy: Problem with that is that you enforce dependencies which aren't needed to run the project.

8:03 wingy: i got FileNotFoundException Could not locate _main__init.class or _main.clj on classpath: clojure.lang.RT.load (RT.java:432)

8:03 when running lein repl

8:03 anyone knows what that means?

8:05 nvm

8:05 something wrong in project.clj that i fixed

8:05 by CTRL-Z

8:09 this is weird

8:13 michaelr525: (GET "/place/:id" {{place-id "id"} :params headers :headers}

8:13 does it look like a valid compojure route ^^^^^^^^^^ ?

8:14 weavejester: michaelr525: The compojure.handler/site function includes wrap-keyword-params, so if you're using that, it should be {place-id :id}

8:15 michaelr525: You could also write it as [id :as {headers :headers}]

8:16 michaelr525: Although more commonly, headers are handled by middleware.

8:17 michaelr525: thanks!

8:17 hope it will work, i think the compojure version used here is old

8:18 weavejester: michaelr525: You might want to upgrade then. Compojure hasn't changed that much, aside from bug fixes.

8:20 michaelr525: i always like to use the latest version of everything but right now I want to make this project work first. I'm using clj-facebook-graph and it's not updated. so in the mean time i'm just holding my fingers and hope that everything will work until the project is finished and then i'll upgrade everything..

8:21 weavejester: the keyword syntax worked :)

8:22 maybe the docs should be updated too, since they use the string convention..

8:22 weavejester: michaelr525: Well, it depends on whether you've wrapped your routes in wrap-keyword-params or not.

8:22 michaelr525: ok, got it

8:44 jayunit100__: whats the advantage of having a separate file for each test file ? it seems like just more… files to maintain.

8:45 _ulises: jayunit100__: surely you wouldn't want a single file with all your tests either?

8:46 zaamkablam: Well, if you keep all your test in a single file, even in a mid-scale project you will soon end up with a 3-6 kloc behemoth.

8:47 jayunit100__: no… i mean, each ns file could come with the tests in it.

8:47 so if I have 5 files in a project, then each file would have (i.e. at the bottom) several deftest entries.

8:48 _ulises: jayunit100__: wouldn't that include your tests in your software when you deploy/release it?

8:48 jayunit100__: yeah i don't think thats the worst thing.

8:48 i mean, clojure is pretty compact.

8:49 but point taken nonetheless :)

8:50 _ulises: jayunit100__: sorry, I'm just trying to ask all the questions I can think of for why you'd want separate files for your tests, and one per ns/piece of functionality, etc.

9:00 jayunit100__: speaking of tests.....

9:00 leon test outputs are difficult to read. any better test debugger tools for clj ?

9:00 s/leon/lein

9:02 _ulises: jayunit100__: I've recently started using midje and I find it wonderful

9:02 jayunit100__: you also have the difftest lein plugin which tries to do a diff of the expected and actual values

9:06 jayunit100__: do u use midge in lein ?

9:07 _ulises: jayunit100__: yup

9:10 jayunit100__: ok cool maybe ill try it :)

9:15 _ulises: jayunit100__: there's a lein-midje plugin too :)

9:15 jayunit100__: yup i assumed so :)

9:24 Drakeson: I noticed there are various projects with C, LLVM, etc. as the backend beside Clojurescript. Is there one with Haskell as the backend?

9:37 zaamkablam: Hey, anybody familiar with clojure.contrib.graph?

9:39 Seriously, newb question here. Cheap karma, yo.

9:42 wingy: michaelr525: are you using clojure without noir?

9:45 Scriptor: zamaterian: go ahead and ask, someone might still be able to answer

9:46 zaamkablam: Is there a graph object? I mean, on clojuredocs.org I can see all the functions to work with graphs, but no mention, how a graph is actually made.

9:47 madsy: zaamkablam: There should be a git repo with sample code for those libraries

9:47 zaamkablam: Yeah, I'm looking for it now.

9:47 Thanks. :)

9:48 madsy: After all, a lot of stuff in the main namespace are APIs that once was in contrib

9:48 were*

9:49 I still miss some platform-independent OpenGL bindings :/

9:49 Using Swing for graphics is horrible

9:50 zaamkablam: ... or using Swing at all? :)

9:53 So, yeah, turns out graphs are just structs with :neighbors and :nodes

10:09 ab3: hi

10:10 I installed clojure on osx with brew, i can eval cmds but when I press the up key I get this "^[[A" characters.

10:10 any idea whats up with that

10:14 zaamkablam: Simple answer: no

10:14 I have that as well.

10:14 zomg: As do I

10:14 zaamkablam: But, I suggest you get Leiningen. It's REPL is much more comfortable.

10:14 zomg: Fine on Ubuntu though

10:16 zaamkablam: You'd go like 'Computer-machine! Gimme `lein repl`, yo!' and it will be awesome.

10:17 ab3: well that is annoying, is this leiningen normal clojure?

10:18 sirsublime: Yes, it's basically a lightweight build and development tool.

10:18 For Clojure that is.

10:19 kippy1: for Java interop, are there any performance gains to be had via :gen-class as opposed to loading the script via RT and then invoking the functions?

10:19 ab3: I'll try it out

10:20 sirsublime: Personally, I find it a delight to work with and all the cool kids are using it. So if you are going to mess around some OS projects, chances are that you will need to get it either way.

10:35 kippy1: Guys, for Java interop, are there any performance gains to be had via :gen-class as opposed to loading the script via RT and then invoking the functions?

11:21 cshell: Is it bad that I had a nightmare last night where someone stole my nick?

11:22 kmicu: yes

11:22 borkdude: cshell I am wondering about this too sometimes, what if someone else starts using mine

11:22 cshell: that's what I thought

11:22 you can register your nick with nickserv

11:22 that's what I did

11:22 borkdude: that's on IRC only

11:22 cshell: but in the dream someone got it

11:23 ah

11:24 cshell is what i use on irc - elsewhere its 64BitChris but irc doesn't like that nick

11:31 rlb: Any idea why (Thread/sleep 1000) might be pegging the cpu(s) suddenly (used to work fine).

11:32 ...perhaps a java problem -- happens in 1.2, 1.3, and 1.4 now.

11:32 pdk: hey, i asked about this last night though i'm still trying to see if there's a compiler bug going on here: http://pastebin.com/QpbN17Hx

11:32 fails to compile with a null pointer exception on line 17 for me on 1.3/1.4

11:32 when loading source from repl

11:37 rlb: pdk: here, repl doesn't matter even clojure -e '(Thread/sleep 1000)' pegs the cpu(s).

11:38 pdk: oh sorry i was asking about an unrelated issue actually

11:38 rlb: in my case, since it suddenly happens in all three clojure versions, I sispect some java change (and I did recently update openjdk).

11:42 yeah, it's java...

11:42 (current debian unstable openjdk 7, fwiw)

11:42 cshell: rlb: is it openjdk or does it happen on the oracle jvm?

11:43 rlb: happens to openjdk 6 too -- makes me wonder if there might be something strange happening on this machine...

11:43 pdk: actually

11:43 when you say pegs the cpu can you clarify there

11:43 runs at 100% load i'm assuming?

11:44 lynaghk: ping: dnolen

11:44 rlb: just looking at top -- runs at ~150% CPU

11:45 (noticed because the fan winds up)

11:45 pdk: yes oracle jvm here is fine

11:54 dnolen: lynaghk: pong

11:54 lynaghk: dnolen: morning dude.

11:55 dnolen: I was wondering what the roadmap for a new core.match release is. I noticed the new defpred stuff in there when I submitted some patches yesterday

11:56 dnolen: lynaghk: probably not until cKanren gets wrapped up.

11:56 lynaghk: dnolen: If I understand correctly, that's a bit of a breaking change since now end users have to declare the fns they want to use in :when clauses.

11:56 dnolen: lynaghk: once that's solid I'm planning on spending some serious time on core.match.

11:56 lynaghk: you can use :guard for the old behavior.

11:57 lynaghk: but yes breaking change.

11:57 lynaghk: dnolen: okay, cool. Do you have a sense of how long the cKanren stuff will take? I.e., more than a month?

11:57 dnolen: I'd like to use core.match, so I'm wondering if we should just maintain an internal fork for some of our projects.

11:57 dnolen: lynaghk: ~month? <month? It's getting close.

11:58 lynaghk: dnolen: okay, sweet.

11:59 dnolen: lynaghk: I'm happy to apply your two CLJS patches and cut another alpha if that would help you out.

11:59 lynaghk: dnolen: that would be super rad, thanks!

12:00 dnolen: With the cKanren stuff on core.logic, is that a speed thing, or is it adding new features for maths to the engine?

12:01 dnolen: lynaghk: not speed at all. yes arithmetic becomes sensible.

12:01 lynaghk: but it also makes cKanren a generic extensible constraint solver.

12:01 lynaghk: i mean "makes core.logic"

12:02 lynaghk: dnolen: ah. So that would move core.logic into the same problem domain as Cassowary (though since the latter is specific to linear constraints, it might

12:02 be faster.

12:02 dnolen: lynaghk: yes it'll be a generic solver so I don't think it'll compete with specialized solvers. But I'm also curious to see how well it compares.

12:03 lynaghk: been adding cKanren functionality with an eye for perf.

12:04 lynaghk: dnolen: likewise. I still haven't really dug into the Cassowary stuff for any real projects. There's another fork with an eye on speed, and I'd be interested to see the relative perf and expresiveness.

12:05 rlb: The thread sleep problem is a kernel bug (thanks to nthykier on #debian-java): http://blog.windfluechter.net/content/blog/2012/07/01/1481-100-cpu-load-due-leap-second

12:05 resetting the date fixed it

12:05 lynaghk: dnolen: oh, by the way---I'm jealous that you might be running into Bostock in the hallways. NYT graphics are going to kill it next year. I might need to get a subscription just for the pictures.

12:06 dnolen: lynaghk: haha, yeah pretty cool. Not sure how much we'll see of him tho :) He'll stay in SF.

12:09 lynaghk: patches applied, alpha11 going out.

12:09 lynaghk: er alpha10 I mean.

12:09 lynaghk: dnolen: thanks a ton David!

12:11 dnolen: have you seen my C2-powered TodoMVC? I'd be interested to hear your thoughts (if any) on it; I'm thinking about submitting it upstream

12:11 dnolen: no idea what they would do with it, since it's not exactly JavaScript and definitely not MVC. Could be a good intro to folks for cljs though.

12:11 dnolen: lynaghk: link?

12:12 lynaghk: https://github.com/lynaghk/c2-demos/tree/master/todoMVC

12:12 dnolen: lynaghk: thanks, will check it out.

12:17 samrat: slimv users, how do i turn off autoclosing of parentheses in the REPL? it's preventing me from entering multi-line lists

12:22 hyPiRion: Hmm, people often complain that the result of conj is confusing. e.g. (conj [1 2] 3) vs (conj '(1 2) 3). What is the argument for having conj in this way?

12:23 I've read it before, but I'm unable to find it.

12:24 rlb: hyPiRion: roughly, I believe it's so that you can use conj without having to know the exact nature of the underlying collection, and it will do the most effcient thing.

12:25 i.e. if you're creating a function that will operate on a collection (and the resulting order isn't critical)

12:29 hyPiRion: ,(doc conj)

12:29 clojurebot: "([coll x] [coll x & xs]); conj[oin]. Returns a new collection with the xs 'added'. (conj nil item) returns (item). The 'addition' may happen at different 'places' depending on the concrete type."

12:31 pdk: hyPiRion

12:31 hyPiRion: ?

12:31 pdk: it always picks whichever end is going to have O(1) insertion for the type of collection given

12:35 hyPiRion: pdk: I know that, what I'm wondering about is why such a function was added into Clojure. It confuses a hell of a lot beginners.

12:38 treehug: hyPiRion: what function ?

12:39 hyPiRion: conj

12:43 rlb: hyPiRion: I'm not sure I understand what you're asking -- initially confusing or not, conj is a part of the collection abstraction. You need it for that abstraction to work.

12:46 hyPiRion: rlb: Of course. But is it because it's "impossible" to add an element in front of a vector, or "impossible" to add an element at the end of a list?

12:46 rlb: Say I ask you to write a function that *efficiently* adds the even numbered elements of a source collection to a destination collection. Without conj, you couldn't (at least not without inappropriate type testing).

12:46 _ulises: ,(doc cons)

12:46 clojurebot: "([x seq]); Returns a new seq where x is the first element and seq is the rest."

12:46 rlb: hyPiRion: and there are other functions that allow you to be more specific when it matters.

12:47 hyPiRion: btw, if you haven't seen it yet, you might find this useful - http://clojure.org/cheatsheet

12:48 hyPiRion: rlb: I'm using it everyday :)

12:49 It's not about not understanding the function itself, I'm just trying to understand why it was added. Is it because of performance reasons, or because of the abstraction reasons?

12:51 ab3: I can install leiningen with brew on osx

12:52 pdk: it behaves differently based on concrete type so it breaks sequence abstractions, pretty much just for performance in cases for doing things i

12:53 like using a structure as a stack

12:53 ab3: I get a 502 error: Error: Download failed: http://github.com/technomancy/leiningen/tarball/1.7.1

12:53 rlb: hyPiRion: both -- conj allows you to write something that doesn't need to know about what kind of coll you have, but needs to be efficient.

12:53 ab3: anyone knows there I can find a working formula

12:53 rlb: i.e. if I'm writing (defn foo [coll] ...) and I want to add an element to coll *efficiently*, I can just use conj.

12:54 If it's a vector it'll get added to the end. If it's a list, it'll get added to the beginning, since the costs of the operation vary based on the actual type.

12:56 hyPiRion: rlb: Okay, so it's for efficiency reasons then.

12:57 rlb: absolutely

13:05 aniero: whoa, lein-tarsier is *awesome*

13:05 sattvik: ^^

13:07 sattvik: aniero: Ah, thanks. Although i think it needs a couple updates to take advantage of new features in lein2.

13:07 aniero: which i'm not using yet, so hey :)

13:07 SO much easier than figuring out an "ng-server" shell command &c

13:07 and having a repl on the terminal with access to the same runtime state as my editor is <3

13:07 so: thanks!

13:16 locojay: hi i m have a string ext. and would like to replace like following (clojure.string/replace stringtoreplace #(str "\." ext "$") "html") but does not like it . any idea?

13:20 gfredericks: &(clojure.string/replace "foooooo" #(str "\." "bar" "$") "html")

13:20 lazybot: java.lang.RuntimeException: Unsupported escape character: \.

13:21 gfredericks: well that's one problem at least

13:21 what did you intend by "\."?

13:22 locojay: gfredereicks change for example "test.xls" to "test.html" where i have e variable ext with the value "xls"

13:23 gfredericks: &(doc clojure.string/replace)

13:23 lazybot: ⇒ "([s match replacement]); Replaces all instance of match with replacement in s. match/replacement can be: string / string char / char pattern / (string or function of match). See also replace-first."

13:23 locojay: doing (str/replace "test.xls" #("\.xls$") "html") will work

13:23 but not it i do the above since my ext might change

13:23 gfredericks: I highly doubt that

13:23 but I think I know what you're asking

13:24 you'll either have to create a regex yourself, which seems to be what you're trying to do, or test the ending substring

13:25 &(apropos "pattern")

13:25 lazybot: java.lang.RuntimeException: Unable to resolve symbol: apropos in this context

13:25 gfredericks: &(clojure.repl/apropos "pattern")

13:25 lazybot: ⇒ (re-pattern)

13:25 gfredericks: &(doc re-pattern)

13:25 lazybot: ⇒ "([s]); Returns an instance of java.util.regex.Pattern, for use, e.g. in re-matcher."

13:26 gfredericks: &(let [ext "xls"] (clojure.string/replace "test.xls" (re-pattern (str "\\." ext "$")) "html"))

13:26 lazybot: ⇒ "testhtml"

13:26 gfredericks: &(let [ext "xls"] (clojure.string/replace "test.xls" (re-pattern (str "\\." ext "$")) ".html"))

13:26 lazybot: ⇒ "test.html"

13:26 gfredericks: thar it is

13:26 locojay: thanks

14:14 SrPx: Am I the only one who thinks "+" is wrong? It should have an arity of 2. (reduce +) should be the same as the current +

14:14 ):

14:15 tomoj: how exactly? you don't mean ((reduce +) 1 2 3) == (+ 1 2 3) I guess?

14:15 AimHere: Clojure complains because you're feeding the wrong arity to reduce, not +

14:16 SrPx: tomoj: yes thats what I mean

14:16 AimHere: sigh reduce should have arity of 1 then

14:16 tomoj: ((reduce +) [1 2 3]) actually

14:17 AimHere: That sounds very inconsistent though

14:17 SrPx: sounds perfectly consistent for me : s

14:17 AimHere: Reduce takes a function as it's first argument, and spits out whatever the result of that first argument is

14:18 SrPx: this way you can generalize the concept of what the current + does to any other binary mathematical function ou invent...

14:18 AimHere: You're saying that if there's no arguments, reduce returns a function '+', and if there are arguments, it returns a number

14:18 SrPx: by ((reduce my-func) [1 2 3])

14:18 tomoj: maybe you mean (reduce my-func [1 2 3]) ?

14:19 oh, I see

14:19 SrPx: tomoj: no, because if reduce has an arity of 2

14:19 tomoj: (partial reduce my-func) ?

14:19 AimHere: Ah, shouldn't you just want to call this something other than reduce?

14:19 SrPx: tomoj: you cant do this: (send-action destination (reduce my-func))

14:20 tomoj: (send-action destination (partial reduce my-func))

14:20 SrPx: AimHere: fold maybe

14:20 tomoj: fold is already taken :P

14:20 SrPx: ):

14:20 AimHere: Also, there are questions of associativity here, aren't there? If your action isn't commutative, then you have two 'reduce' answers, depending on whether it's left- or right- associative

14:20 SrPx: tomoj: maybe a funny symbol

14:22 AimHere: hmm yes

14:23 (defn fl [func] (partial reduce func)) ... ((fl +) [1 2 3]) = 5 <- not sure if this is would work

14:23 wow

14:23 = 6*

14:23 tomoj: s/commutative/associative/ ?

14:23 SrPx: =p

14:23 anyways

14:23 is there a library for event dispatching and stuff on clojure?

14:23 tomoj: also for compatibility with clojure.core.reducers my-func should have a zero-arg identity

14:24 SrPx: wat

14:24 tomoj: I'm working on one at the moment

14:24 SrPx: tomoj: can I see it

14:24 tomoj: like (+) == 0 is the identity for additition

14:24 (my-func) should return the identity for your operation

14:25 SrPx: tomoj: oh there is this, but is this necessary? the starting value can just be (+ element-1 element-2)

14:25 tomoj: if you don't use clojure.core.reducers you don't need it of course

14:25 clojure.core.reducers/reduce uses (my-func) instead of element-1 as the starting value

14:25 SrPx: I know

14:26 just asking if this is necessary for the reduce behavior? or a particular choice?

14:26 I see it more natural if reduce can only receive a function w/ 2 arguments as it is always a "apply to consecutive neighbors" behavior

14:26 tomoj: not sure why they chose that. I suspect it is more general. maybe it is needed for fold?

14:27 SrPx: they do it in other languages too. idk

14:27 tomoj: you are working on event dispatch?

14:27 tomoj: yeah, nothing to show yet though

14:27 SrPx: Hm okay

14:27 guess I am too : s

14:28 as I can't find one and I absolutely need this to start any useful project

14:28 tomoj: you're using clojure on the jvm?

14:28 pdk: if the function has multiple arities then reduce will always pass it only 2 arguments on each call

14:28 tomoj: (or js)?

14:29 SrPx: I guess so? I'm just starting at this point I've not passed the 'download leiningen and play with its repl phase'

14:29 tomoj: oh jvm definitely not js

14:29 tomoj: have you looked at lamina?

14:29 SrPx: let me see

14:29 tomoj: https://github.com/ztellman/lamina/

14:30 maybe also relevant https://github.com/ztellman/aleph/

14:30 SrPx: tomoj: not sure what he is doing on lamina o.o

14:31 pdk: additionally i'm still looking at what i can only conclude might be a compiler bug

14:31 tomoj: I think lamina has some fundamental problems (otherwise I'd be trying to port it to js), but I still liked it quite a lot

14:31 pdk: with a function that fails to compile throwing a null pointer on the binding list of a doseq

14:31 tomoj: http://www.infoq.com/presentations/Event-Driven-Programming-in-Clojure

14:35 SrPx: (reading about aleph atm, seems interesting)

15:02 Is redefining default stuff disrecommended (forgot the eng. word) ?

15:06 amalloy: SrPx: discouraged. and yes, mildly: if you have a good reason go ahead

15:06 assuming that what you mean is defining a new function named, say, `get` in your namespace, for example to do a database get

15:07 if you actually mean overwriting clojure.core/get with a new function, then probably never

15:07 jweiss: i'm trying to see what's causing an NPE in my program, but as far as I can tell, the caught exception has an empty stack trace. (catch Exception e (into [] (.getStackTrace e))) returns []. i'm at a loss, anyone know what could cause that?

15:09 SrPx: amalloy: I'm trying to get some haskell flavor by enabling auto partial application and ease of composing, I'd have to redefine +, -, *, / to binary funcs and hack some of the functional functions (er..)

15:10 would this break clojure's core stuff?

15:10 amalloy: you can do that in your own namespace if you want, and excluse all the clojure.core functions

15:10 *exclude

15:10 but if you try to replace the clojure.core functions your runtime will explode and ninjas (probably me) will murder you

15:10 SrPx: exclude it?

15:10 lal

15:11 its not even possible is it?

15:11 to actually replace them

15:11 o.o

15:11 TimMc: You can certainly *shadow* the fns.

15:11 SrPx: except if you change the source I guess

15:11 but thats not what I meann

15:11 amalloy: you can replace them, and if you do then bad things will happen

15:11 so you shouldn't

15:12 TimMc: (:refer-clojure [:exclude (+ - / * ...)]) or something, then (defn + ...)

15:12 borkdude: also some functions are inlined so shadowing won't work always, right?

15:12 amalloy: borkdude: shadowing would always work; replacing wouldn't always

15:12 borkdude: right

15:13 amalloy: (one of the bad things i alluded to)

15:30 jg__: hi all, how should i interpret (def *now* (Date.)), i thought the dot should be the first element of the list for java interop

15:31 ?

15:37 borkdude: jg__ (Date.) is the same as new Date() in Java

15:38 jg__: borkdude: is the syntax documented somewhere? can't find it...

15:39 borkdude: http://clojure.org/java_interop, search for (Classname. args*)

15:39 jg__ I see now you can also write (new Date), didn't know that

15:39 ,(new Date)

15:39 clojurebot: #<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: Date, compiling:(NO_SOURCE_PATH:0)>

15:40 borkdude: ,(new java.util.Date)

15:40 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ExceptionInInitializerError>

15:40 borkdude: ,(java.util.Date.)

15:40 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class java.util.Currency>

15:40 borkdude: ,(java.lang.Date.)

15:40 clojurebot: #<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: java.lang.Date, compiling:(NO_SOURCE_PATH:0)>

15:40 borkdude: hmm

15:40 amalloy: &(java.util.Date.)

15:40 lazybot: ⇒ #inst "2012-07-01T19:40:00.608-00:00"

15:40 borkdude: &(new java.util.Date)

15:40 lazybot: ⇒ #inst "2012-07-01T19:40:16.202-00:00"

15:40 amalloy: hiredman: clojurebot seems broken again

15:41 SrPx: I have to work

15:41 but clojure is so more awesome : (

15:42 jg__: yeah, the (new ...) syntax is in the java interop docs, i'm just wondering where people get their info about this weird dot constructor notation...

15:42 borkdude: jg__ it's there also

15:43 jg__ I literaly posted the text

15:43 jg__ again: http://clojure.org/java_interop, search for (Classname. args*)

15:43 jg__: ohhh, that's true

15:43 damn, i must be tired

15:43 thanks!

15:43 borkdude: jg__ no problem, happens to me all the time ;)

15:59 wingy: hey guys

16:00 i wonder if it makes sense to use ring/compojure/hiccup directly without noir? the benefits i imagine 1. no middle guy since it seems to be stupid simple anyway with ring thus no need to first understand an abstraction and then the implementations 2. if i wanna change any stack in the future i can just switch without noir having to support it

16:01 the doc for the individual components seem to be pretty good

16:01 weavejester: I tend to prefer using Compojure directly

16:01 borkdude: wingy of course, the more knowledge the better

16:01 Raynes: wingy: Nothing wrong with using Compojure.

16:02 wingy: I'm a maintainer of Noir and using Compojure in some of my projects. Probably even going to move Refheap to Compojure.

16:02 borkdude: Raynes that's what I was curious about, but it was too short to tweet lik you said

16:02 Raynes what are the reasons to move?

16:03 wingy: Raynes: you dont like noir's abstraction over compojure and hiccup?

16:05 Raynes: borkdude: Noir is less flexible with middleware. Refheap doesn't have a very complex middleware scenario, but if it ever needed one, it'd be better to be using Compojure. Furthermore, with lib-noir around, the primary reason I was using Noir is now in lib-noir. My favorite things about noir are noir.session and noir.response and we can use those from any web framework now. Also, using lib-noir from a large site that isn't noir-based keeps me honest and

16:05 sure lib-noir works with Compojure and doesn't accidentally acquire noir-specific behavior.

16:06 borkdude: Raynes ok cool

16:06 Raynes: wingy: It really isn't that much abstraction. What Noir gives you is a contained web framework with nuts and bolts and everything you need to get a website up and running.

16:06 It is designed to help you get a website together that is organized well and keeps you from having to hunt for libraries.

16:07 borkdude: wingy Raynes right, abstraction over hiccup? it's just normal hiccup right?

16:07 Raynes: Abstraction over Compojure.

16:07 borkdude: ah.. don't you like (abstraction over compojure) and hiccup

16:08 it would make life so much easier if people started using parens in natural language ;)

16:08 Raynes: Basically, Noir has 'defpage' which creates Compojure routes and stores them in atoms, and when you start the server it puts your middleware and routes together into a handler and throws it at the server and bang, website.

16:08 ivaraasen: Noir is great

16:08 Raynes: With Compojure, you just create Compojure routes and compose them into a handler yourself. It's about 3 extra lines of code.

16:09 pipeline: noir and korma are what drove me to learn clojure

16:10 ivaraasen: pipeline: yeah, i'm learning Clojure right now due to Noir

16:10 Raynes: The abstraction is very simple and it makes it super easy for people to put together routes and create a website. That's what is wonderful about Noir.

16:11 borkdude: and the docs are nice to read

16:11 which is a big plus

16:11 Raynes: The only problem with the abstraction is that it takes away the raw flexibility of Compojure's routes because Noir handles the routes under the covers and there isn't a lot of magic you can do with them. Thing is, lots of people don't need that flexibility and don't care. Especially new people to Clojure. That's what makes Noir important.

16:16 borkdude: So, Noir's abstraction was never what was really important to me. It was the contained nature. The fact that Noir has everything you need and you don't have to hunt through a bunch of libraries that haven't been updated since the latest incompatible hiccup release, etc, for basic things like stateful sessions. (defroutes handler (GET "/" [] (html [:h1 "Welcome to my website!"]))) vs (defpage "/" [] (html [:h1 "Welcome to my website!"])) is the

16:16 difference -- 2 hours is the library hunting difference. ;)

16:17 A day of frustration is the difference for someone new to Clojure, which is why Noir is adored by new people (and that's wonderful, because it means Noir is doing what Chris wanted, getting people into Clojure for web dev).

16:17 hyPiRion: Raynes: Yeah, as long you find out that Clojure is in fact nice for web devel, you've got them hooked.

16:18 gfredericks: the route definitions get sprinkled around the various defpages?

16:18 borkdude: gfredericks yes

16:18 hyPiRion: They can learn the more "amazing" stuff later on.

16:18 gfredericks: man; that acutally makes me like rails for something

16:18 borkdude: gfredericks explain

16:18 (don't know rails)

16:18 Raynes: gfredericks: That's another reason I'm wary of it and some people plain don't like it.

16:19 gfredericks: borkdude: in rails all the routing goes in one file

16:19 cemerick: The community effect is great, but stateful sessions are evil (not surprisingly). </non-sequitur>

16:19 Raynes: It's mutable. defpage creates a route and stores it in an atom under the covers. Nothing but this links them together and there is no visible link in your code.

16:19 gfredericks: so when something's really fubared you can start there and follow the path of execution rather than not knowing where to start

16:19 borkdude: gfredericks you have that option of course with Noir: just put all the defpages in one file?

16:19 Raynes: You can just sprinkle defpages everywhere and they're automatically composed into the final routes in the end.

16:19 amalloy: cemerick: complex but easy

16:19 tomoj: I thought I was the only one who cared about that :)

16:20 gfredericks: borkdude: if you have a lot of them?

16:20 tomoj: relatedly it disturbs me that cljs-template sets up noir

16:20 borkdude: gfredericks you only need a couple of defpages, the rest is done through clojurescript :P

16:20 tomoj: maybe will create just-cljs-template...

16:20 gfredericks: borkdude: defpage complects the route with the response

16:20 cemerick: gfredericks: thanks for the pointer, BTW

16:20 gfredericks: cemerick: no probalo

16:20 (inc lazybot)

16:20 lazybot: ⇒ 7

16:20 Raynes: cemerick: Man, we've been over that.

16:20 cemerick: Get off my lawn.

16:21 gnarmis: Related question: what if I need a prefix url? A little new to noir

16:21 Raynes: You can take away my defpage, but you can't take away my noir.session.

16:21 cemerick: Raynes: I thought the lawn statement was supposed to go in the other direction on this topic?

16:21 Raynes: gnarmis: Prefix url?

16:21 hyPiRion: prefix url? Like, absolute url?

16:21 gnarmis: so sort of like "/api/foo", "/api/bar"

16:21 Raynes: cemerick: Get *on* my lawn.

16:21 gnarmis: Oh, like Compojure's context macro.

16:22 Yeah, I'm not sure you can easily do that in Noir.

16:22 cemerick: Raynes: Go mock out a ring request that depends on a particular mutable-in-place session state. Oh, right, that sucks.

16:22 Raynes: Might have to post on the mailing list and see if anyone else has done anything.

16:22 gnarmis: raynes: not familiar with that in compojure. hmm

16:22 hyPiRion: You could shadow defpage.

16:22 gnarmis: ah ok, for sure

16:22 Raynes: cemerick: muhoo implemented that behavior in noir.session specifically so it would work with Friend.

16:23 * cemerick isn't saying it *can't* work, just that it doesn't have to be so hard :-)

16:23 borkdude: gfredericks I don't see how you mean the complecting thing: compojure also combines routes and their responses?

16:23 Raynes: Actually, you might have just said something entirely different than I thought you did.

16:23 * Raynes wipes his eyes and reads ago.

16:23 gfredericks: borkdude: I was comparing it to rails

16:23 Raynes: again*

16:23 cemerick: In other news, can we all please talk about something important, like making O(1) for argument types that support it?

16:23 bah

16:23 s/making/making second

16:24 hyPiRion: cemerick: You're talking about the last argument?

16:24 gfredericks: second is not O(1)?

16:24 for which types?

16:24 cemerick: it's O(2) for seqs!!!!1!1!

16:24 gfredericks: O(2) is O(1)

16:24 alindeman: Hehe

16:24 borkdude: cemerick take it easy, it's sunday and you're drinking a margarita ;-)

16:24 cemerick: gfredericks: dude, you're harshing my snark

16:25 Sorry, I was late to the "last" thread.

16:25 Raynes: cemerick: Anyways, if you hate mutable sessions, I'd hate to make you use noir defpage for a day.

16:25 hyPiRion: Actually, it's O(1) for seqs, but O(log n) for anything else, right?

16:25 gfredericks: hyPiRion: wat

16:25 hyPiRion: or wait, it's probably O(log n) seqs as well.

16:25 cemerick: Raynes: I'm afraid I've never used noir

16:25 gfredericks: oh I supposed for vectors that might have to be true

16:25 borkdude: I'm off, bye

16:26 hyPiRion: gfredericks: Well, if we like to be very picky about the runtime ;)

16:26 gfredericks: assymptotics isn't too useful at this point

16:26 let's just say "Can we make second faster?"

16:26 s/faster/smarter and thereby faster/

16:27 hyPiRion: We can if you can create a sufficiently smart compiler.

16:27 tomoj: clojure needs it's own asymptotics notation where O*(1) == O(log n)...

16:27 gfredericks: O(1) \subset O(log n)

16:27 cemerick: "sufficiently smart compiler" is the godwin's rule of PL discussion

16:28 alindeman: lol

16:28 gfredericks: tomoj: we could switch to #{:slow :medium :fast}

16:28 tomoj: :D

16:28 gfredericks: let's start now. Vectors are fast

16:28 alindeman: Can we just unroll all the loops?

16:28 gfredericks: is reversing a seq medium or slow?

16:29 tomoj: depends on the problem :(

16:29 hyPiRion: gfredericks: It's constant time.

16:29 *vector, sorry

16:29 tomoj: #{:slow :fast-enough}

16:29 gfredericks: hyPiRion: reversing a vector is constant?

16:30 hyPiRion: gfredericks: yep, as far as I remember.

16:30 gfredericks: hyPiRion: perhaps a read-only version; but not a conjable version

16:31 hyPiRion: If you sprinkle some magic on, it's possible.

16:31 gfredericks: hyPiRion: I'll bet you forty things of value

16:32 ivaraasen: hyPiRion: how fast are we talking? O(MG)?

16:32 cemerick: hyPiRion: `reverse` is always linear. rseq can be constant-time.

16:33 gfredericks: &(doc rseq)

16:33 lazybot: ⇒ "([rev]); Returns, in constant time, a seq of the items in rev (which can be a vector or sorted-map), in reverse order. If rev is empty returns nil"

16:33 hyPiRion: cemerick: rseq it is, then.

16:33 amalloy: second is O(∞) for (lazy-seq (recur))

16:33 gfredericks: hyPiRion: like I said; read-only, not conjable :P

16:33 amalloy: we should improve that

16:33 cemerick: thus, &(rseq '(1 2 3))

16:33 gfredericks: &(rseq '(1 2 3))

16:33 lazybot: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Reversible

16:33 hyPiRion: &(rseq [1 2 3])

16:33 lazybot: ⇒ (3 2 1)

16:33 cemerick: isn't & lazybot's inline eval char?

16:34 gfredericks: cemerick: ##

16:34 amalloy: cemerick: ##'(this is)

16:34 hyPiRion: It's ##nil

16:34 lazybot: ⇒ (this is)

16:34 cemerick: oh jeez

16:34 gfredericks: cemerick: ask again nobody heard you

16:34 * cemerick can't keep up

16:35 gfredericks: surely you had to know this for the lazybot chapter of your book

16:36 cemerick: "comprehensive" has many interpretations

16:36 hyPiRion: "comprehensive" is relative.

16:37 gfredericks: ,(comp :re :hensive)

16:37 clojurebot: #<core$comp$fn__2453 clojure.core$comp$fn__2453@3129730f>

16:37 cemerick: gfredericks: also, don't blow my cover. Most people around here think (rightly) that I'm a regular shmoe. :-)

16:38 hyPiRion: ,((comp :re :hensive) {:re :ea :hensive :sy})

16:38 clojurebot: nil

16:38 hyPiRion: oh yeah, I meant juxt.

16:38 gfredericks: cemerick: surely you had to know this when you read the lazybot chapter of that book you bought that one time I mean

16:39 hyPiRion: your code wasn't very juxtrehensive

16:40 hyPiRion: gfredericks: sadly. I'm getting rusty :(

16:45 cemerick: surely Raynes' book is going to mention lazybot?

16:45 Raynes: speaking of, have you seen any attributable rise in tryclj traffic in the past 3 months?

16:46 Raynes: cemerick: I don't look at tryclj traffic.

16:46 I certainly can if you like.

16:46 I just mean that I don't make a habit of it. :p

16:46 gfredericks: who votes for pronouncing tryclj like "trickle"

16:47 Raynes: If it makes you happy.

16:48 cemerick: When did your book release?

16:50 cemerick: March got around 3.9k views. In April through today, it rose and remained at around 4.5k

16:51 cemerick: 59% of page visits since April have been new visitors.

16:52 amalloy: 4.2k of my visitors over those months has been referred from 4Clojure.

16:52 Giggity.

16:53 amalloy: Raynes: prepare to experience a similar inflow to refheap :P

16:53 Raynes: Hah

16:53 Huh. Do I even track refheap traffic?

16:53 I'm totally insane if I don't.

16:53 Analytics is like dope.

16:54 Oh boy, looks like I do.

16:54 Wow, this is depressing.

16:54 hyPiRion: Speaking of refheap, does anyone know if someone has ported/made a syntax highlighter for Clojure?

16:55 Raynes: hyPiRion: Nope. I use pygments.

16:55 hyPiRion: Raynes: I know, that's why I was asking ;)

16:55 Raynes: If someone made a highlighter for Clojure, I still probably wouldn't use it.

16:55 Not until it supported at least the most useful subset of the languages pygments does.

16:59 amalloy: Raynes: what's depressing?

17:00 TimMc: Can't you use different highlighters for different languages?

17:00 Raynes: amalloy: Crappy traffic, but I'm not sure it is even working right since I think I'm only tracking refheap.com and not www.refheap.com

17:00 TimMc: Sure, with a lot of work. Pygments also handles the generation of line numbers and such.

17:01 And the theming.

17:02 SrPx: Oh

17:02 You should send this to every newcomer around: http://chasemerick.files.wordpress.com/2011/07/choosingtypeforms2.png?w=640

17:05 TimMc: Raynes: Hmm, I see. Seems complectated. :-P

17:06 hyPiRion: SrPx: That's messy. I'd just tell every newcomer to use a map.

17:06 SrPx: hyPiRion: I concluded that from the chart though. (:

17:06 wingy: i prefer cutting the middle men

17:08 SrPx: Wow.

17:08 solussd_: could someone cryptographically inclined tell me if this password hashing function is adequate? :) https://www.refheap.com/paste/4ff0bc29e4b062b6746d14b0

17:09 Raynes: https://github.com/noir-clojure/lib-noir/blob/master/src/noir/util/crypt.clj There's a lib-noir for that!

17:10 Just a shameless plug. I'm neither cryptographically inclined nor have I actually read your code.

17:10 cemerick: Raynes: why pygments instead of syntaxhighlighter? More supported languages?

17:10 SrPx: So anyway, protocols are the equivalent of Common Lisp's classes and multimethods if I got it right?

17:10 Raynes: cemerick: And less hideous javascript.

17:10 cemerick: SrPx: Clojure multimethods are the equivalent of Common Lisp's multimethods. :-)

17:10 ivan: solussd_: is that a fixed salt? but anyway, use bcrypt or scrypt

17:11 solussd_: ivan: I was thinking of using the time in milliseconds of the password creation date

17:11 Raynes: well, I happen to be using Noir, so, I guess I'll use that (pff. can't write any of my own code in clojure-- someone has done everything!)

17:12 cemerick: Raynes: does syntaxhighlighter imply more involved js? I just threw it into another site with one line? *shrug*

17:12 * adu <3 multimethods

17:12 cemerick: Everybody does :-D

17:13 SrPx: cemerick: I was not aware of those

17:13 Raynes: cemerick: *shrug*. I just can't see syntaxhighlighter working out well for a pastebin site.

17:13 solussd_: i gave a presentation on polymorphism at work and described multimethods as part of it… the .net programmers were unimpressed (or just didnt get it)

17:13 cemerick: Raynes: fair. js implementations of everything…meh.

17:13 Python > js.

17:14 Of course.

17:14 Raynes: cemerick: It actually isn't a huge bummer anyways, since I obviously don't highlight every single time a request is made to a paste page.

17:14 I pre-highlight and store that for later consumption.

17:14 Super dooper fast.

17:15 cemerick: do you store the original source too?

17:15 Raynes: Yes.

17:15 hyPiRion: I suppose, if they want to edit the original.

17:16 wingy: cool i dont have to reload server when i make changes

17:17 how is that done by compojure?

17:17 or ring

17:17 Raynes: Same way it is done in Noir, just more explicit -- wrap-reload

17:17 wingy: its reading the file for each request?

17:17 Raynes: Noir wraps wrap-reload under the covers for you. If you used compojure, you'd need to do it yourself.

17:18 If something has changed since the last request, it just reloads the code.

17:18 weavejester: lein-ring automatically adds wrap-reload

17:18 Raynes: You'd want this turned off in production.

17:18 wingy: it detects file change?

17:18 weavejester: If you're using Compojure, using lein-ring is a good idea

17:18 wingy: and reload it?

17:18 yeah im using lein-ring

17:18 Raynes: weavejester: Really? Can I use lein ring to run my code in production?

17:18 weavejester: And lein-ring automatically removes wrap-reload in production.

17:18 wingy: what is wrap-reload?

17:18 weavejester: Raynes: Yep

17:18 Raynes: How does it know I'm in production?

17:19 weavejester: Raynes: The LEIN_NO_DEV environment variable being set.

17:19 wingy: where can i read about it

17:19 Raynes: Cool.

17:19 * Raynes hugs weavejester

17:19 Raynes: You're my friend.

17:19 weavejester: wingy: It's in ring-core

17:19 wingy: ok

17:20 weavejester: er… ring-devel I mean

17:20 wingy: http://ring-clojure.github.com/ring/ring.middleware.reload.html

17:20 Raynes: Haha

17:20 Raynes: I've also created a Heroku thing that automatically runs lein ring server

17:21 wingy: warpy: cool

17:21 weavejester: i meant

17:22 clojure stack is so dead simple and cool

17:22 lisp syntax fits all kind of DSLs

17:26 weavejester: Raynes: Incidentally, you can also use profiles to control production options in lein-ring as well. It just tries to have sensible defaults.

17:27 hiredman: amalloy: where you saying clojurebot is broken because it could find a class called java.lang.Date?

17:28 amalloy: hiredman: he couldn't find java.util.Date either, unless i was misreading

17:28 (whew, i wasn't)

17:28 hiredman: are you sure?

17:28 brehaut: cemerick, raynes: re:syntaxhighlighter on refheap, it could make page load times really sluggish; if you include every brush thats a lot of bloat for each request, and the default dynamic loading system is a bit hairy with letting the page load properly first

17:28 amalloy: borkdude: ,(java.util.Date.)

17:28 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class java.util.Currency>

17:29 clojurebot: java.util.concurrent is "When I find myself in times of trouble / Prof. Doug Lea comes to me / Coding lines of wisdom / j.u.c."

17:29 technomancy: =D

17:29 hiredman: I see someone looking for Date (which needs an import), looking for java.util.Currency (which doesn't exist) and java.lang.Date (wrong package)

17:29 ,(import 'java.util.Date)

17:29 clojurebot: java.util.Date

17:29 hiredman: ,(Date.)

17:29 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class java.util.Currency>

17:30 hiredman: huh

17:32 TEttinger: ,(java.util.Date.)

17:32 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class java.util.Currency>

17:32 TEttinger: ,(Integer.)

17:32 clojurebot: #<CompilerException java.lang.IllegalArgumentException: No matching ctor found for class java.lang.Integer, compiling:(NO_SOURCE_PATH:0)>

17:34 TEttinger: &(java.util.Date.)

17:34 lazybot: ⇒ #inst "2012-07-01T21:34:01.026-00:00"

17:35 hyPiRion: &(java.sql.Date. 0)

17:35 lazybot: ⇒ #inst "1970-01-01T00:00:00.000-00:00"

17:45 pepijndevos: what algo is used by clojures persistent maps? (and what are alternatives?)

17:46 hyPiRion: pepijndevos: http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/

17:47 pepijndevos: hyPiRion, 2009, is that still up to date? I seem to remember something was changed n there recently.

17:47 but maybe I'm confusing hashmaps and treeemaps.

17:48 wingy: isn't it more pragmatic to use ":require .. :as" instead of ":use .. :only" .. the former gives you namespace and all functions in it rather than micro pick all parts and they could still collide with others in current namespace

17:48 the former is kinda like node.js where you require everything to a local variable

17:49 tomoj: false dichotomy: (:require [foo :as f :refer [bar]])

17:49 brehaut: wingy: :require … :as … :refer gives you all three

17:49 tomoj: did I mean dilemma? hmm

17:50 wingy: brehaut: more recommended than using :use?

17:50 brehaut: probably

17:50 wingy: i see all functions colliding in one namespace is not a great thing

17:50 brehaut: use is still handy in a repl though

17:50 wingy: yeah

17:50 for fast access

17:51 brehaut: i think :require :refer going forward is the preferred option (it was only added in 1.4) to lessen the confusion around ns usage forms

17:54 hyPiRion: pepijndevos: It was brought up yesterday, so I suppose those links are still valid. But don't take my word for it.

17:54 amalloy: pepijndevos: i don't think clojure's maps have changed since then, either hash or tree

17:54 pepijndevos: amalloy, that's probably it.

17:54 me finding treemap, and thinking "wow, this is new and awesome"

17:56 wingy: brehaut: so it makes more sense to either use :as OR :refer, not both at the same time right

17:56 (:require [compojure.core :as core :refer :all]

17:57 or perhaps you have reasons for using them at the same time

17:57 ok it depends

17:57 brehaut: wingy: not necessarily true. some NSs you will want a handful of functions from without the NS qualification, but others with

17:57 wingy: right

17:58 Raynes: brehaut: fwiw, I hate people (amalloy) who do that.

17:59 brehaut: Raynes: you are dead to me

17:59 amalloy: (dec Raynes)

17:59 lazybot: ⇒ 12

17:59 Raynes: You were never alive to me. Get out of my internet.

18:00 hyPiRion: Raynes: /ignore amalloy ?

18:00 brehaut: hahah

18:00 Raynes: He's my best friend. :(

18:00 amalloy: Raynes treasures his abusive relationships

18:01 hyPiRion: You need to heal that Stockholm syndrome, Raynes.

18:01 nkraft: System: Host Yoda Kernel 2.6.38-8-generic-pae i686 (32 bit) Distro Linux Mint 11 Katya

18:06 ivaraasen: amalloy: (:abuse 'freenode.raynes.childhood)?

18:28 solussd_: is there a Noir + Friend (authentication) tutorial somewhere? Looks like I can just plug it [friend] in as middleware, right?

18:46 SrPx: (on matching-function callback) ... (on (fn [event] (eq (event :name) 'click)) (hide (event :target))) ;; does that seems reasonable?

18:48 kovasb: why use symbols instead of keywords to indicate the event name?

18:48 amalloy: also (fn [event] (= (event :name) 'click)) is just (comp #{'click} :name)

18:49 gfredericks: is calling a one-element set fast?

18:49 kovasb: nice

18:49 gfredericks: do large data structure cache their hashes?

18:50 nicholasf: ooc, are you guys discussing clojurescript or clojure here?

18:50 SrPx: amalloy: #{} ?

18:50 kovasb: set literal notation

18:50 SrPx: kovasb: dunno, what is the difference?

18:50 kovasb: keywords are always inert, and have some useful features

18:51 SrPx: such as?

18:51 kovasb: you can use them as functions

18:51 SrPx: anyway I'm just asking about the 'on' thing, is it OK to use it?

18:51 kovasb: (:keyword {:keyword 1}) ---> 1

18:51 SrPx: kovasb: oh , nice!

18:51 kovasb: and you don't have to quote them

18:51 SrPx: ({:a 1} :a) works too

18:51 kovasb: and they are more amenable to being treated as data

18:51 gfredericks: same character count though

18:51 SrPx: o.O

18:52 how?

18:52 clojurebot: with style and grace

18:52 kovasb: using them as functions lets you compose more easily

18:52 since keywords are inert there is no question about what the serialized data means

18:53 whereas with symbols, you can to wonder if they are supposed to be bound to something or not

18:53 amalloy: SrPx: nobody can tell you whether it's "okay" to use your `on` function, lacking any context about where it came from, what it does, or anything. all i can do is recognize that, yes, it appears to be either a macro or a function

18:53 SrPx: amalloy: I still don't get what you have done exactly :s

18:54 kovasb: its equivalent to (fn [name] (#{'click} (:name event)(

18:55 *)

18:55 )

18:55 :)

18:57 SrPx: sure but

18:57 gfredericks: &(time (count (filter #{-1} (range 1000000))))

18:57 lazybot: ⇒ "Elapsed time: 396.446818 msecs" 0

18:57 SrPx: (#{'click'} (:name event)) õo

18:58 gfredericks: &(time (count (filter #(= % -1) (range 1000000))))

18:58 lazybot: ⇒ "Elapsed time: 636.541203 msecs" 0

18:58 gfredericks: o_O

18:58 SrPx: &(#{':click'} (:name {:name :click}))

18:58 lazybot: ⇒ nil

18:59 amalloy: too many 's

18:59 SrPx: &(#{:click} (:name {:name :click}))

18:59 lazybot: ⇒ :click

18:59 SrPx: 's?

18:59 gfredericks: amalloy: what is '} ?

18:59 SrPx: &(#{:click} :test)

18:59 lazybot: ⇒ nil

18:59 amalloy: gfredericks: an error

18:59 SrPx: &(#{:click} :click)

18:59 lazybot: ⇒ :click

18:59 gfredericks: amalloy: but it didn't crash

19:00 amalloy: the reader did the best it could

19:00 SrPx: [19:48] <amalloy> also (fn [event] (= (event :name) 'click)) is just (comp #{'click} :name)

19:00 I don't get it amaloy, it will not return true on your form

19:00 amalloy: &(read-string "(#{'x'} x)")

19:00 lazybot: ⇒ (#{(quote x')} x)

19:00 kovasb: the value will serve as truthy

19:00 nil and false serve as false

19:01 amalloy: indeed. you don't need true or false, you just need something that acts true or false in an if-test

19:01 kovasb: everything else is true, for the purposes of control structures

19:01 SrPx: kovasb: hm :S

19:01 &((fn [a] (= (a :name) :bah)) {:name :bah})

19:01 lazybot: ⇒ true

19:01 SrPx: kovasb: okay I guess o.o

19:01 thanks

19:01 this is really nice

19:02 kovasb: yes it all comes together pretty well

19:02 i was a non-believer in nil punning until i started to use it

19:02 SrPx: &(#{:a :b :c} :c)

19:02 lazybot: ⇒ :c

19:02 SrPx: &(#{:a :b :c} :d)

19:02 lazybot: ⇒ nil

19:02 kovasb: but it really makes code better

19:03 SrPx: so this form above can be used as a "has-keyword"

19:03 amalloy: more like has-element

19:03 &('#{a b 1 2} 1)

19:03 lazybot: ⇒ 1

19:03 kovasb: set is a function from elements to themselves

19:03 SrPx: oh sure

19:03 kovasb: map is a function from elements to other elements

19:03 map = {}

19:04 SrPx: this is a real cool definition ( =

19:04 kovasb: btw you can override the default return value to be something other than nil

19:04 in the {} case

19:05 SrPx: I've just looked for curiosity; I don't really care about it; but there is almost no jobs for clojure and lisps. But I am positive they are the best languages I've seem and I've looked at all the common ones.

19:05 kovasb: &({:a 1} :b :c)

19:05 lazybot: ⇒ :c

19:05 SrPx: Why?

19:05 clojurebot: SrPx: because you can't handle the truth!

19:05 SrPx: kovasb: (:

19:05 wait

19:05 amalloy: SrPx: to help you tell whether nil mean: "the value is nil" vs "there's nothing here"

19:05 SrPx: &({:a 1} :a)

19:05 lazybot: ⇒ 1

19:05 SrPx: &({:a 1} :b)

19:05 lazybot: ⇒ nil

19:06 SrPx: wait '#{}?

19:06 &('#{:a} :a)

19:06 lazybot: ⇒ :a

19:06 SrPx: &('#{:a} :b)

19:06 lazybot: ⇒ nil

19:06 SrPx: &(#{:a} :a)

19:06 lazybot: ⇒ :a

19:06 SrPx: &(#{:a} :b)

19:06 lazybot: ⇒ nil

19:06 SrPx: .-.

19:07 amalloy: &#{a b c}

19:07 lazybot: java.lang.RuntimeException: Unable to resolve symbol: a in this context

19:07 amalloy: &'#{a b c}

19:07 lazybot: ⇒ #{a c b}

19:10 kovasb: SrPx: there are jobs out there once you become proficient

19:11 SrPx: kovasb: and how many years is that? (:

19:11 kovasb: SrPx: it took me about 1 year to become competent, but its only my second real language

19:11 SrPx: and probably not in my country though

19:11 brehaut: SrPx: its not how many years you've been using clojure, but how many hours ;)

19:11 SrPx: kovasb: what is your first

19:12 kovasb: mathematica

19:12 SrPx: kovasb: oh you have no experience in c-like langs?

19:12 brehaut: SrPx: ive been using clojure for years, but im not that proficient

19:12 kovasb: just school stuff really

19:12 amalloy: each month of clojure is a decade of programming something else. it's like narnia in a way

19:12 SrPx: kovasb: that should be really good for you. who told you about clojure

19:12 kovasb: the internet :)

19:13 i probably saw it on hacker news or something

19:13 SrPx: the internet was not so kind for me

19:13 I've learned extensively other languages for 10 years before hearing about lisps

19:13 kovasb: i mean, i was in the market for a high level language on the jvm so it was not a coincidence

19:13 ivaraasen: i've learned more about CS concepts and implementation in the last week reading up on Clojure and Haskell than I've ever learned throughout my studies

19:13 SrPx: amalloy: what are you doing on clojure if I might ask

19:14 kovasb: ivaraasen: coolness

19:14 amalloy: all of my programming :P

19:14 SrPx: are all you guys CS bachelors? :s

19:14 kovasb: i was math

19:14 SrPx: amalloy: *okay*

19:14 amalloy: i'm sure we have some PhDs in here somewhere

19:14 ivaraasen: kovasb: yeah. I study petroleum geology, so we mostly learn Matlab, maybe some basic C

19:14 SrPx: I mean, are you all people who completed college already? (not know the word again sorry)

19:15 don't*

19:15 amalloy: SrPx: a lot of my code is at http://github.com/flatland, and i wrote a big chunk of www.4clojure.com

19:15 SrPx: amalloy: yay (:

19:15 rlb: SrPx: I imagine there's a substantial variety here...

19:15 SrPx: lazybot is yours

19:15 gfredericks: man that backwards smiley took me a second

19:15 amalloy: i know we have some people here who aren't college graduates (eg Raynes)

19:16 SrPx: gfredericks: what does that mean

19:16 gfredericks: I think in-school folk are frequent

19:17 kovasb: ambrose

19:17 gfredericks: working on bachelor's

19:17 SrPx: hmm your avg age?

19:17 kovasb: i don't think education level is that relevant for clojure mastery

19:17 no idea :)

19:17 i am 31

19:17 SrPx: just curiosity

19:18 ivaraasen: SrPx: dunno. I'm 21

19:19 gfredericks: my average age is ~13

19:19 kovasb: lol

19:19 gfredericks: it keeps rising though

19:24 SrPx: gfredericks: lal!

19:24 amalloy: noticed you basically don't use deftype, defstruct and those

19:24 gfredericks: finally somebody lalled

19:24 SrPx: gfredericks: ?

19:24 gfredericks: SrPx: lal?

19:24 SrPx: is this good?

19:24 lal = lol

19:25 gfredericks: then yes it's good

19:25 SrPx: why?

19:25 clojurebot: why not?

19:25 gfredericks: because it's funny-spelt

19:25 SrPx: lal

19:25 amalloy: defstruct is awful/old, don't use it. deftype/defrecord are valuable but "advanced" features you shouldn't use without a good reason

19:25 SrPx: amalloy: all I wanted to hear ( :

19:25 also that your source is basically a sequence of defn's

19:26 and probably most of clojure projects

19:26 is this correct?

19:26 amalloy: pretty normal

19:27 wingy: how do i convert this one: (GET "/categories/:id" [id] to use destructuring in compojure?

19:29 the example shows: {{id "id"} :params} but (GET "/categories/:id" [{{id "id"} :params}] didnt work out pretty well

19:30 SrPx: again for curiosity, if Clojure source is basically a sequence of defs and defns, couldn't we, instead of packages, organize all them in a big, categorized database?

19:30 of functions

19:30 wingy: this worked: (GET "/categories/:id" {{id "id"} :params}

19:30 forgot that its a fn call and not fn declaration

19:31 SrPx: also, (derive ::rect ::shape) ::name evaluates to a namespace? we are deriving namespaces? o.o

19:32 TimMc: SrPx: ::name *reads* to :whatever.namespace/name

19:32 amalloy: &::rect

19:32 lazybot: ⇒ :clojure.core/rect

19:37 SrPx: TimMc: oh okay

19:41 TimMc: &'::rect ;; more specifically -- note the quoting

19:41 lazybot: ⇒ :clojure.core/rect

19:42 pepijndevos: why does clojure use 5 bits per layer of persistent*

19:42 TimMc: Chosen by fair dice roll.

19:43 amalloy: 5d1

19:43 clojurebot: 5

19:43 TimMc: haha

19:43 pepijndevos: ??

19:43 lazybot: pepijndevos: Uh, no. Why would you even ask?

19:43 amalloy: "i threw five objects into the air, and by god five came back down!"

19:43 gfredericks: lol

19:43 TimMc: Seriously though, it was probably the result of some benchmarking.

19:43 pepijndevos: 5d1

19:43 clojurebot: 5

19:43 pepijndevos: I don't get it, what does that do?

19:44 TimMc: 1d6

19:44 clojurebot: 1

19:44 amalloy: pepijndevos: XdY rolls X Y-sided dice and adds together the result

19:47 5d5

19:47 clojurebot: 19

19:47 gfredericks: 834d234

19:47 clojurebot: 96838

19:48 brehaut: I call dibs on the half-orc barbarian

19:48 amalloy: yeah, those sound like pretty good hit dice

19:49 brehaut: lol

19:50 gfredericks wants people to help him write a cljs-svg lib so that he can stop playing pointless games of chess

19:53 SrPx: ,({[0 0] :foo [1 1] :boo} [0 0])

19:53 pepijndevos: TimMc, I guess, any smaller, and lookup would go up, any larger and copying would get expensive. tricksy

19:54 clojurebot: :foo

19:54 SrPx: /\ o.o that

19:54 amalloy: SrPx: what else would you expect?

19:54 SrPx: just surprised anything can be a key

19:54 amalloy: SrPx: didn't you come from haskell? languages without real anything->anything maps are pretty crippled

19:55 SrPx: amalloy: you are overestiming me...

19:55 gfredericks: ,{(atom (ref (Object.))) (ref (atom (Object.)))}

19:55 clojurebot: {#<Atom@33c06b38: #<Ref@231d8cb8: #<Object java.lang.Object@6901960a>>> #<Ref@6721a061: #<Atom@50a8752c: #<Object java.lang.Object@63a4c512>>>}

19:55 amalloy: &({[0 1] :foo} (range 2)) ;; doesn't have to be exactly the same

19:55 lazybot: ⇒ :foo

19:56 SrPx: &({(fn [x] x) 1 (fn [a b] (a b)) 2} (fn [x] x)})

19:56 lazybot: java.lang.RuntimeException: Unmatched delimiter: }

19:56 amalloy: okay, that won't work

19:56 SrPx: &({(fn [x] x) 1 (fn [a b] (a b)) 2} (fn [x] x))

19:56 lazybot: ⇒ nil

19:56 SrPx: heh

19:56 I know

19:57 amalloy: but! ##(let [f (fn [x] x)] ({x :foo} x))

19:57 lazybot: java.lang.RuntimeException: Unable to resolve symbol: x in this context

19:57 pepijndevos: Hm, so what are the last 2 bytes used for? Just a mini-node, or just padding?

19:57 amalloy: &(let [f (fn [x] x)] ({f :foo} f))

19:57 lazybot: ⇒ :foo

19:58 SrPx: f is a var?

19:58 dnolen: SrPx: that's an old idea. Java, Objective-C, Smalltalk all support. Perhaps even Smalltalk got it from elsewhere.

19:58 SrPx: dnolen: Java objc really?

19:58 dnolen: SrPx: ^ re: arbitrary keys.

19:58 SrPx: yes.

19:58 SrPx: dnolen: by external libs you mean?

19:59 pepijndevos: The only reason why anything as a key seems problematic to me is mutable keys.

19:59 dnolen: pepijndevos: Java, Objective-C, Smalltalk all consider immutable types.

19:59 amalloy: dnolen: do you know how dynamic vars interact with core.logic? like if i do (binding [x 1] (run* [f] (...declarations using x...))) do i see x=1?

20:00 SrPx: dnolen: from my past langs, was pretty sure python, lua and javascript only accepted strings for example... and c++ didn't have hashes

20:00 amalloy: was that for me? I don't know

20:00 I don't even know what binding and run* are

20:01 jayunit100__: how to add args to an anonymous function?

20:01 dnolen: SrPx: Lot of languages are neat yet still get so many details horribly wrong.

20:01 jayunit100__: (reduce #([x y] (+ x y)) [1 1])

20:01 amalloy: i guess in that case i could force it by putting a doall inside the binding, but what if i wanted to do (run* [x] (fresh [a] (binding [*focus-object* a] (...)))) to make a particular logic variable available throughout my program

20:01 dnolen: amalloy: you should, run* is not lazy.

20:03 amalloy: cool. and is that a horrible smell? i want to create the "universe of relevant objects" once, so that i can do stuff like (connecto a b) without having to repeat "btw, a and b are both members of this universe of interesting objects"

20:04 SrPx: that sounds pterodactly cool.

20:04 amalloy: jayunit100__: just use 'fn

20:05 jayunit100__: how ok

20:05 cshell: hey, is the person who was having the 100% cpu problem with (Thread/sleep 1000) still here?

20:05 jayunit100__: s/how/wow

20:05 thats odd - anonymous funcs dont support args ?

20:05 dnolen: amalloy: I don't see any problems at the moment with that.

20:06 gfredericks: jayunit100__: they do

20:06 cshell: I guess the leap second is causing a problem with Java and time taking a lot of cpu: http://bit.ly/N5NM2H

20:06 jayunit100__: ,(#(+ % 1) 1)

20:06 clojurebot: 2

20:06 amalloy: great, thanks

20:09 jayunit100__: ahhh i see "The arity of an anonymous function is determined by the highest argument referenced inside." -from s.o.

20:10 amalloy: why did u suggest using fn ? is it unidiomatic to use multiple args in an agonymous function?

20:23 pepijndevos: are the last 2 bits in a persistent datastructure any special?

20:23 SrPx: java.lang.IllegalArgumentException: No matching method found: concat for class java.lang.String ?

20:23 :s

20:23 &(.concat "a" "b")

20:23 lazybot: ⇒ "ab"

20:24 * SrPx sighs

20:24 gfredericks: pepijndevos: last two bits?

20:24 amalloy: &(doc str)

20:24 lazybot: ⇒ "([] [x] [x & ys]); With no args, returns the empty string. With one arg x, returns x.toString(). (str nil) returns the empty string. With more than one arg, returns the concatenation of the str values of the args."

20:24 wingy: i am trying to split my routes into separate files but i get an error: https://gist.github.com/3030168

20:24 how do i do it correctly?

20:25 pepijndevos: gfredericks, yea, the hash is 32 bits, and then each level uses 5

20:25 SrPx: amalloy: ty

20:25 &(doc +)

20:25 lazybot: ⇒ "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"

20:25 SrPx: &(doc list)

20:25 lazybot: ⇒ "([& items]); Creates a new list containing the items."

20:25 SrPx: &(str "a" "b")

20:25 lazybot: ⇒ "ab"

20:25 amalloy: categories/api

20:26 pepijndevos: gfredericks, so you end up with 2 bits at the end. I wonder if they are special, ignored, or just mini-nodes

20:26 wingy: amalloy: i always forget .. thx

20:26 gfredericks: pepijndevos: I don't know :(

20:27 TimMc: pepijndevos: There's an article explaining this... does it explain the 2 bits?

20:27 pepijndevos: TimMc, not as far as I can tell, but I did not study the code

20:27 TimMc, these bits are arguably a bit of an edge case ;)

20:28 gfredericks: perhaps at level 7 you can only have 4 entries :)

20:28 pepijndevos: maybe...

20:28 or you can wrap around and do the whole thing again, with the thing offset by 2

20:30 no, that would be silly

20:32 TimMc: Also, why does that article show 33 bits? http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/

20:35 pepijndevos: TimMc, I wondered that too, I assume it's an error.

20:35 amalloy: maybe it's a carry bit left over from someone's half-adder

20:39 wingy: if i want to work with browser DOM the choice seems to be between Domina, Enfocus and Jayq .. how do these compare to each other? the former 2 do not require jQuery at all?

20:40 seems like if i use enlive then i should use enfocus .. and if i use hiccup then domina

20:40 same style

20:42 pepijndevos: hm, where is this INode described in the blogpost?

20:43 ah https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentHashMap.java#L325

20:49 yoklov: using trampoline doesn't have any inherent limitations over true tail recursion, right?

20:49 gfredericks: it's hacky

20:49 yoklov: well, if I'm still getting a stack overflow, that means i'm not doing it somewhere I should be

20:50 even if the stack overflow is very rare now

20:54 dnolen: yoklov: I don't think you should have problems with trampoline.

20:55 rlb: yoklov: in general, trampolines can be a bit less efficient.

20:55 yoklov: not sure it's significant in clojure.

20:57 yoklov: I'm using continuation passing style to get call/cc, and using a trampoline to stop from blowing the stack, which is working in most cases

20:57 dnolen: yoklov: have you looked at clojure-tco?

20:59 yoklov: I remember hearing about it a while back, this is actually older code which I'm trying to fix a bug in, so using it now would require rewriting pretty much everything

21:01 yonatane: Do you think libs like noir should make the session variable "injectable", for example when I want noir and sandbar to share the same session variable and not have two different ones?

21:08 devn: yonatane: do you need to synchronize sessions between the two sessions?

21:08 yonatane: i dont know to be honest, but having two session vars around that need to be the same thing smells bad to me

21:09 it seems like 1 is a good thing, but then again maybe there are too many eggs in one basket if that is the case

21:11 wingy: my research about DOM manipulation: jQuery seems to be very OOPish compareed to Closure's more FP style: http://blog.blazingcloud.net/2012/03/09/manipulating-the-dom-google-closure-vs-jquery/

21:11 yoklov: i always agreed with the sentiment that jquery was somewhat monadic

21:13 wingy: there goes jayq and jquery .. left is domina, enfocus and closure .. since cljs is using the latter and the latter is far more used i think we have a winner

21:14 yoklov: err, what's wrong with jayq?

21:15 (haven't used it recently, but iirc it was great)

21:15 wingy: just personal taste

21:15 i prefer fp style when coding

21:15 jquery returns objects with methods

21:15 yoklov: you think google closure is more functional than jquery?

21:16 wingy: according to the comparisons

21:16 yoklov: really?

21:16 brainproxy: wingy: you can use jayq together with threading macros to stay in a functional style

21:16 yoklov: google closure is extremely OOP

21:16 wingy: they have proper namespacing .. they use functions on elements

21:16 brainproxy: i think clojurescript supports doto also

21:18 yoklov: that article isn't really idiomatic for jquery

21:18 wingy: you guys seem to prefer jquery

21:19 yoklov: e.g. the example with adding and removing classes would better be $("#articles").addClass("mobile").toggleClass("hidden").removeClass("gerbil-bate");

21:19 method chaining is still stateful, but it lets you ignore that there's mutation going on, to a certain extent

21:19 dnolen: wingy: I jayq or domina is mostly a matter of taste. eventually I think CLJS specific libs will win out since they are subject to more optimizations.

21:21 wingy: yoklov: that looks oop

21:22 brehaut: method chaining doesnt have to be stateful

21:22 wingy: dnolen: clojure is still very weak in frontend .. all the UIs and stuff we benefit from other libs

21:22 brainproxy: wingy: I have something like this in a cljs script:

21:22 `(doto ($ "[name|=move]") (.val "") (.focus)))`

21:23 yoklov: That looks more OOP than `goog.dom.classes.add(element, 'mobile'); goog.dom.classes.remove(element, 'hidden'); goog.dom.classes.toggle(element, 'gerbil-bate');`?

21:23 statements are very non-fp

21:23 wingy: i dont know if i can trust a small lib like domina to be well maintained and bug fixed when problems occur

21:23 and questions

21:23 dnolen: wingy: why? most Clojure libs are small :)

21:24 brehaut: dnolen: how many hundred lines is core.logic?

21:24 dnolen: brehaut: it's getting big now for a Clojure program. pushing near 3000 lines now.

21:25 wingy: dnolen: yeah .. but the question is why not use jQuery/Closure if they are really tested, well maintained and popular

21:25 brehaut: dnolen: a true behemoth for clojure then ;)

21:25 dnolen: wingy: domina is built on top of Closure.

21:25 brehaut: PHP is popular. should we be using that too?

21:26 (theres nothing like a good slipper slope strawman)

21:26 * gfredericks imagines a slipper slope

21:26 * brehaut once again considers buying a proper keyboard

21:26 * brainproxy throws rubies at gfredericks

21:27 * gfredericks gem installs brainproxy-shield

21:28 brainproxy: i was thinking maybe you'd like ruby slippers... stupid wizard of oz reference :p

21:28 gfredericks: crap I forgot about the 1930's

21:28 TimMc: Wait, is it that old?

21:29 * gfredericks realizes the roaring twenties are just a couple of world cups away

21:29 TimMc: Within my lifetime, that film will be a century old.

21:29 gfredericks: what? films can't be a century old

21:29 surely you jest

21:29 brainproxy: 1939, yeah...

21:29 brehaut: seriously daskeyboard? no international shipping‽

21:30 gfredericks: brehaut: we're making time jokes; stay on topic

21:30 brehaut: lol timezones?

21:30 gfredericks: nothing funnier than time, whatever it is

21:34 rlb: brehaut: got a filco -- quite like it fwiw

21:35 yoklov: hm, if I'm getting a stack overflow error, my stacktraces should probably be… huge, right?

21:35 dnolen: yoklov: usually

21:35 devn: where does the {:pre} go with multiple arities?

21:36 can you have it function definition-wide, or must it be tied to each arity? can it be tied separately to each arity?

21:36 yoklov: Hm. If they're tiny, e.g. 5 lines long, does it mean I probably have a memory leak somewhere?

21:37 brehaut: yoklov: that would also require everything to be stashed on the stack right?

21:37 yoklov: doenst java in general prefer the heap?

21:37 yoklov: yeah

21:39 I think the issue *could* be that I'm preventing GC accidentally with closures, but that would certainly be on the heap...

21:58 amalloy: it's 100% not a GC issue, yoklov

21:59 small stacktraces could just mean that the JVM's stacktrace-printer is omitting repeated lines, in that (1000 more) way that it sometimes does

21:59 yoklov: hm

21:59 dang.

21:59 amalloy: and stack space for a thread is preallocated long before that thread starts new'ing

21:59 so gist your actual stacktrace

22:00 yoklov: it's different every time

22:04 wait, got the real one, nm it's huge

22:04 Raynes: SrPx: Mine, actually.

22:04 amalloy: i'll fight you for it

22:04 SrPx: Raynes: yours... ?

22:04 Raynes: SrPx: I started lazybot years ago when I first started using Clojure. amalloy hopped on later on and we became bestest friends evars.

22:05 SrPx: yay .

22:05 Raynes: amalloy and I both work on flatland projects.

22:05 SrPx: I see

22:06 hmm so, now that I'm here, why don't we forget that folder based filesystem, make a tag-based filesystem where you find your files by a real-time filter of their names/tags/type

22:07 and then we define a filetype (I mean datatype, whatever) called clfunc

22:07 make it searchable in awesome ways like "find function that will pass the test = (f [1 2 3]) [3 4 5]

22:07 and then plug every function we make into a giant database of awesomeness

22:08 hm hm hm ?

22:08 : D

22:08 ):

22:09 nobody loves me t.t

22:10 kkreamer: I was just thinking of the first time I copy a file... same name, same tags, etc.

22:11 I guess the copied one has to sport a goatee

22:11 SrPx: Why do you need to copy a file?

22:11 yoklov: woohoo! fixed it!

22:12 kkreamer: To change the copy without affecting the original, I guess

22:13 or, onto removable media to give to someone

22:13 the latter use case probably isn't a problem, I suppose

22:14 SrPx: Hmm well you have the same problem on the folder based architecture, though.

22:14 They just add "copy of " to the name so you just do it too?

22:14 I don't see why you couldn't have 2 files with the same matching though

22:14 kkreamer: I usually copy to a different directory

22:15 SrPx: Anyway I don't know why people are relunctant but I think this would solve most of my problems today

22:15 and I'm yet to find a tool that will do it in other way

22:15 maybe they don't think it is a problem at all

22:15 that they can't grab whatever file/function they want from their entire system/life (or even a huge database) in a few keystrokes

22:17 kkreamer: well, build it then, and if it's awesome and solves a problem, people will use it

22:18 until then, I'll keep using find

22:18 SrPx: I can't find the right way to build it.

22:18 find?

22:18 kkreamer: be back in a bit...

22:18 SrPx: what is find ? u.u

22:24 amalloy: $google bash find

22:24 lazybot: [find Man Page] http://ss64.com/bash/find.html

22:32 uvtc: technomancy: ping

22:42 technomancy: uvtc: what's up?

22:43 uvtc: Hi techomancy. Those two lein-newnew issues. I was using the newest lein 2.0.0-preview7. I'd rm -fr'd my ~/.m2 and ~/.lein before use.

22:44 I was just going through the process again, but for some reason it's taking forever to download the lein 2 jar again.

22:44 technomancy: do you have an old version declared in your user profile?

22:44 uvtc: Is that kept somewhere else besides ~/.lein or ~/.m2?

22:44 technomancy: ~/.lein/profiles.clj

22:44 clojurebot: /.lein/profiles.clj is nice, but it doesn't allow you to vary the profile for a specific project without checking it in to the repo

22:45 uvtc: I'd wiped that out completely before trying lein 2 preview 7.

22:45 After I pinged you just now, I figured I'd wipe everything out and try again, but it's never taken this long to install the lein jar... not sure what's up.

22:46 technomancy: problems with github?

22:46 someone mentioned they were returning 502 on tarball download

22:46 uvtc: 22% [==============> ] 2,362,606 8.51K/s eta 14m 30s

22:46 technomancy: weird

22:46 it's supposed to just redirect to s3

22:46 uvtc: Every previous time I've installed lein it's taken just a few seconds.

22:47 Resolving cloud.github.com (cloud.github.com)...,,, ...

22:47 Connecting to cloud.github.com (cloud.github.com)||:80... connected.

22:47 HTTP request sent, awaiting response... 200 OK

22:47 Length: 10321086 (9.8M) [application/x-java-archive]

22:47 Location: http://cloud.github.com/downloads/technomancy/leiningen/leiningen-2.0.0-preview7-standalone.jar

22:48 technomancy: that's just a cname for an S3 bucket IIRC

22:49 uvtc: Anyway, I was indeed using lein-newnew 0.3.4 ... well, at least, that's the version I saw in ~/.m2/repository .

22:50 kkreamer: maybe Amazon is having problems again...

22:55 nevermind, it downloaded for me

22:56 uvtc: Oooh, d/l seems to be speeding up. eta 45s.

22:56 kkreamer: from the link you gave, anyway

22:56 uvtc: hahaha. spoke too soon.

22:56 kkreamer: and in just a few seconds

22:57 uvtc: Mine just stopped.

22:57 kkreamer, stop hogging my bandwidth! ;)

22:57 kkreamer: heh

22:58 uvtc: Ah, completed.

23:00 technomancy, So, again, after rm -fr ~/.lein and rm -fr ~/.m2, rm bin/lein,

23:00 and after grabbing a fresh lein2, chmod +x,

23:00 lein version ==> Leiningen 2.0.0-preview7 on Java 1.7.0_03 OpenJDK 64-Bit Server VM

23:00 `lein new app foo-bar`

23:01 There's no doc directory,

23:01 and the project.clj has Clojure 1.3.0 listed.

23:02 technomancy: uvtc: so for some reason it's using 0.3.3 for you

23:02 uvtc: john@garnet:~/.m2/repository/lein-newnew/lein-newnew$ ll

23:02 total 4

23:02 drwxrwxr-x 2 john john 4096 Jul 1 22:58 0.3.4/

23:03 technomancy: oh wait, I was using the default template

23:03 uvtc: And there's all 0.3.4 files in there.

23:03 technomancy: you're right; the app template is out of date

23:03 my bad

23:03 uvtc: Ah, cool then. Thanks. :)

23:07 technomancy, also issue 37.

23:07 technomancy: yup, reopened them both

23:09 uvtc: If I clone a repo, create a fork, make my changes, push my fork to my origin, send a pull-request, and it gets merged, what's the next step? Do I delete the local branch? (`git checkout master; git branch -d my-branch`?)

23:10 technomancy: might as well delete the branch, yeah

23:11 uvtc: To delete it also from origin,

23:11 that's `git push origin :my-branch` , correct?

23:11 technomancy: right

23:11 uvtc: thanks, technomancy

23:11 technomancy: probably doesn't matter with a repo that small, but you might as well

23:12 uvtc: technomancy, is it any more (or less) hassle when someone sends you a pull-request on master (rather than on a dedicated branch)?

23:13 technomancy: uvtc: one from master is not a big deal, but it means when it gets merged then your master will probably not be tracking my master

23:13 which means you'll get extraneous merge commits whenever you pull from me, and those can be annoying

23:15 uvtc: Most folks just periodically pull from upstream to keep up to date, right?

23:17 technomancy: yeah

23:17 uvtc: Anyway though, I was asking specifically if it's any more bother to you (the person I'm sending the pull-request to), if it's on master vs. a separate branch.

23:17 Sounds like it's six of one, half dozen of the other.

23:17 technomancy: if your master is just my master plus the stuff you want me to pull, it's fine

23:17 but making commits on master tends to cause extraneous noise to sneak in there

23:18 it's possible to avoid that, but it's better not to have to bother

23:18 uvtc: Very good. Thanks.

23:21 technomancy: sure

23:32 mshroyer: anyone here using clojure-swank? I'm having an issue that I've failed at googling

23:32 basically the repl is "laggy" in Emacs

23:32 like when I type (+ 1 2)

23:32 there's a half-second or so hang after typing each of the arguments

23:33 S11001001: are you using jack-in with swank-clojure 1.3.4?

23:33 mshroyer: yep I'm using jack-in, and let me double check my swank-clojure version

23:33 TimMc: Any chance the REPL has been running for a couple of days? :-)

23:33 mshroyer: heh nope, this is a fresh repl, thanks though

23:33 S11001001: never experienced it myself

23:34 paging?

23:34 TimMc: Darn, can't blame it on the leap-second, then.

23:34 mshroyer: and it's swank-clojure 1.4.2 I'm using

23:35 S11001001: hmm, so you're hanging on round-trip for slime doc; after the delay you get a minibuffer goodie?

23:35 mshroyer: S11001001: yeah that seems to be what's happening, as far as I can tell

23:35 S11001001: & I should upgrade

23:35 lazybot: java.lang.RuntimeException: Unable to resolve symbol: I in this context

23:35 S11001001: heh

23:36 you a CL slime user by any chance mshroyer ?

23:36 mshroyer: well strictly, after the delay followed by me typing a space

23:36 S11001001: actually yes

23:36 sbcl

23:36 S11001001: got slime in your emacs load-path?

23:37 mshroyer: hmm why yes I do

23:37 S11001001: I had funky issues with the swank protocol screwing up [which caused a delay] when printing, because I had my own slime loading

23:37 okay that's almost certainly your problem

23:37 mshroyer: cool, let me try then...

23:37 S11001001: kick slime out of your load-path, restart, and let jack-in install its own slime stuff

23:37 wingy: hiccup is awesome

23:38 so simple and fun

23:38 S11001001: yeah, some crazy people want to add function invocation to it though

23:38 mshroyer: S11001001: good call! that fixed it, thanks!

23:38 S11001001: mshroyer: np

23:57 mindbender: isn't `lein repl` supposed to start a properly classpathed repl when started at the root of a clojure project?

Logging service provided by n01se.net