2012-06-11
| 01:21 | eck | hi 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:22 | eck | are they essentially just a more lightweight/optimized implementation of a string? |
| 01:24 | nDuff | eck: keywords provide identity guarantees, ie. they're always interned |
| 01:25 | nDuff | eck: ...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:26 | eck | ok, 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:26 | eck | is there a case where two strings that are equal in the ordinary sense of the word would not be considered equal in clojure? |
| 01:27 | nDuff | "foo" always _equals_ "foo", but it may not be _identical_ to "foo" |
| 01:27 | nDuff | Keywords are interned, so not just equality but identity are guaranteed. |
| 01:27 | eck | ok i think that makes sense |
| 01:27 | johnmn3 | the windows-github tool is pretty slick |
| 01:27 | nDuff | ...and I think we have a communication mismatch re: "not have that problem" re: namespaces |
| 01:27 | johnmn3 | https://github.com/johnmn3/zljdb |
| 01:27 | nDuff | ...namespaces are a feature, not a bug, if using them as singletons |
| 01:28 | eck | i 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:29 | nDuff | Yes. 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:29 | eck | hmm, that's true |
| 01:29 | nDuff | same thing with ::tee in clojure; it's local to the namespace. |
| 01:30 | nDuff | Not a unique thing to Clojure, by the way -- keywords as first-class objects go a long way back |
| 01:30 | eck | ok that makes sense |
| 01:30 | eck | yeah i was reading about keywords in CL but i felt like i was kind of missing the point |
| 01:32 | eck | nDuff: thank you! |
| 01:33 | nDuff | np -- glad to be able to help |
| 01:36 | jblomo | gfredericks: looks like dnolen fixed the bug i'm seeing in 47f4a1e8 |
| 01:39 | nDuff | (already have clojure.core/use and clojure.core/require rebound for other reasons...) |
| 02:33 | nDuff | Hrm. |
| 02:50 | amalloy | good luck with that, man. bet you a million dollars it's special-cased in at least one place |
| 03:42 | nDuff | woohoo! |
| 03:42 | nDuff | ...and integrated a bit more cleanly with nREPL... |
| 03:43 | michaelr` | i wonder, does anyone here use Eclise with a dark colored theme? |
| 03:43 | clojurebot | Just 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:44 | michaelr` | clojurebot: this time it was appropriate, bot |
| 03:44 | clojurebot | learning a new runtime is much harder than learning a new language. |
| 03:44 | michaelr` | clojurebot: unless it's chinese |
| 03:44 | clojurebot | Huh? |
| 03:45 | michaelr` | clojurebot: Korean |
| 03:45 | clojurebot | I don't understand. |
| 03:45 | michaelr` | clojurebot: just use your imagination |
| 03:45 | clojurebot | excusez-moi |
| 03:45 | michaelr` | clojurebot: intuition |
| 03:45 | clojurebot | No entiendo |
| 03:45 | michaelr` | clojurebot: viva la france!!!11 |
| 03:45 | clojurebot | It's greek to me. |
| 03:49 | jblomo | can i run lein-ring in single-threaded mode? |
| 04:00 | amalloy | jblomo: why would you want to? what would it even mean? |
| 04:01 | jblomo | amalloy: trying to debug an issue where i think multiple threads are writing to one file |
| 04:02 | amalloy | anyway, i don't think any single-threaded mode exists for lein-ring. jetty has a configurable threadpool size, though |
| 04:03 | jblomo | yea, trying max-threads now |
| 04:18 | ro_st | is 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:19 | Vinzent | ro_st, you could try the "find file in project" package |
| 04:49 | lypanov | Unable 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:49 | lypanov | org.clojure:clojure:jar:null |
| 04:49 | lypanov | anyone know what this means? |
| 04:53 | lypanov | help* |
| 04:55 | lypanov | all of clojars just broke or something? |
| 04:55 | zoldar | lypanov: are you by any chance using leiningen or a similar tool for project management ? |
| 04:55 | lypanov | yes. |
| 04:55 | lypanov | this is lein -> maven error |
| 04:55 | zoldar | is 1.2.0 a complete must ? |
| 04:55 | lypanov | i don't require it. |
| 04:55 | lypanov | gonna add exclusions to everything manually. |
| 04:56 | zoldar | then change 1.2.0 in project.clj to 1.2.1 |
| 04:56 | lypanov | its not in project.clj. |
| 04:56 | lypanov | :dependencies [[org.clojure/clojure "1.3.0"] |
| 04:56 | zoldar | what are your dependencies? |
| 04:56 | zoldar | nothing more ? |
| 04:57 | lypanov | solved. |
| 04:58 | lypanov | zoldar: will be back in 20 mins or so. |
| 04:58 | lypanov | need to continue release. |
| 04:58 | lypanov | added :exclusions [org.clojure/clojure] to every dep. |
| 04:58 | zoldar | weird |
| 04:58 | lypanov | last week monday the same project.clj worked. |
| 04:59 | Vinzent | probably some of your deps depends on 1.2 |
| 05:11 | ro_st | for some reason my slime repl isn't using the injections in my dev profile |
| 05:12 | IRC-Client-Test | yoo |
| 05:12 | Mad_Master | yo |
| 06:02 | Chiron_ | 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:10 | zoldar | Chiron_: 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:11 | Chiron_ | 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:12 | Chiron_ | as you see, BatchCount extends BaseBatchBolt and defines a new instance variable |
| 06:12 | nDuff | ChiralSym: yes, but there's no reason for any of your code to follow that example. |
| 06:12 | nDuff | err |
| 06:13 | nDuff | Chiron_: ...after all, the parent class doesn't care how the child manages state |
| 06:13 | cemerick | Chiron_: 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:13 | Chiron_ | Storm Clojure DSL works with non-transactional topologies, I'm about creating a transactional one |
| 06:14 | Chiron_ | I'm checking this article: http://pragprog.com/magazines/2010-11/getting-clojure |
| 06:24 | zoldar | Chiron_: 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:30 | Chiron_ | I'm not stubborn :) but what is the clojure form that allows me to: KeyedCountUpdater extends BaseTransactionalBolt implements ICommitter |
| 06:33 | zoldar | Chiron_: this may be of some help to you |
| 06:33 | zoldar | http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/ |
| 06:34 | hoeck | Chiron_: 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:37 | nDuff | Hrm. |
| 06:37 | Chiron_ | that helpful, thanks! |
| 06:38 | nDuff | => (:symbol (first (clojure-frame-vars))) |
| 06:38 | nDuff | #'clojure.core/*agent* |
| 06:38 | nDuff | => (type (:symbol (first (clojure-frame-vars)))) |
| 06:38 | nDuff | clojure.lang.Var |
| 06:38 | nDuff | ...shouldn't that be a clojure.lang.Symbol instance? |
| 06:40 | nDuff | (...or, more to the point -- how do I access the symbol in that map, rather than the var behind it?) |
| 06:40 | Chiron_ | clojurebot: do you know what is your relation to lisp? |
| 06:40 | clojurebot | "if you never learnt Lisp, then you never learned to program" -- some rant on some blog somewhere |
| 06:42 | sayyestolife | Hello. |
| 06:43 | sayyestolife | Is 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:44 | hoeck | Chiron_: http://pastie.org/4066628 |
| 06:47 | Chiron_ | hoeck: that is much more neater than gen-class ! thanks :beerchug: |
| 06:50 | ro_st | using lein-ring. is there a way to have 'lein2 ring server' somehow use the same process that's in my slime repl? |
| 06:50 | ro_st | so that i can push changes to it and see it update in the browser? |
| 06:54 | sayyestolife | Can someone explain to me why the application hangs at the "swap!" http://pastebin.com/NHygxkNW ? |
| 06:56 | hoeck | Chiron_: yes, but you have no way to get the generated classname, and you cannot call or overwrite protected methods |
| 06:57 | hoeck | Chiron_: 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:57 | Chiron_ | tell me about it :D |
| 06:58 | hoeck | sayyestolife: swap! needs a function as its first arg |
| 06:58 | hoeck | sayyestolife: you should get an exception when running this |
| 06:58 | hoeck | ,(swap! (atom 100) 200) |
| 06:58 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn> |
| 06:59 | hoeck | sayyestolife: you probably want to use reset! instead |
| 06:59 | sayyestolife | Oh ok! |
| 07:00 | sayyestolife | Now it works. cheers! |
| 07:01 | hoeck | sayyestolife: to model a point and update directions atomically you could use sth. along: (swap! (atom {:x 100, :y 0}) update-in [:x] + 100) |
| 07:06 | ro_st | in 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:10 | ro_st | eventually 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:11 | hoeck | ro_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:12 | ro_st | ok. as all these functions are used by a synchronous json api ring service, i'm pretty sure they'll stay in scope |
| 07:12 | ro_st | so 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:14 | hoeck | ro_st: the user id is constant all the time? |
| 07:14 | ro_st | for now, yes |
| 07:15 | ro_st | but eventually friend will somehow provide this value |
| 07:15 | hoeck | well then just use a plain def |
| 07:16 | hoeck | dynamic 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:16 | ro_st | ah, 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:16 | ro_st | ? |
| 07:17 | ro_st | using (binding) |
| 07:17 | hoeck | for 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:18 | hoeck | ro_st: right |
| 07:18 | ro_st | it is request specific |
| 07:18 | ro_st | ok, great. i'll forge on with a def for now. thanks hoeck |
| 07:21 | cshell | cemerick: Does friend's openid workflow work with the Google Identity ToolKit (GITkit?) |
| 07:22 | cemerick | cshell: don't know; never heard of it |
| 07:23 | cshell | cemerick: It's basically a way to get started with OpenID https://developers.google.com/identity-toolkit/ |
| 07:24 | cshell | cemerick: I'm not schooled enough in either to figure out if they can work together or must be discrete |
| 07:24 | cemerick | oh, it's just an openid login picker; sure, that should work fine |
| 07:24 | cemerick | presumably it's no different than https://code.google.com/p/openid-selector/ |
| 07:25 | cemerick | (insofar as you need to configure it to submit to the URI in your site that starts the openid workflow |
| 07:25 | cshell | cemerick: 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:26 | cshell | oh yeah, that is cool too - I hadn't seen that one |
| 07:32 | cshell | cemerick: 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:42 | ro_st | arrrgggghh. how do i get slime-repl to always have pprint available? |
| 07:43 | ro_st | it's already in profiles dev injections. |
| 07:43 | ro_st | i specifically want to pprint. inspect doesn't give me what i want |
| 08:05 | borkdude | Connect Four in Clojure: http://afternoon-window-3802.herokuapp.com/ |
| 08:05 | borkdude | (another game made by my students ;-)) |
| 08:18 | ro_st | is there a when-let which supports multiple bindings? |
| 08:19 | ro_st | where binding N+1 only evaluates if binding N evalutes as non-falsey |
| 08:19 | ro_st | .. truthy (duh) |
| 08:19 | ro_st | right now i'm doing (when-let [N1] (when-let [N2] …)) |
| 08:20 | ordnungswidrig | ro_st: you can realize this with a monad, IIRC. |
| 08:20 | ro_st | um :) for the sake of argument, let's pretend i have no idea what a monad is |
| 08:23 | ordnungswidrig | ro_st: better that is :) |
| 08:23 | ordnungswidrig | ro_st: maybe this helps http://inclojurewetrust.blogspot.de/2010/12/when-let-maybe.html |
| 08:28 | BeatsOnToast | Anyone 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:29 | semperos | ordnungswidrig: nice find |
| 08:30 | ro_st | just what is a monad anyway? |
| 08:30 | gfredericks | a burrito |
| 08:30 | ordnungswidrig | BeatsOnToast: you want to process it with compojure? |
| 08:30 | ro_st | if you had to define it without requiring 3 years of CompSci under Sussman himself |
| 08:30 | ordnungswidrig | ro_set: it's turtles all the way down., |
| 08:30 | gfredericks | ~monad |
| 08:30 | clojurebot | monad 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:31 | BeatsOnToast | ordnungswidrig: yes please |
| 08:31 | BeatsOnToast | ordnungswidrig: doing GET requests seems simple, but I'm not sure how to take in PUT requests with data |
| 08:31 | ro_st | ok, now that we've gotten through the haha-funny-you-don't-know-and-we-do-ery… what is it? |
| 08:31 | semperos | ro_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:32 | hyPiRion | BeatsOnToast: http://en.wikibooks.org/wiki/Compojure/Core_Libraries#Servlet_Bindings |
| 08:32 | gfredericks | ro_st: you don't have to know what monads are to make fun of them :) |
| 08:32 | semperos | for every 10 developers, you'll find about 20 definitions/metaphors for what a monad is |
| 08:32 | ro_st | is it like NaN in javascript, which doesn't equal itself? |
| 08:32 | ordnungswidrig | (defroutes my-app-routes (GET "/test" [] ...) (PUT "/put-test" [] ...)) |
| 08:32 | ordnungswidrig | there you go |
| 08:33 | ro_st | is it a special form of function or macro? |
| 08:34 | ro_st | a higher level concept that has no direct representation in code? |
| 08:34 | gfredericks | I think it's kind of a design pattern... |
| 08:34 | ro_st | a trick pulled on people new to FP by people who make FP languages? |
| 08:35 | ro_st | gfredericks: that sounds right. i've seen monads referred to as "The IO monad". as if there's only one |
| 08:35 | semperos | ro_st: I've found these helpful, Clojure-specific monad tutorials: https://gist.github.com/2909874 |
| 08:35 | ro_st | thanks semperos. i'll give them a read. |
| 08:35 | semperos | np; and no need to go sequentially, pick the explanation/style that makes sense to you |
| 08:35 | gfredericks | ro_st: how might you implement error handling if you were in a pure functional language that didn't have a mechanism for it? |
| 08:35 | vijaykiran | ro_st: this video is nice too: http://www.youtube.com/watch?v=ObR3qi4Guys |
| 08:36 | ro_st | Monads are design patterns for writing DSLs. boom. |
| 08:36 | kmicu | Does anyone know why "escape-html already refers to: #'hiccup.core/escape-html" in lein-cljsbuild sample project? |
| 08:36 | hyPiRion | gfredericks: By return values? |
| 08:37 | gfredericks | hyPiRion: I think you get to the meat of the problem when you try to make it short-circuit |
| 08:37 | ro_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:37 | ro_st | there we go |
| 08:37 | gfredericks | ro_st: like I said, a burrito |
| 08:37 | ro_st | yeah, that's totally clear now :-) |
| 08:38 | borkdude | ro_st when-let with multible bindings sort of: https://www.refheap.com/paste/2700 |
| 08:38 | RickInGA | kmicu: you get that message when you "use" a namespace that has a function name that exists in another "use"d namepsace |
| 08:39 | borkdude | ro_st it is more like if-let though |
| 08:39 | borkdude | nested |
| 08:40 | hyPiRion | RickInGA: I think he asks why it is already defined in that namespace. |
| 08:40 | ro_st | nice borkdude, thanks |
| 08:42 | hyPiRion | borkdude: Have you seen the multiple if-let discussion on the mailing list? |
| 08:42 | kmicu | RickInGA: 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:48 | ro_st | is there a way to scrub a slime repl clean of any defs (other than closing and starting a new one)? |
| 08:49 | borkdude | hyPiRion yes, I started that discussion :P |
| 08:50 | ro_st | midje circumspec lazytest and clojure.test. which one to use? |
| 08:57 | ro_st | looks like midje and lein2 aren't friends yet? |
| 09:37 | semperos | ro_st: I use midje with lein2 |
| 09:37 | semperos | this project uses both clojure.test and midje, though nothing advanced: https://github.com/semperos/clj-webdriver |
| 09:37 | ro_st | i managed to get midje+lazytest working with lein2, thanks :-) |
| 09:38 | semperos | sweet |
| 09:38 | ro_st | is it idiomatic to have multiple arity functions have an implementations call into an implementation at another arity? |
| 09:39 | ro_st | eg, (get-resource uuid) and (get-resource uuid version) |
| 09:39 | ro_st | i want the first to find the latest version and then call the second |
| 09:40 | ro_st | so that i don't have to duplicate everything |
| 09:40 | semperos | ro_st: unless I'm misunderstanding, that sounds exactly like the idiom |
| 09:40 | semperos | code example? |
| 09:42 | ro_st | actually, 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:42 | ro_st | but having modified the func to use multiple arities, i can see how it would work |
| 09:49 | hyPiRion | ro_st: It's more or less idiomatic. |
| 09:53 | ro_st | does midje have a fact grouping function, like describe from BDD? |
| 09:56 | semperos | there's `facts`, which is similar |
| 09:56 | ro_st | gah of course |
| 09:57 | ro_st | so much to learn!!! |
| 10:03 | jimduey | ro_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:03 | ro_st | nice! |
| 10:04 | ro_st | i certainly will do. i was referring mostly to internalising tools. using repl, lein and emacs together to have a productive coding experience |
| 10:06 | kreig1 | heylo |
| 10:06 | kreig1 | so, is it me, or did clojure 1.2.0 disappear from clojars/maven repos? |
| 10:06 | kreig1 | because suddenly I annot build my project |
| 10:07 | kreig1 | Caused 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:07 | kreig1 | org.clojure:clojure:jar:null |
| 10:07 | di-csuehs | is 1.2.0 in the range of 1.2.1? |
| 10:08 | kreig1 | nope it is not |
| 10:08 | di-csuehs | do you specify that range? |
| 10:08 | kreig1 | No I do not |
| 10:08 | di-csuehs | or is it inherited from something |
| 10:08 | di-csuehs | hmmm. |
| 10:08 | kreig1 | it appears that noir and korma do so |
| 10:09 | kreig1 | if I move to the betas on those two, it works (plenty of other problems tho) |
| 10:09 | kreig1 | I build this project from scratch constantly |
| 10:09 | kreig1 | and it worked as of friday |
| 10:11 | kreig1 | So 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:11 | ro_st | another user had this issue earlier today. search today's logs for 1.2.1 |
| 10:11 | di-csuehs | kreig1: should I be finding any version of clojure in clojars? |
| 10:12 | kreig1 | ro_st a quick link to where I can find the logs? |
| 10:12 | ro_st | they were able to fix by somehow telling a dependency to exclude clojure itself |
| 10:12 | ro_st | not sure of syntax or even if that makes any sense. just what i can remember :-) |
| 10:12 | kreig1 | found it |
| 10:13 | kreig1 | hmm |
| 10:13 | kreig1 | this is pretty shitty |
| 10:15 | kreig1 | solved, just for the record: added :exclusions [org.clojure/clojure] to the deps that Maven bitched about (noir and korma in this case) |
| 10:16 | S11001001 | ro_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:18 | ro_st | someone who's aggregated on planet.clojure.in should probably push out a short post about the issue kreig1 just dealt with |
| 10:19 | kreig1 | S11001001: what is curious to me, is how without hcanging my deps, or lein, this changed |
| 10:20 | kreig1 | S11001001: that implies to me that some data lein acts on when resolving deps changed |
| 10:20 | kreig1 | S11001001: I'm curious as to what that was |
| 10:20 | ro_st | well, lein seems to check deps whenever you change your project.clj |
| 10:20 | ro_st | that's what it feels like to me (without having read lein's source) |
| 10:20 | kreig1 | ro_st: this project is built from scratch by integration builder, last time was friday, and it worked |
| 10:21 | kreig1 | there were no commits in the meantime |
| 10:21 | technomancy | this is why no one should ever use version ranges |
| 10:21 | technomancy | they are terrible |
| 10:21 | ro_st | so perhaps when it did this, part of the checking is deps-of-deps, which started to fail |
| 10:21 | technomancy | clojurebot: repeatability? |
| 10:21 | clojurebot | repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability |
| 10:21 | kreig1 | it's telling me I shouldbe using lein |
| 10:21 | technomancy | ^ explanation |
| 10:21 | kreig1 | I shouldn't be using lein |
| 10:21 | kreig1 | or clojars, or any of that |
| 10:21 | ro_st | technomancy: so just explicit version numbers are ok, right? |
| 10:22 | technomancy | kreig1: this is all bullshit inherited from maven; nothing specific to clojure |
| 10:22 | technomancy | ro_st: right |
| 10:22 | ro_st | great |
| 10:22 | kreig1 | technomancy: I not cutting on lein there, I understand the shitball it inherited |
| 10:22 | technomancy | one solution would be to write a plugin that walked your deps tree and warned you every time there was a version range |
| 10:22 | kreig1 | technomancy: just saying that I prolly want to manage my deps by hand |
| 10:22 | technomancy | haha |
| 10:22 | kreig1 | technomancy: heh, I know, until the next time I upgrade Ring 8^) |
| 10:23 | kreig1 | actually, what I should be doing is using lein/maven to manage them, but not require a lein deps every build |
| 10:24 | kreig1 | aka, to DL deps and put them in lib, commit them in the repo. |
| 10:24 | technomancy | I think it would be a lot easier to just not use anything that uses version ranges |
| 10:24 | ro_st | technomancy: 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:25 | kreig1 | technomancy: considering that the two most ciritical components of my app appaently use ranges... (noir and korma) |
| 10:25 | technomancy | kreig1: first thing to do is file bug reports with them if the latest versions still use ranges |
| 10:26 | kreig1 | technomancy: 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:26 | technomancy | next is to figure out a way to prevent it from happening again; possibly via a range-detection plugin |
| 10:26 | kreig1 | technomancy: it's all good tho, :exclude fixed it for now |
| 10:26 | technomancy | there could be other ranges in there still that aren't causing problems yet but will down the line |
| 10:27 | kreig1 | technomancy: 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:29 | kreig1 | technomancy: yah, the 1.2.X series of noir used a range |
| 10:29 | kreig1 | as does korma |
| 10:29 | kreig1 | technomancy: thanks for the tools and help |
| 10:39 | lypanov | kreig1: i had the same problem this morning. |
| 10:39 | lypanov | half way through a critical production deploy. |
| 10:40 | lypanov | utterly unimpressed. |
| 10:40 | tomoj | I notice clojurescript doesn't include the third_party bits of closure, e.g. goog.async.Deferred. is there a reason for this? |
| 10:40 | lypanov | tomoj: cus it sucks. |
| 10:40 | lypanov | tomoj: i have jars in clojars that add it. |
| 10:40 | kreig1 | lypanov: my takeaway is to not put lein deps in my main deploy line |
| 10:41 | lypanov | kreig1: anyone running production without clean installs every time is crazy. |
| 10:41 | ivan | why not deploy uberjars? |
| 10:41 | kreig1 | lypanov: a clean install doens't mean running lein deps at deploy time tho |
| 10:42 | kreig1 | ivan: that is how we deploy. We build an uberjar. |
| 10:42 | borkdude | I 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:42 | lypanov | guess the build does make more sense to happen on accetp/dev or so. |
| 10:42 | lypanov | but wouldn't have helped me this morning. |
| 10:43 | ro_st | is there a method like filter that returns true or false based on whether all the iterated function calls return true? |
| 10:43 | kreig1 | borkdude: add :exclusions [org.clojure/clojure] to the noir dependency |
| 10:43 | borkdude | ro_st every? |
| 10:43 | kreig1 | several of us ran into similiar problem today |
| 10:43 | ro_st | ah. i was trying all? |
| 10:43 | lypanov | kreig1: and yes, i also had no issues last week. all perfect and then the world blew up this morning. |
| 10:44 | borkdude | ro_st In C# it is called All<T> |
| 10:44 | kreig1 | lypanov: yah, still don't know why it blew up this weekend |
| 10:44 | borkdude | kreig1 why? |
| 10:44 | lypanov | my assumption is something changed in clojars. |
| 10:44 | kreig1 | borkdude: see logs |
| 10:44 | lypanov | or maven etc. |
| 10:44 | lypanov | ah you found out? /me reads without scan mode enabled |
| 10:44 | borkdude | my students had presentations this morning, suddenly things stopped working :( |
| 10:45 | kreig1 | borkdude: in short, noir (1.2.X) used a ranged dependency, that suddenly broke over the weekend |
| 10:45 | lypanov | kreig1: 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:45 | borkdude | kreig1 in clojars? |
| 10:45 | kreig1 | borkdude: see the logs |
| 10:45 | lypanov | kreig1: *everything* from ibdknox uses them then. |
| 10:46 | lypanov | noir-cljs, korma, etc etc etc. |
| 10:46 | kreig1 | borkdude: the exclusion stops maven from puking on the ranged dep |
| 10:46 | kreig1 | borkdude: we still don't know why it broke over the weekend tho (we being other users who hit it) |
| 10:47 | kreig1 | lypanov: resolve your deps as your pull them in, not all at deploy/build time |
| 10:47 | lypanov | kreig1: 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:47 | borkdude | kreig1 my students complained working with clojure (tools) is terribly buggy/beta… it wasn't a very nice experience in that regard... |
| 10:47 | borkdude | kreig1 I think I shouldn't have made them use beta eclipse plugins and leiningen2 ˆ_^ |
| 10:47 | kreig1 | borkdude: no, you shouldn't have 8) |
| 10:47 | kreig1 | borkdude: never use eclipse 8) |
| 10:48 | lypanov | borkdude: 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:48 | borkdude | next year I hope things will get more stable and less confusing... |
| 10:48 | lypanov | i've used it for for a while in personal projects and never had this. |
| 10:48 | kreig1 | lypanov: you are over your bitch limit 8^) |
| 10:48 | lypanov | think its just a single crazy occasion. |
| 10:48 | lypanov | kreig1: agreed. bad morning. |
| 10:48 | kreig1 | lypanov: hehe |
| 10:48 | borkdude | but things won't become more stable if no-one takes the risk of actually using it I guess ;) |
| 10:48 | ivan | I build everything from source but it took a long time to track everything down and patch things and write a build system |
| 10:49 | TimMc | borkdude: So, how did your guinea pigs^W^Wstudents do? |
| 10:49 | kreig1 | lypanov: same here. 8^) Also, we totally replaced a RoR app with clojure |
| 10:49 | lypanov | technomancy: i'd personally say clojars should just refuse such jars if its that critical. |
| 10:50 | lypanov | poms* sorry. |
| 10:50 | borkdude | TimMc some made a nice app http://roulette-clojure.herokuapp.com/ |
| 10:50 | kreig1 | borkdude: where you teaching? |
| 10:50 | borkdude | TimMc but some had a very imperative approach still, OO-minded |
| 10:50 | lypanov | kreig1: we're just part way in. using clojurescript at first. next up replacing the core of the app with clj. |
| 10:51 | borkdude | TimMc I only had 5 lessons though, they were trained in OO almost three years now |
| 10:51 | TimMc | yeah |
| 10:51 | kreig1 | lypanov: what is the clojurescript experience? We are considering using it |
| 10:51 | lypanov | kreig1: very good. though difficult at times to interop. but thats a given more or less. |
| 10:51 | borkdude | and I should definitely tell them that using def inside functions is not idiomatic... |
| 10:51 | kreig1 | lypanov: my tentative plan is to build alot of our UI via JS on the client, using our existing JSON data api |
| 10:52 | lypanov | kreig1: its so small and well written that any time you have issues you can basically just go read the clojurescript source itself. |
| 10:52 | lypanov | compiler* that is |
| 10:52 | kreig1 | lypanov: what are you finding to be real wins over just jquery/js? |
| 10:52 | borkdude | kreig1 University of Applied Sciences Utrecht (polytechnic is a better word for it) |
| 10:52 | lypanov | a dutchie! |
| 10:53 | borkdude | lypanov yeah, you too? |
| 10:53 | lypanov | kreig1: code compactness. |
| 10:53 | antares_ | Monger 1.0 RC1 is released after 11 months of work: https://twitter.com/clojurewerkz/status/212193256459612161 |
| 10:53 | lypanov | borkdude: english but in voorburg (near DH) for 12+ years. |
| 10:53 | antares_ | also, http://clojuremongodb.info |
| 10:54 | borkdude | lypanov ok, been to any clojure meeting already? |
| 10:54 | lypanov | borkdude: once a long long time ago. was debating wednesday but probably won't due to match so hopefully next few weeks. |
| 10:54 | ro_st | antares_: been using it for the last couple weeks |
| 10:54 | ro_st | loving it |
| 10:54 | antares_ | ro_st: thank you! |
| 10:54 | borkdude | lypanov yes, that sucks because I actually planned to go |
| 10:55 | ro_st | i love that i can read mongodb.org docs and translate directly into clojure without any fuss |
| 10:55 | ro_st | so kudos on that point |
| 10:55 | tomoj | nothing 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:55 | lypanov | kreig1: 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:55 | lypanov | tomoj: i replied earlier. |
| 10:55 | lypanov | tomoj: in summary: |
| 10:55 | tomoj | (included third_party in libs so it's available now) |
| 10:55 | lypanov | ah no. its not. |
| 10:55 | lypanov | they messed it up. |
| 10:56 | technomancy | lypanov: clojars refusing jars that declare version ranges is definitely on the table |
| 10:56 | lypanov | i'll find my bug report. waiting for a reaction. |
| 10:56 | borkdude | kreig1 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:56 | technomancy | I'm for it |
| 10:56 | kreig1 | borkdude: I don't know WHY it changed, just that the ranges are the cause. SOmething in the superpom or whatever |
| 10:56 | lypanov | borkdude: i'm still unsure of that also. |
| 10:56 | ro_st | antares_: i guess your focus is documentation at http://clojuremongodb.info/ now? |
| 10:57 | technomancy | probably a warning when you generate the jar too |
| 10:57 | antares_ | 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:57 | lypanov | tomoj: use: :exclusions [org.clojure/google-closure-library] on anything that does the actual include. |
| 10:57 | antares_ | 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:57 | lypanov | tomoj: then, [org.clojars.lypanov/google-closure-library-repackaged "0.0-1376" ] [org.clojars.lypanov/google-closure-library-third-party-repackaged "0.0-1376"] |
| 10:57 | llasram | I 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:58 | ro_st | antares_: 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:58 | tomoj | lypanov: 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:58 | lypanov | tomoj: i use noir-cljs so don't have any experience with the leon cljs build thingy. |
| 10:58 | ro_st | mongo shell is horrid in comparison |
| 10:58 | tomoj | ah |
| 10:58 | lypanov | tomoj: aha. that doesn't work. |
| 10:58 | ro_st | antares_: examples++. |
| 10:58 | lypanov | the deps.js has to be adjusted. |
| 10:58 | lypanov | its all a big mess. but the above two lines work. |
| 10:59 | lypanov | dunno why the uploaded jars are broken. the fix is easy. |
| 10:59 | tomoj | thanks, I'll try that |
| 10:59 | lypanov | only 1376 btw, hope that works for you. |
| 10:59 | lypanov | if not.. here are instructions for building the jar yourself: http://dev.clojure.org/jira/browse/CLJS-276 |
| 11:00 | tomoj | thanks |
| 11:01 | tomoj | I 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:01 | llasram | technomancy: How does maven (?) resolve dependencies when different libraries specify multiple different versions of a shared dependency? |
| 11:01 | technomancy | llasram: normally it just picks the newer one I believe |
| 11:01 | tomoj | or maybe (:use [goog.async :only [Deferred]]) will work if I use the repackaged stuff.. |
| 11:01 | technomancy | possibly giving precedence to those "higher" in the tree |
| 11:01 | technomancy | if there are non-overlapping ranges though it just gives up, which is craaaazy |
| 11:03 | llasram | technomancy: I see. That makes sense. And hmm -- is giving up if there isn't a common usable dependency not the right behavior? |
| 11:05 | tomoj | (nope) |
| 11:07 | llasram | I 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:07 | kreig1 | technomancy: Apparently the mavent metadata file says 1.2.0 is the latest org.clojure/clojure release |
| 11:08 | ro_st | how would i write a checker for midje that trues when count > 0? |
| 11:08 | kreig1 | AHHH |
| 11:08 | kreig1 | ok |
| 11:08 | kreig1 | found the problem |
| 11:09 | kreig1 | lypanov: ok, so apparently the maven report right now says 1.2.0 is the latest release |
| 11:09 | kreig1 | lypanov: 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:09 | ro_st | nm, got it! |
| 11:10 | kreig1 | lypanov: so it appears that maven rolled back data or something |
| 11:12 | lypanov | tomoj: i don't use use currently. only e.g. [goog.ui.PopupDatePicker :as popupdp] |
| 11:12 | lypanov | tomoj: learning clojure at same time as i use it in a production project :P |
| 11:13 | tomoj | lypanov: and then how do you use the PopupDatePicker constructor? |
| 11:13 | lypanov | 90 popup (goog.ui.MyPopupDatePicker. picker) |
| 11:14 | kreig1 | technomancy: My maven-metadata-central.xml says: <lastUpdated>20100914121821</lastUpdated> |
| 11:14 | tomoj | ah of course, just fully qualified.. |
| 11:15 | tomoj | thanks |
| 11:15 | kreig1 | technomancy: tho that file was DLed today. It looks like the central maven repo is handing out bad data |
| 11:15 | ro_st | bad maven! |
| 11:15 | ro_st | i wonder if they know |
| 11:16 | lypanov | summary: lets get clojure on clojars not us off clojars. |
| 11:16 | ro_st | or have they all gone into cryo-stasis already? |
| 11:16 | lypanov | like mvn ever cared about the users. its all about the ideals man! |
| 11:17 | lypanov | technomancy: btw read your reply to headius a while back on twitter where he says lion is making him rethink. |
| 11:17 | lypanov | technomancy: ditto for me. i'm the biggest freaking apple fanboy ever created. but i'm sick of it now. using fedora lately instead. |
| 11:18 | lypanov | lion is a complete f-up |
| 11:19 | mwillhite | hey 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:19 | mwillhite | any ideas? |
| 11:19 | lypanov | :/ |
| 11:19 | mwillhite | I haven't touched the code since friday… |
| 11:19 | mwillhite | remote repo down? |
| 11:19 | lypanov | how many people now? 5? |
| 11:19 | lypanov | mwillhite: add :exclusions [org.clojure/clojure] to every dep other than your clojure sep in your project.clj |
| 11:20 | lypanov | dep* |
| 11:20 | mwillhite | thanks |
| 11:20 | mwillhite | what happened? |
| 11:20 | TimMc | Welp, time to put my ~/.m2/repository up as a torrent... |
| 11:20 | tomoj | lypanov: fwiw not using the jars, using a checkout of clojurescript, and just adding the third_party to libs seems to work fine |
| 11:20 | lypanov | tomoj: w00t! |
| 11:21 | ro_st | i'm loving the lazy nature of clojure to prevent unnecessary io work. |
| 11:21 | ro_st | in this case, hitting mongo db up for more data |
| 11:22 | lypanov | mwillhite: we're not quite sure yet alas. |
| 11:22 | lypanov | ah, kreig1 has an idea |
| 11:24 | tomoj | ..except that closure assumes goog.global has e.g. setTimeout, which isn't true for a node.js module :( |
| 11:24 | mwillhite | okay thanks :) |
| 11:25 | lypanov | tomoj: https://github.com/zzdhidden/node-jquery-deferred |
| 11:25 | TimMc | I rm -r'd my m2 repo and did lein deps in a clean project, and everything seemed to work... |
| 11:25 | lypanov | i'm using jquery deferred rather than the goog one, maybe the above is a good idea. |
| 11:26 | lypanov | tomoj: if you're running with advanced try the externs/jquery.js file from github ibdknox/jayq |
| 11:26 | kreig1 | ok, send email to clojure list explaining the situation |
| 11:26 | kreig1 | sent... |
| 11:27 | kreig1 | TImMc: interesting... |
| 11:27 | ivan | http://twistedmatrix.com/pipermail/twisted-python/2011-June/024149.html beware the jQuery Deferred |
| 11:27 | TimMc | kreig1: Do you have a project.clj testcase I could try? |
| 11:27 | tomoj | lypanov: 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:27 | ivan | the Closure implementation is pretty sane, except for handling of undefined retvalues |
| 11:27 | lypanov | tomoj what features out of interest? |
| 11:28 | lypanov | ah |
| 11:28 | tomoj | branch in particular, not sure what else is different |
| 11:28 | kreig1 | TimMc: I nuked my .m2, removed my exclusions, and it failed again (as I would expect) |
| 11:28 | lypanov | ivan's ref summarized :) |
| 11:28 | technomancy | llasram: the problem is maven conflates ranges and "hard requirements" |
| 11:28 | kreig1 | basically, right now 1.2.1 is not available |
| 11:28 | kreig1 | technomancy: that's the symptom |
| 11:28 | kreig1 | technomancy: the cause is that maven central repo took 1.2.1 out of play |
| 11:28 | technomancy | llasram: you should be able to declare a soft range |
| 11:29 | technomancy | kreig1: whoa seriously? |
| 11:29 | technomancy | central's policies are usually super-conservative |
| 11:29 | lypanov | 6 people up to now with broken projects. |
| 11:29 | kreig1 | technomancy: see my email to the list (just sent, might need moderation approval) |
| 11:29 | kreig1 | technomancy: see also my comments above: |
| 11:29 | ro_st | lypanov: that know about it / know to come ask on here |
| 11:29 | technomancy | kreig1: that's a much worse problem, but it doesn't mean the inherent brokenness of version ranges isn't a problem |
| 11:29 | lypanov | the .xml changed on 5th. fits with mine. |
| 11:29 | kreig1 | technomancy: maven central repo is serving up maven-metadata-central.xml for org.clojure/clojure from like 2010 |
| 11:30 | lypanov | ro_st: good point. |
| 11:30 | kreig1 | technomancy: agreed |
| 11:30 | TimMc | kreig1: http://repo1.maven.org/maven2 worksforme |
| 11:30 | TimMc | with clojure 1.2.1 |
| 11:30 | kreig1 | hmm |
| 11:30 | kreig1 | central (http://repo1.maven.org/maven2) |
| 11:30 | kreig1 | that's what I am hitting |
| 11:30 | lypanov | ditto. |
| 11:30 | kreig1 | could it by a mirroring issue? |
| 11:30 | technomancy | ro_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:31 | technomancy | I do want to speak on a more general build topic at the next conj |
| 11:32 | ro_st | technomancy: 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:32 | ro_st | i'm still battling to get my slime repl to respect injections, for example |
| 11:32 | kreig1 | TimMc: the maven central server appears to be right, at least when going thru web interface |
| 11:32 | lypanov | kreig1: aye, i had no problems with the browser this morning. |
| 11:32 | technomancy | injections is 2.x only, but it should apply across the board in all tasks |
| 11:33 | technomancy | ro_st: definitely interested in hearing ways the docs could be improved though |
| 11:33 | ro_st | i 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:33 | technomancy | hm; like not even printlns are showing up? |
| 11:34 | ro_st | https://www.refheap.com/paste/3087 |
| 11:35 | ro_st | so 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:35 | technomancy | huh; bummer. can you open an issue? |
| 11:35 | technomancy | "use" isn't going to do any good |
| 11:36 | technomancy | because it's not going to follow you around when you change namespaces |
| 11:36 | ro_st | oh, right. so it has to be require'd? |
| 11:37 | technomancy | well I mean use will be equivalent to require in this case |
| 11:37 | technomancy | gotta take off; will follow up on the issue tracker |
| 11:37 | ro_st | cool. shot |
| 11:37 | kreig1 | TimmC: can you show me your m2/repository/org/clojure/clojure/maven-metadata-central.xml ? |
| 11:40 | TimMc | kreig1: No such file. |
| 11:41 | TimMc | ls -R on .m2 only shows jars, poms, and checksums. |
| 11:41 | TimMc | lein 1.6.2 if it matters |
| 11:41 | pepijndevos_ | 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:41 | ivan | http://mirrors.ibiblio.org/pub/mirrors/maven2/org/clojure/clojure/maven-metadata.xml |
| 11:42 | pepijndevos_ | source file: http://google-refine.googlecode.com/svn/trunk/main/src/com/google/refine/clustering/binning/Metaphone3.java |
| 11:42 | TimMc | pepijndevos_: Missing from the classpath at runtime, then? |
| 11:42 | kreig1 | I don't understand |
| 11:42 | pepijndevos_ | TimMc, but it does find the class |
| 11:42 | kreig1 | TImMc: I mean ~/.m2 ... |
| 11:43 | pepijndevos_ | TimMc, Just not the constructor, which is weird |
| 11:43 | lypanov | kreig1: i have <lastUpdated>20100914121821</lastUpdated> |
| 11:44 | TimMc | kreig1: I know. It's not there. |
| 11:44 | hiredman | pepijndevos_: none of those constructors are public |
| 11:45 | pepijndevos_ | hiredman, oh, shoot. erm, ok, so a static method I guess? |
| 11:45 | kreig1 | TImMC: woah |
| 11:45 | kreig1 | TimMc: do you have any metadata files there? |
| 11:46 | kreig1 | lypanov: I edited the metadata file to say 1.2.1 and everything works |
| 11:46 | pepijndevos_ | hiredman, ok, thanks, but now I have no idea how to get an instance of this thing |
| 11:46 | mwillhite | even after I exclude clojure from each of my deps, I still have the same error message |
| 11:47 | TimMc | kreig1: https://www.refheap.com/paste/3088 |
| 11:48 | lypanov | mwillhite: can you try to get more of an error? |
| 11:48 | lypanov | what you pasted didn't include a stacktrace. |
| 11:48 | kreig1 | mwillhite: do you explicitely depend on clojure 1.2.1? |
| 11:49 | mwillhite | oh weird, updating metadata file (like kreigl) to 1.3.0 it seems to be working… |
| 11:49 | mwillhite | no I have no dependencies on 1.2.1 |
| 11:49 | mwillhite | its all 1.3.0 |
| 11:49 | TimMc | pepijndevos_: So weird! The only instances of the keyword "public" are the class and main(). |
| 11:49 | kreig1 | argh |
| 11:49 | mwillhite | my metadata file was at 1.2.0 |
| 11:49 | pepijndevos_ | TimMc, ah, there is a helper class that has a method to construct it |
| 11:50 | pepijndevos_ | downloading some other classes now |
| 11:50 | mwillhite | lypanov: 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:51 | kreig1 | mwillhite: when lein version? |
| 11:52 | mwillhite | kreig1: 2.0.0-SNAPSHOT |
| 11:52 | kreig1 | argh |
| 11:53 | kreig1 | where do those metadata files come from? |
| 11:53 | kreig1 | and what does TimMc not have any? |
| 11:53 | kreig1 | s/what/why |
| 11:54 | lypanov | fun. |
| 11:54 | ivan | MITM yourself with the correct metadata from ibiblio |
| 11:54 | kreig1 | http://repo.maven.apache.org/maven2/org/clojure/clojure/maven-metadata.xml |
| 11:54 | ivan | er I mean set ibiblio as your repo? |
| 11:54 | kreig1 | that file is the culprit! |
| 11:54 | kreig1 | ivan: how? I am not a lein power user 8) |
| 11:54 | ivan | heck if I know |
| 11:55 | kreig1 | ivan: adde the repo, testing |
| 11:56 | lypanov | fun that http://build.clojure.org/job/clojure/386/console built on friday for first time in a month or so. |
| 11:57 | kreig1 | BEWM! |
| 11:58 | kreig1 | that seems to have fixed it |
| 11:58 | kreig1 | added this to my project.clj: |
| 11:59 | kreig1 | :repositories {"ibiblio" "http://mirrors.ibiblio.org/pub/mirrors/maven2/" } |
| 11:59 | kreig1 | since for NOW at least, it has the right data |
| 11:59 | kreig1 | but as soon as the mirror updates, it will fuck us all again |
| 12:00 | ivan | mirror the mirror before it's too late |
| 12:00 | lypanov | better than everything is on clojars and things work reliably than this mess up. |
| 12:00 | lypanov | that* |
| 12:02 | ivan | I have a feeling ibiblio will get clobbered any minute now given what looks like a weekly mirror |
| 12:02 | ivan | maybe someone should tell them to not mirror |
| 12:04 | ivan | (is this just an org/clojure thing?) |
| 12:05 | kreig1 | that's the only metadata file that looks out of date at least |
| 12:05 | ivan | oh |
| 12:08 | rplevy | so then what is causing this "org.sonatype.aether.resolution.VersionRangeResolutionException" I am having the same problem this morning |
| 12:08 | pandeiro | anyone have a go-to java lib for transforming scanned documents into text via OCR? |
| 12:09 | kreig1 | rplevy: bad metadata from maven |
| 12:09 | kreig1 | rplevy for the org.clojure/clojure project |
| 12:09 | rplevy | was something bad pushed? |
| 12:09 | kreig1 | rplevy: no idea |
| 12:09 | kreig1 | since fucking clojure list is moded, my email is not out yet |
| 12:09 | kreig1 | this is ridiculous |
| 12:09 | lypanov | i hate that also. 4+ emails i've sent to that and nothing posted. no longer using. |
| 12:10 | lypanov | ahhh great and my wife just left the house with the wrong debit card while i was debating grabbing sushi. |
| 12:10 | kreig1 | rplevy: depends, I don't know if metadta is generated or uploaded |
| 12:11 | rplevy | deleting .m2... |
| 12:11 | kreig1 | that won't help |
| 12:11 | kreig1 | add ibilbio mirror to your project.clj (for now) |
| 12:11 | rplevy | you're right it didn't |
| 12:11 | kreig1 | argh |
| 12:11 | rplevy | ok I will do that, thanks |
| 12:11 | kreig1 | man, it's a fucking monday with vengeance |
| 12:13 | langmartin | I'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:13 | TimMc | langmartin: Have you confirmed the resources are in there? |
| 12:13 | TimMc | Myabe it was built wrong. |
| 12:14 | langmartin | TimMc: yeah, if I just open the file in emacs (which unzips it) they're there |
| 12:15 | langmartin | the 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:15 | rplevy | kreig1: got the URL handy? I'm still looking for it... |
| 12:15 | rplevy | to add in repos in lein |
| 12:16 | kreig1 | Fuck |
| 12:16 | kreig1 | I do |
| 12:16 | kreig1 | but now I can't paste into my IM client |
| 12:16 | kreig1 | MONDAY! DAMN YOU! |
| 12:16 | rplevy | lol |
| 12:16 | kreig1 | asd http://mirrors.ibiblio.org/pub/mirrors/maven2/ |
| 12:16 | technomancy | sonatype has it too |
| 12:17 | rplevy | kreig1: thanks! |
| 12:17 | TimMc | langmartin: Yes, that could be trouble. |
| 12:17 | technomancy | https://oss.sonatype.org/content/groups/public/ |
| 12:17 | rplevy | isn't it sonatype that is having problems today? |
| 12:17 | technomancy | it has 1.2.1 at least |
| 12:18 | hiredman | langmartin: 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:18 | technomancy | oh, I didn't check the metadata file, just the presence of the jar |
| 12:18 | technomancy | this lists 1.2.1 though: https://oss.sonatype.org/content/groups/public/org/clojure/clojure/maven-metadata.xml |
| 12:19 | kreig1 | testing witht aht repo |
| 12:19 | kreig1 | ibilbio is bitching at me |
| 12:19 | langmartin | hiredman: I'm not, but that's a good note. from the repl, (io/resource "sql") returns the url for project/resources/sql |
| 12:19 | langmartin | nil in the uberjar |
| 12:20 | technomancy | kreig1: which noir version do you need to specify to repro? |
| 12:20 | hiredman | langmartin: seems unlikely |
| 12:20 | hiredman | is "sql" a directory? |
| 12:21 | hiredman | (cause that is not going to work) |
| 12:21 | langmartin | hiredman: it is a directory |
| 12:21 | hiredman | well there you go, you can't do that |
| 12:21 | langmartin | io/as-file coerces it to a list from the repl.... |
| 12:22 | hiredman | "you can't do that" |
| 12:22 | langmartin | hiredman: can't do what? |
| 12:22 | langmartin | open a directory and list the files in it? |
| 12:22 | kreig1 | techno: 1.2.2 |
| 12:22 | kreig1 | technomancy: 1.2.2 |
| 12:23 | technomancy | kreig1: cool; was able to repro and confirm that adding sonatype fixes it |
| 12:23 | kreig1 | technomancy: I added sonatype as a repo and it works |
| 12:23 | kreig1 | technomancy: yup, confirmed here too |
| 12:23 | technomancy | kreig1: since you're stuck in moderation purgatory I'll post to the clojure list |
| 12:23 | kreig1 | technomancy: que ridiculo |
| 12:24 | technomancy | dinc |
| 12:24 | technomancy | this first manifested over the weekend? |
| 12:25 | kreig1 | yah |
| 12:25 | kreig1 | one of my coworkers said he built last night fine, and it broke this morning |
| 12:25 | kreig1 | but not a totally reliable report. I know that we build friday afternoon tho |
| 12:25 | kreig1 | built... |
| 12:25 | technomancy | yeah, hard to say unless you have a fresh m2 |
| 12:25 | ibdknox | dnolen: Finally got a chance to talk to Bret Victor this weekend :) Avi Bryant too! |
| 12:26 | technomancy | not 100% sure why noir's version ranges are blowing up here but at least we have a fix |
| 12:26 | ibdknox | I went around singing Clojure/CLJS praise everywhere I could |
| 12:27 | kreig1 | technomancy: yah, the amn file mod time on the maven repo itself says Sept 2010 |
| 12:27 | kreig1 | technomancy: bad restore? |
| 12:27 | foxdonut | ibdknox: do tell! |
| 12:27 | ibdknox | I was at FOOcamp |
| 12:27 | kreig1 | in chicago? |
| 12:27 | kreig1 | ah |
| 12:27 | kreig1 | should have gone |
| 12:28 | ibdknox | very neat opportunity and a bit of a surreal experience |
| 12:28 | ibdknox | no |
| 12:28 | technomancy | kreig1: well while noir's range declaration is annoying, it still should be able to resolve *something* within the range it requires |
| 12:28 | ibdknox | kreig1: foo is at O'Reilly's headquarters |
| 12:28 | ibdknox | in sebastopol |
| 12:28 | kreig1 | aahh, misunderstood |
| 12:28 | dnolen | ibdknox: haha, very cool! |
| 12:29 | ibdknox | Norvig knew who I was :) Another life goal down lol |
| 12:29 | ibdknox | But yeah, I think I got a fair number of "important" people interested in Clojure :) |
| 12:29 | foxdonut | awesome! |
| 12:29 | ibdknox | not sure if that will result in anything, but who knows |
| 12:30 | foxdonut | did Bret Victor have any idea about LT? |
| 12:31 | ibdknox | yeah, 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:31 | langmartin | ok, 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:32 | muhoo | what's the trick in lein repl to get the full stacktrace instead of the one-line stummary? |
| 12:32 | muhoo | heh, summary? |
| 12:32 | TimMc | muhoo: (pst) |
| 12:33 | muhoo | TimMc: thx |
| 12:33 | foxdonut | ibdknox: very cool. |
| 12:37 | muhoo | i seem to have acquired a compojure vs. ring incompatibility of some kind: https://www.refheap.com/paste/3090 |
| 12:38 | foxdonut | (england just scored and lead france 1-0) |
| 12:41 | technomancy | kreig1: https://clojars.org/org.clojure/clojure |
| 12:44 | technomancy | not 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:45 | kreig1 | technomancy: thanks |
| 12:46 | muhoo | oh 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:47 | kreig1 | so.... |
| 12:47 | kreig1 | trying to decide just how much to leap into the "javascript" application world |
| 12:48 | kreig1 | I have historically been more of a generate html and decorate with javascript person |
| 12:48 | kreig1 | but, am contemplating mving to a mostly JS app, with lots of client side rendering, and a JSON api on the backend |
| 12:48 | kreig1 | obviously clojurescript is on the table |
| 12:49 | dnolen_ | ibdknox: haha, that's awesome that you got meet Norvig |
| 12:49 | dnolen_ | ibdknox: so imagine you guys will starting cranking on LT in earnest soon. |
| 12:49 | ibdknox | dnolen_: playground out in the next two weeks |
| 12:50 | ibdknox | the goal is something legitimately useful for Clojure by the end of YC |
| 12:51 | dnolen_ | ibdknox: sweet! |
| 12:54 | lypanov | dnolen_: hey if you get time could you take a look at http://dev.clojure.org/jira/browse/CLJS-276 / poke someone about it? |
| 12:54 | gfredericks | I 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:54 | lazybot | gfredericks: What are you, crazy? Of course not! |
| 12:54 | lypanov | ibdknox: btw i'm really confused by my level, does "pre-beta" mean may or oct? |
| 12:54 | pbostrom_ | kreig1: take the leap, Clojurescript is great |
| 12:55 | lypanov | gfredericks: org.clojure/data.json |
| 12:55 | ibdknox | lypanov: here's the estimated break down http://www.kickstarter.com/projects/ibdknox/light-table/posts/210336 |
| 12:55 | gfredericks | lypanov: yeah I got that part right |
| 12:56 | lypanov | ibdknox: sweet. just the kickstarter end dates don't correspond so got really confused |
| 12:56 | ibdknox | yeah KS didn't let me change them :( |
| 12:56 | dnolen_ | 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:57 | lypanov | dnolen_: none of my posts to ml are allowed through. |
| 12:57 | lypanov | so i've stopped even bothering lately. |
| 12:57 | lypanov | will try to email stuart. |
| 12:58 | dnolen_ | lypanov: yes that would be the thing to do. |
| 12:58 | dnolen_ | lypanov: if it's a real issue and there's a patch I will happily apply it. |
| 12:58 | pbostrom_ | ibdknox: just curious since you changed up the levels during the campaign, but does the $80 level include early beta access? |
| 12:59 | gfredericks | wasn'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:59 | lypanov | gfredericks: about using, or using? |
| 13:00 | lypanov | as in, created with, or about? if so, iirc hickey gave an awesome one. |
| 13:01 | lypanov | dnolen_: good point. i'll figure out if i can attach a patch to the issue. now its just instructions. |
| 13:02 | dnolen_ | lypanov: thx, have you submitted your CA? |
| 13:02 | lypanov | dnolen_: nope, will look into doing so. |
| 13:02 | lypanov | https://github.com/stuartsierra/cljs-formatter sweeeeeet |
| 13:03 | edw | Hey guys, I'm getting "Failed to collect dependencies for clojure.lang.LazySeq@..." errors when running lein. Any ideas WTF this means? |
| 13:03 | gfredericks | lypanov: where the presentation itself was made with cljs |
| 13:03 | technomancy | edw: probably this issue? http://groups.google.com/group/clojure/browse_thread/thread/776d9acff0785f15 |
| 13:03 | gfredericks | lypanov: the slides |
| 13:03 | technomancy | screw-up at maven central |
| 13:04 | edw | Ah. Thank you. I am breathing into a paperbag here... |
| 13:04 | technomancy | edw: is the clojars fix not working for you? |
| 13:05 | muhoo | that should be added to /topic |
| 13:05 | kmicu | dnolen: "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:05 | technomancy | muhoo: now that it's on clojars it shouldn't be causing any more trouble |
| 13:05 | edw | I'm trying it now. |
| 13:05 | dnolen_ | kmicu: it's true moving forward yes. |
| 13:05 | technomancy | edw: you shouldn't have to do anything special to bring in the clojars fix though |
| 13:06 | technomancy | unless you've left out clojars entirely |
| 13:06 | edw | What clojars? I'm trying the sonatype thing right now. |
| 13:06 | technomancy | read the second message =) |
| 13:06 | edw | Ah. |
| 13:06 | llasram | edw: 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:06 | edw | Again, (panic-mode 1) |
| 13:07 | technomancy | llasram: that's leiningen's fault; the error message is just crappy |
| 13:07 | muhoo | technomancy: nice shoestring catch! thanks for that. |
| 13:07 | gfredericks | technomancy: does src/user.clj mean something special to lein? |
| 13:07 | edw | I just rebuilt emacs from the git repo, which confused me about the source of the errors... |
| 13:07 | technomancy | gfredericks: no, that's actually all Clojure |
| 13:07 | llasram | technomancy: Ah, ok. Error messages are hard... |
| 13:07 | gfredericks | oh wow I think I remember hearing that like a year ago |
| 13:08 | gfredericks | okay so clojure automatically picks up any "user.clj" on the classpath? |
| 13:08 | technomancy | gfredericks: it's useful for crazy hacks like clj-nstools |
| 13:08 | muhoo | technomancy: does lein2 have a different algorithm for resolving dependencies than lein 1.7.1? |
| 13:09 | technomancy | muhoo: it uses aether rather than maven-ant-tasks. I don't know if there are intentional differences, but it's a different implementation. |
| 13:10 | muhoo | and the order in which the :dependencies are declared affects how the resolution is done, corret? |
| 13:10 | muhoo | correct? |
| 13:11 | technomancy | I think so |
| 13:12 | technomancy | edw: which version of leiningen do you have? |
| 13:13 | edw | preview6 |
| 13:13 | edw | 2.0 |
| 13:13 | technomancy | huh |
| 13:13 | technomancy | weird |
| 13:13 | edw | os x 10.7.blah |
| 13:13 | edw | using clojure 1.4 |
| 13:13 | technomancy | which task were you invoking that emitted that output? |
| 13:13 | edw | deps |
| 13:14 | technomancy | weird |
| 13:14 | duck1123 | I saw that same message the other day, but I can't remember what caused it or how I fixed it |
| 13:14 | edw | (Everything's under control now with the fix you pointed me to. Thank you.) |
| 13:14 | duck1123 | edw: are you using clj-webdriver? |
| 13:14 | technomancy | edw: you shouldn't have to add sonatype now actually |
| 13:15 | edw | duck1123: No. |
| 13:15 | edw | technomancy: What, if anything shoul I have to do now, and when did the situation change? |
| 13:16 | technomancy | edw: after I posted the first message I deployed a fix to clojars that should work transparently with no changes |
| 13:16 | technomancy | edw: was that fix not working for you? |
| 13:18 | duck1123 | Ok, 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:18 | edw | Nothing worked until I put that in like ten minutes ago and all's been well since. |
| 13:19 | edw | My Heroku instances are working restarting again even though I didn't push out that project.clj change though. |
| 13:20 | technomancy | they should have a cached m2 repo |
| 13:20 | edw | Ah. |
| 13:20 | edw | A random question: anyone know if you can get OS X's Terminal.app to do click-to-position-cursor in emacs? |
| 13:21 | muhoo | cemerick: regarding :unauthorized-uri, should it not overwrite that until after auth succeeds/fails? |
| 13:23 | cemerick | muhoo: What do you mean "overwrite"? |
| 13:23 | muhoo | cemerick: 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:23 | muhoo | dunno if that makes any sense |
| 13:23 | cemerick | oh, I see what you mean |
| 13:24 | muhoo | i'm hacking around that by excepting /css/* /img/* /js/* for now |
| 13:25 | muhoo | but as i get more ajaxy, that won't work. |
| 13:25 | borkdude | so more info on the breaking maven/clojars thingy? |
| 13:25 | cemerick | muhoo: well, each request is stateless, so there's no indication as to which one is the "redirectable" uri. |
| 13:26 | muhoo | i'm thinking that maybe the first one should stay until after auth succeeds. subsequent unauthroized requests wouldn't replace :unauthorized-uri maybe? |
| 13:26 | cemerick | e.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:27 | muhoo | aye, true. |
| 13:27 | cemerick | why is the browser hitting these asset URIs if the page that refers to them requires authentication? |
| 13:28 | muhoo | that's a very good question |
| 13:28 | muhoo | maybe because the login page uses them |
| 13:29 | lypanov | 403s? |
| 13:29 | muhoo | yep, 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:29 | duck1123 | Shouldn't making exceptions for your assets be the desired solution anyway? Do they really need to be authed to get the CSS file? |
| 13:30 | muhoo | in this case, that's how i solved it, yes. |
| 13:31 | kmicu | dnolen: 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:36 | lypanov | kmicu: i'm doing so in production with no issues. |
| 13:37 | cemerick | muhoo: right, so getting the authorization guards in the right places is important. |
| 13:38 | cemerick | There'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:38 | cemerick | lypanov: http 403 (unauthorized), which often leads to a login page |
| 13:39 | muhoo | sandbar? |
| 13:40 | muhoo | duck1123: this is what i ended up with https://www.refheap.com/paste/3091 |
| 13:42 | cemerick | muhoo: A Clojure authentication framework by Brenton Ashworth. |
| 13:44 | teleghui | lypanov:thx, http server on android will be strange for js app :) |
| 13:44 | duck1123 | replacing my homebrewed auth system with friend is just one of the items on my list of things to do |
| 13:45 | muhoo | cemerick: hm, shouldn't be too hard to graft something like this onto friend: https://www.refheap.com/paste/3092 (from his docs) |
| 13:45 | nDuff | teleghui: you don't need a HTTP server for local browser-hosted on Android |
| 13:45 | nDuff | err, browser-hosted apps |
| 13:46 | cemerick | muhoo: quite right; you could write it right now, actually :-) |
| 13:46 | muhoo | it'd be one function, and a short one too |
| 13:46 | cemerick | Doesn't need to be part of friend, just a bit of middleware that reuses the authorization fns. |
| 13:46 | antares_ | I am trying to access request or query params from a Noir handler. Is it possible without dropping down to bare compojure handlers? |
| 13:46 | muhoo | what a great language to be working in. |
| 13:47 | gfredericks | is there a way to `lein repl` with a working directory independent of the project? |
| 13:47 | gfredericks | e.g. LEIN_ROOT=/my/project lein repl |
| 13:49 | teleghui | nDuff: i need if i want to connect REPL to ot :) |
| 13:49 | muhoo | antares_: it's usually {:as fields} |
| 13:49 | nDuff | teleghui: ahh, you mean a remote one? *nod*. |
| 13:50 | muhoo | antares_ : i.e. (defpage "/login" {:as params} , then params is your query or form params |
| 13:50 | antares_ | muhoo: so it works like regular destructuring over maps? |
| 13:50 | technomancy | gfredericks: other than cd? maybe set PWD? |
| 13:51 | antares_ | I tried that, with :keys [a b] and :as m I only have :a and :b in the map |
| 13:52 | muhoo | i'm almost certain i've done (defpage "/foo" {:keys [a b] :m} before |
| 13:52 | muhoo | sorry :as m |
| 13:53 | antares_ | muhoo: yup, it works now, I found an issue on my end. Thank you! |
| 13:53 | teleghui | nDuff: you can't connect to repl from static site served via file:/// |
| 13:53 | gfredericks | technomancy: 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:53 | nDuff | teleghui: did I say file:///? |
| 13:54 | duck1123 | gfredericks: you could set up a shell script to set your project before launching the repl. |
| 13:58 | muhoo | slamhound is giving me this: ZipException error in opening zip file java.util.zip.ZipFile.open (ZipFile.java:-2) |
| 13:59 | technomancy | muhoo: usually means a jar was truncated |
| 13:59 | borkdude | probably not a lot people have noticed the central/clojars thing, since they are looking forward to their new macbooks :P |
| 13:59 | dustingetz | i'm struggling with postgresql environment/auth issues, anybody been through this before? |
| 13:59 | muhoo | i also have checkouts in my cp too. h |
| 14:03 | semperos | dustingetz: it's an experience I think most like to forget :) |
| 14:04 | technomancy | dustingetz: I hear the best thing to do in development is run postgres as your own user |
| 14:04 | dustingetz | shit wrong room haha sorry folks |
| 14:06 | gfredericks | duck1123: what does "set your project before launching the repl" mean? |
| 14:09 | duck1123 | gfredericks: basically, have your shell script cd into the project and run the repl and then return when done |
| 14:10 | duck1123 | I know there's a better way to do that, but it's been some time |
| 14:10 | S11001001 | duck1123: you can't setcwd in java |
| 14:10 | duck1123 | but you can in bash |
| 14:10 | duck1123 | it's not a great solution... |
| 14:11 | zachallaun | Quick 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:11 | S11001001 | right, but sometimes you want your code to be executing in the invoking directory |
| 14:12 | S11001001 | for which you can java -cp `cd projdir && lein classpath` clojure.main --repl or whatever |
| 14:12 | muhoo | zachallaun: if you're in dev mode, you shouldget the stacktrace. |
| 14:12 | muhoo | zachallaun: if you want stacktraces sent to you, not to the browser, there's http://github.com/kenrestivo/firealarm |
| 14:12 | zachallaun | muhoo: Awesome, thanks! |
| 14:13 | gfredericks | duck1123: wouldn't that mean the JVM's CWD is still the project? |
| 14:15 | duck1123 | Could 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:16 | duck1123 | just throwing out random thoughts here |
| 14:20 | gfredericks | that is worth thinking about |
| 14:20 | gfredericks | thx |
| 14:21 | muhoo | much 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:21 | AimHere | duck1123, if you're talking about bash, pushd and popd would be your friends for that sort of thing |
| 14:22 | muhoo | i.e. Caused by: java.lang.NoClassDefFoundError: Could not initialize class cheshire.core__init |
| 14:25 | ivan | muhoo: beats spending 99% of your time writing a non-maven build system |
| 14:26 | amalloy | gtrak: 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:26 | amalloy | (keyed [a b c]) => {:a a, :b b, :c c} |
| 14:27 | Jayunit100 | muhoo: me to |
| 14:27 | gtrak | ah thanks, I was thinking something like it must exist |
| 14:27 | Jayunit100 | Spend most of my time defining w packages and namespaces. |
| 14:27 | muhoo | ivan: oh lein makes it a LOT less painful, to be sure. |
| 14:28 | kreig1 | muhoo: that overhead goes away |
| 14:28 | Jayunit100 | 1) 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:28 | kreig1 | muhoo: I am writing a "real world app" and most of my time is writing actualy clojure |
| 14:28 | gtrak | amalloy: I was mostly just curious to see if I could do it, but it seems kind of a dual to destructuring. |
| 14:30 | kreig1 | muhoo: about 13k lines now |
| 14:30 | muhoo | kreig1: that's huge for a clj program. |
| 14:30 | dakrone | muhoo: where are you seeing that exception? |
| 14:31 | muhoo | dakrone: https://www.refheap.com/paste/3093 |
| 14:31 | gtrak | amalloy: 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:31 | muhoo | dakrone: from the ns declaration, ultimately |
| 14:31 | kreig1 | lunch time |
| 14:32 | dakrone | muhoo: do you have the code up somewhere, this is just a stacktrace |
| 14:32 | amalloy | gtrak: (defn foo [x] (let [y (inc x)] (keyed [y x]))) |
| 14:33 | gtrak | right |
| 14:33 | amalloy | let-map can't do that |
| 14:33 | muhoo | dakrone: 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:33 | kmicu | lypanov: Were you able to run https://github.com/stuartsierra/cljs-formatter? |
| 14:34 | gtrak | yea, you'd have to re-bind it, (defn foo[x] (let-map [y (inc x) x x])) |
| 14:34 | amalloy | you also can't let-bind some intermediate values like (let [x 1, y (inc x), z (inc y)] (keyed [x z])) |
| 14:34 | lypanov | kmicu: no never tried it might in a few weeks. |
| 14:34 | amalloy | i think it's a lot nicer to separate out "let's bind something" from "let's return a map" |
| 14:35 | gtrak | amalloy: 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:35 | amalloy | meh. core is crowded enough, without importing all the random crap i write |
| 14:36 | gtrak | hehe |
| 14:36 | amalloy | just use some external libraries; there's no reason everything should be in core |
| 14:36 | gtrak | I guess if I wrote more random crap I'd feel the same way |
| 14:37 | gtrak | amalloy: mind if I link to keyed on my blog? |
| 14:37 | amalloy | knock yourself out |
| 14:38 | muhoo | kreig1: wow, clojure itself is only 28k lines or so. so whatever you're writing, wow. |
| 14:38 | amalloy | gtrak: btw, keyed also takes (keyed :strs [a]) => {"a" a} |
| 14:38 | amalloy | which helps dualize with map destructuring |
| 14:40 | gtrak | ah yea, neato |
| 14:42 | dustingetz | how do i change a dynamic variable? i've tried set! and def, from within the appropriate ns |
| 14:42 | ohpauleez | dustingetz: welcome man! |
| 14:43 | tbaldridge | dustingetz: I think as of Clojure 1.3 you have to set the var as dynamic first: (def ^:dynamic foo 42) |
| 14:43 | tbaldridge | Then set! should work iirc. |
| 14:43 | ohpauleez | dustingetz: you want the binding function |
| 14:43 | ohpauleez | http://clojuredocs.org/clojure_core/clojure.core/binding |
| 14:43 | dustingetz | lol, hi paul, we met at philly lambda a month or two ago, you gave a talk on clojure and clojurescript at tutorspree |
| 14:43 | ohpauleez | if you want it to be stateful, you need something like an atom |
| 14:43 | dustingetz | thanks for the link |
| 14:44 | ohpauleez | dustingetz: of course I remember |
| 14:44 | tbaldridge | yeah, bindings only apply to the current thread. So use binding with pmap and you'll run into tons of issues. |
| 14:46 | gtrak | amalloy: map juxt vs zipmap, i like that, too |
| 14:46 | amalloy | gtrak: in particular there's no reason at all to use zipmap at runtime when you could build the form at macro time |
| 14:46 | amalloy | with zipmap or with juxt, whatever |
| 14:47 | gtrak | ah, I see, that's much better |
| 14:49 | gtrak | so you build the literal with symbols, then it gets eval'd at runtime |
| 14:56 | adu | are any of you going to the Reston, VA meeting? |
| 14:58 | muhoo | dakrone: 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:02 | gtrak | amalloy: 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:03 | xeqi | muhoo: `lein deps :tree` will show you what versions its getting |
| 15:03 | xeqi | for lein2 |
| 15:03 | muhoo | xeqi: yes, i did that. and the versions are the same on this non-working app as for my working demo app |
| 15:04 | muhoo | lein2 check blows up: https://www.refheap.com/paste/3094 lein2 check works just fine: https://www.refheap.com/paste/3095 |
| 15:05 | nDuff | lpetit: Howdy -- I posted to clojure-tools this morning w/ a proposal for the REPL / classpath thing; would very much appreciate your feedback. |
| 15:05 | muhoo | oh, wtf? there are two different versions of jackson in there. beeee-zarre |
| 15:06 | nDuff | lpetit: (also added Felix support to clojure.osgi in a different changeset; feedback would be welcome there as well) |
| 15:06 | lpetit | nDuf: 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:06 | lpetit | nDuff: have you been able to contact aav ? |
| 15:08 | nDuff | Haven'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:08 | nDuff | ...thanks for the suggestion, though; I'll send an email. |
| 15:09 | lpetit | nDuff: well, he's more "the creator", I'm just a "user" of clojure.osgi which happens to use his own fork :) |
| 15:26 | pbostrom | amalloy: 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:26 | amalloy | pbostrom: i think it's supposed to be for performance; i have no idea if it makes a difference |
| 15:46 | gfredericks | ,(let [m {:foo 4}] (identical? m (assoc m :foo 4))) |
| 15:46 | clojurebot | true |
| 15:47 | gfredericks | ,(let [m {:foo 4}] (identical? m (-> m (assoc :foo 5) (assoc :foo 4)))) |
| 15:47 | clojurebot | false |
| 15:47 | S11001001 | microoptimization ahoy |
| 15:48 | borkdude | gfredericks that looks a bit scary |
| 15:48 | S11001001 | ,(let [m {:bar 4}] (identical? m (assoc m :bar 5 :bar 4))) |
| 15:48 | clojurebot | false |
| 15:49 | arrdem | hey guys.. classpath issue I need some help with |
| 15:50 | arrdem | I 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:50 | arrdem | ideas? |
| 15:51 | gtrak | i think you need to compile the java in a separate step |
| 15:51 | gtrak | how are you compiling? |
| 15:51 | arrdem | I javac first, leave the .class files next to their .javas and then run clj |
| 15:52 | amalloy | ~leiningen |
| 15:52 | clojurebot | http://github.com/technomancy/leiningen |
| 15:52 | S11001001 | lein looks in classes, not the java source tree |
| 15:52 | arrdem | k I'll check it out. thaks |
| 15:53 | S11001001 | huh. |
| 15:54 | gtrak | arrdem: in the sample project: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L170 |
| 15:57 | muhoo | oh FFS. clj-aws depends on jackson-core-asl, for the license (apache), whereas cheshire depends on jackson-core, presumably LGPL? |
| 15:57 | gtrak | muhoo: you can add exclusions in your project.clj |
| 15:57 | dakrone | muhoo: which clj-aws? |
| 15:58 | dakrone | muhoo: https://github.com/pingles/clj-aws/blob/master/project.clj ? |
| 15:58 | lypanov | aye. exclusions ftw. |
| 15:59 | muhoo | dakrone: https://www.refheap.com/paste/3094 |
| 16:00 | dakrone | muhoo: ahh, clj-aws is using an older version of jackson |
| 16:00 | muhoo | so 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:00 | muhoo | i don't know for sure if that's what's causing cheshire to fail to load in lein2, but it might be |
| 16:01 | muhoo | if the two jackson's have the same ns, they could be clobbering each other |
| 16:01 | muhoo | will try exclusion and see how that goes |
| 16:01 | gtrak | muhoo: sometimes it's random which version of the class gets loaded first |
| 16:01 | gtrak | you definitely want to avoid that scenario |
| 16:02 | dakrone | tell amazon to upgrade their deps ;) |
| 16:03 | gtrak | "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:04 | muhoo | it's repeateable: in lein2 clj-aws gets loaded first, with the incompatible jackson. in lein1.7.1, noir then cheshire gets loaded first |
| 16:04 | gtrak | muhoo: yea, on a different version of java, the other may get loaded, ask me how I know ;-) |
| 16:04 | muhoo | same project |
| 16:04 | muhoo | hahahaa |
| 16:05 | muhoo | now i understand why technomancy is so keen on repeatability. it appears that it's not a given in java. |
| 16:05 | gtrak | nah |
| 16:06 | gtrak | one 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:06 | gtrak | him -> a colleague |
| 16:06 | gtrak | took a couple hours to figure out what was going on |
| 16:07 | gtrak | maybe it was cglib |
| 16:10 | timvisher | is ring-json-params still the state-of-the-art for json middleware? |
| 16:11 | dustingetz | question about dynamic vars again |
| 16:11 | dustingetz | from a third party library docs: |
| 16:11 | dustingetz | By 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:11 | dustingetz | using ns or in-ns, i do: (set! *migrations-namespace* 'gb.install.migrations) |
| 16:12 | dustingetz | which yields `Can't change/establish root binding of: *migrations-namespace* with set ` |
| 16:12 | dustingetz | also tried |
| 16:12 | dustingetz | (def ^:dynamic lobos.migration/*migrations-namespace* 'gb.install.migrations) which yields Can't create defs outside of current ns |
| 16:12 | gtrak | alter-var-root? |
| 16:13 | technomancy | that sounds craaaaazy |
| 16:13 | gtrak | dropped my laptop. thankful for ssd ;-D |
| 16:14 | dustingetz | hmm, the docs on alter-var-root are confusing to me |
| 16:14 | dustingetz | how would i use it? |
| 16:14 | dustingetz | it expects a fn to apply to the global |
| 16:14 | dustingetz | i would expect to use set! in that fn or something, i dont see how that would resolve the error |
| 16:17 | gtrak | ,(#(identity 5)) ; replace 5 with your value |
| 16:17 | clojurebot | 5 |
| 16:17 | technomancy | I would be surprised if lobos made you use alter-var-root |
| 16:17 | technomancy | if it really does I would suggest looking for an alternative |
| 16:18 | gtrak | why not just add your migrations to its namespace? |
| 16:19 | dustingetz | i get classpath errors because my package structure doesn't line up with their namespaces |
| 16:20 | gtrak | dustingetz: uhhh... I think you should just use defmigration |
| 16:20 | dustingetz | i will probably confirm to their requirement for now bc this is super dumb |
| 16:20 | dustingetz | i am using defmigration but their (migrate) fn is trying to load my migrations from lobos/migrations.clj which is due to that global |
| 16:20 | gtrak | defmigration swaps a var within that namespace |
| 16:21 | gtrak | what's the problem? |
| 16:21 | dustingetz | running (migrate) yields error: Could not locate lobos/migrations__init.class or lobos/migrations.clj on classpath |
| 16:21 | dustingetz | due to the damn global |
| 16:22 | gtrak | why wouldn't you be able to access that namespace? |
| 16:22 | gtrak | sounds like a project setup issue |
| 16:22 | gtrak | ,(use 'arbitrary.ns) |
| 16:22 | clojurebot | #<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate arbitrary/ns__init.class or arbitrary/ns.clj on classpath: > |
| 16:23 | muhoo | great, :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:23 | gtrak | ,(require 'arbitrary.ns) |
| 16:23 | clojurebot | #<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate arbitrary/ns__init.class or arbitrary/ns.clj on classpath: > |
| 16:23 | dakrone | muhoo: because lein2 uses cheshire in itself |
| 16:23 | muhoo | wat? |
| 16:23 | clojurebot | For Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888 |
| 16:24 | gtrak | and for JSwat go here: http://www.shopify.com/technology/5370262-wat-a-funny-look-at-ruby-and-javascript-oddities |
| 16:24 | technomancy | dakrone: you mean the repl-specific stuff? |
| 16:24 | dakrone | technomancy: yea |
| 16:24 | technomancy | did we end up with a way to turn that off? |
| 16:25 | dakrone | technomancy: 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:26 | technomancy | muhoo: for debugging's sake try getting it working with lein run first |
| 16:26 | gtrak | dakrone: on-demand? |
| 16:26 | lypanov | gtrak: thing with ruby that kills me is "blah if blah and blah" does NOT do what you expect |
| 16:26 | muhoo | technomancy: it was failing with lien2 check |
| 16:26 | muhoo | lein2 check |
| 16:26 | technomancy | oh, ok, so it's not the repl deps then |
| 16:26 | dakrone | gtrak: in `lein repl`, clj-http isn't loaded until you try to use (cdoc ...) or (clojuredocs ...) |
| 16:26 | gtrak | lypanov: ? |
| 16:27 | gtrak | dakrone: ah |
| 16:27 | muhoo | it doesn't seem like a repl thing. i'm preparing a bare minimum fail case now |
| 16:27 | timvisher | How would you go about handling json parse errors gracefully if you were trying to use the wrap-json-params middleware? |
| 16:27 | gtrak | lypanov: 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:30 | gtrak | lypanov: I've always hated having to think about operator precedence |
| 16:30 | gtrak | even 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:32 | lypanov | gtrak: right. in ruby i always wrap any "expression" conditionals with () for this reason. |
| 16:32 | lypanov | (e.g. b = blah, or blah if b) |
| 16:34 | gtrak | yea... another fun one, C/C++ you have the option to shoot yourself like this if (a = getValue()) {blah}... instead of ==. java stops you |
| 16:34 | emezeske | gtrak: Shoot yourself, or be succinct, depending on context :) |
| 16:34 | gtrak | emezeske: haha yea |
| 16:35 | gtrak | quite easy to gloss over |
| 16:36 | gtrak | so there's a pattern to write literals on the left: if (null = getValure()) is now a compile error |
| 16:37 | emezeske | gtrak: Otherwise known as Yoda Conditionals |
| 16:38 | gtrak | ah, I never heard that one |
| 16:39 | emezeske | "If null is getValue(), ..." |
| 16:39 | muhoo | why yoda? |
| 16:39 | emezeske | Read the above in yoda voice :) |
| 16:39 | gtrak | it does apply in java though, in the case of checking equality of strings, thankfully clojure just does the right thing with nulls |
| 16:39 | amalloy | gtrak: getValue() = null is an error too |
| 16:40 | gtrak | yea |
| 16:40 | muhoo | we do have the NPE though... the segfault of java |
| 16:40 | emezeske | amalloy: In Java maybe, but in C++, only God knows what that will do. |
| 16:40 | emezeske | amalloy: I guess "null" implies Java, though, so I'll quiet down |
| 16:41 | gtrak | so in java, aString.equals("literal") should really be "literal".equals(aString), so you can skip the null check |
| 16:41 | gtrak | ,(= "hello" nil) |
| 16:41 | clojurebot | false |
| 16:41 | amalloy | emezeske: 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:42 | emezeske | amalloy: That would definitely do the trick. |
| 16:44 | muhoo | nice. i can't get it to fail in a small test app |
| 16:44 | gtrak | amalloy: it can be used to check for a null-pointer, no? say if an allocation didn't work? |
| 16:44 | muhoo | so now i have to build up the whole app, file by file, waiting to see where it breaks :-/ |
| 16:45 | amalloy | gtrak: huh? |
| 16:45 | emezeske | muhoo: You using git? Maybe a git bisect could be helpful? |
| 16:45 | gtrak | like: if (a=malloc(large_amount) {} , it's been a while ;-). malloc will return null if it can't |
| 16:46 | amalloy | indeed. but your null = getValue() example is not valid in either direction |
| 16:46 | gtrak | right |
| 16:47 | gtrak | that'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:48 | amalloy | gtrak: you're using an example that does not support the (entirely viable, though i don't like them personally) yoda conditions |
| 16:48 | amalloy | both of these result in a compiler error: (getValue() = null) (null == getValue()) |
| 16:49 | amalloy | er, too many =s in the second |
| 16:49 | gtrak | huh? |
| 16:49 | gtrak | am I missing something? |
| 16:50 | amalloy | apparently. getValue() = null already fails to compile, so there's no value in switching the order to save yourself |
| 16:50 | gtrak | right... sure. |
| 16:51 | muhoo | emezeske: 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:51 | gtrak | null == getValue() is fine |
| 16:51 | cemerick | Why does java.jdbc's get-connection define its own URI convention, instead of just passing strings and URIs along to DriverManager directly? |
| 16:52 | muhoo | emezeske: 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:53 | emezeske | muhoo: Ah, yeah, a git bisection would not be helpful then |
| 16:53 | emezeske | muhoo: Just a regular by-hand bisection :) |
| 16:55 | muhoo | i 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:55 | jsabeaudry | Raynes, still nothing regarding my pull request? not even a comment or an insult? |
| 16:55 | cemerick | perhaps seancorfield knows? :-) |
| 16:56 | Raynes | jsabeaudry: What pull request where? :| |
| 16:56 | Raynes | I tried to tackle a bunch of the pull requests and stuff I'd been ignoring last night. |
| 16:56 | Raynes | Oh! |
| 16:56 | Raynes | tryclj. |
| 16:56 | jsabeaudry | Yup :) |
| 16:56 | Raynes | I knew I recognized the nick. |
| 16:57 | muhoo | is there a way to get lein2 check to show a longer, or rather complete, stacktrace, none of this "... 46 more" stuff? |
| 16:58 | nDuff | lpetit: 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:58 | Raynes | I 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:59 | nDuff | Is 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:00 | Raynes | The 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:00 | Raynes | (and the code does a lot of what I'm not familiar with in cljs) |
| 17:02 | muhoo | nDuff: i'm pretty sure i've reloaded unloaded ns'es before |
| 17:03 | muhoo | oic, the ... 46 more are at the top of the stacktrace. odd. |
| 17:03 | nDuff | muhoo: 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:03 | technomancy | muhoo: usually 46 more means 46 more identical frames |
| 17:04 | arrdem | from a lein -main function how can I drop to the REPL after running some code? |
| 17:04 | technomancy | arrdem: (clojure.main/repl) |
| 17:04 | arrdem | cheers |
| 17:04 | gtrak | oh damn, that's useful |
| 17:04 | jsabeaudry | Raynes, 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:06 | Raynes | jsabeaudry: Well, I actually understand js to some extent. |
| 17:06 | jsabeaudry | Raynes, ah you dont understand clojure to some extent? ;) |
| 17:07 | Raynes | I don't understand this language at all. |
| 17:07 | gtrak | js is like scheme, right? |
| 17:07 | nDuff | ...if only. |
| 17:08 | brehaut | its like scheme that suffered a TBI at a young age |
| 17:08 | brehaut | (traumatic brain injury) |
| 17:08 | gtrak | they should have just made it scheme and called it javascript |
| 17:09 | gtrak | javascheme |
| 17:09 | brehaut | if they have just switchd the parens for braces, it would have appeased the C programmers too |
| 17:09 | borkdude | there were plans for scheme-like languages first I heared in a Crockford talk |
| 17:09 | borkdude | for a Scheme-like language in the browser I mean |
| 17:09 | borkdude | The grand Scheme of things |
| 17:12 | pbostrom | +1 for (clojure.main/repl), I've been running $ lein repl => (-main) all this time, so many wasted keystrokes |
| 17:12 | S11001001 | phpscript |
| 17:12 | S11001001 | the skeleton key to popularity |
| 17:12 | gtrak | omg |
| 17:13 | gtrak | let's port clojure to php! |
| 17:13 | S11001001 | you first |
| 17:13 | eck` | let's port php to clojure! |
| 17:13 | gtrak | hahahaha |
| 17:13 | borkdude | gtrak what's next.. vbscript? |
| 17:13 | gtrak | yea! |
| 17:14 | borkdude | cljobol |
| 17:14 | llasram | Since there are JVM COBOLs... |
| 17:15 | eck` | good thinking -- we can leverage the efficiency of clojure with the ease-of-use of cobol |
| 17:15 | S11001001 | how 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:16 | muhoo | dakrone: is there a 2.0.0 equivalent to jackson-mapper? |
| 17:16 | borkdude | clojure to objective c? |
| 17:16 | gtrak | borkdude: we kinda have that with cljs -> gambit |
| 17:19 | muhoo | dakrone: i think i am really screwed here. clj-aws-s3 requires jackson-mapper-asl. it refuses to compile without it |
| 17:20 | muhoo | and 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:21 | muhoo | FML |
| 17:24 | dakrone | muhoo: can you open an issue on cheshire so I can look into it at a later time? |
| 17:27 | muhoo | sure |
| 17:29 | muhoo | i'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:31 | lpetit | nDuff: ping |
| 17:31 | pepijndevos__ | dnolen, ISubstitutions is a rather large protocol :| |
| 17:32 | nDuff | lpetit: pong |
| 17:32 | dnolen | pepijndevos__: how do you think it could being smaller? |
| 17:33 | lpetit | nDuff: 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:33 | lpetit | : |
| 17:33 | pepijndevos__ | dnolen, don't know yet... I imagine the difference between the -no-check and * variants to be pretty generic |
| 17:34 | lpetit | nDuff: https://github.com/laurentpetit/ccw/blob/master/ccw.util/src/clj/ccw/util/bundle.clj#L82 |
| 17:36 | ferd | I was showing 4clojure.com to a co-worker... Looks like he brought it down ;-) Just started getting: 502 Bad Gateway. |
| 17:36 | lpetit | nDuff: maybe also this could be interesting: https://github.com/laurentpetit/ccw/blob/master/ccw.util/src/clj/ccw/util/bundle.clj#L105 |
| 17:38 | lpetit | nDuff: 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:39 | nDuff | lpetit: works in my testing, yes. |
| 17:40 | nDuff | lpetit: ...only case I haven't checked is AOT-compiled code |
| 17:40 | amalloy | ferd: this damn site goes down all the time and i can't figure out how to keep it up consistently |
| 17:41 | pepijndevos__ | dnolen, why is Substitutions a protocol if there is only one implementation? |
| 17:41 | ferd | amalloy: you run it? Is it the JVM that dies or what? |
| 17:41 | gfredericks | pepijndevos__: the Substitutions type implements other protocols |
| 17:42 | amalloy | ferd: 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:42 | gfredericks | in order for it to have substitution-y behavior as well there needs to be a protocol to implement |
| 17:42 | pepijndevos__ | hm |
| 17:42 | amalloy | i 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:43 | pepijndevos__ | ah, I see... trying to remember all this stuff now. |
| 17:43 | gfredericks | pepijndevos__: since you can't just add bare methods onto a type |
| 17:43 | gfredericks | also there might be some hypothetical reason you might want to implement it with something else; dunno |
| 17:43 | lpetit | nDuff: 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:43 | ferd | amalloy: 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:44 | amalloy | yeah, it's unlikely it was his fault |
| 17:45 | ferd | amalloy: he says it's back up now. He's trying to kill it again :-) |
| 17:47 | amalloy | i know, i brought it up manually, again :P |
| 17:47 | nDuff | lpetit: Hmm -- that's a thing that can be done, yes. |
| 17:48 | amalloy | hope he enjoys it! |
| 17:48 | nDuff | lpetit: setting the *bundle* var is both worthwhile and necessarily dependent on clojure.osgi, but having a generic, non-OSGi-aware version is sane. |
| 17:48 | dakrone | muhoo: check out cheshire.factory |
| 17:48 | nDuff | (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:49 | dakrone | muhoo: https://github.com/dakrone/cheshire/blob/master/src/cheshire/factory.clj |
| 17:49 | lpetit | nDuff: 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:50 | lpetit | nDuff: in my experience, setting the thread's context class loader as per the prior provided url was sufficient |
| 17:51 | nDuff | lpetit: it worked in _most_ cases for me, but not all |
| 17:52 | nDuff | lpetit: specifically, setting the thread classloader was not always sufficient for some kind of interaction with compiled Java classes coming from the local bundle. |
| 17:52 | lpetit | nDuff: would be interested in a comprehensive "state of the art" report because it's too easy to forget |
| 17:52 | lpetit | nDuff: oh |
| 17:52 | lpetit | compiled java classes, or gen-classes ? |
| 17:53 | nDuff | compiled java classes |
| 17:53 | nDuff | darned 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:53 | dnolen | pepijndevos__: down to 4 for ISubstitutions http://github.com/clojure/core.logic/commit/118a3c30991080f1303eb6c55deed54f61abcc93 |
| 17:53 | lpetit | nDuff: 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:54 | lpetit | nDuff: it's quite hard to come up with the minimal requirements, indeed |
| 17:54 | dnolen | pepijndevos__: can probably get down to 3 with some more thought. Thanks for the feedback. |
| 17:54 | pepijndevos__ | dnolen, you're to fast :P |
| 17:54 | nDuff | lpetit: 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:55 | nDuff | lpetit: ...which, if nothing else, is bookkeeping for the module-unload system |
| 17:55 | pepijndevos__ | 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:56 | lpetit | nDuff: 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:56 | dnolen | pepijndevos__: it only disequality constraints in master - cKanren branch is more generic. |
| 17:56 | nDuff | lpetit: 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:56 | nDuff | s/classes/cases/ |
| 17:56 | dnolen | pepijndevos__: disequality constraints is really just CLP(Tree), which is a part of cKanren |
| 17:57 | lpetit | nDuff:thanks, will read it (tho not yet -> bed time here in France). CU ! |
| 17:57 | pepijndevos__ | 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:58 | pepijndevos__ | dnolen, which onee do you think could be omited with some thought? |
| 17:58 | gtrak | mmm... retina display sounds nice for emacs |
| 17:59 | dnolen | pepijndevos__: maybe update ... it's a bit tied into looking at and checking the constraint store. |
| 18:00 | pepijndevos__ | hm |
| 18:00 | dnolen | pepijndevos__: we do have a new gross big protocol tho - IFiniteDomain ... less clear how to make that one smaller. |
| 18:01 | pepijndevos__ | dnolen, looking it up... sounds interesting. |
| 18:01 | pepijndevos__ | I feel that a domain representation is something I can work on without understanding the whole of ckanren |
| 18:02 | dnolen | pepijndevos__: definitely, it's pretty self contained. |
| 18:02 | pepijndevos__ | right |
| 18:03 | pepijndevos__ | I'm probably going to look at it with oscar the coming days |
| 18:03 | dnolen | pepijndevos__: all Java ints, sorted-sets, and IntervalFD need to interoperate. |
| 18:06 | dnolen | pepijndevos__: 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:07 | pepijndevos__ | dnolen, how is a domain different from a sorted set in terms of interface? |
| 18:09 | dnolen | pepijndevos__: hmm? sorted-sets can be *used* as a domain. so can an Integer or Long. So can an instance of IntervalFD |
| 18:09 | dnolen | pepijndevos__: Java integer types will also be marker protocoled as ISingletonDomain. |
| 18:10 | pepijndevos__ | dnolen, I mean, afaict, clojure.set contains all the operations you want to perform. I think these are not protocol based though :( |
| 18:10 | dnolen | pepijndevos__: they are protocols so can't use them. |
| 18:10 | dnolen | pepijndevos__: also we don't actually want sets anyway. too slow. |
| 18:11 | dnolen | aren't protocols. |
| 18:11 | dnolen | pepijndevos__: for example in cKanren core.logic (intersection 1 (interval 1 10)) is just a bounds check and returns 1. |
| 18:12 | dnolen | pepijndevos__: also if no intersection, we just want nil |
| 18:13 | pepijndevos__ | dnolen, right, right... a domain is to a set like a seq to a reducer ;) |
| 18:13 | pepijndevos__ | erhm, other way around |
| 18:15 | pepijndevos__ | what does lb, ub and drop-before do? |
| 18:16 | pepijndevos__ | does ifinitedomain also express non-number domains? |
| 18:18 | pepijndevos__ | ah, lower bound and upper bound |
| 18:18 | muhoo | technomancy: is there some way to get a list of or debug what the classpath is at the time that leinw is compiling? |
| 18:19 | muhoo | lein2 |
| 18:19 | technomancy | other than `lein classpath` you mean? |
| 18:20 | dnolen | pepijndevos__: 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:20 | muhoo | technomancy: yes! that's it. perfect. i found the problem, i think |
| 18:20 | muhoo | .m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.7/jackson-core-asl-1.9.7.jar: |
| 18:20 | muhoo | that shoudl NOT be on the cp. it's not in :dependencies, not in lein deps :tree. why is it in cp? |
| 18:21 | pepijndevos__ | dnolen, why do you want that? (< :tea :milk) makes no sense. |
| 18:21 | dnolen | pepijndevos__: think about zebrao. |
| 18:21 | dnolen | pepijndevos__: and many other constraint satisfaction problems. |
| 18:22 | pepijndevos__ | dnolen, what about it? |
| 18:23 | pepijndevos__ | dnolen, you mean constraints like rightofo? |
| 18:23 | dnolen | pepijndevos__: righto could be (+fd h0 1 h1) |
| 18:23 | muhoo | shouldn't lein2 deps :tree be the same list of jars as in lein2 classpath? |
| 18:24 | technomancy | it should |
| 18:26 | muhoo | hmmm, nm, that's not it then |
| 18:28 | pepijndevos__ | dnolen, I don't know... I'll think about it. |
| 18:28 | dnolen | pepijndevos__: 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:28 | muhoo | i'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:29 | pepijndevos__ | dnolen, I think separating the order from the domain might be key to a simple interface. |
| 18:30 | Jayunit100 | whats the most idiomatic what to implement case statement logic in clojure? seems like there are different options. |
| 18:30 | dnolen | pepijndevos__: I meant order of the goals. What order are you talking about? |
| 18:30 | brehaut | Jayunit100: if you need a case, then case is probably the best |
| 18:30 | Jayunit100 | glad i asked…. |
| 18:30 | brehaut | Jayunit100: condp is a bit more general than case, and cond is very general |
| 18:30 | Jayunit100 | brehaut: condp ---> okay cool. |
| 18:31 | pepijndevos__ | dnolen, of the domain, IFiniteDomain contains all sorts of things that only apply to ordered things. |
| 18:46 | muhoo | is 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:50 | technomancy | muhoo: it's actually Clojure that's compiling those, not leiningen |
| 18:51 | technomancy | there's nothing we can do to prevent them from getting compiled unfortunately |
| 18:54 | muhoo | np, thanks |
| 18:56 | pepijndevos_ | dnolen, do you have an email where I can write more elaborately about my thoughts? I only have your -lists address :P |
| 18:57 | dnolen | pepijndevos_: what's your twitter account? |
| 18:57 | pepijndevos_ | dnolen, pepijndevos |
| 18:58 | dnolen | pepijndevos_: DM'ed |
| 18:58 | pepijndevos_ | yay |
| 18:58 | pepijndevos_ | dnolen, I'll probably write you after having talked to oscar |
| 18:58 | dnolen | pepijndevos_: sounds good! looking forward to it. |
| 19:16 | vishesh | Is there a function that can filter a list until some condition is met? |
| 19:17 | amalloy | &(doc drop-while) |
| 19:17 | lazybot | ⇒ "([pred coll]); Returns a lazy sequence of the items in coll starting from the first item for which (pred item) returns logical false." |
| 19:18 | vishesh | thanks. That seems to be it. |
| 19:53 | seancorfield | quick 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:55 | amalloy | seancorfield: they are all sequential, in the order the agent got them |
| 19:56 | cgag | i thought multiple threads would process things sent to an agent |
| 19:56 | seancorfield | and 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:57 | seancorfield | amalloy: 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:58 | amalloy | sounds about right |
| 19:58 | technomancy | send-off uses an unbounded thread pool |
| 19:59 | seancorfield | technomancy: so that only matters if you have lots of agents? |
| 19:59 | gfredericks | seancorfield: 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:59 | technomancy | seancorfield: it matters if you want to control the number of active threads |
| 19:59 | seancorfield | gfredericks: right, that what i was assuming from the docs but i wanted to double-check |
| 20:00 | seancorfield | technomancy: suppose i have just one agent in my program... then send and send-off are the same, right? |
| 20:00 | technomancy | right |
| 20:00 | seancorfield | if i have 100 agents, it might matter (depending on the size of the thread pool for send)... |
| 20:00 | technomancy | well, assuming agents are the only thing using the thread pool |
| 20:01 | seancorfield | ah, gotcha... |
| 20:02 | seancorfield | so 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:03 | ohpauleez | seancorfield: Also, are you sure you really want agents? and not futures? |
| 20:13 | gfredericks | man when is core.logic going to be the top google hit for "core logic" |
| 20:14 | dnolen | gfredericks: what is it? |
| 20:14 | technomancy | whenever the maintainers of corelogic.com forget to renew their domain registration I would guess |
| 20:14 | gfredericks | $google core logic |
| 20:14 | lazybot | [CoreLogic - Information. Analytics. Insight.™] http://www.corelogic.com/ |
| 20:15 | dnolen | gfredericks: I mean is core.logic 2nd? |
| 20:15 | gfredericks | 2nd or third |
| 20:15 | gfredericks | looks 3rd to me |
| 20:15 | gfredericks | farvv.com is second |
| 20:16 | gfredericks | technomancy: you who surpassed Mister Versus the Ants ought to have more hope |
| 20:17 | technomancy | luckily Carl Stephenson never learned about godaddy |
| 20:17 | gfredericks | :) |
| 20:17 | gfredericks | technomancy: you've confused a whole pile of middle school teachers |
| 20:17 | fil512 | is there a shorthand for (((:a (:b (:c map))) ? |
| 20:17 | gfredericks | fil512: get-in or -> |
| 20:17 | technomancy | I'm still waiting for an awesome flame war to erupt on the wikipedia talk page |
| 20:18 | technomancy | fil512: not without matching parentheses =) |
| 20:18 | gfredericks | fil512: though -> only works with keywords |
| 20:22 | rlb | seancorfield: 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:22 | seancorfield | ohpauleez: i do not want futures for this |
| 20:22 | ohpauleez | ahh, ok. Always worth a reminder ;) |
| 20:22 | rlb | Of course, in reality, it wouldn't be that severe. |
| 20:22 | rlb | s/wouldn't/shouldn't/ |
| 20:23 | technomancy | ideally you'd just have a thread listening on an in-process queue |
| 20:23 | seancorfield | rlb: but if they're sequential, you'll tie up one thread and queued invocations just wouldn't be run, right? |
| 20:23 | technomancy | but you can abuse agents for it if it's not worth setting that up |
| 20:23 | amalloy | seancorfield: in his example, `a` doesn't always refer to the same agent |
| 20:24 | seancorfield | immutability :) |
| 20:24 | brainproxy | is 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:25 | weavejester | brainproxy: It applies the wrap-reload middleware in the ring-devel package |
| 20:25 | brainproxy | whoops, meant :auto-refresh? more specifically |
| 20:25 | brainproxy | weavejester: cool, thanks |
| 20:25 | weavejester | brainproxy: Oh, in which case, that applies the wrap-refresh middleware in the ring-refresh package |
| 20:26 | weavejester | brainproxy: https://github.com/weavejester/ring-refresh |
| 20:26 | brainproxy | weavejester: thanks :) |
| 20:26 | cemerick | seancorfield: mind if I bother you about java.jdbc? :-) |
| 20:27 | seancorfield | fire away |
| 20:27 | fil512 | how do I test a string for containing a substring? |
| 20:28 | fil512 | clojure.string substring? doesn't seem to exist any more... |
| 20:29 | cemerick | seancorfield: Why does java.jdbc's get-connection define its own URI convention, instead of just passing strings and URIs along to DriverManager directly? |
| 20:29 | emezeske_ | fil512: Juse use .indexOf, I think |
| 20:29 | emezeske_ | fil512: Just* |
| 20:30 | fil512 | hmm.. not boolian--kinda icky |
| 20:30 | fil512 | no builtin boolean? |
| 20:30 | cemerick | I'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:32 | seancorfield | cemerick: ask technomancy - i believe he added the string / URI functionality |
| 20:32 | technomancy | uh oh; what'd I break this time? |
| 20:32 | cemerick | ah, I should have done a blame ;-) |
| 20:33 | technomancy | I wasn't aware the underlying drivers support URIs; is that widely implemented? |
| 20:33 | cemerick | technomancy: java.jdbc's get-connection doesn't accept postgres-style connection strings |
| 20:33 | cemerick | or, not ones that include parameters (including login info) |
| 20:33 | technomancy | I have it working here; can you give an example? |
| 20:34 | seancorfield | postgresql://user:login@host:post/dbname ? |
| 20:35 | seancorfield | or something like that |
| 20:35 | kwertii | You can put all kinds of other params on there, too, with ?foo=bar&baz=asdf |
| 20:35 | cemerick | seancorfield: that produces "No suitable driver" when provided to DriverManager |
| 20:35 | cemerick | technomancy: 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:36 | technomancy | I thought I added support for both, but try postgres:// |
| 20:36 | seancorfield | in 0.2.2, the jdbc: prefix is stripped, before that it would have given an error |
| 20:36 | seancorfield | are you using 0.2.2 cemerick ? |
| 20:36 | cemerick | yup |
| 20:37 | cemerick | technomancy: a bare postgres:// URI gets through get-connection, but fails because it doesn't pick up the user, password, and ssl params |
| 20:37 | seancorfield | postgres should map to postgresql |
| 20:38 | cemerick | it's not a huge deal by any stretch, but I presume people will trip over this |
| 20:38 | technomancy | cemerick: try the format used by DATABASE_URL in heroku |
| 20:38 | cemerick | yes, sorry, been using postgresql:// |
| 20:38 | technomancy | postgres://username:password@host:port/db |
| 20:38 | seancorfield | otherwise subprotocol://user:password@host:post/stuff should "just work" as far as i can tell from the code... |
| 20:38 | technomancy | I've never seen the query-param format used before |
| 20:38 | seancorfield | :port not :post |
| 20:39 | cemerick | used with oracle as well IIRC |
| 20:39 | technomancy | cemerick: you're saying postgres.heroku.com gave you that style? |
| 20:39 | technomancy | delegating to the underlying driver sounds fine though as long as it's a superset of URI styles supported |
| 20:40 | cemerick | technomancy: yes; "JDBC URL" provides me with the param style. "URL" style does not include the ssl option |
| 20:40 | cemerick | (which heroku's pg requires) |
| 20:40 | seancorfield | as long as (.getPath uri) returns the piece with the query params you should be fine tho'... |
| 20:40 | technomancy | oh, yuk |
| 20:40 | xeqi | I ran into similiar jdbc/url issues once when trying to create an in-memory derby db |
| 20:41 | xeqi | re: custom syntax |
| 20:41 | seancorfield | feel free to open a ticket in JIRA and attach a patch (for parse-properties-uri, I assume?) |
| 20:42 | cemerick | sure, 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:42 | cemerick | WIll definitely include URI examples. |
| 20:43 | cemerick | seancorfield: BTW, I hope all's well of late. :-) |
| 20:46 | fil512 | what's a nice way to test (contains-substring "isgoofy" "goof") |
| 20:46 | fil512 | ? |
| 20:46 | fil512 | there used to be a clojure.string substring? |
| 20:46 | fil512 | but looks like that disappeared at 1.3 |
| 20:46 | fil512 | did it get replaced by something? |
| 20:47 | seancorfield | cemerick: it's been a bumpy couple of months for me in a number of ways... |
| 20:47 | rlb | does send-off still use a thread pool, or rather, does it re-use threads, or start a new thread each time? |
| 20:48 | seancorfield | according to the docs rlb send-off does not use a thread pool, just "a separate thread" ... |
| 20:49 | seancorfield | fil512: you can just call .substring on a string |
| 20:49 | ericthorsen1 | ''pmhgh-0p[]]'' |
| 20:49 | fil512 | like (.substring "foo" "o") |
| 20:49 | fil512 | ? |
| 20:50 | emezeske_ | &((fn [s sub] (not= (.indexOf s sub) -1)) "isgoofy" "goof") |
| 20:50 | lazybot | ⇒ true |
| 20:50 | emezeske_ | fil512: ^ |
| 20:50 | ericthorsen1 | sorry…about the noise…son hicgjacked the keyboard |
| 20:50 | rlb | seancorfield: 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:50 | rlb | |
| 20:50 | wmealing_ | ericthorsen, i was trying to decypher that too. |
| 20:51 | wmealing_ | was thinking it was a root pass for a moment. |
| 20:53 | fil512 | the indexOf approach is too messy. |
| 20:53 | fil512 | I like the .substring suggestion much better |
| 20:54 | fil512 | I just need to figure out the syntax |
| 20:54 | seancorfield | (.substring some-str start-index) or (.substring some-str start-index end-index) i think? |
| 20:54 | emezeske_ | fil512: I don't think that substring does what you want. |
| 20:55 | emezeske_ | seancorfield: He wants to test whether a string contains a substring |
| 20:55 | seancorfield | oh, clojure.string/substring was a different function? |
| 20:55 | fil512 | I found it |
| 20:56 | fil512 | (.contains some-str substr) |
| 20:56 | fil512 | that does what I want |
| 20:56 | fil512 | much nicer syntax than indexOf |
| 20:57 | seancorfield | i see clojure.contrib.string/substring? was a test, much like contains? |
| 20:57 | seancorfield | er, .contains ? |
| 20:57 | fil512 | I think clojure.contrib.string/substring? doesn't exist in 1.4 any more |
| 20:57 | fil512 | It looks like it got removed in 1.2 |
| 20:58 | fil512 | Well to clarify, I think it's called clojure.string now and clojure.string doesn't contain substring? any more |
| 20:58 | fil512 | But .contains works perfectly |
| 20:58 | seancorfield | a lot of old contrib went away in 1.3 |
| 20:58 | fil512 | (.contains some-str substr) does exactly what I'm looking for |
| 21:19 | dreish | ,(+ 1 #=(+ 2 3)) |
| 21:19 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.> |
| 21:20 | dreish | Foo. Was hoping someone had figured out a safe way to enable that. |
| 21:20 | duck1123 | Is there an easy way to turn the Set-Cookie from a ring response into a :cookies header for another request? |
| 21:21 | duck1123 | Up to this point, I haven't actually been using HTTP, so any cookie features from clj-http or kin won't help me |
| 21:23 | duck1123 | although, now that I mention it. clj-http might have what I need |
| 21:38 | gfredericks | dreish: it sounds like it ought to be possible |
| 21:47 | brainproxy | is 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:55 | xeqi | duck1123: https://github.com/xeqi/peridot or https://github.com/xeqi/kerodon do cookie-jar stuff |
| 21:55 | xeqi | if you want to stay in ring |
| 21:55 | brehaut | lein ring server, swank ? |
| 21:59 | brainproxy | brehaut: yes, just saw how I can chain with "," and also there is a `lein do ...` syntax for chaining that is under development apparently |
| 21:59 | brainproxy | however, the `swank` task doesn't get started as the `ring server` task blocks it |
| 22:00 | brainproxy | generally, 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:00 | technomancy | brainproxy: yes, there should be another higher-order task like `do` that does that |
| 22:01 | technomancy | but it would involve collapsing multiple eval-in-project calls into one |
| 22:01 | brainproxy | technomancy: but `do` isn't available in preview6, right? |
| 22:01 | technomancy | brainproxy: right; it was implemented last weekend |
| 22:02 | brainproxy | if I clone and build lein manually, and put the standalone jar thing in place manually, I should get the `do` thing? |
| 22:12 | technomancy | yeah but you can do chaining without `do` on preview6 |
| 22:12 | technomancy | with-profile just won't apply across the whole chain |
| 22:13 | technomancy | and it doesn't solve your problem of composing eval-in-project calls |
| 22:30 | muhoo | heh, 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:31 | brainproxy | technomancy: 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:32 | technomancy | brainproxy: yeah. perhaps trampoline could just be improved so it works with do |
| 22:32 | technomancy | that might be better than introducing a new task |
| 22:32 | technomancy | since trampoline is already all about calculating what's needed to run and then running it afterwards. |
| 22:33 | brainproxy | in 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:34 | technomancy | I usually write a -main function to launch jetty and run (def s (-main 5000)) as the first thing after swank launches |
| 22:36 | brainproxy | okay, 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:36 | brainproxy | *you're |
| 22:36 | technomancy | maybe; I haven't used lein-ring |
| 22:37 | technomancy | I'm not sure what it offers if you have a 5-line -main function to launch jetty |
| 22:38 | brainproxy | i can probably extract those options and wrap them up in my own -main, yes... was just exploring the various avenues |
| 22:39 | eggsby | I've been pretty pleased how simple it is to work with jetty/netty w/ clojure |
| 22:42 | brehaut | technomancy: 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:58 | technomancy | brehaut: it's 7 lines for full compojure+session-secret: http://p.hagelb.org/7-line-main.html |
| 22:59 | technomancy | for this one I've been working on today |
| 22:59 | brehaut | technomancy: thanks |
| 22:59 | technomancy | np |
| 23:01 | brehaut | technomancy: system/getenv is nice and in hindsight and obvious thing to do. |
| 23:02 | amalloy | technomancy: 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:03 | xeqi | I like enviorn for env stuff as well |
| 23:03 | Raynes | amalloy: Hahaha |
| 23:03 | xeqi | *environ |
| 23:03 | technomancy | heh; nice |
| 23:03 | technomancy | sneak peak: http://p.hagelb.org/deps-verify.html |
| 23:04 | amalloy | wait, are we making sneak peak jokes on purpose today? |
| 23:04 | amalloy | ah good |
| 23:06 | technomancy | xeqi: yeah I need to check that out |
| 23:35 | technomancy | any 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:42 | alex_baranosky | any favorite ways to compare large nested maps ? |
| 23:44 | xumingmingv | alex_baranosky, directly use '='? |
| 23:45 | alex_baranosky | what? |
| 23:45 | clojurebot | what is 2d6 |
| 23:48 | alandipert | alex_baranosky: like clojure.data/diff? |
| 23:50 | alex_baranosky | I'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:51 | duck1123 | over ssh? |