#clojure logs

2012-07-27

00:04muhooheh, hello world applet in seesaw is 8mb
00:06FrozenlockWith a little chance your app will be below 10 mo :P
00:06dnolenmuhoo: in an era when 16gb of RAM and 1TB of HD, and web browsers that consume 1/2 GB of RAM is the norm it truly baffles me that anybody cares anymore.
00:07muhooi'm thinking about the download time
00:08muhoonot everyone has 100mb fiber to the home
00:08muhoo(or their phone)
00:09dnolenmuhoo: so write it in ClojureScript ~40k gzipped ;)
00:09muhoothat makes a lot more sense, yes :-)
00:09muhooplus, it'll run on phones, which seesaw likely won't
00:10amalloybut muhoo, google will be giving everyone free 1gb/s internet speeds Real Soon Now!
00:10FrozenlockI thought the 5mb was the free one
00:11amalloyi dunno, maybe it is. their webpage is mostly flowers and pretty lights
00:12FrozenlockEh. I watched the entire hour google-fiber "infopub" today. Guess I didn't want to get things done.
00:13FrozenlockOh neat, I found how to get the collection size: (server-eval "db.DBNAME.validate().datasize")
00:14technomancyleiningen is still under 10mb
00:14technomancyjust barely =)
00:14Frozenlocktechnomancy: And we love you for that :)
00:14technomancyhehe
00:17muhootechnomancy: how is nrepl.el coming along?
00:18technomancymuhoo: it's great! the latest release landed a bunch of features, and we're hoping to make a wider announcement next week after we've had a bit more time to find bugs and stabilise it
00:19FrozenlockYay (server-eval "db.DBNAME.stats()") is even faster. (I'm leaving this for the logging, if anyone is wondering to whom I'm talking)
00:19Frozenlocknrepl.el? As in elisp?
00:19muhootechnomancy: thanks very much for making that happen.
00:19technomancyFrozenlock: yup!
00:19FrozenlockO_o
00:20Raynesmuhoo: FWIW, I don't use SLIME anymore.
00:20Raynesmuhoo: Go use it.
00:21FrozenlockIs it a replacement for slime and swank?
00:21RaynesYes.
00:21muhooRaynes: i'm itching to
00:21Raynesmuhoo: Well, scratch. It isn't perfect yet, but it's usable.
00:21RaynesAnd fun.
00:22Raynes<3
00:22semperosvery cool
00:22RaynesFeels good to be working with Clojure through a single clean .el file instead of through some weird crufty protocol and 4 million lines of elisp.
00:23technomancythe main things that are missing are eldoc support, tracing, and the inspector
00:23technomancybut it's way more hackable than swank
00:23RaynesNone of which I use.
00:23Raynes:D
00:23RaynesI don't even know what eldoc is!
00:23RaynesIt's greart.
00:23Raynesgreat*
00:24muhoohow do you hook nrepl.el into an existing running lein project?
00:24Frozenlock(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
00:24Frozenlock(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode)
00:24Frozenlock(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode)
00:24Frozenlock(setq eldoc-idle-delay 0.01)
00:24Frozenlock
00:24Frozenlock.emacs porn :)
00:24Raynesmuhoo: You mean an existing nrepl server?
00:24technomancyRaynes: eldoc is what shows you arglists in the minibuffer. its lack is probably my biggest annoyance right now.
00:25muhooRaynes: yes
00:25Raynestechnomancy: Okay, so I do sometimes use that, but very rarely.
00:26Raynestechnomancy: Looks like M-x nrepl
00:27RaynesEr, muhoo
00:27muhoook, it just hits localhost at whatever the nrepl port is i guess then
00:28Raynestechnomancy: Why doesn't it take a host too?
00:28technomancyRaynes: dunno, sounds like an oversight
00:29Raynestechnomancy: Also, a way to cleanly close a connection might be nice. If I close the *nrepl-server* buffer I get a trace.
00:29technomancythere's an open issue for that
00:29RaynesIt works, but not cleanly.
00:29technomancyyep
00:29RaynesCool.
00:29technomancyhttps://github.com/kingtim/nrepl.el/issues/33
00:29RaynesYou rock.
00:29muhoooic, nrepl-connect takes host and port
00:29muhooit's one page of elisp, nice
00:29Raynesmuhoo: Yeah, but it isn't interactive.
00:30muhoowell, 1200 lines of elisp, but still, one file
00:30technomancyI wonder if the bencode stuff should be in its own library?
00:30technomancyprobably at some point
00:31muhoo(interactive "nPort: ") maybe could take host too
00:31semperosdnolen: I've been tinkering with implementing unification for my custom defrecord, and I'm probably not doing it correctly, but I don't see how (run* [q] (== q my-record)) gets affected by my implementation of IUnifyTerms, since it dispatches on the LVar
00:32semperosand since that dispatch uses some sort of identity-like fn for solving the unification, I'm confused that it doesn't return (identity my-record)
00:33muhootechnomancy: haha, it loaded on emacs22. i have to try this out and see if it works
00:33technomancywhoa; on 22?
00:33technomancyI was kind of surprised it worked on 23
00:33muhooya
00:34dnolensemperos: (== q my-record) is handled for you.
00:34muhoohow do i start an nrepl server?
00:34dnolensemperos: same for (== my-record q)
00:34technomancymuhoo: M-x nrepl-jack-in should do the trick
00:34dnolensemperos: you only need to the handle the cases where q is bound to something else.
00:34muhoochrist, it works!
00:34dnolensemperos: I mean that those two cases are handle if q is fresh.
00:35muhootechnomancy: you can put "tested on emacs22" in the readme :-)
00:35semperosdnolen: right, but why is q finally bound to a PersistentArrayMap, and not my Element record type proper?
00:35semperosI'm missing something obvious, I feel
00:36dnolensemperos: PersistentArrayMap is IPersistentMap, so you should be able to handle that by implementing unify-with-map for your record.
00:37dnolensemperos: as I said before, this *may not* work given how protocols are implemented.
00:37semperosdnolen: thanks for patiently repeating things til they sink in for me :)
00:37dnolensemperos: also in general there's no such thing as saying which term type takes precedence.
00:37semperosok
00:38dnolensemperos: I believe at the moment there a latent guarantee that in (== u v), the type of u supersedes v
00:39dnolensemperos: needs thought as to whether that should be a real contract.
00:45dnolensemperos: if you want to guarantee a behavior you could define IUnifyWithPersistentArrayMap
00:46dnolensemperos: and then you could ensure that unification w/ your record always results in your record.
00:46dnolensemperos: though this again assumes that concrete types take precendence over interfaces ... not sure about that.
00:47dnolenwhen using extend-type I mean.
00:47semperosright
00:48semperosI'll give that a stab, too
00:49brehautre:special editions
00:49brehauthttp://forum.rpg.net/showthread.php?638384-Cthulhu-my-French-special-edition-of-Masks-just-arrived-(pics!)
00:49brehautbah wrong window sorry
00:54dnolensemperos: I think I had looked at this in the past - I believe concrete types always take precedence over interfaces.
00:54dnolensemperos: so it should work I think.
00:55semperoscool
00:56semperosI'll give it a try, though the combo of learning as I go has made it slow-going
01:01dnolensemperos: heh, I bet. would be helpful if you document your exploration somehow, otherwise I have no idea how to improve the situation.
01:02semperosdnolen: sure thing, I plan to put together some blog posts once webdriver-logic reaches some critical API mass and I've spent more time in core.logic's implementation
01:08dnolensemperos: I mostly mean keep me posted. Not many people have ventured into extending core.logic.
01:08semperosdnolen: can do
01:11dnolensemperos: yeah looking at the source, seems like concrete types always win over interfaces.
01:11semperossweet
01:11dnolensemperos: if it doesn't work then I have some thinking to do.
01:11semperosthanks for checking
01:30sridattahey all. new to clojure and just got started with Noir. one thing that surprises me is that HTML templating in clojure is done in clojure code. isn't this generally a bad practice (mixing presentation with business logic)?
01:31semperossridatta: there are a few ways to approach templating with Clojure, Hiccup and Enlive representing two distinct approaches
01:32semperosHiccup uses Clojure data structures, which doesn't prevent you from keeping your Clojure-as-template-code limited to presentation, it just gives you a very powerful language to template with
01:33semperosEnlive lets you write plain HTML and then use a CSS-like query language to insert values into that HTML when you build your page
01:34sridattainteresting. are both equally idiomatic/supported among the community?
01:35muhoosridatta: there's slso mustache
01:35semperossridatta: I'd say so
01:36semperosfolks here like coding Clojure (go figure), so Hiccup might get used more often for examples in blog posts
01:36semperosbut if you have a team with separate designers/front-end folk who don't want to see Clojure code, Enlive is probably a better option
01:37semperosEnlive is good both for parsing and generating, whereas Hiccup is specifically for generating HTML
01:37sridattaawesome. I'll try out both of them and see which I like more
01:38sridattaalso is Noir the de facto higher-level web library for Ring?
01:38semperoswouldn't say de facto, though Chris Granger has put together a nice collection of web libraries
01:38semperosCompojure has been around a lot longer, so it's used often
01:38semperosthere are also low-level ones, like Mustache
01:38muhooRaynes: technomancy: thanks, now using nrepl.el in emacs22, with "lein2 trampoline repl :headless" to start the projects and "M-x nrepl RET portnum" to connect. works!
01:39semperossridatta: I'd suggest, before you write too much code in Noir, to at least build a small dummy app using a lower-level library, so you really understand what Ring is doing "under the hood"
01:40semperosNoir holds onto a lot of "hidden state" for you and provides a nice set of conventions, but you'll find that Clojure web dev is more about composing small, functional libraries than taking on the monolithic convention-based framework approach
01:40muhoonoir is pretty lightweight compared to, for example, rails.
01:40semperosit'll make writing your own middleware and extensions to Noir's base functionality *much* easier
01:41sridattacool I'll dig in and see. from what I see, it's at the level of Express for node.js or Sinatra for ruby
01:41semperosintentionally so
01:46babysnakeshi, I've been reading great things about "the joy of clojure" book, but since it's written for clojure 1.2 I'm wondering if it's still that useful for clojure 1.4 (I already read "programming clojure")?
01:48semperosbabysnakes: absolutely worth reading, it's a lot more than a "how to" book
01:48semperosnot that Programming Clojure is just that either, but TJoC has a lot of value regardless of Clojure version
01:48babysnakessemperos: thx
01:58muhoohow do i get a lein2 plugin to be available on the classpath of the project?
01:59muhooin lein1, it was by default. in lein2, i can get the plugin to load via ~/.lein/profile.clj :plugins [], but the plugins aren't in the classpath in the project's repl, rendering them pretty useless (they're repl tools)
02:17emezeskemuhoo: I believe that the idea of a Leiningen plugin is that it only runs as part of Leiningen, so the host project's classpath is never polluted with it
02:18emezeskemuhoo: If the host project uses it, it's not a plugin (by that definition)
02:18emezeskemuhoo: I would guess that you need to add it to just :dependencies, but probably only in the :dev profile
02:19emezeskemuhoo: I'm not technomancy, though, so don't take my word for it :)
02:20amalloyindeed, that doesn't sound much like a plugin; it's just a library
02:20harjaThis is a dumb question and I know perhaps I could find the answer myself but given that I have a Leiningen project that I've coded stuff to src/project_name/core.clj how do I import it to lein repl? I've basically did everything inside vimclojure now
02:21harjaon vimclojure I can just (use 'myproject.core)
02:21amalloyyou can probably add it conditionally as a dependency only when in the dev profile, to get the effect of the old dev-dependencies; but Raynes or technomancy would know more specifics than i do
02:24harjanever mind, I found an error, works now.
02:39muhooemezeske: yep, thanks, it is indeed just a library, and {:dev {:dependencies seems to do it!
02:46sayyestolifeLets say I have a function which takes 3 parameters, and I have a vector, [3 4 5], can I somehow destruct/construct that vector so that I can pass it to my function? (Without modifying the function)
02:46emezeskemuhoo: great!
02:49sayyestolifenevermind, got it
02:49sayyestolifeapply will do the trick :)
02:52mritzJust about to start learning clojure. I have a 24/hour webcam on me if any of you guys want to watch
02:54scottjmritz: haha, twitch.tv?
02:55mritzscottj: hehe I'm kidding, but the joke was based on that website
02:55scottjmritz: I don't know if you could actually get people to watch it, but if you were famous or something and could then they could spot mistakes and tell you in the chat
02:58muhootechnomancy: fyi, it's not perfect in emacs22. this nrepl network capture trace: https://www.refheap.com/paste/3826 yeilds this backtrace in emacs: https://www.refheap.com/paste/3825 . still, pretty cool it got that far.
02:58mritzscottj: Yeah, I suppose something more like a live HOWTO could work.
02:58mritzfor live interaction
03:00scottjmritz: well if notch or pg or whoever were learning say js they could probably get 1000+ viewers to comment on their every move (or at least on their music)
03:12kralnamaste
03:16burthello
03:18burtI need a bit of help: I have '(["fresh" :hello :world] ["" :foo :bar] ["" :bar :baz] ["cool" :qux :qex] ["" :etc :etc])
03:18burtI would like to make the most recent first element in the vector propagate
03:19burtso it becomes '(["fresh" :hello :world] ["fresh" :foo bar] ["fresh" :bar :baz] ["cool" :qux qex] ["cool :etc :etc])
03:19burta friend told me to use reductions but i cant figure out how
03:25_tca_burt: are you familiar with how reduce works?
03:25burt_tca_: im a newb, only a little bit
03:25burtits a fold right, yeah?
03:25burtim just having trouble with the function and whether i need init or now
03:26burtive tried a bunch of permutations but im getting a bit frustrated
03:27toxmeisterburt: ,(first (reduce (fn[[acc pa] [a b c]] (let[a (if (empty? a) pa a)] [(conj acc [a b c]) a])) [] [["fresh" :hello :world] ["" :foo :bar] ["" :bar :baz] ["cool" :qux :qex] ["" :etc :etc]]))
03:30burttoxmeister: studying
03:30toxmeisterburt: the key is to keep a record of the last valid "a" around for future reference (as part of the reduce accumulator)
03:30burttoxmeister: what happens to c?
03:31amalloyburt: why do "fresh" and "cool" 'propagate', but not ""?
03:31burtamalloy: because "" is supposed to be the most recent non-empty string value
03:32amalloyreductions does sound like the right answer
03:32burtamalloy: what is the vectors im "updating" are of variable length?
03:32burtif*
03:32amalloydoesn't matter
03:33burtthanks toxmeister & amalloy
03:34amalloyso https://gist.github.com/3186665
03:35burtamalloy: great name
03:35burtamalloy: thank you
03:36burtamalloy: errr -- where is carry-over defined?
03:37amalloyoh, i left out the defn form
03:37amalloyupdated
03:37burtthanks amalloy
03:37amalloy(i'll tell my parents you like my name)
03:37burtha ha
04:59benedikttechnomancy: that sounds sensible. i might have an older version. What is the emacs-package called?
05:04benedikttechnomancy: looks like it is installed with leiningen
06:54Raynesmuhoo: Pretty sure you win the award for longest paste ever: https://www.refheap.com/paste/3826
08:26ambrosebsHow can I get lein-tarsier (aka. lein vimclojure) to not fetch it's own Clojure dep? I'm trying to run my own Compiler dep.
08:26ambrosebsI'm using lein 1.7.1
08:31clgvambrosebs: there is an :exclusions option you can specify for each dependency
08:32ambrosebsclgv: I'm installing it like so: lein plugin install lein-tarsier 0.9.3
08:32ambrosebsWhere do I put the :exclusions?
08:32clgvoh right, damn.
08:33ambrosebsclgv: I did try and make a :dev-dep ... didn't run.
08:33clgvambrosebs: should though. but you have to be in the project directory
08:33ambrosebsclgv: It blew up on a nrepl dep
08:34ambrosebsMaybe I need to add an extra dep myself..?
08:35clgvI dont know
08:35ambrosebsI worked around it by deleting the jar after running lein deps.
08:35ambrosebsSeems to work.
08:39XPheriorHey cemerick. Was taking a peak at Friend and had a few question. Are you around?
08:39XPheriorPeek, rather.
09:09cshell_,(macroexpand (defmacro f [name & args] `(defn ~name [& ~args])))
09:09clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
09:11clgv cshell_: you have to quote the expression you want to expand. and you cannot `def` in clojurebot's sandbox
09:12cshell_If I call that macro above, with name and no additional args, it expands to (defn name [& nil]) - could someone please tell me how to make those args not expand to nul if I'm creating a call to another function with my macro?
09:12cshell_clgv: ah okay, sorry
09:12cshell_I want it to expand to (defn name []) - I'm sure it's something simple that I'm missing
09:13clgvcshell_: give a complete example: macro call and expansion
09:14cshell_k, one sec
09:14cshell_(defmacro f [name & args] `(defn ~name [& ~args]))
09:15cshell_(macroexpand '(f my-fun))
09:15cshell_(def my-fun (clojure.core/fn ([& nil])))
09:16gfrederickscshell_: use ~@args instead of ~args
09:16cshell_awesome, that worked, thanks gfredericks
09:17mdeboardyou're welcome
09:17mdeboardmy friend
09:17gfrederickscshell_: check that it does what you want for (f a b c d)
09:17gfredericksthe example makes me suspicious that there's a deeper problem
09:18cshell_okay, onsec
09:21cshell_(macroexpand '(f my-func a b c d))
09:21cshell_(def my-func (clojure.core/fn ([a b c d])))
09:21cshell_is it odd to have the '(' around the arguments?
09:25clgvcshell_: yes
09:26clgvcshell_: try that one (defmacro f [name & args] `(defn ~name ~(vec args)))
09:28cshell_appears to do something similar
09:28cshell_(macroexpand '(f my-func))
09:28cshell_(def my-func (clojure.core/fn ([])))
09:29clgvcshell_: try macroexpand-1
09:29cshell_(clojure.core/defn my-func [a b c d])
09:29cshell_so the defn must be expanding it that way?
09:30clgvcshell_: I misread your previous post. defn expands to (def bla (fn ([a] ...) ([a b].. )))
09:30cshell_(clojure.core/defn my-func []) - with no args
09:30cshell_ah cool
09:30cshell_thanks clgv :)
09:30clgvcshell_: but what do you want to do?
09:32cshell_I just wanted to be able to have optional args passed in - the ~@args seemed to ensure that the nil didn't appear
09:32cshell_that was pretty much my main problem, in hindsight - the parens in the defn expansion was a curiosity
09:33clgvcshell_: you want functions with optional args and default values?
09:34clgvcshell_: if so, you can have a look at the clojure.options library (version 0.2.0)
09:35cshell_I'm using enlive and trying to make a macro that will call deftemplate with some common transforms: http://pastebin.com/Gf0jbxjK
09:36cshell_I made the defn macro as an example to make the question less complex
09:36cshell_I'll check out the options lib too :)
09:37clgvI don't know enlive, but might there be a macro/defn that does something like common-pages already?
09:39cshell_You can do snippets and such which help you with common pieces of html that you want to inject in - they also have templates, but what I found was that I was repeating those lines of code in that pastebin for every call to deftemplate
09:40cshell_I've never written a macro before, but it seemed to be a good fit because there was a lot of boilerplage
09:40cshell_er, plate
09:41clgvcshell_: humm, in my opinion there should be a way to specify these transformations though a function
09:42cshell_So a function for each of the transformations? and then compose them together?
09:44clgvcshell_: that would be idiomatic. but with deftemplate alon that seems not possible
09:45cshell_because deftemplate is a macro?
09:45cshell_and the way it treats the transformation forms?
09:45clgvthe second I think
09:46cshell_yeah, that's what I've been struggling with - I have been thinking about a better way for a while but nothing has worked
09:48clgvcshell_: you can look at the source and build something that works
09:48clgvcshell_: maybe thats a sign to use a different templating lib? I don't know if there is a better one
09:51cshell_Yeah, I have an odd requirement to support in that I need the templates files (html) to be almost a snapshot of what the page should look like (so the web designers can work with them) and then I come in and make some parts dynamic
09:52cshell_They don't understand templating, they only understand html and css
09:54cshell_clgv: thanks for your help!
10:22solussdnaming convention advice request: I have a namespaces called blah.auth.helpers, blah.auth.roles, etc… and I want a base "auth" namespace. I would usually call it blah.auth.core, but I'm considering blah.auth (which would mean there would be both an auth/ directory and an auth.clj in the blah directory of my project). Does anyone have a preference?
10:26elliottwsolussd this isn't from clojure at all, but I've always like to keep my directories either full of files or full of directories… always seemed cleaner to me. fwiw
10:26duck1123I would choose blah.core over blah, but blah.auth and blah.auth.* is fine
10:26duck1123that's how I do it, at least
10:27solussdduck1123: that's where I was leaning… I think core makes sense for the base of a project, but feels wrong in other namespaces…
10:28solussdcemerick/friend follows that convention too.
10:28solussdthanks guys
10:28elliottwsolussd i also like core, because it implies others in it's name. if i just saw blah.auth i wouldn't get to assume that there was .helpers and .roles
10:28solussdhmm.
10:29cemerickXPherior: shoot
10:29llasramMy understanding is that the `blah.core` convention is purely an artifact of how the Clojure compiler generates classes which use their namespace as a prefix, not a package. So single-component namespaces result in classes in the root package, which Make Java Unhappy Sometimes (tm)
10:29duck1123it seems highly dependant on what the namespaces actually do
10:30solussdyeah, i'm more concerned with 'further down' the namespace hierarchy, e.g. blah.auth.core vs. blah.auth
10:30duck1123llasram: but it's such a convention now, that is seems wrong to see it otherwise, even in cljs where it's not an issue
10:31llasramduck1123: Hmm, that is a good point
10:32duck1123I would possibly use core if blah.auth was a library and there is a single namespace that should be all you need
10:33gtrakis there a way to attach an eclipse debugger to a swank session?
10:34solussdduck1123: auth isnt a library in this case- just authentication/authorization stuff for the app
10:34solussdthat makes sense as the litmus test though
10:39gtraknevermind, I figured it out, swank shows a dt_socket when it starts and I can connect to that
10:43Bronsahi, is it normal that use-ing aleph.tcp takes 7seconds?
10:44stuartsierrayse
10:44stuartsierra*yes
10:44Bronsaok
10:45Bronsathanks
10:53stuartsierrasolussd: for the record, I never liked 'core' names because I thought it was needless mimicry of the Clojure language, which only adopted the '.core' name when it became clear that single-part namespaces were a problem for Java interop.
10:53pjstadig(inc stuartsierra)
10:53lazybot⇒ 2
10:54solussdstuartsierra: what should someone do for things that live at the top of their namespace? blah.blah?
10:54solussdi've seen that a lot
10:54stuartsierrasolussd: 'your-group-id-or-name.blah'
10:55llasramOOC, why doesn't Clojure just use the namespace as the package name?
10:55solussdah, like cemerick.friend. :)
10:55stuartsierrallasram: it used to
10:56llasramstuartsierra: It caused problems?
10:56stuartsierraBut you still need to generate a class for the static initializer code
10:56goodieboyis there a way to test java interop? like... mock java methods via midje etc.? I'm guessing no?
10:56solussdmaybe the default behavior of leiningen's (lein new) needs to change then since it's probably most responsible for the continuation of *.core namespaces
10:56stuartsierrasolussd: I'd like that
10:57llasramstuartsierra: Ah. And someone / rhickey decided using the terminal namespace token as the class for the initializer code was better than reserving some name like `__clojure_init`?
10:58cemerickThe .core convention in lein new is there because there's no clearly better approach. Single-segment namespaces shouldn't be encouraged, and so `lein new` would have to autogenerate a "groupId" segment.
10:58pjstadigtechnomancy had talked about detecting a multi-segment name and not auto-appending the ".core"
10:58cemerickI remember $USER being suggested, but no one liked that much.
10:59pjstadigcemerick: lein new can get a groupId segment
10:59pjstadiglein new foo/bar the groupId is foo
10:59cemericksure, but what % of users will ever do that?
11:00pjstadigthe % that know its there and why
11:00cemerickWell, that % probably won't use lein new anyways, for other reasons.
11:00cemericks/won't/don't
11:02cemerickA `lein new` that interrogates the user for a groupId would work.
11:02cemerickI'm sure there's lots of other options that could usefully be exposed that way.
11:06achengemacs question: if my cursor is somewhere in the middle of a defn, is there a command or a keyboard chord for evaluating the defun?
11:07craigbroC-M-x
11:07achengooh thanks!
11:07duck1123bear in mind that evaling just 1 fn will screw up it's line numbers
11:07craigbroyou know, I just look thru the SLIME menu
11:08craigbroit lists most of the operationgs
11:08craigbroopertaions
11:08craigbroalso F1-m
11:08craigbrowill list the mode docs and that includes keybindings
11:08duck1123C-h m is gread for seeing bindings for the current modes
11:08duck1123great
11:22locojay1hi is there something like ipython notebook in clojure . web repl where i can add markdown , code , plots (incanter). then save the thing and open later. great for tutorial
11:26locojay1i guess lightable would do this once released
11:27georgeklocojay1, this is the closest I know of, http://vimeo.com/44968627, but still a POC as far as I know
11:27georgekhe's working on it though and it looks very promising
11:27georgekas he used to work on mathematica, very close to what you're asking about
11:28georgekhttps://github.com/kovasb/session
11:28georgekdon't think that repo represents the latest work though
11:29locojay1thanks missed that meetup
11:33goodieboyweavejester: hey, trying our your nifty rotary lib, thanks! I was wondering, how can i get a count of all docs in a table?
11:49weavejestergoodieboy: I don't think there's code for that yet in Rotary. The library isn't complete yet. I think there is a pull request for it, but the author didn't reply to my comments. I may send a message to him to see if he's interested making the changes.
11:49goodieboyweavejester: ahh ok, np. Thanks!
11:51weavejestergoodieboy: Wait, sorry, the pull request I was thinking of has already been merged.
11:51weavejestergoodieboy: The query function has a :count option key
11:52goodieboyweavejester: ahh ok! I'll have a look.
11:52weavejestergoodieboy: Although there isn't an equivalent to `scan`… we might need a patch for that.
11:53craigbroweavejester: so I hope that email patch for clout.core/path-decode worked out ok, how do you prefer such things? git pull requests?
11:53goodieboyweavejester: gotcha, yeah scan is what i'm looking for. i'll have a look at the code
11:54weavejestercraigbro: I think that slipped through my inbox, I'm afraid. Let me look it over now.
11:58weavejestercraigbro: A pull request would be best, though I think I might create a codec library for path-decode, since it's used in other places.
11:58weavejestercraigbro: Maybe I'll create a ring/ring-codec library.
11:58weavejesterOr maybe web-codecs
12:00craigbroweavejester: seems a reasonable approach
12:01goodieboy,(+ 123456789.0 0.1)
12:01clojurebot1.234567891E8
12:01weavejestercraigbro: I didn't know about the quoteReplacement method - thanks for pointing that out
12:02craigbroweavejester: it bloweded up my app 8)
12:02weavejestercraigbro: Ring had a similar problem, which I fixed but without quoteReplacement. I forgot to do the same to Clout, though.
12:06cemerickI've been thoroughly flummoxed by core.unify. To wit: https://www.refheap.com/paste/3829
12:06cemerickHelp?
12:07cemerick(I expected the second unification to return nil or something.
12:09oskarthwhat is the best clojure eqv to http://play.golang.org/? ie online repl with multilines integrated simple pastebin
12:10technomancypjstadig: there was some gripeage about whether dropping the .core suffix would cause issues for osgi or something
12:11technomancyat which point I lost interest... but I'd be up for revisiting it
12:12technomancyas long as it doesn't involve someone explaining what OSGi is to me in words that don't communicate any substantial meaning to my mind and me nodding blankly
12:14technomancyoskarth: cljbin.com does evaluation
12:17oskarthtechnomancy: thanks!
12:22cemerickwell, that's what I get for straying from core.logic. :-) https://www.refheap.com/paste/3829
12:27dnolencemerick: I think there are still a couple of subtle bugs in the friendly unifier, bug reports welcome.
12:29hiredmancemerick: the examples show a function called `unifier` rahter than `unify`
12:29mdeboardAnyone here have any experience using iText in Clojure? I'm wondering whether I'm just not smart enough to do this or if iText just has a very poor API.
12:30cemerickhiredman: right; unify/unifier is the equivalent of logic/unify; unify/unify is supposed to be the equivalent of logic/binding-map (or, is, except when unification can't succeed, in which case it tosses an exception. :-|
12:31cemerickdnolen: Noted. I'll be throwing a couple 100K iterations of data from test.generative at it, so we'll see what pops up. :-)
12:36dnolencemerick: heh cool. I'm curious to see how well cKanren can be leveraged for automatic test generation.
12:50lynaghk`dnolen: I watched your NYC Clojure meetup talk yesterday. Nice job---I'm really interested to see if I can use core.logic for some positioning/layout stuff that I'm working on now.
12:51eggsbylynaghk`: it was so sad the way it cut off
12:51lynaghk`eggsby: I know! I was on the edge of my seat about that question =P
12:54zerokarmaleftwent digging for those links...tom hickey's avatar always cracks me up
12:56dnolenlynaghk`: it's probably possible. I have yet to do any serious profiling / optimization work tho.
12:56dnolenlynaghk`: it just depends on how many constraints and what is fast enough for your problem
12:57lynaghk`dnolen: I'm more interested in expressiveness over performance at this point; most of the layout will be for static concerns like margins, &c.
12:58lynaghk`dnolen: not sure exactly what I need at the moment; I'm working on the semantics of a data visualization grammar and won't need to tackle rendering for a while.
12:59dnolenlynaghk`: yes then it would probably work for that. That said it doesn't seem slow. Solving dinesman and the stones problem takes like 3 / 4ms
12:59lynaghk`dnolen: yeah, that's nuts. I just need to grok a bit more so I can express layout in terms of finite domains
13:05dnolenlynaghk`: for doing layout stuff you should probably wait for the equation sugar, it pretty tedious at the moment to do anything even moderately complex.
13:06lynaghk`dnolen: equation sugar looking something like the ClojureScript API I slapped onto Cassowary?
13:06lynaghk`(constrain! (== (+ 10 (right A)) (left B)))
13:07dnolenlynaghk`: I haven't looked closely at that, but is it a macro that expands expressions out into primitive constraint ops?
13:08lynaghk`no macro; excludes clojure core arithmetic and replaces with multimethod that builds primitive constraints
13:08lynaghk`but yeah, basically the same thing I suspect.
13:08dnolenlynaghk`: yeah, same idea but this will be a macro.
13:14mritzI've converted a few of my most CPU intensive code to Clojure (from Python). I've had some pretty impressive gains with out trying hard or knowing much about JVM/Clojure. Is this typical?
13:14craigbrojvm vs python runtime?
13:14mritzyes
13:14craigbrojvm usually wins in my experience
13:15mritzIn the area where I am serializing ~1 MB protobuff objects… Clojure is going at about 100x.
13:18dnolenmritz: regardless of the uninformed opinions you may find on the InterWebs - Clojure is not slow ;)
13:18burtmritz: that's a lot. :)
13:18burtdnolen: do people really say that?
13:18dnolenburt: you see lots of horrendously written benchmarks and judgements yes.
13:19burtwritten no doubt by ruby programmers
13:19burt;)
13:19mritzruby programmers can write?
13:19mritzboom
13:20burti kid the ruby guys, but when someone is using a language that has a community mantra about not needing to be fast, and then starts to care about performance, it's a little unsettling
13:22solussdcould anyone tell me why this code isn't creating symbols as expected (e.g. group-mime-type should resovle to :my.name.space/group): https://www.refheap.com/paste/e7bfe3f0d81cb6ab53fd50425
13:24llasramsolussd: (a) The macro is just repeatedly receiving the symbol `type-name` as its parameter
13:24hiredmansolussd: macros don't work like that
13:24hiredman,(doc ns-name)
13:24clojurebot"([ns]); Returns the name of the namespace, a symbol."
13:24solussdllasram: oh geez. ok thanks
13:24solussdim not operating on much sleep today. :D
13:25llasramsolussd: (b) not the immediate problem, but a separate bug: the reader metadata is applied at read-time, so you're annotating a random intermediate from with {:const true}, not the final symbol. You need to ensure that the symbol you generate in the macro has itself the metadata you want
13:25llasrams,from,form,
13:26solussdah, that explains the expansion missing it
13:27llasramhiredman: Oh, nice. I've wondered why namespaces aren't Named, but that at least is a nicer way of going from namespace -> symbol
13:27hiredmanATR Named implies a string name, but the name of a namespace is a symbol
13:27hiredmanAtR?
13:28llasramHmm. That makes sense
13:28hiredmanI think AtR is better
13:34alexyakushevHello everyone, a question on macros here. Suppose I want a macro with variable number of arguments, which method is correct? https://www.refheap.com/paste/3834
13:37llasramalexyakushev: Both?
13:37joegalloalexyakushev: i think a common approach is to use [& args] and then just solve it as a single arity
13:38joegallounless a and b are totally distinct things, then you might see [a & [b]] or something clever like that.
13:38alexyakushevjoegallo: Thank you, I will try to do it this way
13:40joegallothat said, searching for "(defmacro" in core, i generally see: [& forms], [blah & forms], or multi-arity. of course, you shouldn't necessarily write your code like clojure/core.clj, but it's a small hint at what is out there.
13:40joegallofor instance, if-not is pretty concisely written as two separate arities.
13:42lynaghk`cemerick: I've got a friend question for you.
13:42cemerickshoot
13:43lynaghk`cemerick: is there a nice way to perform some work and stick it in the session when a user first authenticates? I can put it in the credential map, but then I have to do quite a bit of digging to get it out agin
13:44lynaghk`cemerick: and it seems like nosing into the implementation details: (get-in request [session identity current])
13:46cemericklynaghk`: what is the data in question?
13:46lynaghk`cemerick: to give you a bit of context, I'm basically using a 3rd-party service to authenticate users. They have a Java API, and it returns an object that you can then query to get more info (the user's files, &c.)
13:47cemerickThat seems like exactly the sort of thing that should be in current identity.
13:47lynaghk`cemerick: wait, is there some kind of (get-identity) fn I can call that will return the map?
13:47cemericksure
13:47lynaghk`rather than me having to dig through the session manually
13:48cemerick(friend/identity req) gives you a map of all identities associated with the current session
13:48cemerick(-> req friend/identity friend/current-authentication) gives you the current one.
13:48cemericks/one/identity
13:48lynaghk`ah, yeah. That's basically exactly what I've been doing except I did it manually. Thanks!
13:49cemerickOr, you can just call (current-authentication) if you're safely on the original request thread.
13:50lynaghk`cemerick: that sounds even better. There's no magic thread stuff going on under the standard ring/compojure stack, is there?
13:50lynaghk`basically, I just couldn't call that fn within a future or something?
13:50cemericklynaghk`: it depends upon the dynamic binding of friend/*identity*, so all the usual caveats about dynamic vars apply
13:57lynaghk`cemerick: works great. Thanks!
14:05cemerickdnolen: All the test data comes from test.generative at the bottom, but I am using core.logic to find useful queries over it. I think that qualifies as core.logic generating tests, though probably not in the way you mean.
14:06juhu_chapaHi all! Why is not true the following expr? (= (.getReturnType (.getMethod String "length" nil)) int)
14:06S11001001,(type int)
14:06clojurebotclojure.core$int
14:07S11001001,(supers (type int))
14:07clojurebot#{clojure.lang.IMeta clojure.lang.IObj clojure.lang.Fn clojure.lang.IFn java.util.concurrent.Callable ...}
14:07S11001001juhu_chapa: int is not a type
14:07S11001001otoh
14:07S11001001,(type Integer/TYPE)
14:07clojurebotjava.lang.Class
14:08S11001001juhu_chapa: you have to be careful with the types of things you give to =; = is no help whatsoever if you don't line them up right, it just returns false
14:15juhu_chapaS11001001: what expr must go in order to get true?
14:17cemerickdnolen: And BTW, the unifier seems to do well, for me anyway: ~100K unifications so far without a hiccup.
14:17dnolencemerick: sweet!
14:20xumingmingvis there a tool like javadoc for clojure?
14:20craigbromarginalia?
14:21juhu_chapaS11001001: I just read line above, thanks.
14:21technomancyxumingmingv: in general it's not needed nearly as much since you can access documentation at runtime in the repl. but there are a few tools for generating HTML if you need to publish something on the web
14:21technomancymarginalia being the most commonly-used
14:21xumingmingvthanks technomancy craigbro
14:22mdeboardlol
14:24Vinzentxumingmingv, take a look at https://github.com/weavejester/codox
14:25xumingmingvVinzent: thanks
14:57KirinDaveI had this funny idea that when you had a nested class in java, clojure could reach it via (import 'org.byzantine.TopClass$NestedClass)
14:57KirinDaveIs that wrong?
14:58llasramKirinDave: That's the way to do it
14:58KirinDaveHmm
14:59KirinDaveMaybe there is a deps issue then.
15:00scgilardithat class name is also how java refers to it. getting a manifest of the jar (say, by opening it in emacs or jar -t) may be helpful.
15:00scgilardijava -> the jvm
15:13amalloyKirinDave: that's a fine import statement, as long as your code is referring to it as TopClass$NestedClass
15:13amalloyand not, say, hoping to get away with just NestedClass
15:13KirinDaveYeah.
15:13technomancyhierarchy is an illusion
15:13technomancygenerally speaking
15:13KirinDaveIt is actually one of those fun things where multiple versions of a lib are included.
15:14KirinDaveSo now I am going through excluding from every package jetty so I make sure to get the version of jetty I want.
15:14amalloycan't you set a global exclusion and let lein do that?
15:16KirinDaveamalloy: Can I?
15:16KirinDaveamalloy: I've never seen that in the wild, and the exclusions stuff isn't exactly documented.
15:16amalloyhttps://github.com/technomancy/leiningen/blob/master/sample.project.clj#L42
15:17KirinDaveThat's a timesaver.
15:17amalloygood thing it was exactly documented
15:18KirinDaveamalloy: Might be good to mention it in the readme, tutorial, wiki documentation, etc before you do a victory dance. :)
15:19amalloyi'm sure lein has a great readme/wiki, but the only docs i ever have a reason to look at are the sample project.clj options
15:20emezeskeWhy on earth would you need to put an advanced feature like that in the readme or tutorial? The wiki, sure. Anyway, if you're looking for advanced stuff, the sample.project.clj is *the* place to look, it's exhaustive.
15:21KirinDaveemezeske: Irc is not a rich media format, so you'll have to just imagine me doing a fry face, then massaging my temples, and then making a face that suggests we both have better uses for our time than to argue the definition of documentation.
15:22KirinDaveemezeske: I apologize for asking you to meet me on said metaphorical bridge, but I'm being beleaguered by tech gossip reporters and it's been a rough morning.
15:22emezeskeWell, I thought it was a fine use of my time, or I wouldn't have typed it out :)
15:23emezeskeBut sure, we don't need to argue about it.
15:30duck1123the global exclusions were great in the early days of 1.3 migration. All my projects had "don't want to see contrib anywhere on my classpath"
15:32hiredmankovasb: have you seen http://www.mathjax.org/demos/tex-samples/ ?
15:34kovasbhiredman: have not, looks pretty good
15:34zerokarmaleftwith the exception of radicals
15:35hiredmanzerokarmaleft: there are other rendering options that look better
15:35hiredmanrendering to html/css ends up with the funky looking radicals, but rendering to mathml or svg doesn't
15:36hiredmanhttp://www.mathjax.org/demos/mathml-samples/
15:38KirinDavehiredman: Seems to work right for me?
15:39hiredmanKirinDave: it renders the radical, but the top line is not as smooth and crisp
15:40zerokarmaleftyea, it's visually segmented, the mathml and svg renders are better though
15:51KirinDavehiredman: Ah, so it does. A very subtle effect, like 1 pixel raised?
15:51KirinDavePeriodically?
15:52KirinDavehiredman: I see this in Chrome, http://fayr.am/INxQ
15:53hiredmanfirefox is similar, but slightly different
15:53hiredmanI imagine the html/css rendering mode is most likely to have differences between browsers
15:53KirinDavehiredman: Barely perceptible on my screen.
15:54KirinDavehiredman: I'd take the anti-aliased text over slight artifacts in long radicals, personally.
16:07solussdack! is clojars down?
16:08RaynesOh no. Abandon all hope!
16:08Raynestechnomancy: siren sounds
16:08solussdwe're scrreeewed!!
16:08RaynesThe bloody sky is falling.
16:08technomancyeep; can't reach it over SSH
16:09solussdfunny thing is… it kind of is that way. I cant 'clojure-jack-in' because I've added new deps that havent been pulled down yet. :)
16:09Raynestechnomancy: Hold me.
16:09technomancyand it's only 6:00 AM it _ato's time zone
16:09solussdat least it's friday. I'm sure it'll be back by monday
16:10solussddoes clojars get any financial support from anyone? Seems like it's becoming more important all the time
16:10duck1123it's a good thing no one does anything with clojure over the weekend, right?
16:10solussddamn
16:11Raynestechnomancy: What is clojars hosted on?
16:11technomancyRaynes: ato's VPS
16:12RaynesWhat company?
16:12technomancylinode, I think?
16:12RaynesYikes.
16:12Raynes$kill
16:12lazybotKILL IT WITH FIRE!
16:12technomancythere are backups
16:12RaynesAt least he didn't take me down with him.
16:13technomancyheh
16:16technomancyshoot, https://github.com/ato/clojars-web/wiki/Data only shows backups that are on the same server, but I'm sure _ato has some offsite too
16:17brainproxymaybe clojars is protesting fogus' departure from core
16:17hiredmanrebuild from caching repos
16:20stuartsierraClojure and contrib libraries will still be available through Maven Central Repo.
16:23Raynesstuartsierra: But they're utterly useless without my libraries, which are on clojars!
16:23RaynesEverybody uses my libraries, right?
16:23technomancyI'm fairly positive there won't be any data loss, just temporary unavailibility
16:24stuartsierratechnomancy: But why spoil a good excuse for a panic attack?
16:25technomancythe crazy thing is I started to deploy a branch to get releases uploaded to S3 last week, but I never got the AWS creds to actually push it out
16:28stuartsierraReportedly "Linode is having connectivity issues in their Atlanta data center."
16:28technomancyeast coast: all the problems.
16:28Raynestechnomancy: They're having issues at the Atlanta data center. It is just connectivity from what I can see.
16:28technomancycool
16:29technomancystill a good reminder for me to get crackin' on that S3 promotion branch
16:29RaynesWhich is about what you'd expect from Linode. I think amalloy and my VPS has gone down for real once in its lifetime, and everything else has just been network problems.
16:29RaynesMan, I never get that right. "amalloy's and my vps'?
16:30RaynesI should keep an English text book with me at all times.
16:30brainproxy:)
16:30technomancymaybe lazybot could dispense tips from the Elements of Style the same way clojurebot does perlis epigrams?
16:30llasramI apologize on behalf of the ____ city of Atlanta
16:31mdeboarddamn
16:31mdeboardI love madlibs
16:31llasramhehe
16:31hiredmanmore than just a major delta hub
16:32llasramWe also have data centers and an aquarium!
16:32TEttingerand GA Tech
16:33pjstadigtechnomancy: i'll feel better when clojars pushes to S3 because amazon *never* has any outages
16:33RaynesBahahaha
16:33TEttingerpjstadig haha I remember that last outage
16:33RaynesThat last outage took out like half of Heroku.
16:33RaynesI blame technomancy.
16:33TEttingera significant fraction of the internet was disrupted!
16:33pjstadigtho to be fair i guess they rarely have S3 outages
16:33pjstadigmostly EBS
16:33TEttingerwhat did you do, technomancy!
16:34technomancypjstadig: remind me the last time S3 lost data? =)
16:34brainproxytechnomancy: how many VPSs make up clojars?
16:34amalloyi would be astonished if that number were larger than one
16:34pjstadigit's not just about losing data mind you, but connectivity too
16:35pjstadigand i already said that (to be fair) S3 rarely has issues :)
16:35brainproxyi was thinking, how hard would it be to just keep a mirror on a vps in one of rackspace's datacenters, something like that
16:35technomancybrainproxy: just one
16:35technomancybrainproxy: I have a branch that runs on heroku with no single point of failure
16:36technomancyerr
16:36technomancywell, apart from entire AZ outages
16:36brainproxyyeah
16:36technomancythat's why I want to get releases on to S3
16:38frozenlockIs there a function to round up a number?
16:39emezeskefrozenlock: That would be a java question: http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#round(double)
16:40amalloywell, he wants ceil, not round
16:40Raynes&(Math/ceil 0.6)
16:40lazybot⇒ 1.0
16:40emezeskeamalloy: Oh, I think you're right
16:41Raynesamalloy: Would you believe me if I told you I was looking for ceil in javadocs before you said that?
16:41frozenlockThank you very much
16:41goodieboyis anyone familiar with the clj-time lib?
16:42frozenlockgoodieboy: Somehow
16:42frozenlock,ask
16:42S11001001frozenlock: clojure.math.numeric-tower has more exciting versions of those functions
16:42frozenlockS11001001: I've never seen the word "exciting" coupled with the math function round or ceil :P
16:42goodieboyfrozenlock: i'm trying to figure out how to calculate the difference, in milliseconds from the current time, to 1:00 AM
16:43goodieboy1:00 AM, the next day that is
16:45duck1123goodieboy: are you using jodatime for this?
16:45goodieboyduck1123: yeah i think the clj-time lib uses joda
16:46RaynesThat's always 12 hours in The Twilight Zone.
16:50duck1123goodieboy: looks like you're going to want to create an interval (interval from to) and then call .toDuration on that, I assume that str will return the right thing, but I can't test it atm
16:50goodieboyduck1123: ok let me try that out, thanks!
16:51duck1123http://joda-time.sourceforge.net/apidocs/org/joda/time/Interval.html
16:51technomancyclojars is back, folks
16:51RaynesWooooot!
16:51brainproxyclojars lives, yay
16:54llasramgoodieboy: clj-time has some convenience methods. There's probably a cleaner way to do it, but maybe something like this: https://www.refheap.com/paste/3839
16:54llasram(I've used the library some, but not extensively)
16:55goodieboyllasram: nice, thank you for that. Very helpful.
17:27mritzwhats the best way for changing a dependcy version a plugin has? I have protobuf plugins installed that brought down 2.3.1. I want to upgrade this to 2.4.1
17:28technomancymritz: what's the context?
17:29mritztechnomancy: so lein-protobuf has in its projects file a protobuf version number. It is set to 2.3. I have this plugin installed. I'd like to be able to reinstall this plugin with verson 2.4.1.
17:30technomancyso a dependency of the plugin itself... you could try declaring a top-level dependency on the newer version
17:30technomancysorry, declaring it in :plugins
17:30mritzhmm
17:30mritzit has a line (defn version [project]
17:30mritz (or (:protobuf-version project) default-version))
17:31mritzso I thought I could specify :protobuf-version in my project file
17:31technomancyRaynes might know more
17:31RaynesHe might not though.
17:31technomancyit's possible
17:31mritzI just started clojure yesterday so that is probably the main issue
17:32technomancyno, this sounds like an issue with the plugin
17:32RaynesIt should work if you use :protobuf-version. Can you paste your project.clj file to https://www.refheap.com for me?
17:32Raynestechnomancy: Watch your mouth.
17:33mritzhttps://www.refheap.com/paste/3840
17:44Raynesmritz: I'm a little busy at the moment, but I'm making a note to look at this when I get a chance.
17:45RaynesSorry that it isn't working out for you. We've made a truckload of changes to all of this stuff recently. Bound to be some bugs.
17:45RaynesI'll probably work on it on Monday.
17:46RaynesLuckily I get paid for it. :p
17:56mritzRaynes: Thanks. Although I think this MAY have been my fault. What was confusing for me is that leon won't bring down the new version of protobuf until I actually call 'leon protobuf'
17:57RaynesSo it did what you wanted?
17:58mritzRaynes: I did a local repo install from the github. I'll clear out everything again and try it from lein repo just to make sure it was my fault
17:58mritzsorry if my terminology is wrong here, I don't know wtf I'm doing
17:59mritzI'm still not positive it honors the version of my project file, but I have a bunch it will..I'll let you know
18:01technomancyclojurebot: leon?
18:03technomancyclojurebot: snap out of it, man
18:03llasramIt's been a sad time for bots of late
18:18eggsbyanyone here familiar with korma? I'm having some trouble connecting to an oracle db with it
18:19technomancyeggsby: there are some known bugs with korma getting in the way of the standard jdbc adapter
18:19technomancynot sure if this is the same problem you're seeing, but it might help: https://github.com/ibdknox/Korma/issues/62
18:21eggsbyi'll dig into it, slightly irked that its working in grails using the same driver *ugh grails* but not in korma :(
18:22eggsbyI'm getting https://www.refheap.com/paste/3841 when trying to select, I wish there was some way to verify that the connection pool itself was successful
18:27eggsbyis there anything glaringly wrong here? https://www.refheap.com/paste/3842
18:29technomancyeggsby: have you tried raw clojure.java.jdbc?
18:29technomancyI don't really trust defdb
18:29eggsbyI haven't, i'll take a shot at it
18:29eggsbythanks technomancy
18:29hiredmanclojure.java.jdbc will let you pass in a url, just like what you have in grails there
18:32eggsbyand so hiredman, I would just specify the subprotocol as oracle and the subname as the "(...)" TNS bit?
18:34hiredmaneggsby: http://dev.clojure.org/jira/browse/JDBC-21
18:34eggsbyah, so this patch isn't in master?
18:35eggsbynvm
18:35hiredmaneggsby: https://github.com/clojure/java.jdbc/blob/629893eac45050197c37c3e1342de2ad1c232291/src/main/clojure/clojure/java/jdbc.clj#L150
18:35hiredmanconnection-uri
18:52eggsbyweird, now i'm getting a null pointer exception :/ https://www.refheap.com/paste/3844
18:55hiredmaneggsby: I recommend reading beyond the first line of the stacktrace
18:56eggsbyhiredman: that's just what lein repl returns, I wish I could read deeper :(
18:56hiredmanthe last exception thrown in the clojure repl is bound to *e
18:56dnoleneggsby: (clojure.repl/pst *e)
18:57eggsbythanks guys
18:58eggsbyhm, still just the one line
18:58eggsbyI'm doomed
19:17casionso I'm new to lisp, and clojure... I'm having difficulty understanding the differnce between a list and a vector
19:19casionanyone have any words that might make it a bit more clear to me?
19:19technomancycasion: tl;dr is O(n) vs O(1) access
19:19technomancya list is just a head and a tail; a vector is addressable by offset
19:20casiontechnomancy: ahhhh ok
19:20casionthis tutorial did not make that clear at all
19:20casionthank you
19:23ToxicFrogconceptually, a list is a linked list while a vector is, well, a vector: a resizeable array.
19:23ToxicFrog(this may not actually be how they are implemented internally, though)
19:24casionI'm going through the 'clojure tutorial for non-lisp programmers'
19:24casionand it has not (yet?) made that clear
19:25casionit makes more sense now though, thank oyu
19:25technomancywhere's that?
19:25casionhttp://moxleystratton.com/clojure/clojure-tutorial-for-the-non-lisp-programmer
19:26casionit's the only thing I could find that didn't come with a presumption of lisp or funtional programming knowledge (of which I have neither)
19:26hiredman"The vector is another data structure, similar to a list. Vectors are zero-based arrays."
19:26technomancy~volkmann
19:26clojurebotvolkmann is probably the best free introduction to the Clojure language: http://java.ociweb.com/mark/clojure/article.html
19:27casionhiredman: I read that, however the idea that a list was similar to a linked list was not made particularly clear
19:27casionit seems obvious now though
19:28technomancycasion: I think he's pointing out that the tutorial is misleading and/or unhelpful.
19:29hiredmanI dunno
19:29RaynesIt's also about 200 years old. :|
19:29muhootechnomancy: fyi, nrepl.el on emacs22 https://www.refheap.com/paste/3825 doesn't like arrays.
19:29Raynescasion: FWIW, I wouldn't automatically expect anything that doesn't explicitly note a target audience of non-lispers to target lispers specifically.
19:30muhoowiping my machine and reinstalling next week, then will upgrade to emacs24, and maybe nix this time.
19:30Raynescasion: Most Clojure programmers weren't Lispers to begin with.
19:30casionRaynes: good point
19:30technomancymuhoo: unsurprising
19:31casionI've stumbled into clojure with somewhat of a standoffish attitude
19:31casion'this is nothing like C, I'm going to have a hard time' ... before I even got into it
19:31RaynesOh, huh. I guess that guy keeps that tutorial updated.
19:31casionwhich I'm realizing right now :|
19:31casionand obviously that's stupid
19:32RaynesMeh, you'll be fine.
19:32RaynesYou're a strong fellow.
19:32muhoocasion: i tend to fight new things tooth and nail, then, once i figure out their usefulness, i love them.
19:33casionmuhoo: I"m the same way haha
19:33eggsbyguys what is a command that should cause a large stacktrace in a repl? mine all seem to be getting cut off
19:33muhoolike, frinstance, i'm still running debian lemmy, with emacs22, and ion window manager :-)
19:34muhoocasion: you'll be fine. i recommend clojure programming book
19:34casionmuhoo: I moved to os x... where I use dwm
19:34casionfor which I am ridiculed often enough
19:34muhoothe orielly one
19:35technomancydwm is badass
19:35technomancyat least it is under X
19:35casionI can't live without dwm
19:35eggsbydwm... I use awesome
19:35amalloyeggsby: ((fn x [] (x)))
19:35eggsbyawesome is by the author of dwm, right?
19:36eggsbygrr, a single line stacktrace amalloy :(
19:36casionis this o'reilly book well recommended around here?
19:36emezeskeeggsby: After you get the single line, what if you do (pst)?
19:36eggsbyhttps://www.refheap.com/paste/3845
19:37eggsbyunable to resolve symbol pst emezeske
19:37emezeskeeggsby: what clojure version?
19:37eggsbyI guess 1.2.1 according to the repl output
19:37emezeskeeggsby: That's rather ancient, you probably want to upgrade to 1.4
19:37eggsbyeven tho my lein says 1.4
19:37ToxicFrogcacodaemon: I haven't read it myself, but O'Reilly generally does good stuff
19:37emezeskeeggsby: Are you doing "lein repl" ?
19:37eggsbyya
19:38eggsbymy project.clj says *
19:38technomancycasion: I like it a lot
19:38ToxicFrogEr, casion: I haven't read it myself, but O'Reilly generally does good stuff.
19:38null-which book?
19:38ToxicFrogAlso, going from C to Lisp with no intermediate HLL experience? That's going to be a fun head trip. Savour it. :)
19:39null-ToxicFrog: what's HLL?
19:39ToxicFrogHigh Level Language.
19:40hyPiRionI went from Java to Common Lisp. As long you've got an open mind, it's not a problem.
19:40null-ToxicFrog: wouldn't the most dramatic part be no functional programming experience?
19:40muhoowell, if you write c, then you've likely used bash, make, possibly python, depending on which build system you used.
19:41ToxicFroghyPiRion: I wouldn't expect it to be a problem, it's just going to be a much more dramatic change than going from a HLL.
19:41hyPiRionToxicFrog: Ah, I see. It's a very enjoyable ride :)
19:41ToxicFrognull-: this may be a bit snobby but personally I don't consider a language a HLL unless it at least supports things like first-class and higher-order functions, tail call elimination, and other "impure functional" features
19:42ToxicFroghyPiRion: yeah, I approached it more gradually, going from C through Java, Perl, Python, Lua, Haskell and Scala on my way to Lisp, so it was much more gradual.
19:42casionI've worked in a large java project...
19:42casionknowing nearly no java
19:43casionsomehow I ended up being the least incompetent though
19:43eggsbyhm, hmm, I've never seen a stacktrace with a negative value for the line number of an error
19:43null-ToxicFrog: so you are a clojure fan now?
19:43casiona rather dangerous environment
19:43muhooeggsby: paste?
19:44hyPiRionToxicFrog: I think that's a great path, gives you a lot of insights in different paradigms.
19:44eggsbymuhoo: https://www.refheap.com/paste/3846
19:45hyPiRionThose languages are used in production too, so why not?
19:45hiredmaneggsby: you don't have the class for the oracle jdbc driver loaded
19:45muhooi was whining in the #emacs channel about how much i hated dealing with java and php, and technomancy suggested i try clojure, and i've been hooked ever since.
19:46casionI'm only learning clojure because I realized it's getting to the point where at least having ssome basic functional programming knowledge is becoming very useful
19:46technomancymuhoo: haha; nice =)
19:46ToxicFrognull-: yes
19:46null-ToxicFrog: interesting route, haskell -> scala -> clojure
19:47null-:)
19:47eggsbyd'oh hiredman, I figured clojure.java.jdbc would find it on the classpath, dumb question but how do I load it?
19:47ToxicFrognull-: it does contain some aggravations but it is the only lisp that has really "clicked" with me; Scheme appeals to me more on paper but Clojure I actually do things with.
19:47hiredman(Class/forName "the-class-name")
19:47ToxicFrog(similarly, I love Haskell as a concept but somehow I always find myself reaching for Scala instead when I want to get my static typing on)
19:47muhooRaynes: nice, refheap colorizes stacktraces
19:48null-ToxicFrog: cool
19:48eggsbysame err hiredman
19:48ToxicFrogAlso, having easily-"modified" immutable data structures as a core assumption is addictive.
19:48eggsbyhttps://www.refheap.com/paste/3847
19:48ToxicFrogLua is forever ruined for me now :/
19:48null-is there any Clojure book for no "functional" programmers?
19:49Raynesmuhoo: No it doesn't.
19:49muhoonull-: again, i recommend the clojure programming book, o'reilly
19:49muhooRaynes: https://www.refheap.com/paste/3846 parts of it, seems like
19:49Raynesmuhoo: That's purely coincidental because the Clojure lexer picks up those things.
19:49null-muhoo: thanks, I logged in after you mention it
19:49RaynesIt isn't at all purposely.
19:51hiredmaneggsby: pass in {:connection-uri "..."} instead of just the string
19:51eggsbyi'll try hiredman
19:52hiredmanpassing in a string ultimately tries to find the classname based on the subprotocol, but jdbc doesn't have that mapping for oracle
19:52hiredmanseems lame to have it fail, if the classloading there was just removed it would work fine, because you already loaded the class
19:53eggsbywell hiredman, at least that gives me a new err :p
19:54hiredmanthere should be a check, if it cannot map the subname to the class, don't try and load nil
19:54hiredmaneggsby: the connection-uri case might be missing the account params :/
19:54eggsbyit says invalid oracle url, from the ojdbc driver
19:55hiredmanit's oracle so who knows what that means
19:55cemerickhiredman: I think the connection-uri option went in because postgres requires credentials to be URL parameters
19:55cemerick(along with other things, like ssl or not, etc)
19:56jtoyin vim clojure mode, how do I delete a a ( or ), when i hit x on it nothing happens
19:56muhoocemerick: did you end up going with datomic or postgres for your project?
19:56eggsbyjtoy: that's because there is content still inside the form
19:56ibdknoxjtoy: da(
19:56eggsbytype di( first if you want to delete inside the form
19:57aperiodicjtoy: <leader>S will strip the parens and leave the contents intact
19:57cemerickmuhoo: Using postgres, though I'm taking a lot of inspiration from datomic.
19:57jtoyI have ((interests.sources/list_data :client client)) doing da( deletes the code too, i just want to remove the extra pair
19:57cemerickThere's a lot to learn from voltdb as well, in general terms.
19:57aperiodicjtoy: <leader>S
19:59jtoyaperiodic: that worked, thanks
20:00aperiodicjtoy: you should read `:help paredit` when you have the time, so you can pick up on these sorts of things yourself
20:00jtoyaperiodic: i will reread, i tried reading it before and was very confused
20:00jtoyprobably because I'm still a clojure newb
20:01muhoocemerick: i'm curious why. it seems you've had a lot of the db restlessness i've had, trying couchdb, then datomic, then settling on postgres. might make a good blog post if you feel up for one, or a chapter in a new book if you decide to go that route again.
20:01cemerickmuhoo: I'm not sure I've been restless. Used couch for many years now. :-)
20:02aperiodicjtoy: most things in the paredit cheatsheet are also in paredit.vim, and it has much nicer presentation than the paredit help http://www.emacswiki.org/emacs/PareditCheatsheet
20:02jtoyaperiodic: pl
20:02jtoyok, thanks
20:02aperiodicjtoy: you're welcome
20:03muhoocemerick: yes, i know, i've used clutch, and thanks for that. but still, i'd be very interested to hear why postgres got the win.
20:03muhooRaynes: but why? it's web scale.
20:04RaynesI didn't say I actually listened to any of it.
20:04Raynes:p
20:04RaynesIt works for refheap and lazybot and hasn't ate me for dinner yet, so *shrug*.
20:07muhootechnomancy: will nrepl.el connect to this at some point? https://devcenter.heroku.com/articles/debugging-clojure
20:08cemerickmuhoo: I probably would be using datomic now if it weren't so new.
20:08cemerickAnd, my data model needs a little more wiggle room than its schemas readily allow, but I could have worked around it.
20:08muhoocemerick: thanks, that's kind of what i guessed.
20:09cemerickmuhoo: Not to be down on it at all; it's incredibly hot tech, and I was able to do a lot with it in a very short period of time in my experimentations.
20:09cemerickI'm just a lot more conservative about databases.
20:10cemerickAnd other things too, at least in contrast to my willingness to cut myself on programming languages. :-)
20:11muhoomakes sense, thanks
20:11technomancymuhoo: at some point, but writing an HTTP connector is still a fair bit of work
20:11cemerickThere isn't a standard elisp http client?
20:11technomancycemerick: sure there is, it just sounds like a fair bit of work to hook it into nrepl.el
20:11cemerickah
20:11technomancymaybe not; I haven't looked into it enough
20:12technomancythough it occurs to me it would probably be easier to just write an nrepl proxy
20:12technomancycemerick: that shouldn't be hard, right?
20:15cemericktechnomancy: I wouldn't think so; but, nrepl.el should have a proper abstraction away from particular transports anyway. bencode and HTTP aren't going to be all there is.
20:17technomancyyeah, doing it in elisp would definitely be the Right Way
20:21holohi
20:22Raynescemerick: The elisp http client is Satan.
20:22emezeskeholo: gooooooood evening!
20:22technomancyit wasn't bad when I used it to write a couchDB client
20:23holoemezeske, thanks for the warm greeting
20:24holoconnecting to a postgres db, i'm having the error "ERROR: syntax error at or near "user" Position:" using a connection uri like the one in http://tinyurl.com/d5jokze . the person using that uri claims it works on jdbc 0.2.3-SNAPSHOT. i'm using 0.2.3, but i get that error
20:25holothe type of connection URI both used in that link and mine is like this: "jdbc:postgresql://ec2-22-11-231-117.compute-1.amazonaws.com:5432/d1kuttup5cbafl6?user=pcgoxvmssqabye&password=PFZXtxaLFhIX-nCA0Vi4UbJ6lH&ssl=true"
20:28emezeskeholo: I can't help with postgres, but... you didn't just give us your password, did you?
20:31cemerickholo: Assuming that's a heroku postgres URL, and you're using java.jdbc, provide a map of {:connection-uri "that URL"} to with-connection. And, rotate your credentials. :-)
20:36holoemezeske, no, those are the credentials for the example on the link supplied ^^
20:36holocemerick, what do you mean by rotate?
20:36cemerickholo: like emezeske, I thought those were your actual database credentials.
20:36emezeskeholo: Good deal. :)
20:42holocome on..
20:42holocemerick, oh, i understand now what you meant by "rotate"
20:43holocemerick, anyways, i did just like in the link... huh, i'm having still that parse error
20:44cemerickholo: can you paste your code somewhere?
20:47holooh, sorry guys! i had appended "&sslfactory=org.postgresql.ssl.NonValidatingFactory"" , and that was making the error
20:47holocemerick, now i just have The connection attempt failed. - (class org.postgresql.util.PSQLException)
20:49holocemerick, this is what i have: (sql/with-connection {:connection-uri "jdbc:postgresql://ec2-23-23-237-0.compute-1.amazonaws.com:5432/xxxxxxxxx?user=yyyyyyyyyyy&password=zzzzzzzzzzzzzzzzzzzzzJ&ssl=true"}
20:52holo"Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
20:53holohuh, i think it still needs the "&sslfactory=org.postgresql.ssl.NonValidatingFactory" but this produces a parse error
20:58aphyrVaguely disturbing question...
20:58aphyrWhat if I want to take a Map, and let it act as some other interface
20:58aphyrProxy, yeah?
20:58aphyrOh, wait, no, defrecords are open structs
20:59aphyrHA
20:59aphyrSAVED BY RICH HICKEYS FORESIGHT YET AGAIN
21:01holook, i'm trying to add the certificate somehow like this: http://code.naishe.in/2011/07/looks-like-article-no-more-unable-to.html
22:19rbarraudG'Day
23:37mritzClassCastException java.lang.Class cannot be cast to protobuf.core.PersistentProtocolBufferMap$Def protobuf.core/protobuf-load (core.clj:54)
23:37mritzany idea what that is from?
23:38aphyrLooks like you passed a class to protobuf-load.
23:38aphyrGot the source at :54?
23:40mritz(protobuf-load yo data)
23:40mritzyo is my protobuff class
23:40mritzdata is from the file
23:41aphyrprotobuf-load expects a (defprotobuf)
23:41mritz(def yo Ziften.report.Sweet$ScanReport)
23:41aphyrNope.
23:42mritzhmm
23:42mritzthis is my first day of closure
23:42aphyr(def yo (protodef Sweet$ScanReport))
23:42aphyrfrom the example here: https://github.com/flatland/clojure-protobuf
23:42mritzthanks man, I've stared at that example for a long time today
23:43mritzno idea how I've been reading it wrong
23:45mritzwell crap
23:45mritzIllegalArgumentException No matching method found: getDescriptor clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:53)
23:45mritzsame line
23:46jestinepaulhey guys, I have raised a JIRA issue (JDBC-35) regarding the timezones returned from the ResultSet getter method.
23:46jestinepaulhttp://dev.clojure.org/jira/browse/JDBC-35
23:48aphyrsorry mritz, I gotta go home. :/
23:49mritzaphyr: k, thanks for the help
23:50jestinepaulI have also attached a patch to the issue. It would be great if someone can take a look at it and suggest some ideas.
23:56Raynesmritz: Did you by chance open an issue on tryclj.com's github issue tracker a little while ago?
23:57mritzRaynes: nope, but I think I found the issue. an old IRC long said that option optimize_for = LITE_RUNTIME; is the culprit.. I'm trying that now
23:58mritzunfortunately the coder scattered that line in 400 different messages so I'm throwing a script together to rip them out