#clojure logs

2012-06-11

01:21eckhi all; i'm learning clojure, and i'm trying to understand why keywords exist in clojure (i.e. as opposed to just having strings)
01:22eckare they essentially just a more lightweight/optimized implementation of a string?
01:24nDuffeck: keywords provide identity guarantees, ie. they're always interned
01:25nDuffeck: ...also, they're a separate namespace, so you can be sure that ::eof will never be mistaken with "EOF" or "eof", if you're using them as sigils / markers / singletons
01:26eckok, so compared to a string, a string doesn't have a separate namespace but you would also not have that problem, i.e. "foo" always equals "foo"
01:26eckis there a case where two strings that are equal in the ordinary sense of the word would not be considered equal in clojure?
01:27nDuff"foo" always _equals_ "foo", but it may not be _identical_ to "foo"
01:27nDuffKeywords are interned, so not just equality but identity are guaranteed.
01:27eckok i think that makes sense
01:27johnmn3the windows-github tool is pretty slick
01:27nDuff...and I think we have a communication mismatch re: "not have that problem" re: namespaces
01:27johnmn3https://github.com/johnmn3/zljdb
01:27nDuff...namespaces are a feature, not a bug, if using them as singletons
01:28ecki might be missing the namespaces point, but so far i've seen a number of uses of keywords as if they're enums in other languages
01:29nDuffYes. Now, enums in other languages typically exist inside of a class, or a package, or some other kind of namespace, right? That is, you don't want pipe.tee to equal golf.tee, even if they both use "tee"
01:29eckhmm, that's true
01:29nDuffsame thing with ::tee in clojure; it's local to the namespace.
01:30nDuffNot a unique thing to Clojure, by the way -- keywords as first-class objects go a long way back
01:30eckok that makes sense
01:30eckyeah i was reading about keywords in CL but i felt like i was kind of missing the point
01:32ecknDuff: thank you!
01:33nDuffnp -- glad to be able to help
01:36jblomogfredericks: looks like dnolen fixed the bug i'm seeing in 47f4a1e8
01:39nDuff(already have clojure.core/use and clojure.core/require rebound for other reasons...)
02:33nDuffHrm.
02:50amalloygood luck with that, man. bet you a million dollars it's special-cased in at least one place
03:42nDuffwoohoo!
03:42nDuff...and integrated a bit more cleanly with nREPL...
03:43michaelr`i wonder, does anyone here use Eclise with a dark colored theme?
03:43clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
03:44michaelr`clojurebot: this time it was appropriate, bot
03:44clojurebotlearning a new runtime is much harder than learning a new language.
03:44michaelr`clojurebot: unless it's chinese
03:44clojurebotHuh?
03:45michaelr`clojurebot: Korean
03:45clojurebotI don't understand.
03:45michaelr`clojurebot: just use your imagination
03:45clojurebotexcusez-moi
03:45michaelr`clojurebot: intuition
03:45clojurebotNo entiendo
03:45michaelr`clojurebot: viva la france!!!11
03:45clojurebotIt's greek to me.
03:49jblomocan i run lein-ring in single-threaded mode?
04:00amalloyjblomo: why would you want to? what would it even mean?
04:01jblomoamalloy: trying to debug an issue where i think multiple threads are writing to one file
04:02amalloyanyway, i don't think any single-threaded mode exists for lein-ring. jetty has a configurable threadpool size, though
04:03jblomoyea, trying max-threads now
04:18ro_stis it possible to get ido mode to fuzzy across directory boundaries? eg, if i have src/*.clj, src/util*.clj and i'm in a buffer from src, i'd like to have it match a filename from src/util/ when i type some characters from its name
04:19Vinzentro_st, you could try the "find file in project" package
04:49lypanovUnable to resolve artifact: Couldn't find a version in [1.2.0] to match range [1.2.1,1.2.1],[1.3.0,1.3.0]
04:49lypanov org.clojure:clojure:jar:null
04:49lypanovanyone know what this means?
04:53lypanovhelp*
04:55lypanovall of clojars just broke or something?
04:55zoldarlypanov: are you by any chance using leiningen or a similar tool for project management ?
04:55lypanovyes.
04:55lypanovthis is lein -> maven error
04:55zoldaris 1.2.0 a complete must ?
04:55lypanovi don't require it.
04:55lypanovgonna add exclusions to everything manually.
04:56zoldarthen change 1.2.0 in project.clj to 1.2.1
04:56lypanovits not in project.clj.
04:56lypanov :dependencies [[org.clojure/clojure "1.3.0"]
04:56zoldarwhat are your dependencies?
04:56zoldarnothing more ?
04:57lypanovsolved.
04:58lypanovzoldar: will be back in 20 mins or so.
04:58lypanovneed to continue release.
04:58lypanovadded :exclusions [org.clojure/clojure] to every dep.
04:58zoldarweird
04:58lypanovlast week monday the same project.clj worked.
04:59Vinzentprobably some of your deps depends on 1.2
05:11ro_stfor some reason my slime repl isn't using the injections in my dev profile
05:12IRC-Client-Testyoo
05:12Mad_Masteryo
06:02Chiron_Hi, would you please have a look at: http://pastie.org/4066477 I want to be able to code that in Clojure. Extending a class is easy, but how to define a new instance variable? and how to assign a new value to that instance var in a method like prepare?
06:10zoldarChiron_: That's great that you are eager to explore Clojure, but I think that you are approaching it from the wrong angle. Don't try to write Java in Clojure. Clojure is entirely different language based around a functional programming paradigm. You would be better off with some comprehensive introduction in a form of a book like Clojure Programming http://www.clojurebook.com/
06:11Chiron_thanks, I'm trying to code Storm topology in Clojure: https://github.com/nathanmarz/storm-starter/blob/master/src/jvm/storm/starter/TransactionalGlobalCount.java
06:12Chiron_as you see, BatchCount extends BaseBatchBolt and defines a new instance variable
06:12nDuffChiralSym: yes, but there's no reason for any of your code to follow that example.
06:12nDufferr
06:13nDuffChiron_: ...after all, the parent class doesn't care how the child manages state
06:13cemerickChiron_: Storm is largely written in Clojure, and has a very comprehensive Clojure api. Best to use that instead of backing into the Java examples.
06:13Chiron_Storm Clojure DSL works with non-transactional topologies, I'm about creating a transactional one
06:14Chiron_I'm checking this article: http://pragprog.com/magazines/2010-11/getting-clojure
06:24zoldarChiron_: I'm not the one to judge, but to me, the article covers some pretty specific case of heavy java interop and from the outline author seems to essentially translate java to clojure in one-to-one fashion
06:30Chiron_I'm not stubborn :) but what is the clojure form that allows me to: KeyedCountUpdater extends BaseTransactionalBolt implements ICommitter
06:33zoldarChiron_: this may be of some help to you
06:33zoldarhttp://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/
06:34hoeckChiron_: if you do not care about the classname (e.g. because you do not need to pass the classname to some java method or config file), use proxy
06:37nDuffHrm.
06:37Chiron_that helpful, thanks!
06:38nDuff=> (:symbol (first (clojure-frame-vars)))
06:38nDuff#'clojure.core/*agent*
06:38nDuff=> (type (:symbol (first (clojure-frame-vars))))
06:38nDuffclojure.lang.Var
06:38nDuff...shouldn't that be a clojure.lang.Symbol instance?
06:40nDuff(...or, more to the point -- how do I access the symbol in that map, rather than the var behind it?)
06:40Chiron_clojurebot: do you know what is your relation to lisp?
06:40clojurebot"if you never learnt Lisp, then you never learned to program" -- some rant on some blog somewhere
06:42sayyestolifeHello.
06:43sayyestolifeIs there something special that happens when you do a (ref-set), because I have a neverending loop in which I call this, but it seems like it just hangs, ie the ref-set doesn't let go so to speak.
06:44hoeckChiron_: http://pastie.org/4066628
06:47Chiron_hoeck: that is much more neater than gen-class ! thanks :beerchug:
06:50ro_stusing lein-ring. is there a way to have 'lein2 ring server' somehow use the same process that's in my slime repl?
06:50ro_stso that i can push changes to it and see it update in the browser?
06:54sayyestolifeCan someone explain to me why the application hangs at the "swap!" http://pastebin.com/NHygxkNW ?
06:56hoeckChiron_: yes, but you have no way to get the generated classname, and you cannot call or overwrite protected methods
06:57hoeckChiron_: sometimes its easier to just add a few lines of java to expose some functionality to clojure than to spend a day learning the weird gen-class syntax :)
06:57Chiron_tell me about it :D
06:58hoecksayyestolife: swap! needs a function as its first arg
06:58hoecksayyestolife: you should get an exception when running this
06:58hoeck,(swap! (atom 100) 200)
06:58clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
06:59hoecksayyestolife: you probably want to use reset! instead
06:59sayyestolifeOh ok!
07:00sayyestolifeNow it works. cheers!
07:01hoecksayyestolife: to model a point and update directions atomically you could use sth. along: (swap! (atom {:x 100, :y 0}) update-in [:x] + 100)
07:06ro_stin a rest api, i'm currently passing user-id in as the first arg to all my internal service function calls. is there some way to access this state without having to arg it? some reading tells me dynamic bindings might be the answer, but i'd like to check with y'all
07:10ro_steventually i want to use cemerick's friend (but my poor brain hasn't quite managed to grok it, yet) to handle where this user-id value comes from. for now i just want to set a const id somewhere that functions from different namespaces can get to it
07:11hoeckro_st: yes, but they can cause problems when passing functions around and leaving the dynamic binding scope (e.g. pass off a fn to an agent, threadpool or queue)
07:12ro_stok. as all these functions are used by a synchronous json api ring service, i'm pretty sure they'll stay in scope
07:12ro_stso is it as simple as doing (def user-id 25) in a .clj with (ns my-app.app) and then referring to it as (my-app.app/user-id) where-ever i need it?
07:14hoeckro_st: the user id is constant all the time?
07:14ro_stfor now, yes
07:15ro_stbut eventually friend will somehow provide this value
07:15hoeckwell then just use a plain def
07:16hoeckdynamic vars a introduced (depending on your clojure version) with (def ^:dynamic *foo*) and then set to a specific value with (binding [*foo* 'the-value] <code>)
07:16ro_stah, so it'd start as null (supporting the guest-user case) and when friend determines that the user is properly authenticated, it'd bind that user's id in when wrapping the ring handler
07:16ro_st?
07:17ro_stusing (binding)
07:17hoeckfor example, if the user-id is request-specific, you'd do a <decode-and-validate user-id> (binding [*user-id* userid] <handle-the-request>)
07:18hoeckro_st: right
07:18ro_stit is request specific
07:18ro_stok, great. i'll forge on with a def for now. thanks hoeck
07:21cshellcemerick: Does friend's openid workflow work with the Google Identity ToolKit (GITkit?)
07:22cemerickcshell: don't know; never heard of it
07:23cshellcemerick: It's basically a way to get started with OpenID https://developers.google.com/identity-toolkit/
07:24cshellcemerick: I'm not schooled enough in either to figure out if they can work together or must be discrete
07:24cemerickoh, it's just an openid login picker; sure, that should work fine
07:24cemerickpresumably it's no different than https://code.google.com/p/openid-selector/
07:25cemerick(insofar as you need to configure it to submit to the URI in your site that starts the openid workflow
07:25cshellcemerick: right, so when I hit gmail, it pops up a window where I login, then calls a callback address where I do a server side validation against their Identity API, then if I get a 200 I can assume we're safely logged in and tell the popup to close and go to a user's homepage - I think at this time is when I interact with the openid workflow (before I go back to the user's page)
07:26cshelloh yeah, that is cool too - I hadn't seen that one
07:32cshellcemerick: It looks like the openid workflow is a thin wrapper over the openid4java api - I'll read that api and see if I can figure it out :)
07:42ro_starrrgggghh. how do i get slime-repl to always have pprint available?
07:43ro_stit's already in profiles dev injections.
07:43ro_sti specifically want to pprint. inspect doesn't give me what i want
08:05borkdudeConnect Four in Clojure: http://afternoon-window-3802.herokuapp.com/
08:05borkdude(another game made by my students ;-))
08:18ro_stis there a when-let which supports multiple bindings?
08:19ro_stwhere binding N+1 only evaluates if binding N evalutes as non-falsey
08:19ro_st.. truthy (duh)
08:19ro_stright now i'm doing (when-let [N1] (when-let [N2] …))
08:20ordnungswidrigro_st: you can realize this with a monad, IIRC.
08:20ro_stum :) for the sake of argument, let's pretend i have no idea what a monad is
08:23ordnungswidrigro_st: better that is :)
08:23ordnungswidrigro_st: maybe this helps http://inclojurewetrust.blogspot.de/2010/12/when-let-maybe.html
08:28BeatsOnToastAnyone know how you're supposed to do PUT requests using compojure? There don't seem to be any example on the github project or in the docs. I'd like to make a PUT request to "/create" and send some data along with it. Any help would be much appreciated. Thanks!
08:29semperosordnungswidrig: nice find
08:30ro_stjust what is a monad anyway?
08:30gfredericksa burrito
08:30ordnungswidrigBeatsOnToast: you want to process it with compojure?
08:30ro_stif you had to define it without requiring 3 years of CompSci under Sussman himself
08:30ordnungswidrigro_set: it's turtles all the way down.,
08:30gfredericks~monad
08:30clojurebotmonad is "yea, though I should walk in the valley of imperative code, I shall fear no evil, for your monad comforts me" - seen in #haskell
08:31BeatsOnToastordnungswidrig: yes please
08:31BeatsOnToastordnungswidrig: doing GET requests seems simple, but I'm not sure how to take in PUT requests with data
08:31ro_stok, now that we've gotten through the haha-funny-you-don't-know-and-we-do-ery… what is it?
08:31semperosro_st: I've found a combo of reading a bunch of the "better" tutorials on monads and learning haskell helped solidify my understanding of monads
08:32hyPiRionBeatsOnToast: http://en.wikibooks.org/wiki/Compojure/Core_Libraries#Servlet_Bindings
08:32gfredericksro_st: you don't have to know what monads are to make fun of them :)
08:32semperosfor every 10 developers, you'll find about 20 definitions/metaphors for what a monad is
08:32ro_stis it like NaN in javascript, which doesn't equal itself?
08:32ordnungswidrig(defroutes my-app-routes (GET "/test" [] ...) (PUT "/put-test" [] ...))
08:32ordnungswidrigthere you go
08:33ro_stis it a special form of function or macro?
08:34ro_sta higher level concept that has no direct representation in code?
08:34gfredericksI think it's kind of a design pattern...
08:34ro_sta trick pulled on people new to FP by people who make FP languages?
08:35ro_stgfredericks: that sounds right. i've seen monads referred to as "The IO monad". as if there's only one
08:35semperosro_st: I've found these helpful, Clojure-specific monad tutorials: https://gist.github.com/2909874
08:35ro_stthanks semperos. i'll give them a read.
08:35semperosnp; and no need to go sequentially, pick the explanation/style that makes sense to you
08:35gfredericksro_st: how might you implement error handling if you were in a pure functional language that didn't have a mechanism for it?
08:35vijaykiranro_st: this video is nice too: http://www.youtube.com/watch?v=ObR3qi4Guys
08:36ro_stMonads are design patterns for writing DSLs. boom.
08:36kmicuDoes anyone know why "escape-html already refers to: #'hiccup.core/escape-html" in lein-cljsbuild sample project?
08:36hyPiRiongfredericks: By return values?
08:37gfrederickshyPiRion: I think you get to the meat of the problem when you try to make it short-circuit
08:37ro_st"A monad is nothing more than a way to compose functions… The idea behind a monad is to factor out the plumbing code so that its complexity is hidden, leaving only the composition of the functions visible."
08:37ro_stthere we go
08:37gfredericksro_st: like I said, a burrito
08:37ro_styeah, that's totally clear now :-)
08:38borkdudero_st when-let with multible bindings sort of: https://www.refheap.com/paste/2700
08:38RickInGAkmicu: you get that message when you "use" a namespace that has a function name that exists in another "use"d namepsace
08:39borkdudero_st it is more like if-let though
08:39borkdudenested
08:40hyPiRionRickInGA: I think he asks why it is already defined in that namespace.
08:40ro_stnice borkdude, thanks
08:42hyPiRionborkdude: Have you seen the multiple if-let discussion on the mailing list?
08:42kmicuRickInGA: but this is a default project from https://github.com/emezeske/lein-cljsbuild/tree/0.2.1/example-projects/simple. Can anyone confirm that it does not work with lein 1.7.1 or lein2 p6?
08:48ro_stis there a way to scrub a slime repl clean of any defs (other than closing and starting a new one)?
08:49borkdudehyPiRion yes, I started that discussion :P
08:50ro_stmidje circumspec lazytest and clojure.test. which one to use?
08:57ro_stlooks like midje and lein2 aren't friends yet?
09:37semperosro_st: I use midje with lein2
09:37semperosthis project uses both clojure.test and midje, though nothing advanced: https://github.com/semperos/clj-webdriver
09:37ro_sti managed to get midje+lazytest working with lein2, thanks :-)
09:38semperossweet
09:38ro_stis it idiomatic to have multiple arity functions have an implementations call into an implementation at another arity?
09:39ro_steg, (get-resource uuid) and (get-resource uuid version)
09:39ro_sti want the first to find the latest version and then call the second
09:40ro_stso that i don't have to duplicate everything
09:40semperosro_st: unless I'm misunderstanding, that sounds exactly like the idiom
09:40semperoscode example?
09:42ro_stactually, i've realised that it won't work in this case. i need to (or (value) nil) the passed arg for 'version' from outside and do some hopscotch inside based on whether its nil or not
09:42ro_stbut having modified the func to use multiple arities, i can see how it would work
09:49hyPiRionro_st: It's more or less idiomatic.
09:53ro_stdoes midje have a fact grouping function, like describe from BDD?
09:56semperosthere's `facts`, which is similar
09:56ro_stgah of course
09:57ro_stso much to learn!!!
10:03jimdueyro_st: I write the clojure.net blog. If you have any questions feel free to email me and I'll do the best to answer them.
10:03ro_stnice!
10:04ro_sti certainly will do. i was referring mostly to internalising tools. using repl, lein and emacs together to have a productive coding experience
10:06kreig1heylo
10:06kreig1so, is it me, or did clojure 1.2.0 disappear from clojars/maven repos?
10:06kreig1because suddenly I annot build my project
10:07kreig1Caused by: org.apache.maven.artifact.versioning.OverConstrainedVersionException: Couldn't find a version in [1.2.0] to match range [1.2.1,1.2.1],[1.3.0,1.3.0]
10:07kreig1 org.clojure:clojure:jar:null
10:07di-csuehsis 1.2.0 in the range of 1.2.1?
10:08kreig1nope it is not
10:08di-csuehsdo you specify that range?
10:08kreig1No I do not
10:08di-csuehsor is it inherited from something
10:08di-csuehshmmm.
10:08kreig1it appears that noir and korma do so
10:09kreig1if I move to the betas on those two, it works (plenty of other problems tho)
10:09kreig1I build this project from scratch constantly
10:09kreig1and it worked as of friday
10:11kreig1So what I'm reading that message is as saying is, that the available versions are 1.2.0 ... and it doesn't match that constraint
10:11ro_stanother user had this issue earlier today. search today's logs for 1.2.1
10:11di-csuehskreig1: should I be finding any version of clojure in clojars?
10:12kreig1ro_st a quick link to where I can find the logs?
10:12ro_stthey were able to fix by somehow telling a dependency to exclude clojure itself
10:12ro_stnot sure of syntax or even if that makes any sense. just what i can remember :-)
10:12kreig1found it
10:13kreig1hmm
10:13kreig1this is pretty shitty
10:15kreig1solved, just for the record: added :exclusions [org.clojure/clojure] to the deps that Maven bitched about (noir and korma in this case)
10:16S11001001ro_st: because shallowest wins unless some library is being terrible. It's not so much maven's/lein's fault as a particular library
10:18ro_stsomeone who's aggregated on planet.clojure.in should probably push out a short post about the issue kreig1 just dealt with
10:19kreig1S11001001: what is curious to me, is how without hcanging my deps, or lein, this changed
10:20kreig1S11001001: that implies to me that some data lein acts on when resolving deps changed
10:20kreig1S11001001: I'm curious as to what that was
10:20ro_stwell, lein seems to check deps whenever you change your project.clj
10:20ro_stthat's what it feels like to me (without having read lein's source)
10:20kreig1ro_st: this project is built from scratch by integration builder, last time was friday, and it worked
10:21kreig1there were no commits in the meantime
10:21technomancythis is why no one should ever use version ranges
10:21technomancythey are terrible
10:21ro_stso perhaps when it did this, part of the checking is deps-of-deps, which started to fail
10:21technomancyclojurebot: repeatability?
10:21clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
10:21kreig1it's telling me I shouldbe using lein
10:21technomancy^ explanation
10:21kreig1I shouldn't be using lein
10:21kreig1or clojars, or any of that
10:21ro_sttechnomancy: so just explicit version numbers are ok, right?
10:22technomancykreig1: this is all bullshit inherited from maven; nothing specific to clojure
10:22technomancyro_st: right
10:22ro_stgreat
10:22kreig1technomancy: I not cutting on lein there, I understand the shitball it inherited
10:22technomancyone solution would be to write a plugin that walked your deps tree and warned you every time there was a version range
10:22kreig1technomancy: just saying that I prolly want to manage my deps by hand
10:22technomancyhaha
10:22kreig1technomancy: heh, I know, until the next time I upgrade Ring 8^)
10:23kreig1actually, what I should be doing is using lein/maven to manage them, but not require a lein deps every build
10:24kreig1aka, to DL deps and put them in lib, commit them in the repo.
10:24technomancyI think it would be a lot easier to just not use anything that uses version ranges
10:24ro_sttechnomancy: when are you next doing a talk on lein? i watched the one where you covered 1.4 (i assume that was you). it'd rock if there was one that dealt with the way 2.0 does things
10:25kreig1technomancy: considering that the two most ciritical components of my app appaently use ranges... (noir and korma)
10:25technomancykreig1: first thing to do is file bug reports with them if the latest versions still use ranges
10:26kreig1technomancy: when I upgraded to the latest, this issue went away, so either the ranges changed or there are no ranges. However, cannot jump to their latest betas the week of a rollout 8^)
10:26technomancynext is to figure out a way to prevent it from happening again; possibly via a range-detection plugin
10:26kreig1technomancy: it's all good tho, :exclude fixed it for now
10:26technomancythere could be other ranges in there still that aren't causing problems yet but will down the line
10:27kreig1technomancy: and it looks like neither of those uses ranges. Is it possible that something else used a range and these just happened to be the ones Maven complained about?
10:29kreig1technomancy: yah, the 1.2.X series of noir used a range
10:29kreig1as does korma
10:29kreig1technomancy: thanks for the tools and help
10:39lypanovkreig1: i had the same problem this morning.
10:39lypanovhalf way through a critical production deploy.
10:40lypanovutterly unimpressed.
10:40tomojI notice clojurescript doesn't include the third_party bits of closure, e.g. goog.async.Deferred. is there a reason for this?
10:40lypanovtomoj: cus it sucks.
10:40lypanovtomoj: i have jars in clojars that add it.
10:40kreig1lypanov: my takeaway is to not put lein deps in my main deploy line
10:41lypanovkreig1: anyone running production without clean installs every time is crazy.
10:41ivanwhy not deploy uberjars?
10:41kreig1lypanov: a clean install doens't mean running lein deps at deploy time tho
10:42kreig1ivan: that is how we deploy. We build an uberjar.
10:42borkdudeI suddenly had this problem: :dependencies [[org.clojure/clojure "1.3.0"] [noir "1.2.0"]] ;;=> Failed to collect dependencies for clojure.lang.LazySeq@ed61be4a -- why?
10:42lypanovguess the build does make more sense to happen on accetp/dev or so.
10:42lypanovbut wouldn't have helped me this morning.
10:43ro_stis there a method like filter that returns true or false based on whether all the iterated function calls return true?
10:43kreig1borkdude: add :exclusions [org.clojure/clojure] to the noir dependency
10:43borkdudero_st every?
10:43kreig1several of us ran into similiar problem today
10:43ro_stah. i was trying all?
10:43lypanovkreig1: and yes, i also had no issues last week. all perfect and then the world blew up this morning.
10:44borkdudero_st In C# it is called All<T>
10:44kreig1lypanov: yah, still don't know why it blew up this weekend
10:44borkdudekreig1 why?
10:44lypanovmy assumption is something changed in clojars.
10:44kreig1borkdude: see logs
10:44lypanovor maven etc.
10:44lypanovah you found out? /me reads without scan mode enabled
10:44borkdudemy students had presentations this morning, suddenly things stopped working :(
10:45kreig1borkdude: in short, noir (1.2.X) used a ranged dependency, that suddenly broke over the weekend
10:45lypanovkreig1: and yes, my lesson also is that i shouldn't be using leiningen. the last thing i need is my env stopping a deploy. i have enough things to worry about already.
10:45borkdudekreig1 in clojars?
10:45kreig1borkdude: see the logs
10:45lypanovkreig1: *everything* from ibdknox uses them then.
10:46lypanovnoir-cljs, korma, etc etc etc.
10:46kreig1borkdude: the exclusion stops maven from puking on the ranged dep
10:46kreig1borkdude: we still don't know why it broke over the weekend tho (we being other users who hit it)
10:47kreig1lypanov: resolve your deps as your pull them in, not all at deploy/build time
10:47lypanovkreig1: the poms themselves are ancient. not updated for a long time. so i'm assuming something in super-pom or something like that blew up. i don't get half of it though.
10:47borkdudekreig1 my students complained working with clojure (tools) is terribly buggy/beta… it wasn't a very nice experience in that regard...
10:47borkdudekreig1 I think I shouldn't have made them use beta eclipse plugins and leiningen2 ˆ_^
10:47kreig1borkdude: no, you shouldn't have 8)
10:47kreig1borkdude: never use eclipse 8)
10:48lypanovborkdude: aye. it stopped a critical deploy just a few weeks after of using clojure in the build process a RoR app. i have enough issues pushing people to learn but now this.
10:48borkdudenext year I hope things will get more stable and less confusing...
10:48lypanovi've used it for for a while in personal projects and never had this.
10:48kreig1lypanov: you are over your bitch limit 8^)
10:48lypanovthink its just a single crazy occasion.
10:48lypanovkreig1: agreed. bad morning.
10:48kreig1lypanov: hehe
10:48borkdudebut things won't become more stable if no-one takes the risk of actually using it I guess ;)
10:48ivanI build everything from source but it took a long time to track everything down and patch things and write a build system
10:49TimMcborkdude: So, how did your guinea pigs^W^Wstudents do?
10:49kreig1lypanov: same here. 8^) Also, we totally replaced a RoR app with clojure
10:49lypanovtechnomancy: i'd personally say clojars should just refuse such jars if its that critical.
10:50lypanovpoms* sorry.
10:50borkdudeTimMc some made a nice app http://roulette-clojure.herokuapp.com/
10:50kreig1borkdude: where you teaching?
10:50borkdudeTimMc but some had a very imperative approach still, OO-minded
10:50lypanovkreig1: we're just part way in. using clojurescript at first. next up replacing the core of the app with clj.
10:51borkdudeTimMc I only had 5 lessons though, they were trained in OO almost three years now
10:51TimMcyeah
10:51kreig1lypanov: what is the clojurescript experience? We are considering using it
10:51lypanovkreig1: very good. though difficult at times to interop. but thats a given more or less.
10:51borkdudeand I should definitely tell them that using def inside functions is not idiomatic...
10:51kreig1lypanov: my tentative plan is to build alot of our UI via JS on the client, using our existing JSON data api
10:52lypanovkreig1: its so small and well written that any time you have issues you can basically just go read the clojurescript source itself.
10:52lypanovcompiler* that is
10:52kreig1lypanov: what are you finding to be real wins over just jquery/js?
10:52borkdudekreig1 University of Applied Sciences Utrecht (polytechnic is a better word for it)
10:52lypanova dutchie!
10:53borkdudelypanov yeah, you too?
10:53lypanovkreig1: code compactness.
10:53antares_Monger 1.0 RC1 is released after 11 months of work: https://twitter.com/clojurewerkz/status/212193256459612161
10:53lypanovborkdude: english but in voorburg (near DH) for 12+ years.
10:53antares_also, http://clojuremongodb.info
10:54borkdudelypanov ok, been to any clojure meeting already?
10:54lypanovborkdude: once a long long time ago. was debating wednesday but probably won't due to match so hopefully next few weeks.
10:54ro_stantares_: been using it for the last couple weeks
10:54ro_stloving it
10:54antares_ro_st: thank you!
10:54borkdudelypanov yes, that sucks because I actually planned to go
10:55ro_sti love that i can read mongodb.org docs and translate directly into clojure without any fuss
10:55ro_stso kudos on that point
10:55tomojnothing provides goog.async. goog.async.Deferred is provided in a file that sets goog.async.Deferred = function(...){...}. how do I refer to it in cljs?
10:55lypanovkreig1: oh and advanced mode by default. its a no brainer to produce working advanced mode. my generating js decreased from 1.4mb to 89kb.
10:55lypanovtomoj: i replied earlier.
10:55lypanovtomoj: in summary:
10:55tomoj(included third_party in libs so it's available now)
10:55lypanovah no. its not.
10:55lypanovthey messed it up.
10:56technomancylypanov: clojars refusing jars that declare version ranges is definitely on the table
10:56lypanovi'll find my bug report. waiting for a reaction.
10:56borkdudekreig1 I think I read the logs now, but I can't find an explanation of why the exclusion is suddenly needed (maybe I'm missing smth)
10:56technomancyI'm for it
10:56kreig1borkdude: I don't know WHY it changed, just that the ranges are the cause. SOmething in the superpom or whatever
10:56lypanovborkdude: i'm still unsure of that also.
10:56ro_stantares_: i guess your focus is documentation at http://clojuremongodb.info/ now?
10:57technomancyprobably a warning when you generate the jar too
10:57antares_ro_st: yeah, that was absolutely intentional. Otherwise there's one more thing to learn (at basically no benefit). Plus, this way we can easily support a lot of new features like the Aggregation Framework, without providing any new DSLs or huge API changes.
10:57lypanovtomoj: use: :exclusions [org.clojure/google-closure-library] on anything that does the actual include.
10:57antares_ro_st: they are mostly complete but yes, I want them to cover a lot more smaller topics (like using Ring session store with Noir) and as many examples as possible
10:57lypanovtomoj: then, [org.clojars.lypanov/google-closure-library-repackaged "0.0-1376" ] [org.clojars.lypanov/google-closure-library-third-party-repackaged "0.0-1376"]
10:57llasramI was wondering why few people seem to specify version ranges in Clojure projects... Isn't it good thing to use ranges for "library" projects?
10:58ro_stantares_: i used the mongo shell for about a day, and then i realised it's MUCH easier just to use clojure and monger: paredit, better code nav, colouring etc
10:58tomojlypanov: to be clear I just have a local copy of clojurescript in ./checkouts, then I added :libs ["./checkouts/clojurescript/closure/library/third_party/closure"] to the cljs compiler opts
10:58lypanovtomoj: i use noir-cljs so don't have any experience with the leon cljs build thingy.
10:58ro_stmongo shell is horrid in comparison
10:58tomojah
10:58lypanovtomoj: aha. that doesn't work.
10:58ro_stantares_: examples++.
10:58lypanovthe deps.js has to be adjusted.
10:58lypanovits all a big mess. but the above two lines work.
10:59lypanovdunno why the uploaded jars are broken. the fix is easy.
10:59tomojthanks, I'll try that
10:59lypanovonly 1376 btw, hope that works for you.
10:59lypanovif not.. here are instructions for building the jar yourself: http://dev.clojure.org/jira/browse/CLJS-276
11:00tomojthanks
11:01tomojI think I still don't know how to refer to Deferred, even if that works - cljs wants to treat it as a namespace but it's also function
11:01llasramtechnomancy: How does maven (?) resolve dependencies when different libraries specify multiple different versions of a shared dependency?
11:01technomancyllasram: normally it just picks the newer one I believe
11:01tomojor maybe (:use [goog.async :only [Deferred]]) will work if I use the repackaged stuff..
11:01technomancypossibly giving precedence to those "higher" in the tree
11:01technomancyif there are non-overlapping ranges though it just gives up, which is craaaazy
11:03llasramtechnomancy: I see. That makes sense. And hmm -- is giving up if there isn't a common usable dependency not the right behavior?
11:05tomoj(nope)
11:07llasramI guess if you can't override it any way... Hmm. Ruby and Python libraries seem to mostly specify dependency ranges, and AFAICT it works fine for their package ecosystems
11:07kreig1technomancy: Apparently the mavent metadata file says 1.2.0 is the latest org.clojure/clojure release
11:08ro_sthow would i write a checker for midje that trues when count > 0?
11:08kreig1AHHH
11:08kreig1ok
11:08kreig1found the problem
11:09kreig1lypanov: ok, so apparently the maven report right now says 1.2.0 is the latest release
11:09kreig1lypanov: in a working version that I did a lein deps in a few days ago, the metadata file for the maven central repo lists all the properl clojure releases
11:09ro_stnm, got it!
11:10kreig1lypanov: so it appears that maven rolled back data or something
11:12lypanovtomoj: i don't use use currently. only e.g. [goog.ui.PopupDatePicker :as popupdp]
11:12lypanovtomoj: learning clojure at same time as i use it in a production project :P
11:13tomojlypanov: and then how do you use the PopupDatePicker constructor?
11:13lypanov 90 popup (goog.ui.MyPopupDatePicker. picker)
11:14kreig1technomancy: My maven-metadata-central.xml says: <lastUpdated>20100914121821</lastUpdated>
11:14tomojah of course, just fully qualified..
11:15tomojthanks
11:15kreig1technomancy: tho that file was DLed today. It looks like the central maven repo is handing out bad data
11:15ro_stbad maven!
11:15ro_sti wonder if they know
11:16lypanovsummary: lets get clojure on clojars not us off clojars.
11:16ro_stor have they all gone into cryo-stasis already?
11:16lypanovlike mvn ever cared about the users. its all about the ideals man!
11:17lypanovtechnomancy: btw read your reply to headius a while back on twitter where he says lion is making him rethink.
11:17lypanovtechnomancy: ditto for me. i'm the biggest freaking apple fanboy ever created. but i'm sick of it now. using fedora lately instead.
11:18lypanovlion is a complete f-up
11:19mwillhitehey all - I'm getting a weird error when I try any lein command: Exception in thread "main" java.lang.RuntimeException: org.sonatype.aether.resolution.DependencyResolutionException: Failed to collect dependencies for clojure.lang.LazySeq@845c5968
11:19mwillhiteany ideas?
11:19lypanov:/
11:19mwillhiteI haven't touched the code since friday…
11:19mwillhiteremote repo down?
11:19lypanovhow many people now? 5?
11:19lypanovmwillhite: add :exclusions [org.clojure/clojure] to every dep other than your clojure sep in your project.clj
11:20lypanovdep*
11:20mwillhitethanks
11:20mwillhitewhat happened?
11:20TimMcWelp, time to put my ~/.m2/repository up as a torrent...
11:20tomojlypanov: fwiw not using the jars, using a checkout of clojurescript, and just adding the third_party to libs seems to work fine
11:20lypanovtomoj: w00t!
11:21ro_sti'm loving the lazy nature of clojure to prevent unnecessary io work.
11:21ro_stin this case, hitting mongo db up for more data
11:22lypanovmwillhite: we're not quite sure yet alas.
11:22lypanovah, kreig1 has an idea
11:24tomoj..except that closure assumes goog.global has e.g. setTimeout, which isn't true for a node.js module :(
11:24mwillhiteokay thanks :)
11:25lypanovtomoj: https://github.com/zzdhidden/node-jquery-deferred
11:25TimMcI rm -r'd my m2 repo and did lein deps in a clean project, and everything seemed to work...
11:25lypanovi'm using jquery deferred rather than the goog one, maybe the above is a good idea.
11:26lypanovtomoj: if you're running with advanced try the externs/jquery.js file from github ibdknox/jayq
11:26kreig1ok, send email to clojure list explaining the situation
11:26kreig1sent...
11:27kreig1TImMc: interesting...
11:27ivanhttp://twistedmatrix.com/pipermail/twisted-python/2011-June/024149.html beware the jQuery Deferred
11:27TimMckreig1: Do you have a project.clj testcase I could try?
11:27tomojlypanov: looks like google's Deferred has features jquery's doesn't that I want, and I realized s/goog.global = this/goog.global = global/ fixes the problem. thanks though
11:27ivanthe Closure implementation is pretty sane, except for handling of undefined retvalues
11:27lypanovtomoj what features out of interest?
11:28lypanovah
11:28tomojbranch in particular, not sure what else is different
11:28kreig1TimMc: I nuked my .m2, removed my exclusions, and it failed again (as I would expect)
11:28lypanovivan's ref summarized :)
11:28technomancyllasram: the problem is maven conflates ranges and "hard requirements"
11:28kreig1basically, right now 1.2.1 is not available
11:28kreig1technomancy: that's the symptom
11:28kreig1technomancy: the cause is that maven central repo took 1.2.1 out of play
11:28technomancyllasram: you should be able to declare a soft range
11:29technomancykreig1: whoa seriously?
11:29technomancycentral's policies are usually super-conservative
11:29lypanov6 people up to now with broken projects.
11:29kreig1technomancy: see my email to the list (just sent, might need moderation approval)
11:29kreig1technomancy: see also my comments above:
11:29ro_stlypanov: that know about it / know to come ask on here
11:29technomancykreig1: that's a much worse problem, but it doesn't mean the inherent brokenness of version ranges isn't a problem
11:29lypanovthe .xml changed on 5th. fits with mine.
11:29kreig1technomancy: maven central repo is serving up maven-metadata-central.xml for org.clojure/clojure from like 2010
11:30lypanovro_st: good point.
11:30kreig1technomancy: agreed
11:30TimMckreig1: http://repo1.maven.org/maven2 worksforme
11:30TimMcwith clojure 1.2.1
11:30kreig1hmm
11:30kreig1 central (http://repo1.maven.org/maven2)
11:30kreig1that's what I am hitting
11:30lypanovditto.
11:30kreig1could it by a mirroring issue?
11:30technomancyro_st: I don't really have any plans to speak on an overview of Leiningen; my hope is the documentation is clear enough to cover that.
11:31technomancyI do want to speak on a more general build topic at the next conj
11:32ro_sttechnomancy: ok cool. re docs, one thing that i've been unsure of is what's for lein1 and what's for lein2. ditto what clojure-swank uses from the lein1 and/or lein2 configuration settings
11:32ro_sti'm still battling to get my slime repl to respect injections, for example
11:32kreig1TimMc: the maven central server appears to be right, at least when going thru web interface
11:32lypanovkreig1: aye, i had no problems with the browser this morning.
11:32technomancyinjections is 2.x only, but it should apply across the board in all tasks
11:33technomancyro_st: definitely interested in hearing ways the docs could be improved though
11:33ro_sti have it in a profiles>dev map as well as up in the root map and in both cases clojure-jack-in is ignoring em
11:33technomancyhm; like not even printlns are showing up?
11:34ro_sthttps://www.refheap.com/paste/3087
11:35ro_stso i want pprint everywhere, but this doesn't seem to do it. i also had (use 'ring.util.serve) in, and that did nothing either
11:35technomancyhuh; bummer. can you open an issue?
11:35technomancy"use" isn't going to do any good
11:36technomancybecause it's not going to follow you around when you change namespaces
11:36ro_stoh, right. so it has to be require'd?
11:37technomancywell I mean use will be equivalent to require in this case
11:37technomancygotta take off; will follow up on the issue tracker
11:37ro_stcool. shot
11:37kreig1TimmC: can you show me your m2/repository/org/clojure/clojure/maven-metadata-central.xml ?
11:40TimMckreig1: No such file.
11:41TimMcls -R on .m2 only shows jars, poms, and checksums.
11:41TimMclein 1.6.2 if it matters
11:41pepijndevos_I copied a java source file from the internet into my lein directory and added the java source path. It compiles, but cab't find the constructor
11:41ivanhttp://mirrors.ibiblio.org/pub/mirrors/maven2/org/clojure/clojure/maven-metadata.xml
11:42pepijndevos_source file: http://google-refine.googlecode.com/svn/trunk/main/src/com/google/refine/clustering/binning/Metaphone3.java
11:42TimMcpepijndevos_: Missing from the classpath at runtime, then?
11:42kreig1I don't understand
11:42pepijndevos_TimMc, but it does find the class
11:42kreig1TImMc: I mean ~/.m2 ...
11:43pepijndevos_TimMc, Just not the constructor, which is weird
11:43lypanovkreig1: i have <lastUpdated>20100914121821</lastUpdated>
11:44TimMckreig1: I know. It's not there.
11:44hiredmanpepijndevos_: none of those constructors are public
11:45pepijndevos_hiredman, oh, shoot. erm, ok, so a static method I guess?
11:45kreig1TImMC: woah
11:45kreig1TimMc: do you have any metadata files there?
11:46kreig1lypanov: I edited the metadata file to say 1.2.1 and everything works
11:46pepijndevos_hiredman, ok, thanks, but now I have no idea how to get an instance of this thing
11:46mwillhiteeven after I exclude clojure from each of my deps, I still have the same error message
11:47TimMckreig1: https://www.refheap.com/paste/3088
11:48lypanovmwillhite: can you try to get more of an error?
11:48lypanovwhat you pasted didn't include a stacktrace.
11:48kreig1mwillhite: do you explicitely depend on clojure 1.2.1?
11:49mwillhiteoh weird, updating metadata file (like kreigl) to 1.3.0 it seems to be working…
11:49mwillhiteno I have no dependencies on 1.2.1
11:49mwillhiteits all 1.3.0
11:49TimMcpepijndevos_: So weird! The only instances of the keyword "public" are the class and main().
11:49kreig1argh
11:49mwillhitemy metadata file was at 1.2.0
11:49pepijndevos_TimMc, ah, there is a helper class that has a method to construct it
11:50pepijndevos_downloading some other classes now
11:50mwillhitelypanov: the error was: Caused by: org.sonatype.aether.resolution.VersionRangeResolutionException: No versions available for org.clojure:clojure:jar:[1.2.1,1.3.0] within specified range
11:51kreig1mwillhite: when lein version?
11:52mwillhitekreig1: 2.0.0-SNAPSHOT
11:52kreig1argh
11:53kreig1where do those metadata files come from?
11:53kreig1and what does TimMc not have any?
11:53kreig1s/what/why
11:54lypanovfun.
11:54ivanMITM yourself with the correct metadata from ibiblio
11:54kreig1http://repo.maven.apache.org/maven2/org/clojure/clojure/maven-metadata.xml
11:54ivaner I mean set ibiblio as your repo?
11:54kreig1that file is the culprit!
11:54kreig1ivan: how? I am not a lein power user 8)
11:54ivanheck if I know
11:55kreig1ivan: adde the repo, testing
11:56lypanovfun that http://build.clojure.org/job/clojure/386/console built on friday for first time in a month or so.
11:57kreig1BEWM!
11:58kreig1that seems to have fixed it
11:58kreig1added this to my project.clj:
11:59kreig1 :repositories {"ibiblio" "http://mirrors.ibiblio.org/pub/mirrors/maven2/&quot; }
11:59kreig1since for NOW at least, it has the right data
11:59kreig1but as soon as the mirror updates, it will fuck us all again
12:00ivanmirror the mirror before it's too late
12:00lypanovbetter than everything is on clojars and things work reliably than this mess up.
12:00lypanovthat*
12:02ivanI have a feeling ibiblio will get clobbered any minute now given what looks like a weekly mirror
12:02ivanmaybe someone should tell them to not mirror
12:04ivan(is this just an org/clojure thing?)
12:05kreig1that's the only metadata file that looks out of date at least
12:05ivanoh
12:08rplevyso then what is causing this "org.sonatype.aether.resolution.VersionRangeResolutionException" I am having the same problem this morning
12:08pandeiroanyone have a go-to java lib for transforming scanned documents into text via OCR?
12:09kreig1rplevy: bad metadata from maven
12:09kreig1rplevy for the org.clojure/clojure project
12:09rplevywas something bad pushed?
12:09kreig1rplevy: no idea
12:09kreig1since fucking clojure list is moded, my email is not out yet
12:09kreig1this is ridiculous
12:09lypanovi hate that also. 4+ emails i've sent to that and nothing posted. no longer using.
12:10lypanovahhh great and my wife just left the house with the wrong debit card while i was debating grabbing sushi.
12:10kreig1rplevy: depends, I don't know if metadta is generated or uploaded
12:11rplevydeleting .m2...
12:11kreig1that won't help
12:11kreig1add ibilbio mirror to your project.clj (for now)
12:11rplevyyou're right it didn't
12:11kreig1argh
12:11rplevyok I will do that, thanks
12:11kreig1man, it's a fucking monday with vengeance
12:13langmartinI'm having some trouble loading resources from an uberjar, where loading them from the repl works. In the uberjar, the contextClassLoader for the current thread is a clojure DynamicClassLoader and at the repl it's an AppClassLoader. Is that significant? The uberjar does contain the resource files.
12:13TimMclangmartin: Have you confirmed the resources are in there?
12:13TimMcMyabe it was built wrong.
12:14langmartinTimMc: yeah, if I just open the file in emacs (which unzips it) they're there
12:15langmartinthe loading class and the resources are all in the root of the jar, if that's an issue... some of the google results seemed to think names without segments wouldn't load correctly, but most of those people seemed confused
12:15rplevykreig1: got the URL handy? I'm still looking for it...
12:15rplevyto add in repos in lein
12:16kreig1Fuck
12:16kreig1I do
12:16kreig1but now I can't paste into my IM client
12:16kreig1MONDAY! DAMN YOU!
12:16rplevylol
12:16kreig1asd http://mirrors.ibiblio.org/pub/mirrors/maven2/
12:16technomancysonatype has it too
12:17rplevykreig1: thanks!
12:17TimMclangmartin: Yes, that could be trouble.
12:17technomancyhttps://oss.sonatype.org/content/groups/public/
12:17rplevyisn't it sonatype that is having problems today?
12:17technomancyit has 1.2.1 at least
12:18hiredmanlangmartin: most likely you are loading the resource via something like (clojure.java.io/resouce "resources/foo") which works from the lein repl because "." is on the classpath too, but you should just be doing (clojure.java.io/resource "foo") because there is no resources/ in the ubarjar
12:18technomancyoh, I didn't check the metadata file, just the presence of the jar
12:18technomancythis lists 1.2.1 though: https://oss.sonatype.org/content/groups/public/org/clojure/clojure/maven-metadata.xml
12:19kreig1testing witht aht repo
12:19kreig1ibilbio is bitching at me
12:19langmartinhiredman: I'm not, but that's a good note. from the repl, (io/resource "sql") returns the url for project/resources/sql
12:19langmartinnil in the uberjar
12:20technomancykreig1: which noir version do you need to specify to repro?
12:20hiredmanlangmartin: seems unlikely
12:20hiredmanis "sql" a directory?
12:21hiredman(cause that is not going to work)
12:21langmartinhiredman: it is a directory
12:21hiredmanwell there you go, you can't do that
12:21langmartinio/as-file coerces it to a list from the repl....
12:22hiredman"you can't do that"
12:22langmartinhiredman: can't do what?
12:22langmartinopen a directory and list the files in it?
12:22kreig1techno: 1.2.2
12:22kreig1technomancy: 1.2.2
12:23technomancykreig1: cool; was able to repro and confirm that adding sonatype fixes it
12:23kreig1technomancy: I added sonatype as a repo and it works
12:23kreig1technomancy: yup, confirmed here too
12:23technomancykreig1: since you're stuck in moderation purgatory I'll post to the clojure list
12:23kreig1technomancy: que ridiculo
12:24technomancydinc
12:24technomancythis first manifested over the weekend?
12:25kreig1yah
12:25kreig1one of my coworkers said he built last night fine, and it broke this morning
12:25kreig1but not a totally reliable report. I know that we build friday afternoon tho
12:25kreig1built...
12:25technomancyyeah, hard to say unless you have a fresh m2
12:25ibdknoxdnolen: Finally got a chance to talk to Bret Victor this weekend :) Avi Bryant too!
12:26technomancynot 100% sure why noir's version ranges are blowing up here but at least we have a fix
12:26ibdknoxI went around singing Clojure/CLJS praise everywhere I could
12:27kreig1technomancy: yah, the amn file mod time on the maven repo itself says Sept 2010
12:27kreig1technomancy: bad restore?
12:27foxdonutibdknox: do tell!
12:27ibdknoxI was at FOOcamp
12:27kreig1in chicago?
12:27kreig1ah
12:27kreig1should have gone
12:28ibdknoxvery neat opportunity and a bit of a surreal experience
12:28ibdknoxno
12:28technomancykreig1: well while noir's range declaration is annoying, it still should be able to resolve *something* within the range it requires
12:28ibdknoxkreig1: foo is at O'Reilly's headquarters
12:28ibdknoxin sebastopol
12:28kreig1aahh, misunderstood
12:28dnolenibdknox: haha, very cool!
12:29ibdknoxNorvig knew who I was :) Another life goal down lol
12:29ibdknoxBut yeah, I think I got a fair number of "important" people interested in Clojure :)
12:29foxdonutawesome!
12:29ibdknoxnot sure if that will result in anything, but who knows
12:30foxdonutdid Bret Victor have any idea about LT?
12:31ibdknoxyeah, unfortunately didn't get to talk too much about it specifically. But I convinced him to have dinner with me, so we should get to talk then
12:31langmartinok, resources can only refer to files, not directories, so I need to keep an index file rather than listing files in the directory. Seems like it might be handy if io/resources enforced this behavior from the repl too, but all is well. thanks
12:32muhoowhat's the trick in lein repl to get the full stacktrace instead of the one-line stummary?
12:32muhooheh, summary?
12:32TimMcmuhoo: (pst)
12:33muhooTimMc: thx
12:33foxdonutibdknox: very cool.
12:37muhooi seem to have acquired a compojure vs. ring incompatibility of some kind: https://www.refheap.com/paste/3090
12:38foxdonut(england just scored and lead france 1-0)
12:41technomancykreig1: https://clojars.org/org.clojure/clojure
12:44technomancynot that it helps at this point, but one of the reasons for running a private nexus server is to insulate you from these kind of screwups.
12:45kreig1technomancy: thanks
12:46muhoooh that's bizarre. i have ring 1.1.0, ring-core 1.0.2, ring-devel-1.1.0, ring-servlet-1.1.0. one of these things is not like the other :-/
12:47kreig1so....
12:47kreig1trying to decide just how much to leap into the "javascript" application world
12:48kreig1I have historically been more of a generate html and decorate with javascript person
12:48kreig1but, am contemplating mving to a mostly JS app, with lots of client side rendering, and a JSON api on the backend
12:48kreig1obviously clojurescript is on the table
12:49dnolen_ibdknox: haha, that's awesome that you got meet Norvig
12:49dnolen_ibdknox: so imagine you guys will starting cranking on LT in earnest soon.
12:49ibdknoxdnolen_: playground out in the next two weeks
12:50ibdknoxthe goal is something legitimately useful for Clojure by the end of YC
12:51dnolen_ibdknox: sweet!
12:54lypanovdnolen_: hey if you get time could you take a look at http://dev.clojure.org/jira/browse/CLJS-276 / poke someone about it?
12:54gfredericksI add clojure.data.json as a dep, and then `lein deps` complains that it can't find clojure/data/json.clj on the classpath??
12:54lazybotgfredericks: What are you, crazy? Of course not!
12:54lypanovibdknox: btw i'm really confused by my level, does "pre-beta" mean may or oct?
12:54pbostrom_kreig1: take the leap, Clojurescript is great
12:55lypanovgfredericks: org.clojure/data.json
12:55ibdknoxlypanov: here's the estimated break down http://www.kickstarter.com/projects/ibdknox/light-table/posts/210336
12:55gfrederickslypanov: yeah I got that part right
12:56lypanovibdknox: sweet. just the kickstarter end dates don't correspond so got really confused
12:56ibdknoxyeah KS didn't let me change them :(
12:56dnolen_lypanov: not sure what you want me to do, I don't have the bandwidth to try it out. I suggest bringing it up on the ML getting some else to confirm and submitting a patch.
12:57lypanovdnolen_: none of my posts to ml are allowed through.
12:57lypanovso i've stopped even bothering lately.
12:57lypanovwill try to email stuart.
12:58dnolen_lypanov: yes that would be the thing to do.
12:58dnolen_lypanov: if it's a real issue and there's a patch I will happily apply it.
12:58pbostrom_ibdknox: just curious since you changed up the levels during the campaign, but does the $80 level include early beta access?
12:59gfrederickswasn't there someone who gave a presentation using clojurescript back when it first came out? (i.e. instead of pdf or powerpoint or whatever)
12:59lypanovgfredericks: about using, or using?
13:00lypanovas in, created with, or about? if so, iirc hickey gave an awesome one.
13:01lypanovdnolen_: good point. i'll figure out if i can attach a patch to the issue. now its just instructions.
13:02dnolen_lypanov: thx, have you submitted your CA?
13:02lypanovdnolen_: nope, will look into doing so.
13:02lypanovhttps://github.com/stuartsierra/cljs-formatter sweeeeeet
13:03edwHey guys, I'm getting "Failed to collect dependencies for clojure.lang.LazySeq@..." errors when running lein. Any ideas WTF this means?
13:03gfrederickslypanov: where the presentation itself was made with cljs
13:03technomancyedw: probably this issue? http://groups.google.com/group/clojure/browse_thread/thread/776d9acff0785f15
13:03gfrederickslypanov: the slides
13:03technomancyscrew-up at maven central
13:04edwAh. Thank you. I am breathing into a paperbag here...
13:04technomancyedw: is the clojars fix not working for you?
13:05muhoothat should be added to /topic
13:05kmicudnolen: "Loading the file directly in your browser will not work. The Closure transport we use does not support that anymore." Whether it is still true in last cljs version?
13:05technomancymuhoo: now that it's on clojars it shouldn't be causing any more trouble
13:05edwI'm trying it now.
13:05dnolen_kmicu: it's true moving forward yes.
13:05technomancyedw: you shouldn't have to do anything special to bring in the clojars fix though
13:06technomancyunless you've left out clojars entirely
13:06edwWhat clojars? I'm trying the sonatype thing right now.
13:06technomancyread the second message =)
13:06edwAh.
13:06llasramedw: Is it possible you just have something funky in your :dependencies ? That error looks vaguely like it's trying to resolve deps for a LazySeq object
13:06edwAgain, (panic-mode 1)
13:07technomancyllasram: that's leiningen's fault; the error message is just crappy
13:07muhootechnomancy: nice shoestring catch! thanks for that.
13:07gfrederickstechnomancy: does src/user.clj mean something special to lein?
13:07edwI just rebuilt emacs from the git repo, which confused me about the source of the errors...
13:07technomancygfredericks: no, that's actually all Clojure
13:07llasramtechnomancy: Ah, ok. Error messages are hard...
13:07gfredericksoh wow I think I remember hearing that like a year ago
13:08gfredericksokay so clojure automatically picks up any "user.clj" on the classpath?
13:08technomancygfredericks: it's useful for crazy hacks like clj-nstools
13:08muhootechnomancy: does lein2 have a different algorithm for resolving dependencies than lein 1.7.1?
13:09technomancymuhoo: it uses aether rather than maven-ant-tasks. I don't know if there are intentional differences, but it's a different implementation.
13:10muhooand the order in which the :dependencies are declared affects how the resolution is done, corret?
13:10muhoocorrect?
13:11technomancyI think so
13:12technomancyedw: which version of leiningen do you have?
13:13edwpreview6
13:13edw2.0
13:13technomancyhuh
13:13technomancyweird
13:13edwos x 10.7.blah
13:13edwusing clojure 1.4
13:13technomancywhich task were you invoking that emitted that output?
13:13edwdeps
13:14technomancyweird
13:14duck1123I saw that same message the other day, but I can't remember what caused it or how I fixed it
13:14edw(Everything's under control now with the fix you pointed me to. Thank you.)
13:14duck1123edw: are you using clj-webdriver?
13:14technomancyedw: you shouldn't have to add sonatype now actually
13:15edwduck1123: No.
13:15edwtechnomancy: What, if anything shoul I have to do now, and when did the situation change?
13:16technomancyedw: after I posted the first message I deployed a fix to clojars that should work transparently with no changes
13:16technomancyedw: was that fix not working for you?
13:18duck1123Ok, I was getting that when I specified [clj-webdriver "0.6.0-alpha8"] as a dev dependency. Failed on finding org.bouncycastle:bcprov-jdk15on:pom:1.47
13:18edwNothing worked until I put that in like ten minutes ago and all's been well since.
13:19edwMy Heroku instances are working restarting again even though I didn't push out that project.clj change though.
13:20technomancythey should have a cached m2 repo
13:20edwAh.
13:20edwA random question: anyone know if you can get OS X's Terminal.app to do click-to-position-cursor in emacs?
13:21muhoocemerick: regarding :unauthorized-uri, should it not overwrite that until after auth succeeds/fails?
13:23cemerickmuhoo: What do you mean "overwrite"?
13:23muhoocemerick: use case being where i have a whole site wrapped. i hit /foo, that gets added to :unauthorized-uri, then the browser hits /css/reset.css, and now /css/reset.css replaces :unauthorized-uri. when the redirect happens, after auth, it Location:'s the user to /css/reset.css, not to /foo
13:23muhoodunno if that makes any sense
13:23cemerickoh, I see what you mean
13:24muhooi'm hacking around that by excepting /css/* /img/* /js/* for now
13:25muhoobut as i get more ajaxy, that won't work.
13:25borkdudeso more info on the breaking maven/clojars thingy?
13:25cemerickmuhoo: well, each request is stateless, so there's no indication as to which one is the "redirectable" uri.
13:26muhooi'm thinking that maybe the first one should stay until after auth succeeds. subsequent unauthroized requests wouldn't replace :unauthorized-uri maybe?
13:26cemericke.g. if a user hits /foo, bounces to the login page, then explicitly visits /bar, when they finally log in, you'd want them to go to /bar, not /foo.
13:27muhooaye, true.
13:27cemerickwhy is the browser hitting these asset URIs if the page that refers to them requires authentication?
13:28muhoothat's a very good question
13:28muhoomaybe because the login page uses them
13:29lypanov403s?
13:29muhooyep, that's what was happening. /login was excepted from the wrap. i'll just need to be careful to explicitly except from wrap, anything that might be needed for login pages then.
13:29duck1123Shouldn't making exceptions for your assets be the desired solution anyway? Do they really need to be authed to get the CSS file?
13:30muhooin this case, that's how i solved it, yes.
13:31kmicudnolen: but loading the file directly in your browser limitation only applies to REPL connection and I still can serve cljs site without HTTP server in production?
13:36lypanovkmicu: i'm doing so in production with no issues.
13:37cemerickmuhoo: right, so getting the authorization guards in the right places is important.
13:38cemerickThere's been some suggestion that a sandbar-like pattern system is desirable. Not convinced either way on that at the moment, but it would help in cases like this where you're wrapping another complete app.
13:38cemericklypanov: http 403 (unauthorized), which often leads to a login page
13:39muhoosandbar?
13:40muhooduck1123: this is what i ended up with https://www.refheap.com/paste/3091
13:42cemerickmuhoo: A Clojure authentication framework by Brenton Ashworth.
13:44teleghuilypanov:thx, http server on android will be strange for js app :)
13:44duck1123replacing my homebrewed auth system with friend is just one of the items on my list of things to do
13:45muhoocemerick: hm, shouldn't be too hard to graft something like this onto friend: https://www.refheap.com/paste/3092 (from his docs)
13:45nDuffteleghui: you don't need a HTTP server for local browser-hosted on Android
13:45nDufferr, browser-hosted apps
13:46cemerickmuhoo: quite right; you could write it right now, actually :-)
13:46muhooit'd be one function, and a short one too
13:46cemerickDoesn't need to be part of friend, just a bit of middleware that reuses the authorization fns.
13:46antares_I am trying to access request or query params from a Noir handler. Is it possible without dropping down to bare compojure handlers?
13:46muhoowhat a great language to be working in.
13:47gfredericksis there a way to `lein repl` with a working directory independent of the project?
13:47gfrederickse.g. LEIN_ROOT=/my/project lein repl
13:49teleghuinDuff: i need if i want to connect REPL to ot :)
13:49muhooantares_: it's usually {:as fields}
13:49nDuffteleghui: ahh, you mean a remote one? *nod*.
13:50muhooantares_ : i.e. (defpage "/login" {:as params} , then params is your query or form params
13:50antares_muhoo: so it works like regular destructuring over maps?
13:50technomancygfredericks: other than cd? maybe set PWD?
13:51antares_I tried that, with :keys [a b] and :as m I only have :a and :b in the map
13:52muhooi'm almost certain i've done (defpage "/foo" {:keys [a b] :m} before
13:52muhoosorry :as m
13:53antares_muhoo: yup, it works now, I found an issue on my end. Thank you!
13:53teleghuinDuff: you can't connect to repl from static site served via file:///
13:53gfrederickstechnomancy: I was just hoping that I could launch a project from anywhere and have it run with my current working directory; no big deal if that's silly
13:53nDuffteleghui: did I say file:///?
13:54duck1123gfredericks: you could set up a shell script to set your project before launching the repl.
13:58muhooslamhound is giving me this: ZipException error in opening zip file java.util.zip.ZipFile.open (ZipFile.java:-2)
13:59technomancymuhoo: usually means a jar was truncated
13:59borkdudeprobably not a lot people have noticed the central/clojars thing, since they are looking forward to their new macbooks :P
13:59dustingetzi'm struggling with postgresql environment/auth issues, anybody been through this before?
13:59muhooi also have checkouts in my cp too. h
14:03semperosdustingetz: it's an experience I think most like to forget :)
14:04technomancydustingetz: I hear the best thing to do in development is run postgres as your own user
14:04dustingetzshit wrong room haha sorry folks
14:06gfredericksduck1123: what does "set your project before launching the repl" mean?
14:09duck1123gfredericks: basically, have your shell script cd into the project and run the repl and then return when done
14:10duck1123I know there's a better way to do that, but it's been some time
14:10S11001001duck1123: you can't setcwd in java
14:10duck1123but you can in bash
14:10duck1123it's not a great solution...
14:11zachallaunQuick noir question: is there a way to get a stack trace (or other debug info) when a page fails to load, instead of the generic "something very bad has happened"?
14:11S11001001right, but sometimes you want your code to be executing in the invoking directory
14:12S11001001for which you can java -cp `cd projdir && lein classpath` clojure.main --repl or whatever
14:12muhoozachallaun: if you're in dev mode, you shouldget the stacktrace.
14:12muhoozachallaun: if you want stacktraces sent to you, not to the browser, there's http://github.com/kenrestivo/firealarm
14:12zachallaunmuhoo: Awesome, thanks!
14:13gfredericksduck1123: wouldn't that mean the JVM's CWD is still the project?
14:15duck1123Could you write a script to cd into the project, copy the classpath string, cd back to the original dir and invoke java? (Seems way too complicated)
14:16duck1123just throwing out random thoughts here
14:20gfredericksthat is worth thinking about
14:20gfredericksthx
14:21muhoomuch as i love clojure, i'm finding in making Real World Apps (tm), i'm spending maybe 70% of my time dealing with java/jvm/maven/lein stuff, and 30% actually writing clojure
14:21AimHereduck1123, if you're talking about bash, pushd and popd would be your friends for that sort of thing
14:22muhooi.e. Caused by: java.lang.NoClassDefFoundError: Could not initialize class cheshire.core__init
14:25ivanmuhoo: beats spending 99% of your time writing a non-maven build system
14:26amalloygtrak: you might like https://github.com/flatland/useful/blob/develop/src/useful/map.clj#L5 as a simpler (though perhaps not easier, depending on your use cases) alternative to let-map
14:26amalloy(keyed [a b c]) => {:a a, :b b, :c c}
14:27Jayunit100muhoo: me to
14:27gtrakah thanks, I was thinking something like it must exist
14:27Jayunit100Spend most of my time defining w packages and namespaces.
14:27muhooivan: oh lein makes it a LOT less painful, to be sure.
14:28kreig1muhoo: that overhead goes away
14:28Jayunit1001) I would like to contribute to improve the docs and namespace error messages, so that they are more user friendsy, like the ones in GWT. 2) Lein is AWESOME. I can't complain.
14:28kreig1muhoo: I am writing a "real world app" and most of my time is writing actualy clojure
14:28gtrakamalloy: I was mostly just curious to see if I could do it, but it seems kind of a dual to destructuring.
14:30kreig1muhoo: about 13k lines now
14:30muhookreig1: that's huge for a clj program.
14:30dakronemuhoo: where are you seeing that exception?
14:31muhoodakrone: https://www.refheap.com/paste/3093
14:31gtrakamalloy: so, with 'keyed' you have to type a name 2 times, that's better than the 3 times required without it, with let-map you just type it once
14:31muhoodakrone: from the ns declaration, ultimately
14:31kreig1lunch time
14:32dakronemuhoo: do you have the code up somewhere, this is just a stacktrace
14:32amalloygtrak: (defn foo [x] (let [y (inc x)] (keyed [y x])))
14:33gtrakright
14:33amalloylet-map can't do that
14:33muhoodakrone: not for this one. i'll see if i can boil it down to a test case (of course, may end up fixing it in the pprocess :-)
14:33kmiculypanov: Were you able to run https://github.com/stuartsierra/cljs-formatter?
14:34gtrakyea, you'd have to re-bind it, (defn foo[x] (let-map [y (inc x) x x]))
14:34amalloyyou also can't let-bind some intermediate values like (let [x 1, y (inc x), z (inc y)] (keyed [x z]))
14:34lypanovkmicu: no never tried it might in a few weeks.
14:34amalloyi think it's a lot nicer to separate out "let's bind something" from "let's return a map"
14:35gtrakamalloy: yea, I think either one is a definite improvement, maybe 'keyed' should go in core? Like I said I think it's a nice complement to destructuring.
14:35amalloymeh. core is crowded enough, without importing all the random crap i write
14:36gtrakhehe
14:36amalloyjust use some external libraries; there's no reason everything should be in core
14:36gtrakI guess if I wrote more random crap I'd feel the same way
14:37gtrakamalloy: mind if I link to keyed on my blog?
14:37amalloyknock yourself out
14:38muhookreig1: wow, clojure itself is only 28k lines or so. so whatever you're writing, wow.
14:38amalloygtrak: btw, keyed also takes (keyed :strs [a]) => {"a" a}
14:38amalloywhich helps dualize with map destructuring
14:40gtrakah yea, neato
14:42dustingetzhow do i change a dynamic variable? i've tried set! and def, from within the appropriate ns
14:42ohpauleezdustingetz: welcome man!
14:43tbaldridgedustingetz: I think as of Clojure 1.3 you have to set the var as dynamic first: (def ^:dynamic foo 42)
14:43tbaldridgeThen set! should work iirc.
14:43ohpauleezdustingetz: you want the binding function
14:43ohpauleezhttp://clojuredocs.org/clojure_core/clojure.core/binding
14:43dustingetzlol, hi paul, we met at philly lambda a month or two ago, you gave a talk on clojure and clojurescript at tutorspree
14:43ohpauleezif you want it to be stateful, you need something like an atom
14:43dustingetzthanks for the link
14:44ohpauleezdustingetz: of course I remember
14:44tbaldridgeyeah, bindings only apply to the current thread. So use binding with pmap and you'll run into tons of issues.
14:46gtrakamalloy: map juxt vs zipmap, i like that, too
14:46amalloygtrak: in particular there's no reason at all to use zipmap at runtime when you could build the form at macro time
14:46amalloywith zipmap or with juxt, whatever
14:47gtrakah, I see, that's much better
14:49gtrakso you build the literal with symbols, then it gets eval'd at runtime
14:56aduare any of you going to the Reston, VA meeting?
14:58muhoodakrone: it appears to be lein2 related. in lein1.7.1, everything works, all ns's appear to compile. using "lein2 check", i get that stacktrace. so it's related i think to the order of dependency resolution
15:02gtrakamalloy: well at first I was thinking of doing something with &env instead of destructuring and parsing the bindings, so at least I didn't re-invent it that way :-)
15:03xeqimuhoo: `lein deps :tree` will show you what versions its getting
15:03xeqifor lein2
15:03muhooxeqi: yes, i did that. and the versions are the same on this non-working app as for my working demo app
15:04muhoolein2 check blows up: https://www.refheap.com/paste/3094 lein2 check works just fine: https://www.refheap.com/paste/3095
15:05nDufflpetit: Howdy -- I posted to clojure-tools this morning w/ a proposal for the REPL / classpath thing; would very much appreciate your feedback.
15:05muhoooh, wtf? there are two different versions of jackson in there. beeee-zarre
15:06nDufflpetit: (also added Felix support to clojure.osgi in a different changeset; feedback would be welcome there as well)
15:06lpetitnDuf: hello, saw it while at work, indeed. Don't know if I'll have time to answer quickly, tho, very busy both @ work & @ home
15:06lpetitnDuff: have you been able to contact aav ?
15:08nDuffHaven't really made an effort -- my first inclination is to consider a maintainer w/o commits for 6 months inactive, though perhaps it shouldn't be.
15:08nDuff...thanks for the suggestion, though; I'll send an email.
15:09lpetitnDuff: well, he's more "the creator", I'm just a "user" of clojure.osgi which happens to use his own fork :)
15:26pbostromamalloy: I'm reading through useful.map. re: "unchanged values are not re-assoc'd"; is this for performance? In your experience do you find it to be noticeable?
15:26amalloypbostrom: i think it's supposed to be for performance; i have no idea if it makes a difference
15:46gfredericks,(let [m {:foo 4}] (identical? m (assoc m :foo 4)))
15:46clojurebottrue
15:47gfredericks,(let [m {:foo 4}] (identical? m (-> m (assoc :foo 5) (assoc :foo 4))))
15:47clojurebotfalse
15:47S11001001microoptimization ahoy
15:48borkdudegfredericks that looks a bit scary
15:48S11001001,(let [m {:bar 4}] (identical? m (assoc m :bar 5 :bar 4)))
15:48clojurebotfalse
15:49arrdemhey guys.. classpath issue I need some help with
15:50arrdemI have mixed .java and .clj files deep in a dir structure and as I'm compiling them clj claims that it can't find .class files co-located with the .clj's
15:50arrdemideas?
15:51gtraki think you need to compile the java in a separate step
15:51gtrakhow are you compiling?
15:51arrdemI javac first, leave the .class files next to their .javas and then run clj
15:52amalloy~leiningen
15:52clojurebothttp://github.com/technomancy/leiningen
15:52S11001001lein looks in classes, not the java source tree
15:52arrdemk I'll check it out. thaks
15:53S11001001huh.
15:54gtrakarrdem: in the sample project: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L170
15:57muhoooh FFS. clj-aws depends on jackson-core-asl, for the license (apache), whereas cheshire depends on jackson-core, presumably LGPL?
15:57gtrakmuhoo: you can add exclusions in your project.clj
15:57dakronemuhoo: which clj-aws?
15:58dakronemuhoo: https://github.com/pingles/clj-aws/blob/master/project.clj ?
15:58lypanovaye. exclusions ftw.
15:59muhoodakrone: https://www.refheap.com/paste/3094
16:00dakronemuhoo: ahh, clj-aws is using an older version of jackson
16:00muhooso aws-java-sdk is pulling in jackson-core-asl 1.9.7, and noir is pulling in cheshire which pulls in 2.0.0
16:00muhooi don't know for sure if that's what's causing cheshire to fail to load in lein2, but it might be
16:01muhooif the two jackson's have the same ns, they could be clobbering each other
16:01muhoowill try exclusion and see how that goes
16:01gtrakmuhoo: sometimes it's random which version of the class gets loaded first
16:01gtrakyou definitely want to avoid that scenario
16:02dakronetell amazon to upgrade their deps ;)
16:03gtrak"some internet clojure dev needs it to be a different version? we only have a few thousand deployments using it? I'll get right on it!" :-)
16:04muhooit's repeateable: in lein2 clj-aws gets loaded first, with the incompatible jackson. in lein1.7.1, noir then cheshire gets loaded first
16:04gtrakmuhoo: yea, on a different version of java, the other may get loaded, ask me how I know ;-)
16:04muhoosame project
16:04muhoohahahaa
16:05muhoonow i understand why technomancy is so keen on repeatability. it appears that it's not a given in java.
16:05gtraknah
16:06gtrakone time I had conflicting ASM libraries break Spring AOP proxying... but it 'worked for me' on my box ;-), so I told him to stop breaking shit
16:06gtrakhim -> a colleague
16:06gtraktook a couple hours to figure out what was going on
16:07gtrakmaybe it was cglib
16:10timvisheris ring-json-params still the state-of-the-art for json middleware?
16:11dustingetzquestion about dynamic vars again
16:11dustingetzfrom a third party library docs:
16:11dustingetzBy default all migrations are kept in the lobos.migrations namespace. It'll get automatically loaded by migration commands, so there's no need to load it yourself. Thus, to use another namespace you must change the lobos.migration/migrations-namespace dynamic variable.
16:11dustingetzusing ns or in-ns, i do: (set! *migrations-namespace* 'gb.install.migrations)
16:12dustingetzwhich yields `Can't change/establish root binding of: *migrations-namespace* with set `
16:12dustingetzalso tried
16:12dustingetz(def ^:dynamic lobos.migration/*migrations-namespace* 'gb.install.migrations) which yields Can't create defs outside of current ns
16:12gtrakalter-var-root?
16:13technomancythat sounds craaaaazy
16:13gtrak dropped my laptop. thankful for ssd ;-D
16:14dustingetzhmm, the docs on alter-var-root are confusing to me
16:14dustingetzhow would i use it?
16:14dustingetzit expects a fn to apply to the global
16:14dustingetzi would expect to use set! in that fn or something, i dont see how that would resolve the error
16:17gtrak,(#(identity 5)) ; replace 5 with your value
16:17clojurebot5
16:17technomancyI would be surprised if lobos made you use alter-var-root
16:17technomancyif it really does I would suggest looking for an alternative
16:18gtrakwhy not just add your migrations to its namespace?
16:19dustingetzi get classpath errors because my package structure doesn't line up with their namespaces
16:20gtrakdustingetz: uhhh... I think you should just use defmigration
16:20dustingetzi will probably confirm to their requirement for now bc this is super dumb
16:20dustingetzi am using defmigration but their (migrate) fn is trying to load my migrations from lobos/migrations.clj which is due to that global
16:20gtrakdefmigration swaps a var within that namespace
16:21gtrakwhat's the problem?
16:21dustingetzrunning (migrate) yields error: Could not locate lobos/migrations__init.class or lobos/migrations.clj on classpath
16:21dustingetzdue to the damn global
16:22gtrakwhy wouldn't you be able to access that namespace?
16:22gtraksounds like a project setup issue
16:22gtrak,(use 'arbitrary.ns)
16:22clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate arbitrary/ns__init.class or arbitrary/ns.clj on classpath: >
16:23muhoogreat, :exclusions successfully excludes the older jacksons, but, doesn't solve the problem. (ns noir.response (:require [cheshire.core])) is failing, but only on lein2
16:23gtrak,(require 'arbitrary.ns)
16:23clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate arbitrary/ns__init.class or arbitrary/ns.clj on classpath: >
16:23dakronemuhoo: because lein2 uses cheshire in itself
16:23muhoowat?
16:23clojurebotFor Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
16:24gtrakand for JSwat go here: http://www.shopify.com/technology/5370262-wat-a-funny-look-at-ruby-and-javascript-oddities
16:24technomancydakrone: you mean the repl-specific stuff?
16:24dakronetechnomancy: yea
16:24technomancydid we end up with a way to turn that off?
16:25dakronetechnomancy: well, clj-http is loaded on-demand now, but that still may not prevent it from messing up the classloader stuff, I don't understand classloader stuff entirely
16:26technomancymuhoo: for debugging's sake try getting it working with lein run first
16:26gtrakdakrone: on-demand?
16:26lypanovgtrak: thing with ruby that kills me is "blah if blah and blah" does NOT do what you expect
16:26muhootechnomancy: it was failing with lien2 check
16:26muhoolein2 check
16:26technomancyoh, ok, so it's not the repl deps then
16:26dakronegtrak: in `lein repl`, clj-http isn't loaded until you try to use (cdoc ...) or (clojuredocs ...)
16:26gtraklypanov: ?
16:27gtrakdakrone: ah
16:27muhooit doesn't seem like a repl thing. i'm preparing a bare minimum fail case now
16:27timvisherHow would you go about handling json parse errors gracefully if you were trying to use the wrap-json-params middleware?
16:27gtraklypanov: ah, the wat link. Yea I have yet to be impressed enough with ruby to go ahead and learn it. I already know python though.
16:30gtraklypanov: I've always hated having to think about operator precedence
16:30gtrakeven before I started using clojure. Anytime I saw an interview question about it, I'd be like, I'd just put some parenthesis there, I don't give a fuck about the rules
16:32lypanovgtrak: right. in ruby i always wrap any "expression" conditionals with () for this reason.
16:32lypanov(e.g. b = blah, or blah if b)
16:34gtrakyea... another fun one, C/C++ you have the option to shoot yourself like this if (a = getValue()) {blah}... instead of ==. java stops you
16:34emezeskegtrak: Shoot yourself, or be succinct, depending on context :)
16:34gtrakemezeske: haha yea
16:35gtrakquite easy to gloss over
16:36gtrakso there's a pattern to write literals on the left: if (null = getValure()) is now a compile error
16:37emezeskegtrak: Otherwise known as Yoda Conditionals
16:38gtrakah, I never heard that one
16:39emezeske"If null is getValue(), ..."
16:39muhoowhy yoda?
16:39emezeskeRead the above in yoda voice :)
16:39gtrakit does apply in java though, in the case of checking equality of strings, thankfully clojure just does the right thing with nulls
16:39amalloygtrak: getValue() = null is an error too
16:40gtrakyea
16:40muhoowe do have the NPE though... the segfault of java
16:40emezeskeamalloy: In Java maybe, but in C++, only God knows what that will do.
16:40emezeskeamalloy: I guess "null" implies Java, though, so I'll quiet down
16:41gtrakso in java, aString.equals("literal") should really be "literal".equals(aString), so you can skip the null check
16:41gtrak,(= "hello" nil)
16:41clojurebotfalse
16:41amalloyemezeske: i think that can only be correct in C++ if you're returning a value (not a pointer) and someone has overloaded the = operator
16:42emezeskeamalloy: That would definitely do the trick.
16:44muhoonice. i can't get it to fail in a small test app
16:44gtrakamalloy: it can be used to check for a null-pointer, no? say if an allocation didn't work?
16:44muhooso now i have to build up the whole app, file by file, waiting to see where it breaks :-/
16:45amalloygtrak: huh?
16:45emezeskemuhoo: You using git? Maybe a git bisect could be helpful?
16:45gtraklike: if (a=malloc(large_amount) {} , it's been a while ;-). malloc will return null if it can't
16:46amalloyindeed. but your null = getValue() example is not valid in either direction
16:46gtrakright
16:47gtrakthat's the point of that, so you don't accidentally write =, it's a guard. null == getValue() is fine, so you just get in the habit of doing it that way
16:48amalloygtrak: you're using an example that does not support the (entirely viable, though i don't like them personally) yoda conditions
16:48amalloyboth of these result in a compiler error: (getValue() = null) (null == getValue())
16:49amalloyer, too many =s in the second
16:49gtrakhuh?
16:49gtrakam I missing something?
16:50amalloyapparently. getValue() = null already fails to compile, so there's no value in switching the order to save yourself
16:50gtrakright... sure.
16:51muhooemezeske: the change was simple enough, don't need bisect, i went from noir 1.3.0-beta2 to noir-1.3.0-beta8, which bumped cheshire from 3.0.0. to 4.0.0 ==> boom!
16:51gtraknull == getValue() is fine
16:51cemerickWhy does java.jdbc's get-connection define its own URI convention, instead of just passing strings and URIs along to DriverManager directly?
16:52muhooemezeske: the mystery is in what specifically in my app is causing this failure to manifest itself, and only with lein2, just to make life interesting.
16:53emezeskemuhoo: Ah, yeah, a git bisection would not be helpful then
16:53emezeskemuhoo: Just a regular by-hand bisection :)
16:55muhooi tried a minimal test app, with just the :dependencies from the broken app, and no problems. so it's somethign i'm doing somewhere, some order of class-loading based on the tangle of :requires i've got somewhere
16:55jsabeaudryRaynes, still nothing regarding my pull request? not even a comment or an insult?
16:55cemerickperhaps seancorfield knows? :-)
16:56Raynesjsabeaudry: What pull request where? :|
16:56RaynesI tried to tackle a bunch of the pull requests and stuff I'd been ignoring last night.
16:56RaynesOh!
16:56Raynestryclj.
16:56jsabeaudryYup :)
16:56RaynesI knew I recognized the nick.
16:57muhoois there a way to get lein2 check to show a longer, or rather complete, stacktrace, none of this "... 46 more" stuff?
16:58nDufflpetit: Thank you for the suggestion to ping aav; heard back with initial interest and intent to closely review and merge over the next few days.
16:58RaynesI talked with some friends who know more about cljs than I do and the general consensus was that, for such a small codebase, moving to cljs didn't really gain anything. And the translation was more or less direct, so it felt like writing javascript in Clojure just for the sake of it. I left it open because I planned to revisit it and play with it myself in the future, but I just haven't had time.
16:59nDuffIs it worth filing a bug about (remove-ns) not removing the value from clojure.core/*loaded-libs*? (Is it, for that matter, a bug?) -- Can lead to unintuitive behavior as a removed namespace then can't be reloaded.
17:00RaynesThe code is something I'd like to explore as a learning experience because I'd like to move refheap to cljs at some point.
17:00Raynes(and the code does a lot of what I'm not familiar with in cljs)
17:02muhoonDuff: i'm pretty sure i've reloaded unloaded ns'es before
17:03muhoooic, the ... 46 more are at the top of the stacktrace. odd.
17:03nDuffmuhoo: I'm quite sure that using require to repopulate an unloaded ns doesn't work with Clojure 1.4.0 without clearing the entry out from *loaded-libs*
17:03technomancymuhoo: usually 46 more means 46 more identical frames
17:04arrdemfrom a lein -main function how can I drop to the REPL after running some code?
17:04technomancyarrdem: (clojure.main/repl)
17:04arrdemcheers
17:04gtrakoh damn, that's useful
17:04jsabeaudryRaynes, I agree that it is mostly for the sake of having it in cljs but can also serve as an example of simple cljs. What are the advantages of keeping it in javascript?
17:06Raynesjsabeaudry: Well, I actually understand js to some extent.
17:06jsabeaudryRaynes, ah you dont understand clojure to some extent? ;)
17:07RaynesI don't understand this language at all.
17:07gtrakjs is like scheme, right?
17:07nDuff...if only.
17:08brehautits like scheme that suffered a TBI at a young age
17:08brehaut(traumatic brain injury)
17:08gtrakthey should have just made it scheme and called it javascript
17:09gtrakjavascheme
17:09brehautif they have just switchd the parens for braces, it would have appeased the C programmers too
17:09borkdudethere were plans for scheme-like languages first I heared in a Crockford talk
17:09borkdudefor a Scheme-like language in the browser I mean
17:09borkdudeThe grand Scheme of things
17:12pbostrom+1 for (clojure.main/repl), I've been running $ lein repl => (-main) all this time, so many wasted keystrokes
17:12S11001001phpscript
17:12S11001001the skeleton key to popularity
17:12gtrakomg
17:13gtraklet's port clojure to php!
17:13S11001001you first
17:13eck`let's port php to clojure!
17:13gtrakhahahaha
17:13borkdudegtrak what's next.. vbscript?
17:13gtrakyea!
17:14borkdudecljobol
17:14llasramSince there are JVM COBOLs...
17:15eck`good thinking -- we can leverage the efficiency of clojure with the ease-of-use of cobol
17:15S11001001how about as a first exercise, an acme-php (http://hackage.haskell.org/packages/archive/acme-php/0.0.1/doc/html/src/Prelude-PHP.html) for clojure
17:16muhoodakrone: is there a 2.0.0 equivalent to jackson-mapper?
17:16borkdudeclojure to objective c?
17:16gtrakborkdude: we kinda have that with cljs -> gambit
17:19muhoodakrone: i think i am really screwed here. clj-aws-s3 requires jackson-mapper-asl. it refuses to compile without it
17:20muhooand there does not seem to be any such thing in version 2.0.0, to be compatible with the jackson used in cheshire 4.0.0, which i need in order to use noir-1.3.0-beta8...
17:21muhooFML
17:24dakronemuhoo: can you open an issue on cheshire so I can look into it at a later time?
17:27muhoosure
17:29muhooi'll look around to see if org.codehaus.jackson.JsonFactory might be implemented somewhere else in 2.0.0. if there's no such thing anymore, i'm painted into a corner.
17:31lpetitnDuff: ping
17:31pepijndevos__dnolen, ISubstitutions is a rather large protocol :|
17:32nDufflpetit: pong
17:32dnolenpepijndevos__: how do you think it could being smaller?
17:33lpetitnDuff: For my own stuff for CCW, and FYI, here is function I'm using to set things up before e.g. using Interop forms in nrepl server
17:33lpetit:
17:33pepijndevos__dnolen, don't know yet... I imagine the difference between the -no-check and * variants to be pretty generic
17:34lpetitnDuff: https://github.com/laurentpetit/ccw/blob/master/ccw.util/src/clj/ccw/util/bundle.clj#L82
17:36ferdI was showing 4clojure.com to a co-worker... Looks like he brought it down ;-) Just started getting: 502 Bad Gateway.
17:36lpetitnDuff: maybe also this could be interesting: https://github.com/laurentpetit/ccw/blob/master/ccw.util/src/clj/ccw/util/bundle.clj#L105
17:38lpetitnDuff: also, one remark = is overloading in-ns sufficient in all cases ? (is in-ns called under the hood from require, etc. when code is loaded ?)
17:39nDufflpetit: works in my testing, yes.
17:40nDufflpetit: ...only case I haven't checked is AOT-compiled code
17:40amalloyferd: this damn site goes down all the time and i can't figure out how to keep it up consistently
17:41pepijndevos__dnolen, why is Substitutions a protocol if there is only one implementation?
17:41ferdamalloy: you run it? Is it the JVM that dies or what?
17:41gfrederickspepijndevos__: the Substitutions type implements other protocols
17:42amalloyferd: mostly what happens is that user code causes an OOM (since there's no way to sandbox memory allocations), which causes the webserver to crawl into a hole and refuse to talk to anyone
17:42gfredericksin order for it to have substitution-y behavior as well there needs to be a protocol to implement
17:42pepijndevos__hm
17:42amalloyi have a cron job that detects this state and restarts it. when i run the cron job by hand, it works; when the script is run from inside cron, it just kills the existing JVM and fails to bring the site back up
17:43pepijndevos__ah, I see... trying to remember all this stuff now.
17:43gfrederickspepijndevos__: since you can't just add bare methods onto a type
17:43gfredericksalso there might be some hypothetical reason you might want to implement it with something else; dunno
17:43lpetitnDuff: last but not least = I don't know much about nREPL middle wares, but maybe they can, as are ring middle wares, be parameterized ? If so, I'd suggest not hardwiring clojure.osgi specifics in the middleware, and have it take as a parameter a function taking the session and returning the class loader to be used -> and then set this class loader in the right places (thread's context class loader, Compiler/LOADER, etc.)
17:43ferdamalloy: I see. The guy says he was just searching users to mark as "friends" (or, follows, whatever it is) and it suddenly stop responding to user search. But it could've been just coincidence that some other user was running memory hungry code
17:44amalloyyeah, it's unlikely it was his fault
17:45ferdamalloy: he says it's back up now. He's trying to kill it again :-)
17:47amalloyi know, i brought it up manually, again :P
17:47nDufflpetit: Hmm -- that's a thing that can be done, yes.
17:48amalloyhope he enjoys it!
17:48nDufflpetit: setting the *bundle* var is both worthwhile and necessarily dependent on clojure.osgi, but having a generic, non-OSGi-aware version is sane.
17:48dakronemuhoo: check out cheshire.factory
17:48nDuff(re: setting that var being worthwhile -- without it, not all of clojure.osgi's magic works from the REPL, given as the REPL threads weren't set up through the Bundle-Activator and didn't get *bundle* bound)
17:49dakronemuhoo: https://github.com/dakrone/cheshire/blob/master/src/cheshire/factory.clj
17:49lpetitnDuff: something like that (untested, and not adjusted for setting the thread's context class loader, and not solving the setting of the clojure.osgi/*bundle* var also) https://gist.github.com/2912899
17:50lpetitnDuff: in my experience, setting the thread's context class loader as per the prior provided url was sufficient
17:51nDufflpetit: it worked in _most_ cases for me, but not all
17:52nDufflpetit: specifically, setting the thread classloader was not always sufficient for some kind of interaction with compiled Java classes coming from the local bundle.
17:52lpetitnDuff: would be interested in a comprehensive "state of the art" report because it's too easy to forget
17:52lpetitnDuff: oh
17:52lpetitcompiled java classes, or gen-classes ?
17:53nDuffcompiled java classes
17:53nDuffdarned odd bugs, too -- I could refer to MyClass and get back the class object, but then I'd call (type MyClass) and clojure.lang.Compiler would throw a NoClassDefFoundException.
17:53dnolenpepijndevos__: down to 4 for ISubstitutions http://github.com/clojure/core.logic/commit/118a3c30991080f1303eb6c55deed54f61abcc93
17:53lpetitnDuff: then also setting Compiler/LOADER *and* the context classoader should be sufficient ? I'm not sure I remember why setting clojure.osgi/*bundle* is necessary
17:54lpetitnDuff: it's quite hard to come up with the minimal requirements, indeed
17:54dnolenpepijndevos__: can probably get down to 3 with some more thought. Thanks for the feedback.
17:54pepijndevos__dnolen, you're to fast :P
17:54nDufflpetit: setting clojure.osgi/*bundle* ensures that new libraries being require'd from the REPL can tie back into the bundle system to attach metadata to themselves in the overridden loaders provided by clojure.osgi
17:55nDufflpetit: ...which, if nothing else, is bookkeeping for the module-unload system
17:55pepijndevos__dnolen, there are constaints and constraintstores in master too. Did I not pay attention, or is there something more than plain minikanren in there?
17:56lpetitnDuff: oh, ok, understood now. In my classical workflow, I'm only testing things, and namespaces are generally already required by the Eclipse framework. That's why I'm not encountering this problem in the first place.
17:56dnolenpepijndevos__: it only disequality constraints in master - cKanren branch is more generic.
17:56nDufflpetit: if you're curious about classes where clojure.lang.Compiler/LOADER is necessary -- I wrote this while flailing around last week: http://stackoverflow.com/questions/10941330/class-forname-in-clojure-not-respecting-contextclassloader/10955157
17:56nDuffs/classes/cases/
17:56dnolenpepijndevos__: disequality constraints is really just CLP(Tree), which is a part of cKanren
17:57lpetitnDuff:thanks, will read it (tho not yet -> bed time here in France). CU !
17:57pepijndevos__dnolen, ok, thanks. I must say that everything-in-one-big-file makes it a little hard for me to understand a small subset of it.
17:58pepijndevos__dnolen, which onee do you think could be omited with some thought?
17:58gtrakmmm... retina display sounds nice for emacs
17:59dnolenpepijndevos__: maybe update ... it's a bit tied into looking at and checking the constraint store.
18:00pepijndevos__hm
18:00dnolenpepijndevos__: we do have a new gross big protocol tho - IFiniteDomain ... less clear how to make that one smaller.
18:01pepijndevos__dnolen, looking it up... sounds interesting.
18:01pepijndevos__I feel that a domain representation is something I can work on without understanding the whole of ckanren
18:02dnolenpepijndevos__: definitely, it's pretty self contained.
18:02pepijndevos__right
18:03pepijndevos__I'm probably going to look at it with oscar the coming days
18:03dnolenpepijndevos__: all Java ints, sorted-sets, and IntervalFD need to interoperate.
18:06dnolenpepijndevos__: I'm pretty excited about where it's going, particular the constraint store rep vs. the one presented in the paper and GitHub cKanren repo.
18:07pepijndevos__dnolen, how is a domain different from a sorted set in terms of interface?
18:09dnolenpepijndevos__: hmm? sorted-sets can be *used* as a domain. so can an Integer or Long. So can an instance of IntervalFD
18:09dnolenpepijndevos__: Java integer types will also be marker protocoled as ISingletonDomain.
18:10pepijndevos__dnolen, I mean, afaict, clojure.set contains all the operations you want to perform. I think these are not protocol based though :(
18:10dnolenpepijndevos__: they are protocols so can't use them.
18:10dnolenpepijndevos__: also we don't actually want sets anyway. too slow.
18:11dnolenaren't protocols.
18:11dnolenpepijndevos__: for example in cKanren core.logic (intersection 1 (interval 1 10)) is just a bounds check and returns 1.
18:12dnolenpepijndevos__: also if no intersection, we just want nil
18:13pepijndevos__dnolen, right, right... a domain is to a set like a seq to a reducer ;)
18:13pepijndevos__erhm, other way around
18:15pepijndevos__what does lb, ub and drop-before do?
18:16pepijndevos__does ifinitedomain also express non-number domains?
18:18pepijndevos__ah, lower bound and upper bound
18:18muhootechnomancy: is there some way to get a list of or debug what the classpath is at the time that leinw is compiling?
18:19muhoolein2
18:19technomancyother than `lein classpath` you mean?
18:20dnolenpepijndevos__: I've thought about that. What you really want is some kind domain alias. So underneath you have #{1 2 3 4 5} but at the higher level you can say :coffee :tea :water :milk :lemonade
18:20muhootechnomancy: yes! that's it. perfect. i found the problem, i think
18:20muhoo.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.7/jackson-core-asl-1.9.7.jar:
18:20muhoothat shoudl NOT be on the cp. it's not in :dependencies, not in lein deps :tree. why is it in cp?
18:21pepijndevos__dnolen, why do you want that? (< :tea :milk) makes no sense.
18:21dnolenpepijndevos__: think about zebrao.
18:21dnolenpepijndevos__: and many other constraint satisfaction problems.
18:22pepijndevos__dnolen, what about it?
18:23pepijndevos__dnolen, you mean constraints like rightofo?
18:23dnolenpepijndevos__: righto could be (+fd h0 1 h1)
18:23muhooshouldn't lein2 deps :tree be the same list of jars as in lein2 classpath?
18:24technomancyit should
18:26muhoohmmm, nm, that's not it then
18:28pepijndevos__dnolen, I don't know... I'll think about it.
18:28dnolenpepijndevos__: written in terms of CLP(FD) it's going to be way faster (Dan already said it is) and order will matter hardly at all.
18:28muhooi'm baffled as to why i'm getting this error: Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.JsonFactory , when the word codehaus doesn't appear anywhere in the deps. it should be com.fasterxml.jackson.core, etc
18:29pepijndevos__dnolen, I think separating the order from the domain might be key to a simple interface.
18:30Jayunit100whats the most idiomatic what to implement case statement logic in clojure? seems like there are different options.
18:30dnolenpepijndevos__: I meant order of the goals. What order are you talking about?
18:30brehautJayunit100: if you need a case, then case is probably the best
18:30Jayunit100glad i asked….
18:30brehautJayunit100: condp is a bit more general than case, and cond is very general
18:30Jayunit100brehaut: condp ---> okay cool.
18:31pepijndevos__dnolen, of the domain, IFiniteDomain contains all sorts of things that only apply to ordered things.
18:46muhoois there a way to get more detail on what lein is compiling? in other words, it says "compiling foo.server", but it's obviously sub-compiling other ns'es underneath that, just not showing it. is there a way to get it to show that?
18:50technomancymuhoo: it's actually Clojure that's compiling those, not leiningen
18:51technomancythere's nothing we can do to prevent them from getting compiled unfortunately
18:54muhoonp, thanks
18:56pepijndevos_dnolen, do you have an email where I can write more elaborately about my thoughts? I only have your -lists address :P
18:57dnolenpepijndevos_: what's your twitter account?
18:57pepijndevos_dnolen, pepijndevos
18:58dnolenpepijndevos_: DM'ed
18:58pepijndevos_yay
18:58pepijndevos_dnolen, I'll probably write you after having talked to oscar
18:58dnolenpepijndevos_: sounds good! looking forward to it.
19:16visheshIs there a function that can filter a list until some condition is met?
19:17amalloy&(doc drop-while)
19:17lazybot⇒ "([pred coll]); Returns a lazy sequence of the items in coll starting from the first item for which (pred item) returns logical false."
19:18visheshthanks. That seems to be it.
19:53seancorfieldquick q about agents (since i'm still puzzled by them)... if i send 100 function invocations to a single agent, do any of those execute concurrently or are they all sequential (in some unspecified order)?
19:55amalloyseancorfield: they are all sequential, in the order the agent got them
19:56cgagi thought multiple threads would process things sent to an agent
19:56seancorfieldand no one has yet managed to explain the difference between send and send-off to me in a way that satisfies... the difference in the docs talking about "potentially blocking" for send-off and that it uses "a separate thread" rather than "a thread from a thread pool"
19:57seancorfieldamalloy: ok, to sending computation to an agent from all over an application will cause that computation to be single-threaded, but separate from the main app's threads?
19:58amalloysounds about right
19:58technomancysend-off uses an unbounded thread pool
19:59seancorfieldtechnomancy: so that only matters if you have lots of agents?
19:59gfredericksseancorfield: without that single-threadedness I don't think you could make sense of the agent having a state and each function computing the new state
19:59technomancyseancorfield: it matters if you want to control the number of active threads
19:59seancorfieldgfredericks: right, that what i was assuming from the docs but i wanted to double-check
20:00seancorfieldtechnomancy: suppose i have just one agent in my program... then send and send-off are the same, right?
20:00technomancyright
20:00seancorfieldif i have 100 agents, it might matter (depending on the size of the thread pool for send)...
20:00technomancywell, assuming agents are the only thing using the thread pool
20:01seancorfieldah, gotcha...
20:02seancorfieldso if i want to ensure my agent computation runs when the system is busy, i should use send-off rather than risk getting bogged down by the thread pool?
20:03ohpauleezseancorfield: Also, are you sure you really want agents? and not futures?
20:13gfredericksman when is core.logic going to be the top google hit for "core logic"
20:14dnolengfredericks: what is it?
20:14technomancywhenever the maintainers of corelogic.com forget to renew their domain registration I would guess
20:14gfredericks$google core logic
20:14lazybot[CoreLogic - Information. Analytics. Insight.™] http://www.corelogic.com/
20:15dnolengfredericks: I mean is core.logic 2nd?
20:15gfredericks2nd or third
20:15gfrederickslooks 3rd to me
20:15gfredericksfarvv.com is second
20:16gfrederickstechnomancy: you who surpassed Mister Versus the Ants ought to have more hope
20:17technomancyluckily Carl Stephenson never learned about godaddy
20:17gfredericks:)
20:17gfrederickstechnomancy: you've confused a whole pile of middle school teachers
20:17fil512is there a shorthand for (((:a (:b (:c map))) ?
20:17gfredericksfil512: get-in or ->
20:17technomancyI'm still waiting for an awesome flame war to erupt on the wikipedia talk page
20:18technomancyfil512: not without matching parentheses =)
20:18gfredericksfil512: though -> only works with keywords
20:22rlbseancorfield: I may be wrong, but my understanding was that you want send-off for things that might block because imagine that the thread pool only has 10 threads, and you call (send a #(Thread/sleep FOREVER)) 10 times.
20:22seancorfieldohpauleez: i do not want futures for this
20:22ohpauleezahh, ok. Always worth a reminder ;)
20:22rlbOf course, in reality, it wouldn't be that severe.
20:22rlbs/wouldn't/shouldn't/
20:23technomancyideally you'd just have a thread listening on an in-process queue
20:23seancorfieldrlb: but if they're sequential, you'll tie up one thread and queued invocations just wouldn't be run, right?
20:23technomancybut you can abuse agents for it if it's not worth setting that up
20:23amalloyseancorfield: in his example, `a` doesn't always refer to the same agent
20:24seancorfieldimmutability :)
20:24brainproxyis the :auto-reload? option for lein-ring something implemented by lein-ring, or is there a way I can get the same effect if I'm manually invoking run-jetty using the repl
20:25weavejesterbrainproxy: It applies the wrap-reload middleware in the ring-devel package
20:25brainproxywhoops, meant :auto-refresh? more specifically
20:25brainproxyweavejester: cool, thanks
20:25weavejesterbrainproxy: Oh, in which case, that applies the wrap-refresh middleware in the ring-refresh package
20:26weavejesterbrainproxy: https://github.com/weavejester/ring-refresh
20:26brainproxyweavejester: thanks :)
20:26cemerickseancorfield: mind if I bother you about java.jdbc? :-)
20:27seancorfieldfire away
20:27fil512how do I test a string for containing a substring?
20:28fil512clojure.string substring? doesn't seem to exist any more...
20:29cemerickseancorfield: Why does java.jdbc's get-connection define its own URI convention, instead of just passing strings and URIs along to DriverManager directly?
20:29emezeske_fil512: Juse use .indexOf, I think
20:29emezeske_fil512: Just*
20:30fil512hmm.. not boolian--kinda icky
20:30fil512no builtin boolean?
20:30cemerickI'm probably exposing my absolute ignorance re: jdbc connection strings, but getting connections through DriverManager for postgres simply doesn't work without using a property map or passing in my own :factory, etc.
20:32seancorfieldcemerick: ask technomancy - i believe he added the string / URI functionality
20:32technomancyuh oh; what'd I break this time?
20:32cemerickah, I should have done a blame ;-)
20:33technomancyI wasn't aware the underlying drivers support URIs; is that widely implemented?
20:33cemericktechnomancy: java.jdbc's get-connection doesn't accept postgres-style connection strings
20:33cemerickor, not ones that include parameters (including login info)
20:33technomancyI have it working here; can you give an example?
20:34seancorfieldpostgresql://user:login@host:post/dbname ?
20:35seancorfieldor something like that
20:35kwertiiYou can put all kinds of other params on there, too, with ?foo=bar&baz=asdf
20:35cemerickseancorfield: that produces "No suitable driver" when provided to DriverManager
20:35cemericktechnomancy: any jdbc connection string produced from postgres.heroku.com AFAIK, e.g. jdbc:postgresql://ec2-22-21-231-117.compute-1.amazonaws.com:5432/d1kuxup5cdafl7?user=pcgoxvmssqabye&password=NFZXtxaLFhIX-nCA0Vi4UbJ6lH&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
20:36technomancyI thought I added support for both, but try postgres://
20:36seancorfieldin 0.2.2, the jdbc: prefix is stripped, before that it would have given an error
20:36seancorfieldare you using 0.2.2 cemerick ?
20:36cemerickyup
20:37cemericktechnomancy: a bare postgres:// URI gets through get-connection, but fails because it doesn't pick up the user, password, and ssl params
20:37seancorfieldpostgres should map to postgresql
20:38cemerickit's not a huge deal by any stretch, but I presume people will trip over this
20:38technomancycemerick: try the format used by DATABASE_URL in heroku
20:38cemerickyes, sorry, been using postgresql://
20:38technomancypostgres://username:password@host:port/db
20:38seancorfieldotherwise subprotocol://user:password@host:post/stuff should "just work" as far as i can tell from the code...
20:38technomancyI've never seen the query-param format used before
20:38seancorfield:port not :post
20:39cemerickused with oracle as well IIRC
20:39technomancycemerick: you're saying postgres.heroku.com gave you that style?
20:39technomancydelegating to the underlying driver sounds fine though as long as it's a superset of URI styles supported
20:40cemericktechnomancy: yes; "JDBC URL" provides me with the param style. "URL" style does not include the ssl option
20:40cemerick(which heroku's pg requires)
20:40seancorfieldas long as (.getPath uri) returns the piece with the query params you should be fine tho'...
20:40technomancyoh, yuk
20:40xeqiI ran into similiar jdbc/url issues once when trying to create an in-memory derby db
20:41xeqire: custom syntax
20:41seancorfieldfeel free to open a ticket in JIRA and attach a patch (for parse-properties-uri, I assume?)
20:42cemericksure, I'll open a ticket; I don't think I'm the right one to write the patch, though I get the sneaking suspicion that what parse-properties-uri is doing is incompatible with what the postgres driver will be expecting.
20:42cemerickWIll definitely include URI examples.
20:43cemerickseancorfield: BTW, I hope all's well of late. :-)
20:46fil512what's a nice way to test (contains-substring "isgoofy" "goof")
20:46fil512?
20:46fil512there used to be a clojure.string substring?
20:46fil512but looks like that disappeared at 1.3
20:46fil512did it get replaced by something?
20:47seancorfieldcemerick: it's been a bumpy couple of months for me in a number of ways...
20:47rlbdoes send-off still use a thread pool, or rather, does it re-use threads, or start a new thread each time?
20:48seancorfieldaccording to the docs rlb send-off does not use a thread pool, just "a separate thread" ...
20:49seancorfieldfil512: you can just call .substring on a string
20:49ericthorsen1''pmhgh-0p[]]''
20:49fil512like (.substring "foo" "o")
20:49fil512?
20:50emezeske_&((fn [s sub] (not= (.indexOf s sub) -1)) "isgoofy" "goof")
20:50lazybot⇒ true
20:50emezeske_fil512: ^
20:50ericthorsen1sorry…about the noise…son hicgjacked the keyboard
20:50rlbseancorfield: you mean (doc send-off)? That just says "in a separate thread", and since technomancy said "send-off uses an unbounded thread pool" I was wondering.
20:50rlb
20:50wmealing_ericthorsen, i was trying to decypher that too.
20:51wmealing_was thinking it was a root pass for a moment.
20:53fil512the indexOf approach is too messy.
20:53fil512I like the .substring suggestion much better
20:54fil512I just need to figure out the syntax
20:54seancorfield(.substring some-str start-index) or (.substring some-str start-index end-index) i think?
20:54emezeske_fil512: I don't think that substring does what you want.
20:55emezeske_seancorfield: He wants to test whether a string contains a substring
20:55seancorfieldoh, clojure.string/substring was a different function?
20:55fil512I found it
20:56fil512(.contains some-str substr)
20:56fil512that does what I want
20:56fil512much nicer syntax than indexOf
20:57seancorfieldi see clojure.contrib.string/substring? was a test, much like contains?
20:57seancorfielder, .contains ?
20:57fil512I think clojure.contrib.string/substring? doesn't exist in 1.4 any more
20:57fil512It looks like it got removed in 1.2
20:58fil512Well to clarify, I think it's called clojure.string now and clojure.string doesn't contain substring? any more
20:58fil512But .contains works perfectly
20:58seancorfielda lot of old contrib went away in 1.3
20:58fil512(.contains some-str substr) does exactly what I'm looking for
21:19dreish,(+ 1 #=(+ 2 3))
21:19clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>
21:20dreishFoo. Was hoping someone had figured out a safe way to enable that.
21:20duck1123Is there an easy way to turn the Set-Cookie from a ring response into a :cookies header for another request?
21:21duck1123Up to this point, I haven't actually been using HTTP, so any cookie features from clj-http or kin won't help me
21:23duck1123although, now that I mention it. clj-http might have what I need
21:38gfredericksdreish: it sounds like it ought to be possible
21:47brainproxyis it possible to combine tasks, e.g. so I can get the benefit of doing `lein ring server` and `lein swank`, such that my server is fired up and I've got a REPL running in the same process
21:55xeqiduck1123: https://github.com/xeqi/peridot or https://github.com/xeqi/kerodon do cookie-jar stuff
21:55xeqiif you want to stay in ring
21:55brehautlein ring server, swank ?
21:59brainproxybrehaut: yes, just saw how I can chain with "," and also there is a `lein do ...` syntax for chaining that is under development apparently
21:59brainproxyhowever, the `swank` task doesn't get started as the `ring server` task blocks it
22:00brainproxygenerally, it makes sense that one task won't start until another task finishes, but in a case like this it seems like there should be a way to have one run in conjunction with another one
22:00technomancybrainproxy: yes, there should be another higher-order task like `do` that does that
22:01technomancybut it would involve collapsing multiple eval-in-project calls into one
22:01brainproxytechnomancy: but `do` isn't available in preview6, right?
22:01technomancybrainproxy: right; it was implemented last weekend
22:02brainproxyif I clone and build lein manually, and put the standalone jar thing in place manually, I should get the `do` thing?
22:12technomancyyeah but you can do chaining without `do` on preview6
22:12technomancywith-profile just won't apply across the whole chain
22:13technomancyand it doesn't solve your problem of composing eval-in-project calls
22:30muhooheh, apropos to previous discussion about C++, here's what happens when lisp programmers write objective C: http://www.jwz.org/blog/2012/05/its-alive/
22:31brainproxytechnomancy: ah i see, didn't read your previous comment carefully enough ... need a HO task "like do" in order to achieve what I want
22:32technomancybrainproxy: yeah. perhaps trampoline could just be improved so it works with do
22:32technomancythat might be better than introducing a new task
22:32technomancysince trampoline is already all about calculating what's needed to run and then running it afterwards.
22:33brainproxyin the short term, would you say my best option is to use lein ring, and manually insert the code to fire up the repl w/in that same process
22:34technomancyI usually write a -main function to launch jetty and run (def s (-main 5000)) as the first thing after swank launches
22:36brainproxyokay, so your using lein swank and then starting the server... i was thinking other way around to make easy use of the :auto-refresh? and :auto-reload? options that lein ring gives me
22:36brainproxy*you're
22:36technomancymaybe; I haven't used lein-ring
22:37technomancyI'm not sure what it offers if you have a 5-line -main function to launch jetty
22:38brainproxyi can probably extract those options and wrap them up in my own -main, yes... was just exploring the various avenues
22:39eggsbyI've been pretty pleased how simple it is to work with jetty/netty w/ clojure
22:42brehauttechnomancy: im curious, what are the 5 lines? i've been getting away with 3; just an atom and a run-jetty. do you have some more tricks in yours?
22:58technomancybrehaut: it's 7 lines for full compojure+session-secret: http://p.hagelb.org/7-line-main.html
22:59technomancyfor this one I've been working on today
22:59brehauttechnomancy: thanks
22:59technomancynp
23:01brehauttechnomancy: system/getenv is nice and in hindsight and obvious thing to do.
23:02amalloytechnomancy: i only realized *just now* lein-ring isn't your project. i first met it when i didn't know the clojure ecosystem well, and assumed lein meant it was yours. never re-evaluated
23:03xeqiI like enviorn for env stuff as well
23:03Raynesamalloy: Hahaha
23:03xeqi*environ
23:03technomancyheh; nice
23:03technomancysneak peak: http://p.hagelb.org/deps-verify.html
23:04amalloywait, are we making sneak peak jokes on purpose today?
23:04amalloyah good
23:06technomancyxeqi: yeah I need to check that out
23:35technomancyany fedora users around want to help test the Leiningen package? http://hircus.wordpress.com/2012/06/12/important-milestone-in-support-for-clojure-in-fedora-reached/
23:42alex_baranoskyany favorite ways to compare large nested maps ?
23:44xumingmingvalex_baranosky, directly use '='?
23:45alex_baranoskywhat?
23:45clojurebotwhat is 2d6
23:48alandipertalex_baranosky: like clojure.data/diff?
23:50alex_baranoskyI'm going to try to writ e a little script to take two maps, nested sort them, stick the maps in temp files then pipe them to opendiff on my Mac
23:51duck1123over ssh?