#clojure logs

2012-07-01

00:46pdkhi, are there any known guidelines for dealing with null pointer errors on source lines during compilation?
00:47pdki've got one function in a source fule that fails to compile with a null pointer on an unusual line
00:49adunull?
00:49aduwhat's the line?
00:49pdki'll pastebin
00:51pdkhttp://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
00:51pdkso it seems to be throwing a null pointer on the binding list of the doseq of all odd places
00:54michaelr525pdk: do you also get warnings?
00:54pdknope, compilation stops right there when i (load-file) into a repl
00:55pdkshould note it's the same story with 1.3 and 1.4
00:56wingywhat server do i have to run if i choose noir over aleph
00:56wingyjetty?
01:04aduwingy: I love noir
01:04aduwingy: all of the error messages that noir gives seem to contain the word Jetty
01:06pdkok my stack trace doesnt show anything related to the source either it seems
01:07pdkjust traces typical compiler funcionts
01:07pdkfunctions
01:12wingyadu: so if i run noir it will be jetty?
01:12wingyi have heard netty perform far better
01:12wingyand is a fit for web servers handling a lot of requests
01:12wingyi guess i should just try them both out and see for myself
01:16wingyguess i should read this one: http://brehaut.net/blog/2011/ring_introduction
01:18xeqiwingy: noir is independent of the server
01:18xeqiby default the noir templates use jetty
01:19xeqibut since ring has several adapter, you can run it with jetty, as a war in a servlet container, using aleph for netty, etc
01:19wingyright
01:26ibdknoxnetty does not perform better than jetty
01:26ibdknoxunless you're doing long polling
01:26ibdknoxwingy ^
01:27aduwingy: that's my guess
01:29ibdknoxin general, threaded servers are very, very good at serving short-lived requests
01:30Raynesibdknox: I need to talks to yous
01:31lynaghkWhat's the story with dynamic vars in cljs? I should be able to use one as a simple variable pretty much, no?
01:31ibdknoxRaynes: what's up?
01:32Raynesibdknox: 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).
01:32ibdknoxhm
01:32ibdknoxthey're so small
01:32RaynesI'm stuck between 'modularity is good and weavejester wont hate me' and 'jesus, they're so small'.
01:32ibdknoxI dunno that having them in their own namespaces makes sense
01:33amalloyeach middleware having its own namespace is annoying in ring, don't copy that
01:33ibdknoxyeah
01:33ibdknoxI agree
01:33RaynesI agree.
01:33lynaghkthirded.
01:33RaynesI'll change it tonight or tomorrow.
01:33Raynesibdknox: noir.utils or something else?
01:33ibdknoxhm
01:33Raynesamalloy: BTW, you should see if there is any middleware in 4clojure we should move to lib-noir, since 4clojure uses it too.
01:34lazybotI am revealing my sentience just to agree with amalloy on this.
01:34RaynesHurr
01:34kovasblol
01:34ibdknoxlol
01:35amalloy$logout (...nothing to see here...)
01:35lazybotYou've been logged out.
01:35amalloythere are a few neat middlewares but i don't know how generally-applicable they are
01:35kovasbis there a way to backchannel commands to lazybot?
01:35amalloykovasb: only if you own him
01:35kovasbmake sure it agrees with you :)
01:35kovasbhaha
01:35lynaghkkovasb: Your distrust of automatically-adding-watches to atoms is well placed. That stuff has been catching up with me the past few hours.
01:35amalloyanyone can make him agree with you, though, or shoot down your opponents
01:36Raynesamalloy: I'll take a look myself when I do the other stuff. ibdknox gets decide what goes in in the end anyways.
01:36Raynesgets to decide, even
01:36kovasblynaghk: getting too complicated, or something else?
01:36amalloywe have wrap-strip-trailing-slash, which is simple and probably useful
01:36Raynesamalloy: That was in refheap. Already moved to lib-noir.
01:36ibdknoxyeah, that is really useful
01:37lynaghkkovasb: 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
01:37Raynesibdknox: So noir.utils?
01:37Raynesnoir.utiddlware.
01:37amalloywrap-debug, though you'd want a version that doesn't depend on useful
01:37kovasblynaghk: ouch
01:37ibdknoxnoir.util.middleware?
01:38Raynesibdknox: Ah! Excellent.
01:38ibdknoxI used to have one with the wrap-utf8 thing, before that got included in ring by default
01:38kovasblynaghk: 24 hours later, I've finished migrating to build 1424 :)
01:38Raynesibdknox: I tried to get noir.session in ring, but weavejester didn't want it.
01:38kovasbthe horrors
01:38RaynesUnderstandable I guess.
01:38ibdknoxyeah
01:39lynaghkkovasb: 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).
01:39lynaghkkovasb: did you figure out what that index out of bounds thing was about?
01:39amalloythe client-side-caching features are pretty cool, actually, but maybe a little too complex to make part of lib-noir
01:39kovasblynaghk: yes, the compiler was breaking in the worst possible way
01:40kovasblynaghk: apparently was choking on innocuous stuff in some file
01:41amalloyibdknox: 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
01:41lynaghkkovasb: what was it? If you ran into it, we probably have some lil' time bombs waiting around too.
01:41ibdknoxamalloy: oh neat
01:41ibdknoxamalloy: that is also very useful stuff
01:41amalloybut 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
01:42antares_hey Raynes
01:42kovasblynaghk: my way of instantiating high charts was the culprit, was a hack due to some other limitation
01:42Raynesantares_: Sup?
01:42Raynesantares_: I saw your beta.
01:42RaynesCool stuff.
01:42RaynesI'll add it tomorrow.
01:42amalloyperhaps 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
01:43kovasblynaghk: i don't know what exactly about the syntax it was
01:43antares_Raynes: you can just add me to the refheap repo instead, I will break things for you
01:43RaynesHaha
01:43RaynesSec
01:43kovasblynaghk: I'm not understanding what a " atoms that are derefed in the watchers" is
01:44kovasbyou mean the downstream guys?
01:44Raynesantares_: Added.
01:44RaynesBreak away
01:44RaynesHow can I now add the Monger maintainer to my Monger app?
01:44Raynes;p
01:46lynaghkkovasb: 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.
01:46kovasbi see
01:47kovasband what happens when b is derefed?
01:47kovasbsomething bad?
01:47antares_Raynes: migrate to monger, get the maintainer for free
01:47antares_sort of
01:47lynaghkkovasb: potentially, yeah. I got some infinite loops out of it.
01:48kovasbits registering globally so you can have the dependency list?
01:48lynaghkkovasb: 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.
01:48kovasblynaghk: i was having the same problem today for about 3 hours
01:48kovasblynaghk: then i rebooted the browser, and it worked
01:49lynaghkkovasb: yeah. Monkey-patching the Atom type is the only way I could think of picking up atom derefs automatically
01:49lynaghkkovasb: since @ is an unchangable reader macro that expands into cljs.core.deref, so I can't do a namespace-specific protocol thing.
01:49kovasblynaghk: is the fact that B is making a side-effect irrelevant?
01:49kovasbto the example
01:50kovasbright
01:50kovasbyou pretty much have to roll your own atom to do this
01:51Raynesantares_: It's nice for me just because I can ask you for help.
01:51lynaghkkovasb: I'm not sure if that would fix this particular problem.
01:51RaynesThe work you're doing is a huge plus.
01:52kovasblynaghk: yeah, if you can simplify the issue then you can look at what knockout did
01:52simcop2387are 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"
01:52lynaghkkovasb: how do you mean?
01:52kovasbit would seem semantically correct for B to be a dependency
01:53kovasblynaghk: you are doing the same strategy as knockout?
01:53lynaghkkovasb: yeah, that's where I got the idea of implicitly registering in the first place.
01:54lynaghkkovasb: that project has really nice design-level documentation explaining how/why the internals work.
01:54kovasblynaghk: if infinite loops are the problem, i imagine it had those too
01:54kovasblynaghk: until they figured out how to fix it
01:54lynaghkkovasb: 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.
01:55kovasblynaghk: but it is repeatible?
01:55lynaghkkovasb: 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.
01:55kovasbyeah for sure
01:55lynaghkkovasb: between cleaning out lein cljsbuild caches and stuff? Yeah.
01:56kovasblynaghk: js/alert ftw
01:56kovasbsophisticated tools for sophisticated languages
01:56lynaghkI 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
01:57kovasblynaghk: that could be useful
01:57lynaghkinstead of printing out 20-levels deep implementation details of cljs.
01:57kovasblynaghk: also, I'm personally breaking down and resolving to learn to use the analyzer
01:57kovasblynaghk: get get to the bottom of what's going on
01:57lynaghkkovasb: I'll break down and buy you a bottle of scotch next time I run into serious shit then =P
01:57kovasblol
01:58kovasbit will be a function in session
01:58kovasbso it can be easily repeatible
01:58kovasbanalyze this
01:59aduI read a book on clojure today
01:59kovasbgive some nicely tooltiped/hilighted source representation
01:59aduI think it was called "The joy of Clojure"
01:59kovasbadu: you read the whole thing in one day??
01:59lazybotkovasb: Uh, no. Why would you even ask?
01:59aduI had a lot of fun reading it :)
02:00kovasbglad it delivers on its title
02:00adukovasb: I spent the day at a book store because I have no electricity
02:00kovasbcool
02:00adubut now I'm running a generator for my milk, meat, lettuce, and cheese, so I plugged my laptop and router into the fridge
02:01kovasblol
02:01kovasbi see you like simplicity then
02:01aduyes, as long as I have cheese and internet I am a happy man
02:03aduso I've been slowly realizing that clojure is everything I could ever want
02:03aduI've been building a webserver in it
02:03kovasbits like a combination of cheese and internet
02:04aduyesssss
02:04adumy webserver is currently using noir+cheshire+clostache
02:04aduand I'm realizing that clostache and noir don't work well together
02:05aduyou have to use {{{x}}} to substitude html in mustache, and then it works
02:05kovasbI'm a fan of hiccup myself
02:05aduI really want to separate my content from the logic
02:05kovasbhiccup is content
02:05aduand mustache has a zillion implementations
02:06kovasbi see
02:06aduso if I wanted to port my site to intercal, I could
02:06kovasbright
02:06adubut I probably won't
02:06kovasbyou should be able to take from noir what you want, and use moustache
02:06aduthe prototype for the site was in django, but I'm starting to hate django
02:06kovasbyes, once you've realized clojure is all you can ever need
02:06aduand I'm starting to love clojure
02:06kovasbwhy not just go native
02:07aduso you're saying I should write my templates in huccup, not clostache?
02:07kovasbmy position is
02:07kovasbi think templating languages are like child-programming
02:08kovasbi really don't like non-universal sublangauges
02:08aduwhat I don't like about template languages is that they're one-way
02:08kovasbclojure can represent everything you need
02:09kovasbyeah, theres that problem. but its just a consequence of it not being a real programming construct
02:09aduI'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
02:09kovasbits a interesting field, lots of efforts at interesting stuff
02:10aduimagine, parser = G.parse(), template = G.inverse()
02:11aduthe possibilities
02:11adumy at-work efforts are all about webde
02:11aduv
02:11adumy at-home efforts are all about my function database
02:12aduI truely believe in it
02:12aduthat it could become a compiler-compiler-compiler
02:12adumy friends tell me that's too "meta"
02:12aduI don't case
02:12adus/case/care/
02:18antares_Raynes: how can I delete a paste in refheap?
02:20amalloyRaynes: 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?
02:31wingywhat does the #' mean in: run-jetty #'app {:port 8080 :join? false})
02:33aduwingy: I don't know
02:34aduwingy: in Common Lisp it means something, I don't know about Clojure
02:34napping#'app returns the Var that app refers to in the namespace, rather than looking up the value of app
02:34nappingthat means if you redefine app, run-jetty can see the new value through the var
02:37wingynapping: i see thx
02:37wingynapping: since everything is immutable right?
02:37wingyif we passed the app value instead it would still keep the old one even if we changed the var
02:40nappingYeah, if it's not picking up changes, forgetting that could be why. seems like run-jetty could be a macro to avoid that
02:42Raynesantares_: 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.
02:42antares_Raynes: I figured why I cannot sign in
02:42antares_I actually can
02:43antares_but then something fails to authenticate as an SSL peer
02:43antares_and fails
02:43Raynesamalloy: mmarczyk had a similar problem, his username had somehow become null.
02:43amalloyi'm probably just using a different email address
02:44antares_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
02:44antares_to a different window
02:44Raynesantares_: That doesn't happen to me.
02:44Raynesamalloy: Oh, wait, you're complaining about something different.
02:45Raynesamalloy: You shouldn't sign up with an email address you can't remember.
02:45Raynesantares_: I'll try it in safari.
02:45amalloywell 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
02:46Raynesamalloy: Anyways, I can change your account email for you if you want.
02:46amalloymeh. if i desperately need to sign in, i'll just find a way to hack your heroku account
02:47antares_ah, wait
02:47amalloyprobably by starting some kind of heroku-api project and convincing you to commit your password
02:47Raynesantares_: 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.
02:47antares_I think browserid redirects to an HTTPS page
02:47Raynesantares_: If you know js and want to take a look, feel free to punch it in the face and fix that issue.
02:48Raynes*shrug*
02:48antares_Raynes: ok, I will take a look, I am trying to sign in somehow first
02:49Raynesantares_: I can't reproduce that either. I can sign in in any browser just fine. :|
02:49RaynesOr do you mean locally?
02:49antares_locally
02:49RaynesIn safari?
02:49antares_in any browser
02:49RaynesGoing to try.
02:50Raynesantares_: 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. :\
02:50RaynesLooks fine in every other browser.
02:50RaynesI need to look at it/get a css guy to look at it.
02:50RaynesNot necessarily you, just pointing it out in case it looks weird for you.
02:52Raynesantares_: Btw, does Monger have a special function for updating records?
02:52antares_updating records?
02:53antares_it has everything that mongo shell has
02:53antares_like monger.collection/save coll document
02:53antares_if that document has :_id, it will be saved
02:53antares_updated
02:53antares_if not, inserted
02:53RaynesThen that's probably what I'm talking about. congomongo has an update function that updates a document.
02:54RaynesAnyways, does it return a write result?
02:54antares_yes, but we can add save-and-return
02:54antares_but so far I have only seen you use regular updates
02:54RaynesRegular updates was what I was talking about.
02:55antares_I found out what fails
02:55RaynesSorry, I don't understand mongo that well. I'm probably sounding like a lunatic.
02:55antares_http/post to "https://browserid.org/verify"
02:55RaynesSo, refheap isn't working at all for me.
02:56Rayneshttps://www.refheap.com/paste/3397
02:56RaynesThat's what I get when I try to go to /
02:56antares_ok, things work better on oraclejdk 7 which has a differnt set of SSL certificates
02:56antares_yes, I am now seeing the same
02:57antares_I think collection is passed as a keyword somewhere
02:57antares_monger uses strings
02:57RaynesY U BREAK MY REFHEAP
02:57Raynes:p
02:57antares_but I am also redirected to /paste from the root
02:57RaynesI've got to take off. Do you need anything before I run?
02:58antares_yeah, it's in the session store
02:58antares_no, I think I am all set
02:58RaynesCool. I'll mess with all of this stuff tomorrow. I'm going to hack until my fingers bleed tomorrow.
02:58RaynesLaters
02:58antares_Raynes: wait, one question
02:59RaynesSup
02:59antares_Raynes: do you know what may be passing keywords instead of strings to the session store?
02:59antares_I will probably just support keywords as collection names in monger but it is not immediate from the trace
03:00RaynesGood question.
03:00Raynesantares_: (monger-store :sessions)
03:00antares_*immediately obvious
03:00Raynesserver.clj, last line.
03:00antares_ahh, yeah
03:00antares_ok, thanks
03:00Raynes:)
03:01wingyis there a good way to look inside the deps my project is using
03:01wingyto see what namespaces and functions i can use
03:02wingyand their source code .. at the moment they are all .jar:s in .m2/ folder
03:02amalloyopen up the jars in emacs
03:02antares_tab completion in the REPL, it is also not hard to write a function that will list all namespaces under the given one
03:02antares_listing functions is also not hard but some namespaces have quite a few
03:02wingydamn not using emacs
03:03antares_wingy: no need to opening jars in emacs, that's too hardcore
03:03antares_*open
03:03wingyi forgot i could look at their github repos
03:06amalloyantares_: what's hardcore about it? using emacs? reading the source?
03:07antares_amalloy: asking newbies to do both
03:07adugithub++
03:07antares_reading the source is very important but is also not an option early on
03:07antares_and if you need to do it, like adu says, it is easier to browse the repo on github
03:08aduwingy: I've been trying to keep up with your questions
03:08amalloyreading the source is going to be easier than writing a function to list namespaces/functions
03:11wingyadu: i ask a lot dont i :)
03:12aduasking questions is good
03:17wingy"lein repl" starts my server immediately which makes me unable to use the repl
03:18antares_wingy: lein repl compiles your code
03:18wingywhat should i do to regain the repl
03:18antares_this means that you are starting your server in the top-level ns code
03:18antares_which is wrong
03:18antares_start it in -main
03:19wingyi do
03:19wingyin my project.clj there is : :main yobistore.core
03:19antares_anything that blocks cannot be used in the ns code
03:19antares_otherwise lein or anything else that compiles that namespace will be blocked
03:19antares_wingy: it may be one of the dependencies, too
03:20wingy(def -main
03:20antares_quartzite once had this problem when it started the scheduler in the top level code
03:20wingy (run-jetty #'app {:port 8080 :join? false}))
03:20wingyi run it in the -main .. so the repl must behave like "lein run" it runs the -main immediately thus blocking the repl?
03:21wingyok ill look into it
03:21wingyi should follow a guide
03:24antares_wingy: lein repl does not invoke -main
03:24antares_I am in the refheap's repl right now, for example
03:25antares_but both of them compile your code
03:25antares_so if there is anything in the namespace body and not functions, it will be executed after compilation
03:26amalloywingy: (defn -main [& args] ...), not (def -main ...)
03:28wingywii
03:28wingyamalloy: :D
03:28wingythat was the problem
03:30wingyns-publics is quite good for listing everything
03:31wingybut github was better .. no ns-publics, then doc, then source etc
03:39wingycoming from node.js its pretty simple to get middleware and stuff
03:39wingylein is like npm with superpower
03:49amalloyisn'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
03:56antares_wingy: most of that comes from sitting on top of a very large mature ecosystem that solved many problems many years ago
03:57wingyamalloy: yeah .. lein is package manager + build system?
03:58amalloymostly it's a build system
03:58wingycool
03:58wingyantares_: yeah i start to like using java now and looking at their std lib
04:00antares_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)
04:01antares_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.
04:01antares_so you can do things like (-> 2 months ago)
04:02wingywow
04:03amalloydates aren't even that good for the current date :P
04:03antares_amalloy: I agree :)
04:03wingyi start to like jvm .. except the boot time
04:04wingy"the power of the sun in the palm of my hand"
04:05wingyclj/jvm that is
04:08wingydo you prefer enlive's or hiccup's way of doing templating?
04:09wingyfeels that hiccup conform with clj very naturally since it's a DSL and enlive is cleaningly separating template from code
04:10wingyyou have your .html files and then code that manipulates it
04:10antares_I use stencil (a Mustache implementation)
04:11antares_hiccup is fine but frontend developers probably won't like it
04:11antares_mustache typically raises no issues, in fact, some really likei t
04:12wingyantares_: what about enlive?
04:12wingywouldn't frontend devs like it
04:12antares_I haven't tried it
04:12antares_possibly, stencil works well for me and I am happy with it :)
04:16wingyseems not very up to date
04:16wingy8 months ago
04:16wingy7
04:17wingyclojure 1.3
04:17ibdknoxstencil is solid
04:17ibdknoxit hasn't needed updating
04:18ibdknoxsince the mustache spec doesn't change much :)
04:23antares_wingy: stencil is very solid
04:24antares_wingy: another thing about Clojure and JVM is that if something isn't updated for 7 months, it does not mean it is abandoned
04:24antares_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
04:24antares_all http://clojurewerkz.org projects are on 1.3, even though most apps that I use them with are on 1.4
04:24wingyi like how light weight things are in clojure world
04:24antares_we test against 1.4 and 1.5-master-SNAPSHOT
04:25antares_but the default version will be 1.3 for probably at least 1.6 release
04:25wingyok
04:25antares_why? because some folks use 1.3
04:31amalloyibdknox: dsantiago was complaining about proposed changes to the mustache spec this morning
04:31amalloywhich tbh look pretty horrible
04:35dsantiagoamalloy: Like I (and Chris) said, the spec doesn't change much ,despite all the discussion.
04:58otfromseancorfield: are you around?
05:02wingyfor those of you that are using clojure with heroku, what server is heroku using to serve the clojure app?
05:02wingyor is it using whatever server (tomcat, jetty, netty) you are using yourself?
05:03antares_wingy: with Heroku it is typically Jetty because it is embedded
05:03antares_but I don't think Heroku provides you a container like tomcat
05:03wingyantares_: is netty embedded as well?
05:04wingyis jetty good for production?
05:04antares_and netty is typically used as an I/O library, I don't think many projects use its HTTP server as is
05:04antares_wingy: Jetty is at 8.0 or so
05:05wingyantares_: i mean is it fast/reliable enough for many concurrent conncetions in production mode?
05:05antares_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
05:05antares_wingy: Yammer's production services run Jetty
05:06antares_wingy: and they have gazillions users and $MSFT bought them out for 1.1 billion
05:06antares_wingy: good enough for you?
05:06wingywow
05:06wingyhm
05:06wingyyeah it'll do
05:07antares_in general, just about anything should yield several thousands requests per second on hello world-ish apps
05:07antares_people choose jetty because it is really easy to just embed and never worry about it
05:08wingyyeah
05:08wingyill just use that then
05:08wingyand see where it gets me
05:08wingyin my ears embedded sounded weaker than stand alones
05:08otfromheroku have nginx -> jetty, so the jetty isn't directly exposed to the internet
05:09otfromwhich is also something you need to be aware of if doing SSL
05:09otfromas the SSL is between nginx and the world, but the nginx -> jetty is normal http
05:10antares_wingy: how? node.js' hyped HTTP server is embedded
05:10antares_wingy: embedded just means "used as a library". Of course frontend Heroku is Nginx
05:12wingyantares_: i c
05:12wingyusing things as a library is awesome
05:13wingyhate having to start things separately
05:13wingyor bind things through the shell
05:13wingyinstead of in code
05:18noidiis there an equivalent of interface inheritance for protocols?
05:19noidiI'd like to state that my Connections (protocol) are java.io.Closeable
05:20antares_noidi: no, any protocol can be implemented for any type, there is no hierarchy
05:33antares_Finally got to documenting Monger's core.cache and Ring session stores, including a Noir integration example: http://clojuremongodb.info/articles/integration.html
05:46winkso it seems my one running clojure instance didn't choke on the leap second \o/
07:10wingydo you feel i should use noir or compojure and hiccup directly in my ring app?
07:12noidihow 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?
07:16wingythink i will go with noir
07:16wingykeep boilerplate code out of my app
07:26wingyis it ok to specify plugins in project.clj?
07:29aperiodicyes
07:30aperiodiconly if it's really needed to do some sort of build/test/run thing, though
07:31aperiodicif it's just for development convenience (e.g. lein swank) then stick it in ~/.lein/profiles.clj
07:35wingyi would rather want everything in project.clj
07:39hyPiRionwingy: Problem with that is that you enforce dependencies which aren't needed to run the project.
08:03wingyi got FileNotFoundException Could not locate _main__init.class or _main.clj on classpath: clojure.lang.RT.load (RT.java:432)
08:03wingywhen running lein repl
08:03wingyanyone knows what that means?
08:05wingynvm
08:05wingysomething wrong in project.clj that i fixed
08:05wingyby CTRL-Z
08:09wingythis is weird
08:13michaelr525(GET "/place/:id" {{place-id "id"} :params headers :headers}
08:13michaelr525does it look like a valid compojure route ^^^^^^^^^^ ?
08:14weavejestermichaelr525: The compojure.handler/site function includes wrap-keyword-params, so if you're using that, it should be {place-id :id}
08:15weavejestermichaelr525: You could also write it as [id :as {headers :headers}]
08:16weavejestermichaelr525: Although more commonly, headers are handled by middleware.
08:17michaelr525thanks!
08:17michaelr525hope it will work, i think the compojure version used here is old
08:18weavejestermichaelr525: You might want to upgrade then. Compojure hasn't changed that much, aside from bug fixes.
08:20michaelr525i 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..
08:21michaelr525weavejester: the keyword syntax worked :)
08:22michaelr525maybe the docs should be updated too, since they use the string convention..
08:22weavejestermichaelr525: Well, it depends on whether you've wrapped your routes in wrap-keyword-params or not.
08:22michaelr525ok, got it
08:44jayunit100__whats the advantage of having a separate file for each test file ? it seems like just more… files to maintain.
08:45_ulisesjayunit100__: surely you wouldn't want a single file with all your tests either?
08:46zaamkablamWell, 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.
08:47jayunit100__no… i mean, each ns file could come with the tests in it.
08:47jayunit100__so if I have 5 files in a project, then each file would have (i.e. at the bottom) several deftest entries.
08:48_ulisesjayunit100__: wouldn't that include your tests in your software when you deploy/release it?
08:48jayunit100__yeah i don't think thats the worst thing.
08:48jayunit100__i mean, clojure is pretty compact.
08:49jayunit100__but point taken nonetheless :)
08:50_ulisesjayunit100__: 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.
09:00jayunit100__speaking of tests.....
09:00jayunit100__leon test outputs are difficult to read. any better test debugger tools for clj ?
09:00jayunit100__s/leon/lein
09:02_ulisesjayunit100__: I've recently started using midje and I find it wonderful
09:02_ulisesjayunit100__: you also have the difftest lein plugin which tries to do a diff of the expected and actual values
09:06jayunit100__do u use midge in lein ?
09:07_ulisesjayunit100__: yup
09:10jayunit100__ok cool maybe ill try it :)
09:15_ulisesjayunit100__: there's a lein-midje plugin too :)
09:15jayunit100__yup i assumed so :)
09:24DrakesonI noticed there are various projects with C, LLVM, etc. as the backend beside Clojurescript. Is there one with Haskell as the backend?
09:37zaamkablamHey, anybody familiar with clojure.contrib.graph?
09:39zaamkablamSeriously, newb question here. Cheap karma, yo.
09:42wingymichaelr525: are you using clojure without noir?
09:45Scriptorzamaterian: go ahead and ask, someone might still be able to answer
09:46zaamkablamIs 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.
09:47madsyzaamkablam: There should be a git repo with sample code for those libraries
09:47zaamkablamYeah, I'm looking for it now.
09:47zaamkablamThanks. :)
09:48madsyAfter all, a lot of stuff in the main namespace are APIs that once was in contrib
09:48madsywere*
09:49madsyI still miss some platform-independent OpenGL bindings :/
09:49madsyUsing Swing for graphics is horrible
09:50zaamkablam... or using Swing at all? :)
09:53zaamkablamSo, yeah, turns out graphs are just structs with :neighbors and :nodes
10:09ab3hi
10:10ab3I installed clojure on osx with brew, i can eval cmds but when I press the up key I get this "^[[A" characters.
10:10ab3any idea whats up with that
10:14zaamkablamSimple answer: no
10:14zaamkablamI have that as well.
10:14zomgAs do I
10:14zaamkablamBut, I suggest you get Leiningen. It's REPL is much more comfortable.
10:14zomgFine on Ubuntu though
10:16zaamkablamYou'd go like 'Computer-machine! Gimme `lein repl`, yo!' and it will be awesome.
10:17ab3well that is annoying, is this leiningen normal clojure?
10:18sirsublimeYes, it's basically a lightweight build and development tool.
10:18sirsublimeFor Clojure that is.
10:19kippy1for 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:19ab3I'll try it out
10:20sirsublimePersonally, 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:35kippy1Guys, 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:21cshellIs it bad that I had a nightmare last night where someone stole my nick?
11:22kmicuyes
11:22borkdudecshell I am wondering about this too sometimes, what if someone else starts using mine
11:22cshellthat's what I thought
11:22cshellyou can register your nick with nickserv
11:22cshellthat's what I did
11:22borkdudethat's on IRC only
11:22cshellbut in the dream someone got it
11:23cshellah
11:24cshellcshell is what i use on irc - elsewhere its 64BitChris but irc doesn't like that nick
11:31rlbAny idea why (Thread/sleep 1000) might be pegging the cpu(s) suddenly (used to work fine).
11:32rlb...perhaps a java problem -- happens in 1.2, 1.3, and 1.4 now.
11:32pdkhey, 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:32pdkfails to compile with a null pointer exception on line 17 for me on 1.3/1.4
11:32pdkwhen loading source from repl
11:37rlbpdk: here, repl doesn't matter even clojure -e '(Thread/sleep 1000)' pegs the cpu(s).
11:38pdkoh sorry i was asking about an unrelated issue actually
11:38rlbin my case, since it suddenly happens in all three clojure versions, I sispect some java change (and I did recently update openjdk).
11:42rlbyeah, it's java...
11:42rlb(current debian unstable openjdk 7, fwiw)
11:42cshellrlb: is it openjdk or does it happen on the oracle jvm?
11:43rlbhappens to openjdk 6 too -- makes me wonder if there might be something strange happening on this machine...
11:43pdkactually
11:43pdkwhen you say pegs the cpu can you clarify there
11:43pdkruns at 100% load i'm assuming?
11:44lynaghkping: dnolen
11:44rlbjust looking at top -- runs at ~150% CPU
11:45rlb(noticed because the fan winds up)
11:45pdkyes oracle jvm here is fine
11:54dnolenlynaghk: pong
11:54lynaghkdnolen: morning dude.
11:55lynaghkdnolen: 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:56dnolenlynaghk: probably not until cKanren gets wrapped up.
11:56lynaghkdnolen: 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:56dnolenlynaghk: once that's solid I'm planning on spending some serious time on core.match.
11:56dnolenlynaghk: you can use :guard for the old behavior.
11:57dnolenlynaghk: but yes breaking change.
11:57lynaghkdnolen: okay, cool. Do you have a sense of how long the cKanren stuff will take? I.e., more than a month?
11:57lynaghkdnolen: 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:57dnolenlynaghk: ~month? <month? It's getting close.
11:58lynaghkdnolen: okay, sweet.
11:59dnolenlynaghk: I'm happy to apply your two CLJS patches and cut another alpha if that would help you out.
11:59lynaghkdnolen: that would be super rad, thanks!
12:00lynaghkdnolen: With the cKanren stuff on core.logic, is that a speed thing, or is it adding new features for maths to the engine?
12:01dnolenlynaghk: not speed at all. yes arithmetic becomes sensible.
12:01dnolenlynaghk: but it also makes cKanren a generic extensible constraint solver.
12:01dnolenlynaghk: i mean "makes core.logic"
12:02lynaghkdnolen: 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:02lynaghkbe faster.
12:02dnolenlynaghk: 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:03dnolenlynaghk: been adding cKanren functionality with an eye for perf.
12:04lynaghkdnolen: 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:05rlbThe 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:05rlbresetting the date fixed it
12:05lynaghkdnolen: 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:06dnolenlynaghk: haha, yeah pretty cool. Not sure how much we'll see of him tho :) He'll stay in SF.
12:09dnolenlynaghk: patches applied, alpha11 going out.
12:09dnolenlynaghk: er alpha10 I mean.
12:09lynaghkdnolen: thanks a ton David!
12:11lynaghkdnolen: 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:11lynaghkdnolen: 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:11dnolenlynaghk: link?
12:12lynaghkhttps://github.com/lynaghk/c2-demos/tree/master/todoMVC
12:12dnolenlynaghk: thanks, will check it out.
12:17samratslimv users, how do i turn off autoclosing of parentheses in the REPL? it's preventing me from entering multi-line lists
12:22hyPiRionHmm, 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:23hyPiRionI've read it before, but I'm unable to find it.
12:24rlbhyPiRion: 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:25rlbi.e. if you're creating a function that will operate on a collection (and the resulting order isn't critical)
12:29hyPiRion,(doc conj)
12:29clojurebot"([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:31pdkhyPiRion
12:31hyPiRion?
12:31pdkit always picks whichever end is going to have O(1) insertion for the type of collection given
12:35hyPiRionpdk: 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:38treehughyPiRion: what function ?
12:39hyPiRionconj
12:43rlbhyPiRion: 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:46hyPiRionrlb: 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:46rlbSay 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:46clojurebot"([x seq]); Returns a new seq where x is the first element and seq is the rest."
12:46rlbhyPiRion: and there are other functions that allow you to be more specific when it matters.
12:47rlbhyPiRion: btw, if you haven't seen it yet, you might find this useful - http://clojure.org/cheatsheet
12:48hyPiRionrlb: I'm using it everyday :)
12:49hyPiRionIt'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:51ab3I can install leiningen with brew on osx
12:52pdkit behaves differently based on concrete type so it breaks sequence abstractions, pretty much just for performance in cases for doing things i
12:53pdklike using a structure as a stack
12:53ab3I get a 502 error: Error: Download failed: http://github.com/technomancy/leiningen/tarball/1.7.1
12:53rlbhyPiRion: 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:53ab3anyone knows there I can find a working formula
12:53rlbi.e. if I'm writing (defn foo [coll] ...) and I want to add an element to coll *efficiently*, I can just use conj.
12:54rlbIf 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:56hyPiRionrlb: Okay, so it's for efficiency reasons then.
12:57rlbabsolutely
13:05anierowhoa, lein-tarsier is *awesome*
13:05anierosattvik: ^^
13:07sattvikaniero: Ah, thanks. Although i think it needs a couple updates to take advantage of new features in lein2.
13:07anierowhich i'm not using yet, so hey :)
13:07anieroSO much easier than figuring out an "ng-server" shell command &c
13:07anieroand having a repl on the terminal with access to the same runtime state as my editor is <3
13:07anieroso: thanks!
13:16locojayhi 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:20gfredericks&(clojure.string/replace "foooooo" #(str "\." "bar" "$") "html")
13:20lazybotjava.lang.RuntimeException: Unsupported escape character: \.
13:21gfrederickswell that's one problem at least
13:21gfrederickswhat did you intend by "\."?
13:22locojaygfredereicks change for example "test.xls" to "test.html" where i have e variable ext with the value "xls"
13:23gfredericks&(doc clojure.string/replace)
13:23lazybot⇒ "([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:23locojaydoing (str/replace "test.xls" #("\.xls$") "html") will work
13:23locojaybut not it i do the above since my ext might change
13:23gfredericksI highly doubt that
13:23gfredericksbut I think I know what you're asking
13:24gfredericksyou'll either have to create a regex yourself, which seems to be what you're trying to do, or test the ending substring
13:25gfredericks&(apropos "pattern")
13:25lazybotjava.lang.RuntimeException: Unable to resolve symbol: apropos in this context
13:25gfredericks&(clojure.repl/apropos "pattern")
13:25lazybot⇒ (re-pattern)
13:25gfredericks&(doc re-pattern)
13:25lazybot⇒ "([s]); Returns an instance of java.util.regex.Pattern, for use, e.g. in re-matcher."
13:26gfredericks&(let [ext "xls"] (clojure.string/replace "test.xls" (re-pattern (str "\\." ext "$")) "html"))
13:26lazybot⇒ "testhtml"
13:26gfredericks&(let [ext "xls"] (clojure.string/replace "test.xls" (re-pattern (str "\\." ext "$")) ".html"))
13:26lazybot⇒ "test.html"
13:26gfredericksthar it is
13:26locojaythanks
14:14SrPxAm I the only one who thinks "+" is wrong? It should have an arity of 2. (reduce +) should be the same as the current +
14:14SrPx):
14:15tomojhow exactly? you don't mean ((reduce +) 1 2 3) == (+ 1 2 3) I guess?
14:15AimHereClojure complains because you're feeding the wrong arity to reduce, not +
14:16SrPxtomoj: yes thats what I mean
14:16SrPxAimHere: sigh reduce should have arity of 1 then
14:16SrPxtomoj: ((reduce +) [1 2 3]) actually
14:17AimHereThat sounds very inconsistent though
14:17SrPxsounds perfectly consistent for me : s
14:17AimHereReduce takes a function as it's first argument, and spits out whatever the result of that first argument is
14:18SrPxthis way you can generalize the concept of what the current + does to any other binary mathematical function ou invent...
14:18AimHereYou're saying that if there's no arguments, reduce returns a function '+', and if there are arguments, it returns a number
14:18SrPxby ((reduce my-func) [1 2 3])
14:18tomojmaybe you mean (reduce my-func [1 2 3]) ?
14:19tomojoh, I see
14:19SrPxtomoj: no, because if reduce has an arity of 2
14:19tomoj(partial reduce my-func) ?
14:19AimHereAh, shouldn't you just want to call this something other than reduce?
14:19SrPxtomoj: you cant do this: (send-action destination (reduce my-func))
14:20tomoj(send-action destination (partial reduce my-func))
14:20SrPxAimHere: fold maybe
14:20tomojfold is already taken :P
14:20SrPx):
14:20AimHereAlso, 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:20SrPxtomoj: maybe a funny symbol
14:22SrPxAimHere: hmm yes
14:23SrPx(defn fl [func] (partial reduce func)) ... ((fl +) [1 2 3]) = 5 <- not sure if this is would work
14:23SrPx wow
14:23SrPx= 6*
14:23tomojs/commutative/associative/ ?
14:23SrPx=p
14:23SrPxanyways
14:23SrPxis there a library for event dispatching and stuff on clojure?
14:23tomojalso for compatibility with clojure.core.reducers my-func should have a zero-arg identity
14:24SrPxwat
14:24tomojI'm working on one at the moment
14:24SrPxtomoj: can I see it
14:24tomojlike (+) == 0 is the identity for additition
14:24tomoj(my-func) should return the identity for your operation
14:25SrPxtomoj: oh there is this, but is this necessary? the starting value can just be (+ element-1 element-2)
14:25tomojif you don't use clojure.core.reducers you don't need it of course
14:25tomojclojure.core.reducers/reduce uses (my-func) instead of element-1 as the starting value
14:25SrPxI know
14:26SrPxjust asking if this is necessary for the reduce behavior? or a particular choice?
14:26SrPxI 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:26tomojnot sure why they chose that. I suspect it is more general. maybe it is needed for fold?
14:27SrPxthey do it in other languages too. idk
14:27SrPxtomoj: you are working on event dispatch?
14:27tomojyeah, nothing to show yet though
14:27SrPxHm okay
14:27SrPxguess I am too : s
14:28SrPxas I can't find one and I absolutely need this to start any useful project
14:28tomojyou're using clojure on the jvm?
14:28pdkif the function has multiple arities then reduce will always pass it only 2 arguments on each call
14:28tomoj(or js)?
14:29SrPxI guess so? I'm just starting at this point I've not passed the 'download leiningen and play with its repl phase'
14:29SrPxtomoj: oh jvm definitely not js
14:29tomojhave you looked at lamina?
14:29SrPxlet me see
14:29tomojhttps://github.com/ztellman/lamina/
14:30tomojmaybe also relevant https://github.com/ztellman/aleph/
14:30SrPxtomoj: not sure what he is doing on lamina o.o
14:31pdkadditionally i'm still looking at what i can only conclude might be a compiler bug
14:31tomojI 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:31pdkwith a function that fails to compile throwing a null pointer on the binding list of a doseq
14:31tomojhttp://www.infoq.com/presentations/Event-Driven-Programming-in-Clojure
14:35SrPx(reading about aleph atm, seems interesting)
15:02SrPxIs redefining default stuff disrecommended (forgot the eng. word) ?
15:06amalloySrPx: discouraged. and yes, mildly: if you have a good reason go ahead
15:06amalloyassuming that what you mean is defining a new function named, say, `get` in your namespace, for example to do a database get
15:07amalloyif you actually mean overwriting clojure.core/get with a new function, then probably never
15:07jweissi'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:09SrPxamalloy: 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:10SrPxwould this break clojure's core stuff?
15:10amalloyyou can do that in your own namespace if you want, and excluse all the clojure.core functions
15:10amalloy*exclude
15:10amalloybut if you try to replace the clojure.core functions your runtime will explode and ninjas (probably me) will murder you
15:10SrPxexclude it?
15:10SrPxlal
15:11SrPxits not even possible is it?
15:11SrPxto actually replace them
15:11SrPxo.o
15:11TimMcYou can certainly *shadow* the fns.
15:11SrPxexcept if you change the source I guess
15:11SrPxbut thats not what I meann
15:11amalloyyou can replace them, and if you do then bad things will happen
15:11amalloyso you shouldn't
15:12TimMc(:refer-clojure [:exclude (+ - / * ...)]) or something, then (defn + ...)
15:12borkdudealso some functions are inlined so shadowing won't work always, right?
15:12amalloyborkdude: shadowing would always work; replacing wouldn't always
15:12borkduderight
15:13amalloy(one of the bad things i alluded to)
15:30jg__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:31jg__?
15:37borkdudejg__ (Date.) is the same as new Date() in Java
15:38jg__borkdude: is the syntax documented somewhere? can't find it...
15:39borkdudehttp://clojure.org/java_interop, search for (Classname. args*)
15:39borkdudejg__ I see now you can also write (new Date), didn't know that
15:39borkdude,(new Date)
15:39clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: Date, compiling:(NO_SOURCE_PATH:0)>
15:40borkdude,(new java.util.Date)
15:40clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ExceptionInInitializerError>
15:40borkdude,(java.util.Date.)
15:40clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class java.util.Currency>
15:40borkdude,(java.lang.Date.)
15:40clojurebot#<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: java.lang.Date, compiling:(NO_SOURCE_PATH:0)>
15:40borkdudehmm
15:40amalloy&(java.util.Date.)
15:40lazybot⇒ #inst "2012-07-01T19:40:00.608-00:00"
15:40borkdude&(new java.util.Date)
15:40lazybot⇒ #inst "2012-07-01T19:40:16.202-00:00"
15:40amalloyhiredman: clojurebot seems broken again
15:41SrPxI have to work
15:41SrPxbut clojure is so more awesome : (
15:42jg__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:42borkdudejg__ it's there also
15:43borkdudejg__ I literaly posted the text
15:43borkdudejg__ again: http://clojure.org/java_interop, search for (Classname. args*)
15:43jg__ohhh, that's true
15:43jg__damn, i must be tired
15:43jg__thanks!
15:43borkdudejg__ no problem, happens to me all the time ;)
15:59wingyhey guys
16:00wingyi 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:01wingythe doc for the individual components seem to be pretty good
16:01weavejesterI tend to prefer using Compojure directly
16:01borkdudewingy of course, the more knowledge the better
16:01Rayneswingy: Nothing wrong with using Compojure.
16:02Rayneswingy: I'm a maintainer of Noir and using Compojure in some of my projects. Probably even going to move Refheap to Compojure.
16:02borkdudeRaynes that's what I was curious about, but it was too short to tweet lik you said
16:02borkdudeRaynes what are the reasons to move?
16:03wingyRaynes: you dont like noir's abstraction over compojure and hiccup?
16:05Raynesborkdude: 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:05Raynes sure lib-noir works with Compojure and doesn't accidentally acquire noir-specific behavior.
16:06borkdudeRaynes ok cool
16:06Rayneswingy: 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:06RaynesIt is designed to help you get a website together that is organized well and keeps you from having to hunt for libraries.
16:07borkdudewingy Raynes right, abstraction over hiccup? it's just normal hiccup right?
16:07RaynesAbstraction over Compojure.
16:07borkdudeah.. don't you like (abstraction over compojure) and hiccup
16:08borkdudeit would make life so much easier if people started using parens in natural language ;)
16:08RaynesBasically, 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:08ivaraasenNoir is great
16:08RaynesWith Compojure, you just create Compojure routes and compose them into a handler yourself. It's about 3 extra lines of code.
16:09pipelinenoir and korma are what drove me to learn clojure
16:10ivaraasenpipeline: yeah, i'm learning Clojure right now due to Noir
16:10RaynesThe 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:11borkdudeand the docs are nice to read
16:11borkdudewhich is a big plus
16:11RaynesThe 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:16Raynesborkdude: 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:16Raynes difference -- 2 hours is the library hunting difference. ;)
16:17RaynesA 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:17hyPiRionRaynes: Yeah, as long you find out that Clojure is in fact nice for web devel, you've got them hooked.
16:18gfredericksthe route definitions get sprinkled around the various defpages?
16:18borkdudegfredericks yes
16:18hyPiRionThey can learn the more "amazing" stuff later on.
16:18gfredericksman; that acutally makes me like rails for something
16:18borkdudegfredericks explain
16:18borkdude(don't know rails)
16:18Raynesgfredericks: That's another reason I'm wary of it and some people plain don't like it.
16:19gfredericksborkdude: in rails all the routing goes in one file
16:19cemerickThe community effect is great, but stateful sessions are evil (not surprisingly). </non-sequitur>
16:19RaynesIt'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:19gfredericksso when something's really fubared you can start there and follow the path of execution rather than not knowing where to start
16:19borkdudegfredericks you have that option of course with Noir: just put all the defpages in one file?
16:19RaynesYou can just sprinkle defpages everywhere and they're automatically composed into the final routes in the end.
16:19amalloycemerick: complex but easy
16:19tomojI thought I was the only one who cared about that :)
16:20gfredericksborkdude: if you have a lot of them?
16:20tomojrelatedly it disturbs me that cljs-template sets up noir
16:20borkdudegfredericks you only need a couple of defpages, the rest is done through clojurescript :P
16:20tomojmaybe will create just-cljs-template...
16:20gfredericksborkdude: defpage complects the route with the response
16:20cemerickgfredericks: thanks for the pointer, BTW
16:20gfrederickscemerick: no probalo
16:20gfredericks(inc lazybot)
16:20lazybot⇒ 7
16:20Raynescemerick: Man, we've been over that.
16:20Raynescemerick: Get off my lawn.
16:21gnarmisRelated question: what if I need a prefix url? A little new to noir
16:21RaynesYou can take away my defpage, but you can't take away my noir.session.
16:21cemerickRaynes: I thought the lawn statement was supposed to go in the other direction on this topic?
16:21Raynesgnarmis: Prefix url?
16:21hyPiRionprefix url? Like, absolute url?
16:21gnarmisso sort of like "/api/foo", "/api/bar"
16:21Raynescemerick: Get *on* my lawn.
16:21Raynesgnarmis: Oh, like Compojure's context macro.
16:22RaynesYeah, I'm not sure you can easily do that in Noir.
16:22cemerickRaynes: Go mock out a ring request that depends on a particular mutable-in-place session state. Oh, right, that sucks.
16:22RaynesMight have to post on the mailing list and see if anyone else has done anything.
16:22gnarmisraynes: not familiar with that in compojure. hmm
16:22hyPiRionYou could shadow defpage.
16:22gnarmisah ok, for sure
16:22Raynescemerick: muhoo implemented that behavior in noir.session specifically so it would work with Friend.
16:23borkdudegfredericks I don't see how you mean the complecting thing: compojure also combines routes and their responses?
16:23RaynesActually, you might have just said something entirely different than I thought you did.
16:23gfredericksborkdude: I was comparing it to rails
16:23Raynesagain*
16:23cemerickIn other news, can we all please talk about something important, like making O(1) for argument types that support it?
16:23cemerickbah
16:23cemericks/making/making second
16:24hyPiRioncemerick: You're talking about the last argument?
16:24gfrederickssecond is not O(1)?
16:24gfredericksfor which types?
16:24cemerickit's O(2) for seqs!!!!1!1!
16:24gfredericksO(2) is O(1)
16:24alindemanHehe
16:24borkdudecemerick take it easy, it's sunday and you're drinking a margarita ;-)
16:24cemerickgfredericks: dude, you're harshing my snark
16:25cemerickSorry, I was late to the "last" thread.
16:25Raynescemerick: Anyways, if you hate mutable sessions, I'd hate to make you use noir defpage for a day.
16:25hyPiRionActually, it's O(1) for seqs, but O(log n) for anything else, right?
16:25gfrederickshyPiRion: wat
16:25hyPiRionor wait, it's probably O(log n) seqs as well.
16:25cemerickRaynes: I'm afraid I've never used noir
16:25gfredericksoh I supposed for vectors that might have to be true
16:25borkdudeI'm off, bye
16:26hyPiRiongfredericks: Well, if we like to be very picky about the runtime ;)
16:26gfredericksassymptotics isn't too useful at this point
16:26gfrederickslet's just say "Can we make second faster?"
16:26gfrederickss/faster/smarter and thereby faster/
16:27hyPiRionWe can if you can create a sufficiently smart compiler.
16:27tomojclojure needs it's own asymptotics notation where O*(1) == O(log n)...
16:27gfredericksO(1) \subset O(log n)
16:27cemerick"sufficiently smart compiler" is the godwin's rule of PL discussion
16:28alindemanlol
16:28gfrederickstomoj: we could switch to #{:slow :medium :fast}
16:28tomoj:D
16:28gfrederickslet's start now. Vectors are fast
16:28alindemanCan we just unroll all the loops?
16:28gfredericksis reversing a seq medium or slow?
16:29tomojdepends on the problem :(
16:29hyPiRiongfredericks: It's constant time.
16:29hyPiRion*vector, sorry
16:29tomoj#{:slow :fast-enough}
16:29gfrederickshyPiRion: reversing a vector is constant?
16:30hyPiRiongfredericks: yep, as far as I remember.
16:30gfrederickshyPiRion: perhaps a read-only version; but not a conjable version
16:31hyPiRionIf you sprinkle some magic on, it's possible.
16:31gfrederickshyPiRion: I'll bet you forty things of value
16:32ivaraasenhyPiRion: how fast are we talking? O(MG)?
16:32cemerickhyPiRion: `reverse` is always linear. rseq can be constant-time.
16:33gfredericks&(doc rseq)
16:33lazybot⇒ "([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:33hyPiRioncemerick: rseq it is, then.
16:33amalloysecond is O(∞) for (lazy-seq (recur))
16:33gfrederickshyPiRion: like I said; read-only, not conjable :P
16:33amalloywe should improve that
16:33cemerickthus, &(rseq '(1 2 3))
16:33gfredericks&(rseq '(1 2 3))
16:33lazybotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Reversible
16:33hyPiRion&(rseq [1 2 3])
16:33lazybot⇒ (3 2 1)
16:33cemerickisn't & lazybot's inline eval char?
16:34gfrederickscemerick: ##
16:34amalloycemerick: ##'(this is)
16:34hyPiRionIt's ##nil
16:34lazybot⇒ (this is)
16:34cemerickoh jeez
16:34gfrederickscemerick: ask again nobody heard you
16:35gfrederickssurely you had to know this for the lazybot chapter of your book
16:36cemerick"comprehensive" has many interpretations
16:36hyPiRion"comprehensive" is relative.
16:37gfredericks,(comp :re :hensive)
16:37clojurebot#<core$comp$fn__2453 clojure.core$comp$fn__2453@3129730f>
16:37cemerickgfredericks: also, don't blow my cover. Most people around here think (rightly) that I'm a regular shmoe. :-)
16:38hyPiRion,((comp :re :hensive) {:re :ea :hensive :sy})
16:38clojurebotnil
16:38hyPiRionoh yeah, I meant juxt.
16:38gfrederickscemerick: surely you had to know this when you read the lazybot chapter of that book you bought that one time I mean
16:39gfrederickshyPiRion: your code wasn't very juxtrehensive
16:40hyPiRiongfredericks: sadly. I'm getting rusty :(
16:45cemericksurely Raynes' book is going to mention lazybot?
16:45cemerickRaynes: speaking of, have you seen any attributable rise in tryclj traffic in the past 3 months?
16:46Raynescemerick: I don't look at tryclj traffic.
16:46RaynesI certainly can if you like.
16:46RaynesI just mean that I don't make a habit of it. :p
16:46gfrederickswho votes for pronouncing tryclj like "trickle"
16:47RaynesIf it makes you happy.
16:48Raynescemerick: When did your book release?
16:50Raynescemerick: March got around 3.9k views. In April through today, it rose and remained at around 4.5k
16:51Raynescemerick: 59% of page visits since April have been new visitors.
16:52Raynesamalloy: 4.2k of my visitors over those months has been referred from 4Clojure.
16:52RaynesGiggity.
16:53amalloyRaynes: prepare to experience a similar inflow to refheap :P
16:53RaynesHah
16:53RaynesHuh. Do I even track refheap traffic?
16:53RaynesI'm totally insane if I don't.
16:53RaynesAnalytics is like dope.
16:54RaynesOh boy, looks like I do.
16:54RaynesWow, this is depressing.
16:54hyPiRionSpeaking of refheap, does anyone know if someone has ported/made a syntax highlighter for Clojure?
16:55RayneshyPiRion: Nope. I use pygments.
16:55hyPiRionRaynes: I know, that's why I was asking ;)
16:55RaynesIf someone made a highlighter for Clojure, I still probably wouldn't use it.
16:55RaynesNot until it supported at least the most useful subset of the languages pygments does.
16:59amalloyRaynes: what's depressing?
17:00TimMcCan't you use different highlighters for different languages?
17:00Raynesamalloy: 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:00RaynesTimMc: Sure, with a lot of work. Pygments also handles the generation of line numbers and such.
17:01RaynesAnd the theming.
17:02SrPxOh
17:02SrPxYou should send this to every newcomer around: http://chasemerick.files.wordpress.com/2011/07/choosingtypeforms2.png?w=640
17:05TimMcRaynes: Hmm, I see. Seems complectated. :-P
17:06hyPiRionSrPx: That's messy. I'd just tell every newcomer to use a map.
17:06SrPxhyPiRion: I concluded that from the chart though. (:
17:06wingyi prefer cutting the middle men
17:08SrPxWow.
17:08solussd_could someone cryptographically inclined tell me if this password hashing function is adequate? :) https://www.refheap.com/paste/4ff0bc29e4b062b6746d14b0
17:09Rayneshttps://github.com/noir-clojure/lib-noir/blob/master/src/noir/util/crypt.clj There's a lib-noir for that!
17:10RaynesJust a shameless plug. I'm neither cryptographically inclined nor have I actually read your code.
17:10cemerickRaynes: why pygments instead of syntaxhighlighter? More supported languages?
17:10SrPxSo anyway, protocols are the equivalent of Common Lisp's classes and multimethods if I got it right?
17:10Raynescemerick: And less hideous javascript.
17:10cemerickSrPx: Clojure multimethods are the equivalent of Common Lisp's multimethods. :-)
17:10ivansolussd_: is that a fixed salt? but anyway, use bcrypt or scrypt
17:11solussd_ivan: I was thinking of using the time in milliseconds of the password creation date
17:11solussd_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:12cemerickRaynes: does syntaxhighlighter imply more involved js? I just threw it into another site with one line? *shrug*
17:12cemerickEverybody does :-D
17:13SrPxcemerick: I was not aware of those
17:13Raynescemerick: *shrug*. I just can't see syntaxhighlighter working out well for a pastebin site.
17:13solussd_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:13cemerickRaynes: fair. js implementations of everything…meh.
17:13cemerickPython > js.
17:14cemerickOf course.
17:14Raynescemerick: 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:14RaynesI pre-highlight and store that for later consumption.
17:14RaynesSuper dooper fast.
17:15cemerickdo you store the original source too?
17:15RaynesYes.
17:15hyPiRionI suppose, if they want to edit the original.
17:16wingycool i dont have to reload server when i make changes
17:17wingyhow is that done by compojure?
17:17wingyor ring
17:17RaynesSame way it is done in Noir, just more explicit -- wrap-reload
17:17wingyits reading the file for each request?
17:17RaynesNoir wraps wrap-reload under the covers for you. If you used compojure, you'd need to do it yourself.
17:18RaynesIf something has changed since the last request, it just reloads the code.
17:18weavejesterlein-ring automatically adds wrap-reload
17:18RaynesYou'd want this turned off in production.
17:18wingyit detects file change?
17:18weavejesterIf you're using Compojure, using lein-ring is a good idea
17:18wingyand reload it?
17:18wingyyeah im using lein-ring
17:18Raynesweavejester: Really? Can I use lein ring to run my code in production?
17:18weavejesterAnd lein-ring automatically removes wrap-reload in production.
17:18wingywhat is wrap-reload?
17:18weavejesterRaynes: Yep
17:18RaynesHow does it know I'm in production?
17:19weavejesterRaynes: The LEIN_NO_DEV environment variable being set.
17:19wingywhere can i read about it
17:19RaynesCool.
17:19RaynesYou're my friend.
17:19weavejesterwingy: It's in ring-core
17:19wingyok
17:20weavejesterer… ring-devel I mean
17:20weavejesterwingy: http://ring-clojure.github.com/ring/ring.middleware.reload.html
17:20weavejesterRaynes: Haha
17:20weavejesterRaynes: I've also created a Heroku thing that automatically runs lein ring server
17:21wingywarpy: cool
17:21wingyweavejester: i meant
17:22wingyclojure stack is so dead simple and cool
17:22wingylisp syntax fits all kind of DSLs
17:26weavejesterRaynes: Incidentally, you can also use profiles to control production options in lein-ring as well. It just tries to have sensible defaults.
17:27hiredmanamalloy: where you saying clojurebot is broken because it could find a class called java.lang.Date?
17:28amalloyhiredman: he couldn't find java.util.Date either, unless i was misreading
17:28amalloy(whew, i wasn't)
17:28hiredmanare you sure?
17:28brehautcemerick, 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:28amalloyborkdude: ,(java.util.Date.)
17:28amalloyclojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class java.util.Currency>
17:29clojurebotjava.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:29technomancy=D
17:29hiredmanI 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:29hiredman,(import 'java.util.Date)
17:29clojurebotjava.util.Date
17:29hiredman,(Date.)
17:29clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class java.util.Currency>
17:30hiredmanhuh
17:32TEttinger,(java.util.Date.)
17:32clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class java.util.Currency>
17:32TEttinger,(Integer.)
17:32clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching ctor found for class java.lang.Integer, compiling:(NO_SOURCE_PATH:0)>
17:34TEttinger&(java.util.Date.)
17:34lazybot⇒ #inst "2012-07-01T21:34:01.026-00:00"
17:35hyPiRion&(java.sql.Date. 0)
17:35lazybot⇒ #inst "1970-01-01T00:00:00.000-00:00"
17:45pepijndevoswhat algo is used by clojures persistent maps? (and what are alternatives?)
17:46hyPiRionpepijndevos: http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/
17:47pepijndevoshyPiRion, 2009, is that still up to date? I seem to remember something was changed n there recently.
17:47pepijndevosbut maybe I'm confusing hashmaps and treeemaps.
17:48wingyisn'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:48wingythe former is kinda like node.js where you require everything to a local variable
17:49tomojfalse dichotomy: (:require [foo :as f :refer [bar]])
17:49brehautwingy: :require … :as … :refer gives you all three
17:49tomojdid I mean dilemma? hmm
17:50wingybrehaut: more recommended than using :use?
17:50brehautprobably
17:50wingyi see all functions colliding in one namespace is not a great thing
17:50brehautuse is still handy in a repl though
17:50wingyyeah
17:50wingyfor fast access
17:51brehauti 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:54hyPiRionpepijndevos: It was brought up yesterday, so I suppose those links are still valid. But don't take my word for it.
17:54amalloypepijndevos: i don't think clojure's maps have changed since then, either hash or tree
17:54pepijndevosamalloy, that's probably it.
17:54pepijndevosme finding treemap, and thinking "wow, this is new and awesome"
17:56wingybrehaut: so it makes more sense to either use :as OR :refer, not both at the same time right
17:56wingy(:require [compojure.core :as core :refer :all]
17:57wingyor perhaps you have reasons for using them at the same time
17:57wingyok it depends
17:57brehautwingy: not necessarily true. some NSs you will want a handful of functions from without the NS qualification, but others with
17:57wingyright
17:58Raynesbrehaut: fwiw, I hate people (amalloy) who do that.
17:59brehautRaynes: you are dead to me
17:59amalloy(dec Raynes)
17:59lazybot⇒ 12
17:59RaynesYou were never alive to me. Get out of my internet.
18:00hyPiRionRaynes: /ignore amalloy ?
18:00brehauthahah
18:00RaynesHe's my best friend. :(
18:00amalloyRaynes treasures his abusive relationships
18:01hyPiRionYou need to heal that Stockholm syndrome, Raynes.
18:01nkraftSystem: Host Yoda Kernel 2.6.38-8-generic-pae i686 (32 bit) Distro Linux Mint 11 Katya
18:06ivaraasenamalloy: (:abuse 'freenode.raynes.childhood)?
18:28solussd_is there a Noir + Friend (authentication) tutorial somewhere? Looks like I can just plug it [friend] in as middleware, right?
18:46SrPx(on matching-function callback) ... (on (fn [event] (eq (event :name) 'click)) (hide (event :target))) ;; does that seems reasonable?
18:48kovasbwhy use symbols instead of keywords to indicate the event name?
18:48amalloyalso (fn [event] (= (event :name) 'click)) is just (comp #{'click} :name)
18:49gfredericksis calling a one-element set fast?
18:49kovasbnice
18:49gfredericksdo large data structure cache their hashes?
18:50nicholasf ooc, are you guys discussing clojurescript or clojure here?
18:50SrPxamalloy: #{} ?
18:50kovasbset literal notation
18:50SrPxkovasb: dunno, what is the difference?
18:50kovasbkeywords are always inert, and have some useful features
18:51SrPxsuch as?
18:51kovasbyou can use them as functions
18:51SrPxanyway I'm just asking about the 'on' thing, is it OK to use it?
18:51kovasb(:keyword {:keyword 1}) ---> 1
18:51SrPxkovasb: oh , nice!
18:51kovasband you don't have to quote them
18:51SrPx({:a 1} :a) works too
18:51kovasband they are more amenable to being treated as data
18:51gfrederickssame character count though
18:51SrPxo.O
18:52SrPxhow?
18:52clojurebotwith style and grace
18:52kovasbusing them as functions lets you compose more easily
18:52kovasbsince keywords are inert there is no question about what the serialized data means
18:53kovasbwhereas with symbols, you can to wonder if they are supposed to be bound to something or not
18:53amalloySrPx: 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:53SrPxamalloy: I still don't get what you have done exactly :s
18:54kovasbits equivalent to (fn [name] (#{'click} (:name event)(
18:55kovasb*)
18:55kovasb)
18:55kovasb:)
18:57SrPxsure but
18:57gfredericks&(time (count (filter #{-1} (range 1000000))))
18:57lazybot⇒ "Elapsed time: 396.446818 msecs" 0
18:57SrPx(#{'click'} (:name event)) õo
18:58gfredericks&(time (count (filter #(= % -1) (range 1000000))))
18:58lazybot⇒ "Elapsed time: 636.541203 msecs" 0
18:58gfrederickso_O
18:58SrPx&(#{':click'} (:name {:name :click}))
18:58lazybot⇒ nil
18:59amalloytoo many 's
18:59SrPx&(#{:click} (:name {:name :click}))
18:59lazybot⇒ :click
18:59SrPx's?
18:59gfredericksamalloy: what is '} ?
18:59SrPx&(#{:click} :test)
18:59lazybot⇒ nil
18:59amalloygfredericks: an error
18:59SrPx&(#{:click} :click)
18:59lazybot⇒ :click
18:59gfredericksamalloy: but it didn't crash
19:00amalloythe reader did the best it could
19:00SrPx[19:48] <amalloy> also (fn [event] (= (event :name) 'click)) is just (comp #{'click} :name)
19:00SrPxI don't get it amaloy, it will not return true on your form
19:00amalloy&(read-string "(#{'x'} x)")
19:00lazybot⇒ (#{(quote x')} x)
19:00kovasbthe value will serve as truthy
19:00kovasbnil and false serve as false
19:01amalloyindeed. you don't need true or false, you just need something that acts true or false in an if-test
19:01kovasbeverything else is true, for the purposes of control structures
19:01SrPxkovasb: hm :S
19:01SrPx&((fn [a] (= (a :name) :bah)) {:name :bah})
19:01lazybot⇒ true
19:01SrPxkovasb: okay I guess o.o
19:01SrPxthanks
19:01SrPxthis is really nice
19:02kovasbyes it all comes together pretty well
19:02kovasbi was a non-believer in nil punning until i started to use it
19:02SrPx&(#{:a :b :c} :c)
19:02lazybot⇒ :c
19:02SrPx&(#{:a :b :c} :d)
19:02lazybot⇒ nil
19:02kovasbbut it really makes code better
19:03SrPxso this form above can be used as a "has-keyword"
19:03amalloymore like has-element
19:03amalloy&('#{a b 1 2} 1)
19:03lazybot⇒ 1
19:03kovasbset is a function from elements to themselves
19:03SrPxoh sure
19:03kovasbmap is a function from elements to other elements
19:03kovasbmap = {}
19:04SrPxthis is a real cool definition ( =
19:04kovasbbtw you can override the default return value to be something other than nil
19:04kovasbin the {} case
19:05SrPxI'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:05kovasb&({:a 1} :b :c)
19:05lazybot⇒ :c
19:05SrPxWhy?
19:05clojurebotSrPx: because you can't handle the truth!
19:05SrPxkovasb: (:
19:05SrPxwait
19:05amalloySrPx: to help you tell whether nil mean: "the value is nil" vs "there's nothing here"
19:05SrPx&({:a 1} :a)
19:05lazybot⇒ 1
19:05SrPx&({:a 1} :b)
19:05lazybot⇒ nil
19:06SrPxwait '#{}?
19:06SrPx&('#{:a} :a)
19:06lazybot⇒ :a
19:06SrPx&('#{:a} :b)
19:06lazybot⇒ nil
19:06SrPx&(#{:a} :a)
19:06lazybot⇒ :a
19:06SrPx&(#{:a} :b)
19:06lazybot⇒ nil
19:06SrPx.-.
19:07amalloy&#{a b c}
19:07lazybotjava.lang.RuntimeException: Unable to resolve symbol: a in this context
19:07amalloy&'#{a b c}
19:07lazybot⇒ #{a c b}
19:10kovasbSrPx: there are jobs out there once you become proficient
19:11SrPxkovasb: and how many years is that? (:
19:11kovasbSrPx: it took me about 1 year to become competent, but its only my second real language
19:11SrPxand probably not in my country though
19:11brehautSrPx: its not how many years you've been using clojure, but how many hours ;)
19:11SrPxkovasb: what is your first
19:12kovasbmathematica
19:12SrPxkovasb: oh you have no experience in c-like langs?
19:12brehautSrPx: ive been using clojure for years, but im not that proficient
19:12kovasbjust school stuff really
19:12amalloyeach month of clojure is a decade of programming something else. it's like narnia in a way
19:12SrPxkovasb: that should be really good for you. who told you about clojure
19:12kovasbthe internet :)
19:13kovasbi probably saw it on hacker news or something
19:13SrPxthe internet was not so kind for me
19:13SrPxI've learned extensively other languages for 10 years before hearing about lisps
19:13kovasbi mean, i was in the market for a high level language on the jvm so it was not a coincidence
19:13ivaraaseni'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:13SrPxamalloy: what are you doing on clojure if I might ask
19:14kovasbivaraasen: coolness
19:14amalloyall of my programming :P
19:14SrPxare all you guys CS bachelors? :s
19:14kovasbi was math
19:14SrPxamalloy: *okay*
19:14amalloyi'm sure we have some PhDs in here somewhere
19:14ivaraasenkovasb: yeah. I study petroleum geology, so we mostly learn Matlab, maybe some basic C
19:14SrPxI mean, are you all people who completed college already? (not know the word again sorry)
19:15SrPxdon't*
19:15amalloySrPx: a lot of my code is at http://github.com/flatland, and i wrote a big chunk of www.4clojure.com
19:15SrPxamalloy: yay (:
19:15rlbSrPx: I imagine there's a substantial variety here...
19:15SrPxlazybot is yours
19:15gfredericksman that backwards smiley took me a second
19:15amalloyi know we have some people here who aren't college graduates (eg Raynes)
19:16SrPxgfredericks: what does that mean
19:16gfredericksI think in-school folk are frequent
19:17kovasbambrose
19:17gfredericksworking on bachelor's
19:17SrPxhmm your avg age?
19:17kovasbi don't think education level is that relevant for clojure mastery
19:17kovasbno idea :)
19:17kovasbi am 31
19:17SrPxjust curiosity
19:18ivaraasenSrPx: dunno. I'm 21
19:19gfredericksmy average age is ~13
19:19kovasblol
19:19gfredericksit keeps rising though
19:24SrPxgfredericks: lal!
19:24SrPxamalloy: noticed you basically don't use deftype, defstruct and those
19:24gfredericksfinally somebody lalled
19:24SrPxgfredericks: ?
19:24gfredericksSrPx: lal?
19:24SrPxis this good?
19:24SrPxlal = lol
19:25gfredericksthen yes it's good
19:25SrPxwhy?
19:25clojurebotwhy not?
19:25gfredericksbecause it's funny-spelt
19:25SrPxlal
19:25amalloydefstruct is awful/old, don't use it. deftype/defrecord are valuable but "advanced" features you shouldn't use without a good reason
19:25SrPxamalloy: all I wanted to hear ( :
19:25SrPxalso that your source is basically a sequence of defn's
19:26SrPxand probably most of clojure projects
19:26SrPxis this correct?
19:26amalloypretty normal
19:27wingyhow do i convert this one: (GET "/categories/:id" [id] to use destructuring in compojure?
19:29wingythe example shows: {{id "id"} :params} but (GET "/categories/:id" [{{id "id"} :params}] didnt work out pretty well
19:30SrPxagain 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:30SrPxof functions
19:30wingythis worked: (GET "/categories/:id" {{id "id"} :params}
19:30wingyforgot that its a fn call and not fn declaration
19:31SrPxalso, (derive ::rect ::shape) ::name evaluates to a namespace? we are deriving namespaces? o.o
19:32TimMcSrPx: ::name *reads* to :whatever.namespace/name
19:32amalloy&::rect
19:32lazybot⇒ :clojure.core/rect
19:37SrPxTimMc: oh okay
19:41TimMc&'::rect ;; more specifically -- note the quoting
19:41lazybot⇒ :clojure.core/rect
19:42pepijndevoswhy does clojure use 5 bits per layer of persistent*
19:42TimMcChosen by fair dice roll.
19:43amalloy5d1
19:43clojurebot5
19:43TimMchaha
19:43pepijndevos??
19:43lazybotpepijndevos: Uh, no. Why would you even ask?
19:43amalloy"i threw five objects into the air, and by god five came back down!"
19:43gfrederickslol
19:43TimMcSeriously though, it was probably the result of some benchmarking.
19:43pepijndevos5d1
19:43clojurebot5
19:43pepijndevosI don't get it, what does that do?
19:44TimMc1d6
19:44clojurebot1
19:44amalloypepijndevos: XdY rolls X Y-sided dice and adds together the result
19:47amalloy5d5
19:47clojurebot19
19:47gfredericks834d234
19:47clojurebot96838
19:48brehautI call dibs on the half-orc barbarian
19:48amalloyyeah, those sound like pretty good hit dice
19:49brehautlol
19:50brehautgfredericks wants people to help him write a cljs-svg lib so that he can stop playing pointless games of chess
19:53SrPx,({[0 0] :foo [1 1] :boo} [0 0])
19:53pepijndevosTimMc, I guess, any smaller, and lookup would go up, any larger and copying would get expensive. tricksy
19:54clojurebot:foo
19:54SrPx /\ o.o that
19:54amalloySrPx: what else would you expect?
19:54SrPxjust surprised anything can be a key
19:54amalloySrPx: didn't you come from haskell? languages without real anything->anything maps are pretty crippled
19:55SrPxamalloy: you are overestiming me...
19:55gfredericks,{(atom (ref (Object.))) (ref (atom (Object.)))}
19:55clojurebot{#<Atom@33c06b38: #<Ref@231d8cb8: #<Object java.lang.Object@6901960a>>> #<Ref@6721a061: #<Atom@50a8752c: #<Object java.lang.Object@63a4c512>>>}
19:55amalloy&({[0 1] :foo} (range 2)) ;; doesn't have to be exactly the same
19:55lazybot⇒ :foo
19:56SrPx&({(fn [x] x) 1 (fn [a b] (a b)) 2} (fn [x] x)})
19:56lazybotjava.lang.RuntimeException: Unmatched delimiter: }
19:56amalloyokay, that won't work
19:56SrPx&({(fn [x] x) 1 (fn [a b] (a b)) 2} (fn [x] x))
19:56lazybot⇒ nil
19:56SrPxheh
19:56SrPxI know
19:57amalloybut! ##(let [f (fn [x] x)] ({x :foo} x))
19:57lazybotjava.lang.RuntimeException: Unable to resolve symbol: x in this context
19:57pepijndevosHm, so what are the last 2 bytes used for? Just a mini-node, or just padding?
19:57amalloy&(let [f (fn [x] x)] ({f :foo} f))
19:57lazybot⇒ :foo
19:58SrPxf is a var?
19:58dnolenSrPx: that's an old idea. Java, Objective-C, Smalltalk all support. Perhaps even Smalltalk got it from elsewhere.
19:58SrPxdnolen: Java objc really?
19:58dnolenSrPx: ^ re: arbitrary keys.
19:58dnolenSrPx: yes.
19:58SrPxdnolen: by external libs you mean?
19:59pepijndevosThe only reason why anything as a key seems problematic to me is mutable keys.
19:59dnolenpepijndevos: Java, Objective-C, Smalltalk all consider immutable types.
19:59amalloydnolen: 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:00SrPxdnolen: from my past langs, was pretty sure python, lua and javascript only accepted strings for example... and c++ didn't have hashes
20:00SrPxamalloy: was that for me? I don't know
20:00SrPxI don't even know what binding and run* are
20:01jayunit100__how to add args to an anonymous function?
20:01dnolenSrPx: Lot of languages are neat yet still get so many details horribly wrong.
20:01jayunit100__(reduce #([x y] (+ x y)) [1 1])
20:01amalloyi 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:01dnolenamalloy: you should, run* is not lazy.
20:03amalloycool. 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:04SrPxthat sounds pterodactly cool.
20:04amalloyjayunit100__: just use 'fn
20:05jayunit100__how ok
20:05cshellhey, is the person who was having the 100% cpu problem with (Thread/sleep 1000) still here?
20:05jayunit100__s/how/wow
20:05jayunit100__thats odd - anonymous funcs dont support args ?
20:05dnolenamalloy: I don't see any problems at the moment with that.
20:06gfredericksjayunit100__: they do
20:06cshellI guess the leap second is causing a problem with Java and time taking a lot of cpu: http://bit.ly/N5NM2H
20:06jayunit100__,(#(+ % 1) 1)
20:06clojurebot2
20:06amalloygreat, thanks
20:09jayunit100__ahhh i see "The arity of an anonymous function is determined by the highest argument referenced inside." -from s.o.
20:10jayunit100__amalloy: why did u suggest using fn ? is it unidiomatic to use multiple args in an agonymous function?
20:23pepijndevosare the last 2 bits in a persistent datastructure any special?
20:23SrPxjava.lang.IllegalArgumentException: No matching method found: concat for class java.lang.String ?
20:23SrPx:s
20:23SrPx&(.concat "a" "b")
20:23lazybot⇒ "ab"
20:24gfrederickspepijndevos: last two bits?
20:24amalloy&(doc str)
20:24lazybot⇒ "([] [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:24wingyi am trying to split my routes into separate files but i get an error: https://gist.github.com/3030168
20:24wingyhow do i do it correctly?
20:25pepijndevosgfredericks, yea, the hash is 32 bits, and then each level uses 5
20:25SrPxamalloy: ty
20:25SrPx&(doc +)
20:25lazybot⇒ "([] [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:25SrPx&(doc list)
20:25lazybot⇒ "([& items]); Creates a new list containing the items."
20:25SrPx&(str "a" "b")
20:25lazybot⇒ "ab"
20:25amalloycategories/api
20:26pepijndevosgfredericks, so you end up with 2 bits at the end. I wonder if they are special, ignored, or just mini-nodes
20:26wingyamalloy: i always forget .. thx
20:26gfrederickspepijndevos: I don't know :(
20:27TimMcpepijndevos: There's an article explaining this... does it explain the 2 bits?
20:27pepijndevosTimMc, not as far as I can tell, but I did not study the code
20:27pepijndevosTimMc, these bits are arguably a bit of an edge case ;)
20:28gfredericksperhaps at level 7 you can only have 4 entries :)
20:28pepijndevosmaybe...
20:28pepijndevosor you can wrap around and do the whole thing again, with the thing offset by 2
20:30pepijndevosno, that would be silly
20:32TimMcAlso, why does that article show 33 bits? http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/
20:35pepijndevosTimMc, I wondered that too, I assume it's an error.
20:35amalloymaybe it's a carry bit left over from someone's half-adder
20:39wingyif 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:40wingyseems like if i use enlive then i should use enfocus .. and if i use hiccup then domina
20:40wingysame style
20:42pepijndevoshm, where is this INode described in the blogpost?
20:43pepijndevosah https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentHashMap.java#L325
20:49yoklovusing trampoline doesn't have any inherent limitations over true tail recursion, right?
20:49gfredericksit's hacky
20:49yoklovwell, if I'm still getting a stack overflow, that means i'm not doing it somewhere I should be
20:50yokloveven if the stack overflow is very rare now
20:54dnolenyoklov: I don't think you should have problems with trampoline.
20:55rlbyoklov: in general, trampolines can be a bit less efficient.
20:55rlbyoklov: not sure it's significant in clojure.
20:57yoklovI'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:57dnolenyoklov: have you looked at clojure-tco?
20:59yoklovI 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:01yonataneDo 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:08devnyonatane: do you need to synchronize sessions between the two sessions?
21:08devnyonatane: i dont know to be honest, but having two session vars around that need to be the same thing smells bad to me
21:09devnit 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:11wingymy 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:11yoklovi always agreed with the sentiment that jquery was somewhat monadic
21:13wingythere 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:14yokloverr, what's wrong with jayq?
21:15yoklov(haven't used it recently, but iirc it was great)
21:15wingyjust personal taste
21:15wingyi prefer fp style when coding
21:15wingyjquery returns objects with methods
21:15yoklovyou think google closure is more functional than jquery?
21:16wingyaccording to the comparisons
21:16yoklovreally?
21:16brainproxywingy: you can use jayq together with threading macros to stay in a functional style
21:16yoklovgoogle closure is extremely OOP
21:16wingythey have proper namespacing .. they use functions on elements
21:16brainproxyi think clojurescript supports doto also
21:18yoklovthat article isn't really idiomatic for jquery
21:18wingyyou guys seem to prefer jquery
21:19yoklove.g. the example with adding and removing classes would better be $("#articles").addClass("mobile").toggleClass("hidden").removeClass("gerbil-bate");
21:19yoklovmethod chaining is still stateful, but it lets you ignore that there's mutation going on, to a certain extent
21:19dnolenwingy: 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:21wingyyoklov: that looks oop
21:22brehautmethod chaining doesnt have to be stateful
21:22wingydnolen: clojure is still very weak in frontend .. all the UIs and stuff we benefit from other libs
21:22brainproxywingy: I have something like this in a cljs script:
21:22brainproxy`(doto ($ "[name|=move]") (.val "") (.focus)))`
21:23yoklovThat looks more OOP than `goog.dom.classes.add(element, 'mobile'); goog.dom.classes.remove(element, 'hidden'); goog.dom.classes.toggle(element, 'gerbil-bate');`?
21:23yoklovstatements are very non-fp
21:23wingyi dont know if i can trust a small lib like domina to be well maintained and bug fixed when problems occur
21:23wingyand questions
21:23dnolenwingy: why? most Clojure libs are small :)
21:24brehautdnolen: how many hundred lines is core.logic?
21:24dnolenbrehaut: it's getting big now for a Clojure program. pushing near 3000 lines now.
21:25wingydnolen: yeah .. but the question is why not use jQuery/Closure if they are really tested, well maintained and popular
21:25brehautdnolen: a true behemoth for clojure then ;)
21:25dnolenwingy: domina is built on top of Closure.
21:25brehautPHP is popular. should we be using that too?
21:26brehaut(theres nothing like a good slipper slope strawman)
21:28brainproxyi was thinking maybe you'd like ruby slippers... stupid wizard of oz reference :p
21:28gfrederickscrap I forgot about the 1930's
21:28TimMcWait, is it that old?
21:29TimMcWithin my lifetime, that film will be a century old.
21:29gfrederickswhat? films can't be a century old
21:29gfrederickssurely you jest
21:29brainproxy1939, yeah...
21:29brehautseriously daskeyboard? no international shipping‽
21:30gfredericksbrehaut: we're making time jokes; stay on topic
21:30brehautlol timezones?
21:30gfredericksnothing funnier than time, whatever it is
21:34rlbbrehaut: got a filco -- quite like it fwiw
21:35yoklovhm, if I'm getting a stack overflow error, my stacktraces should probably be… huge, right?
21:35dnolenyoklov: usually
21:35devnwhere does the {:pre} go with multiple arities?
21:36devncan you have it function definition-wide, or must it be tied to each arity? can it be tied separately to each arity?
21:36yoklovHm. If they're tiny, e.g. 5 lines long, does it mean I probably have a memory leak somewhere?
21:37brehautyoklov: that would also require everything to be stashed on the stack right?
21:37brehautyoklov: doenst java in general prefer the heap?
21:37yoklovyeah
21:39yoklovI think the issue *could* be that I'm preventing GC accidentally with closures, but that would certainly be on the heap...
21:58amalloyit's 100% not a GC issue, yoklov
21:59amalloysmall stacktraces could just mean that the JVM's stacktrace-printer is omitting repeated lines, in that (1000 more) way that it sometimes does
21:59yoklovhm
21:59yoklovdang.
21:59amalloyand stack space for a thread is preallocated long before that thread starts new'ing
21:59amalloyso gist your actual stacktrace
22:00yoklovit's different every time
22:04yoklovwait, got the real one, nm it's huge
22:04RaynesSrPx: Mine, actually.
22:04amalloyi'll fight you for it
22:04SrPxRaynes: yours... ?
22:04RaynesSrPx: I started lazybot years ago when I first started using Clojure. amalloy hopped on later on and we became bestest friends evars.
22:05SrPxyay .
22:05Raynesamalloy and I both work on flatland projects.
22:05SrPxI see
22:06SrPxhmm 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:07SrPxand then we define a filetype (I mean datatype, whatever) called clfunc
22:07SrPxmake it searchable in awesome ways like "find function that will pass the test = (f [1 2 3]) [3 4 5]
22:07SrPxand then plug every function we make into a giant database of awesomeness
22:08SrPxhm hm hm ?
22:08SrPx: D
22:08SrPx):
22:09SrPxnobody loves me t.t
22:10kkreamerI was just thinking of the first time I copy a file... same name, same tags, etc.
22:11kkreamerI guess the copied one has to sport a goatee
22:11SrPxWhy do you need to copy a file?
22:11yoklovwoohoo! fixed it!
22:12kkreamerTo change the copy without affecting the original, I guess
22:13kkreameror, onto removable media to give to someone
22:13kkreamerthe latter use case probably isn't a problem, I suppose
22:14SrPxHmm well you have the same problem on the folder based architecture, though.
22:14SrPxThey just add "copy of " to the name so you just do it too?
22:14SrPxI don't see why you couldn't have 2 files with the same matching though
22:14kkreamerI usually copy to a different directory
22:15SrPxAnyway I don't know why people are relunctant but I think this would solve most of my problems today
22:15SrPxand I'm yet to find a tool that will do it in other way
22:15SrPxmaybe they don't think it is a problem at all
22:15SrPxthat they can't grab whatever file/function they want from their entire system/life (or even a huge database) in a few keystrokes
22:17kkreamerwell, build it then, and if it's awesome and solves a problem, people will use it
22:18kkreameruntil then, I'll keep using find
22:18SrPxI can't find the right way to build it.
22:18SrPxfind?
22:18kkreamerbe back in a bit...
22:18SrPxwhat is find ? u.u
22:24amalloy$google bash find
22:24lazybot[find Man Page] http://ss64.com/bash/find.html
22:32uvtctechnomancy: ping
22:42technomancyuvtc: what's up?
22:43uvtcHi 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:44uvtcI was just going through the process again, but for some reason it's taking forever to download the lein 2 jar again.
22:44technomancydo you have an old version declared in your user profile?
22:44uvtcIs that kept somewhere else besides ~/.lein or ~/.m2?
22:44technomancy~/.lein/profiles.clj
22:44clojurebot/.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:45uvtcI'd wiped that out completely before trying lein 2 preview 7.
22:45uvtcAfter 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:46technomancyproblems with github?
22:46technomancysomeone mentioned they were returning 502 on tarball download
22:46uvtc22% [==============> ] 2,362,606 8.51K/s eta 14m 30s
22:46technomancyweird
22:46technomancyit's supposed to just redirect to s3
22:46uvtcEvery previous time I've installed lein it's taken just a few seconds.
22:47uvtcResolving cloud.github.com (cloud.github.com)... 204.246.169.228, 204.246.169.179, 204.246.169.49, ...
22:47uvtcConnecting to cloud.github.com (cloud.github.com)|204.246.169.228|:80... connected.
22:47uvtcHTTP request sent, awaiting response... 200 OK
22:47uvtcLength: 10321086 (9.8M) [application/x-java-archive]
22:47uvtcLocation: http://cloud.github.com/downloads/technomancy/leiningen/leiningen-2.0.0-preview7-standalone.jar
22:48technomancythat's just a cname for an S3 bucket IIRC
22:49uvtcAnyway, I was indeed using lein-newnew 0.3.4 ... well, at least, that's the version I saw in ~/.m2/repository .
22:50kkreamermaybe Amazon is having problems again...
22:55kkreamernevermind, it downloaded for me
22:56uvtcOooh, d/l seems to be speeding up. eta 45s.
22:56kkreamerfrom the link you gave, anyway
22:56uvtchahaha. spoke too soon.
22:56kkreamerand in just a few seconds
22:57uvtcMine just stopped.
22:57uvtckkreamer, stop hogging my bandwidth! ;)
22:57kkreamerheh
22:58uvtcAh, completed.
23:00uvtctechnomancy, So, again, after rm -fr ~/.lein and rm -fr ~/.m2, rm bin/lein,
23:00uvtcand after grabbing a fresh lein2, chmod +x,
23:00uvtclein version ==> Leiningen 2.0.0-preview7 on Java 1.7.0_03 OpenJDK 64-Bit Server VM
23:00uvtc`lein new app foo-bar`
23:01uvtcThere's no doc directory,
23:01uvtcand the project.clj has Clojure 1.3.0 listed.
23:02technomancyuvtc: so for some reason it's using 0.3.3 for you
23:02uvtcjohn@garnet:~/.m2/repository/lein-newnew/lein-newnew$ ll
23:02uvtctotal 4
23:02uvtcdrwxrwxr-x 2 john john 4096 Jul 1 22:58 0.3.4/
23:03technomancyoh wait, I was using the default template
23:03uvtcAnd there's all 0.3.4 files in there.
23:03technomancyyou're right; the app template is out of date
23:03technomancymy bad
23:03uvtcAh, cool then. Thanks. :)
23:07uvtctechnomancy, also issue 37.
23:07technomancyyup, reopened them both
23:09uvtcIf 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:10technomancymight as well delete the branch, yeah
23:11uvtcTo delete it also from origin,
23:11uvtcthat's `git push origin :my-branch` , correct?
23:11technomancyright
23:11uvtcthanks, technomancy
23:11technomancyprobably doesn't matter with a repo that small, but you might as well
23:12uvtctechnomancy, is it any more (or less) hassle when someone sends you a pull-request on master (rather than on a dedicated branch)?
23:13technomancyuvtc: 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:13technomancywhich means you'll get extraneous merge commits whenever you pull from me, and those can be annoying
23:15uvtcMost folks just periodically pull from upstream to keep up to date, right?
23:17technomancyyeah
23:17uvtcAnyway 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:17uvtcSounds like it's six of one, half dozen of the other.
23:17technomancyif your master is just my master plus the stuff you want me to pull, it's fine
23:17technomancybut making commits on master tends to cause extraneous noise to sneak in there
23:18technomancyit's possible to avoid that, but it's better not to have to bother
23:18uvtcVery good. Thanks.
23:21technomancysure
23:32mshroyeranyone here using clojure-swank? I'm having an issue that I've failed at googling
23:32mshroyerbasically the repl is "laggy" in Emacs
23:32mshroyerlike when I type (+ 1 2)
23:32mshroyerthere's a half-second or so hang after typing each of the arguments
23:33S11001001are you using jack-in with swank-clojure 1.3.4?
23:33mshroyeryep I'm using jack-in, and let me double check my swank-clojure version
23:33TimMcAny chance the REPL has been running for a couple of days? :-)
23:33mshroyerheh nope, this is a fresh repl, thanks though
23:33S11001001never experienced it myself
23:34S11001001paging?
23:34TimMcDarn, can't blame it on the leap-second, then.
23:34mshroyerand it's swank-clojure 1.4.2 I'm using
23:35S11001001hmm, so you're hanging on round-trip for slime doc; after the delay you get a minibuffer goodie?
23:35mshroyerS11001001: yeah that seems to be what's happening, as far as I can tell
23:35S11001001& I should upgrade
23:35lazybotjava.lang.RuntimeException: Unable to resolve symbol: I in this context
23:35S11001001heh
23:36S11001001you a CL slime user by any chance mshroyer ?
23:36mshroyerwell strictly, after the delay followed by me typing a space
23:36mshroyerS11001001: actually yes
23:36mshroyersbcl
23:36S11001001got slime in your emacs load-path?
23:37mshroyerhmm why yes I do
23:37S11001001I had funky issues with the swank protocol screwing up [which caused a delay] when printing, because I had my own slime loading
23:37S11001001okay that's almost certainly your problem
23:37mshroyercool, let me try then...
23:37S11001001kick slime out of your load-path, restart, and let jack-in install its own slime stuff
23:37wingyhiccup is awesome
23:38wingyso simple and fun
23:38S11001001yeah, some crazy people want to add function invocation to it though
23:38mshroyerS11001001: good call! that fixed it, thanks!
23:38S11001001mshroyer: np
23:57mindbenderisn't `lein repl` supposed to start a properly classpathed repl when started at the root of a clojure project?