#clojure log - May 19 2013

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

0:11 callen: it always surprises me how far I can get with just maps and keywords.

0:22 robink: amalloy: Would zippers be appropriate for that kind of structure?

0:23 amalloy: probably not, but *shrug*

0:23 robink: hm

0:24 amalloy: a rule of thumb for zippers: if you're not immediately certain you want a zipper, you probably don't

0:24 certainly for a fixed-depth tree they bring very little to the table

0:37 robink: amalloy: Gotcha

1:28 mindbender1: Has anyone tried pedestal and liberator?

1:32 callen: mindbender1: don't.

1:33 wei_: my response for wrap-restful-format is always blank. is this the right way to use it? https://gist.github.com/yayitswei/5606785

1:39 tomoj: ianeslick: sure

1:40 how?

1:40 clojurebot: with style and grace

1:44 callen: oddly that's from a presentation about Go

1:45 tomoj: ianeslick: nvm C-c I still satisfies my

1:45 me

1:55 wei_: wrap-restful-response is returning :body #<BufferedInputStream java.io.BufferedInputStream@265970bf> for the body. how can I make it a normal string?

2:03 figured it out; I needed to return a form of {:body {:clojure :map}} in the route

2:34 mindbender1: callen: why is that?

2:37 callen: mindbender1: waste of time

2:38 mindbender1: callen: what do you suggest? either or?

2:38 recycle: (setq erc-hide-list '("JOIN" "PART" "QUIT"))

2:40 callen: mindbender1: vanilla ring/compojure / Luminus

2:40 mindbender1: I've just started looking at pedestal but I must confess I don't really see the point they are trying to make!

2:41 With all those cryptic syntax

2:53 callen: mindbender1: it's nonsense, use ring/compojure.

3:19 tomoj: mindbender1: callen: it's not nonsense...

3:19 what syntax?

3:19 it's just clojure

3:19 callen: yes it is.

3:19 It's a ridiculous waste of time for 99.9% of web apps.

3:19 to sell it as a general solution is disingenuous.

3:21 tomoj: hmm.. I'm listening

3:22 what's the 0.1%?

3:32 mindbender1: tomoj: where you a part of that design?

3:32 what problems where you guys trying to solve?

3:36 tomoj: I wish..

3:38 mindbender1: Would you consider that designsimple?

3:41 tomoj: overall I consider pedestal delightfully simple, though I have not actually tried building an app with it, so my opinion is probably not very valuable

3:42 spoon16: I am trying to do something like ,(apply + x) where x may be a seqable object (which works fine) or a single item

3:43 what is the best way to handle the single item case

3:43 ,(apply + 1)

3:43 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

3:43 spoon16: ,(apply + [1])

3:43 clojurebot: 1

3:50 amalloy: spoon16: don't try to handle "either a sequence or not a sequence". require a sequence, and if someone wants to call your thing on just one object, they can wrap it up themselves

3:52 callen: tomoj: not in this case no. I've built a fair number of apps in Clojure (albeit not as many as some here) but Pedestal is a fool's errand if you actually want to get anything meaningful done.

3:52 tomoj: lots of ceremony that doesn't actually win you anything.

3:55 hiredman: (apply + 0 ...) is also nice in case they pass an empty seq

3:55 callen: tomoj: contrast with something like Meteor which is deeply technically flawed and naive, but it actually *wins* you something.

3:58 hiredman: oh, I guess for + it doesn't matter

3:58 tomoj: callen: I can't argue with such vague claims :)

3:59 spoon16: amalloy: ok

4:00 callen: tomoj: you have two choices, figure it out for yourself in a day or two, or take my word for it

4:00 I'm not going to expound endlessly on what is an obvious subject.

4:03 * tomoj incredulously stares

4:10 callen: tomoj: stare 'til your eyes get dry or make an app. You'll see what I mean.

4:11 ucb: I have the following problem: I'm writing a pickle writer so that I can send batched data to graphite; that's a problem in itself, but let's ignore that for a second. I'm writing tests and for basic data types it's easy, pickle an int, a long, etc. When you get to tuples, still fine for tuple-1 (tuple-1 with an int, etc.) but when you get to tuple-2, then it gets complicated because of the sheer number of possible combi

4:11 nations. What would you guys recommend in this scenario?

4:12 something like quickcheck would be nice as it'd generate tests for me, but I'm working with midje and nothing else.

4:12 callen: ucb: so for starters, stop using midje

4:12 ucb: right now I've opted for low coverage of combinations

4:13 callen: far from helpful. Try again.

4:13 callen: ucb: there's a reason for it, which you'll understand in two seconds

4:13 https://bitbucket.org/kotarak/clojurecheck https://github.com/stuartsierra/lazytest

4:13 ucb: ^^ stop using midje.

4:13 oh god fucking dammit, did my REPL just hang?

4:14 ucb: fair enough, I can use that too. midje will happily run clojure.test tests.

4:14 callen: ucb: midje is the blind leading the credulous.

4:14 ucb: call me both :)

4:14 callen: ucb: you don't follow the mailing list?

4:15 ucb: callen: I do, yes. But not that closely. Why?

4:15 callen: you'd know why midje was a bad idea if you followed more closely earlier on. No matter.

4:16 ucb: fair enough.

4:16 tomoj: callen: ok, that is somewhat better than an incredulous stare. I will try

4:17 callen: tomoj: the key element here is to contrast what working with a vanilla ring app is like vs. pedestal for a more-than-single-page app.

4:17 tomoj: say, a simple CMS or something.

4:17 tomoj: hmm

4:18 vanilla ring and what's the client-side story?

4:18 nothing?

4:18 clojurebot: @ has nothing to do with whether sth is evaluated or not

4:18 callen: tomoj: it's volitional.

4:18 ucb: bleh, clojurecheck won't cut it unfortunately; nothing wrong with it, it's just that ... meh, never mind

4:18 tomoj: ok

4:19 callen: tomoj: you can run cljs with lein-cljsbuild and use one of the RPC wrappers

4:19 tomoj: well I have looked at interceptors for example

4:19 callen: tomoj: or you can run with vanilla JS which gets back to my point

4:19 tomoj: and I quite like them vs the vanilla ring stuff I've been doing

4:19 callen: tomoj: cljs is wildly, massively impractical

4:19 tomoj: what you think of as a "client-side story" is goddamn foolish and a waste of time

4:19 tomoj: I just mean are you serving static html or is there JS basically

4:19 callen: tomoj: you're better using using vanilla jQuery for low complexity/density apps or AngularJS for more serious apps.

4:20 tomoj: but, yes, I'm not going to write an angular app :)

4:20 callen: tomoj: it's a vanilla web server, you can do whatever the fuck you want.

4:20 tomoj: my point is that pedestal wins you nothing and makes common-sense web development more fraught with needless abstraction and complexity.

4:21 if you want a stack that takes having a frontend story a lot more seriously, you'd look at Meteor/Derby/Firebase et al, but they're a bad idea for different reasons.

4:21 tomoj: what is this "win you something"

4:22 my guess is it's like DHH-ian "look at all the code I'm not writing"

4:22 callen: tomoj: quite the opposite.

4:23 tomoj: pedestal is a huge mess of code trying to make you not write code that never needed to be written to begin with on top of a worst-practices-imaginable frontend story.

4:23 tomoj: vanilla ring/compojure apps let you do things how you want, but the idioms one tends to see are clean and simple and function within the web ecosystem perfectly.

4:23 tomoj: do you even do web dev at alL?

4:24 tomoj: I'll just ignore that :)

4:24 callen: so you're just D-K'ing right along

4:24 got it.

4:24 tomoj: example of the "worst-practices-imaginable"?

4:25 callen: no no, you ride your dunning-kruger rollercoaster by yourself.

4:26 ucb: heh - love it

4:32 mindbender1: I have a feeling people are not enjoying the kind of cljs clj dev enviroment I have been playing with.

4:33 callen: mindbender1: I can "deal" with it in vanilla ring with lein-cljsbuild but I don't think it's a good idea.

4:33 mindbender1: lein-cljsbuild? who uses that? not me

4:33 callen: that's...far from the point.\

4:36 mindbender1: callen you're on point though.. I'm losing a grip on simplicity amidst all these new libs

4:37 sharing simple data seem so hard for most authors..

4:38 as Rich puts it.. " Eventual consistency is really hard for programmers"

4:39 tomoj: eventual consistency?

4:39 I'm guessing you mean that in some non-standard sense?

4:40 mindbender1: yep

4:41 tomoj: too many libs to understand?

4:41 mindbender1: no.. so much inconsisrency among them

4:42 inconsistency

4:42 tomoj: ah

4:42 zoldar: mindbender1: in what sense?

4:43 mindbender1: in how they expect you to communcate with them..

4:43 I like to see what I'm giving and what I'm receiving

4:43 don't do any more

4:46 zoldar: ok, I feel stupid, but must admit that I don't get your point. Are you referring to referential transparency? because that's clearly not achieveable in every case

4:48 mindbender1: I mean thinking in data

4:48 re:stu

4:49 zoldar: remember this is clojure

4:51 tomoj: do you have any specific beef?

4:52 mindbender1: yes.. I have a beef with complecting

4:52 especially when I smell it within clojure

4:53 tomoj: that is not very specific

4:53 mindbender1: tomoj: you must be able to distinguish familiarity and simplicity

4:54 I can get familiar with pedastalin 2 months but is it simple?

4:55 tomoj: pedestal is not that big

4:55 but yeah I guess it would take a while to really realize the implications

4:55 mindbender1: there familiarity goes again

4:55 llasram: Ah, the benefits of your language's BFDL sticking to language design and being Dutch

4:56 mindbender1: tomoj: are you familiar with closure ui model

4:56 tomoj: no, I've perused those docs maybe once or twice

4:56 mindbender1: components control control-renderer state events

4:57 when I got familiar I realized it was not that *big*

4:57 It was a pure genius

4:58 tomoj: I think this is at least the second time I've considered telling you "you're bending my mind man"

4:59 mindbender1: so familiarity is a disease because you tend to forget the barrier

4:59 tomoj: oh, yes, I think I see what you're saying

5:01 I'm not familiar with pedestal :P

5:03 but yeah, everyone thinks the stuff they use is simple I guess

5:04 mindbender1: that's why like Rich we must step back and take a second look

5:05 tomoj: but so do you have any specific complains about pedestal or are you just generally worried that it might not be simple?

5:07 mindbender1: Yes.. they don't have a simple js/ui approach

5:07 tomoj: hmm

5:08 I think I totally agree :)

5:08 the way I see it they just haven't addressed that part of the problem

5:09 or do you mean the stuff they wrote is actually complicated?

5:09 I do have some problems with the app model bits too

5:10 mindbender1: they should go study what closure has done and just make little modifications using maps and vectors

5:10 It's far simpler

5:10 tomoj: oh, you really meant that closure ui is genius?

5:10 I thought you meant that it just seemed genius because you were familiar with it

5:12 mindbender1: it's familiar but not there because of the OOP paradigm but comparing it with pedestal is nothing to write home about

5:13 pedestal just makes me want to do OOP

5:13 tomoj: :(

5:14 mindbender1: I would have thought as functional lib they did have a simpler model but lo and behold code weaving

5:14 tomoj: hmm, if I understand what you mean by 'weaving', I totally agree

5:15 kmicu: "pedestal just makes me want do OOP" hardcore

5:15 tomoj: in the chat sample (which is pretty trivial) it seems like information about particular bits is spread all over

5:17 mindbender1: Just from reading the docs I already knew they were approaching the problem in a complex way

5:17 kmicu: Do we read the same docs?

5:17 tomoj: I've been assuming you get the simple vs easy distinction?

5:21 mindbender1: what of A thinking about B, B thinking about A?

5:21 I was assuming you get the data-oriented programming paradign

5:22 do you call what they are doing there data-oriented?

5:22 tomoj: I don't have any more data-oriented ideas

5:23 do you?

5:23 kmicu: Maybe Pedestals DATA flow engine, and DATA model with separation from application model and UI/DOM model is not data oriented. Maybe...

5:24 Call me maybe monad...

5:29 llasram: hah!

5:32 mindbender1: maybe monad: that not data

5:33 that's not the data been referred to in the instance. I'm taking representation.. what's been communicated

5:36 tomoj: we are talking about the dataflow stuff? I don't see how you can get more data-oriented than a bunch of data

5:37 kmicu: x]

5:38 tomoj: I mean wiring up a graph of fns bothers me but the stuff they're operating on seems as data-oriented as possible to me

5:40 kmicu: You can go deeper, but you can fall into the data oriented limbo.

5:41 mindbender1: what you are forced to communicate with matters in this instance

5:42 tomoj: what is your actual complaint? :)

5:42 like what part of the pedestal docs seems complex

5:42 callen: tomoj: you're prejudiced and foolish and don't see the real problems.

5:43 tomoj: you're also talking about a problem space you haven't done anything in.

5:43 Nobody cares if it's data-oriented, only if it helps with either scale or facility. It helps with neither.

5:43 tomoj: of course I'm prejudiced and foolish and don't see the real problems

5:44 callen: Picking and choosing your tools based on which programming gods they sacrifice their goats to is a good way to end up in a hellhole.

5:44 cf. Haskell library ghetto

5:44 tomoj: what have you built that's a web app?

5:45 tomoj: you're like a person that buys a product based purely on brand, not on fitness for purpose.

5:45 "oooh it's data-oriented. Forget the problen being solved, it MUST be awsum. <sic>"

5:46 And Pedestal's fitness for purpose is very poor and the applicability is sparse at best.

5:46 I would have to spend several hours thinking very hard before I could contrive a use-case for which pedestal would even be mediocre.

5:46 Probably one involving an insane amount of boilerplate functionality.

5:47 tomoj: I don't think I've claimed pedestal is awesome, I'm simply trying to understand mindbender1's complaint, because I want to get other perspectives on pedestal's fitness

5:47 callen: tomoj: which really just harkens back to your misdirected accusation on my being in the DHH school, this framework is closer to that.

5:47 tomoj: sorry, didn't mean to accuse, that was simply my best guess for what you meant

5:47 callen: I prefer small composable tools that just work and do their job well.

5:48 In this case, this means vanilla Ring and a raft of small libraries that each solve a particular problem in a way I favor.

5:49 I don't even like Friend because it's too big and complicated.

5:49 it tries to take over too much functionality all in one set of idioms.

5:49 sandbar was better

5:49 clojurebot: It's greek to me.

5:49 * jjs has CPU-bound render thread split into 4 parallel futures, each rendering a quarter of the screen...

5:49 callen: jjl`: :|

5:50 kmicu: 80' was better

5:50 jjs: (Sure it takes 250% CPU, but I'm pegging 60fps...)

5:52 tomoj: callen: definitely sounds sensible to me

5:52 the problem with pedestal is that it's big? or uncomposable? or both?

5:53 noncom: how do i make the irc joined/quit notifications off?

5:53 i am on a qwebirc online client

5:54 tomoj: when I started looking at pedestal I was pretty negatively biased because it seemed big and framework-y, but I've been pretty pleasantly surprised by how much it seems you can drop or swap out with your own stuff

5:54 llasram: noncom: That's entirely a client detail -- you'll need to dig through your client's docs for that

5:55 callen: tomoj: Introduces project complexity for as close to nil benefit as I've ever seen with any library or framework of any size. I had to reassure myself it wasn't a trolly attempt at making the most non-functional framework in existence.

5:55 tomoj: who cares if they let you move your food around on your plate?

5:56 The only reason I *don't* believe it's a troll is because of who is behind it, but knowing that just hurts my confidence in the thought-leaders of the community.

5:56 Reeks of ivory tower in the extreme.

5:56 tomoj: 'move food' == 'drop or swap out'? or something else?

5:57 callen: tomoj: moving food around on one's plate. never heard this idiom?

5:57 tomoj: it means to make some noise/sign of activity without accomplishing anything.

5:58 tomoj: so that's "you don't win anything" again?

5:58 noncom: llasram: ehh.. that won't be easy :) con't find the manual for quebirc client

5:59 callen: tomoj: no, you've misunderstood the idiom.

5:59 llasram: I haven't really been following anything about Pedestal. Are there any good longer-form analyses of it?

5:59 callen: llasram: none that aren't delusional, most of us are too disgusted to bother.

5:59 llasram: hah

5:59 callen: llasram: nobody really wants to be the public negative nancy.

5:59 tomoj: it sounds like you're saying that you'd be just as good starting from an empty project?

5:59 llasram: Maybe you should write a blog post?

5:59 callen: well except for me, I'm the 12th incarnation of Diogenes of Sinope so I might do it anyway.

5:59 tomoj: that's how I took 'without accomplishing anything'

6:00 callen: tomoj: you'd be better off using vanilla Ring.

6:00 tomoj: ..and angular

6:00 callen: don't be irritating, I said there was a specific type of project Angular was suited for.

6:00 If you're going to be disingenuous I'll stop entertaining your fatuous bullshit.

6:00 tomoj: it introduces project-level friction for deployment, creating negative value in that capacity and others.

6:00 kmicu: Trolling party!

6:01 tomoj: I just mean that 'vanilla ring' seems to only address half of pedestal

6:01 callen: I'm not trolling, I'm sincere.

6:01 you don't need Pedestal to use cljs, far from it.

6:01 kmicu: Vanilla Ring for everything!

6:01 callen: shoreleave solves that problem nicely.

6:01 kmicu: vanilla Ring could be anything, given how many libraries you can use.

6:02 kmicu: callen: and interceptors are also bad?

6:02 tomoj: callen: if you don't want to have a conversation with me, feel free to stop talking to me :)

6:02 callen: horofox_: spice and wolf?

6:03 tomoj: I am however interested in understanding your perspective

6:03 but am finding that difficult

6:03 callen: tomoj: you're polluting the channel with this inane conversation.

6:03 kmicu: Cuz it's ego trolling.

6:03 horofox_: callen: yeah

6:03 rasputnik: morning (possibly?) all

6:03 callen: horofox_: nice.

6:03 horofox_: great show.

6:03 horofox_: :)

6:03 callen: rasputnik: hai

6:03 horofox_: makes me want to watch it.

6:03 horofox_: callen: yeah, i love it

6:03 rasputnik: is there a idiomatic way to update a couple of keys in a map using conversion functions?

6:04 callen: rasputnik: conversion functions?

6:04 rasputnik: I've not seen anything described thusly.

6:04 rasputnik: i.e. i have a fix-field1 and fix-field2 function, and want to build up a function to run them across a seq of maps to 'correct' the values

6:04 callen: (map (assoc... ?

6:05 rasputnik: you need a refheap sir.

6:05 rasputnik: callen: works ok with update-in but it's a bit clumsy

6:05 what's a refheap?

6:05 Raynes: Best thing ever.

6:05 https://www.refheap.com

6:05 callen: rasputnik: https://www.refheap.com/paste

6:06 Raynes: It's like a ref, but then it's a heap.

6:06 callen: Raynes: do you have an alert for refheap?

6:06 Raynes: that or you're a lurking pro.

6:06 Raynes: "Hey, you got ref on my heap!" "Hey, you got heap on my ref!" "mmmmm"

6:06 rasputnik: Raynes: :P

6:06 Raynes: I do not have an alert for refheap.

6:06 callen: I need to remember to get those tickets.

6:07 rasputnik: i got 2 lines of clojure pulling data out of an XLSX. 2 of the fields are shitty though, because DATA ENTY IS HARD LOL

6:07 samrat: Raynes: tried using least.authorize but I'm getting {:error 13, :message "Invalid method signature supplied", :links []}

6:07 Raynes: callen: http://www.stubhub.com/imagine-dragons-tickets/imagine-dragons-los-angeles-hollywood-palladium-29-5-2013-4248007/ Better hurry. They're getting uncheap.

6:07 rasputnik: so I just need to pass this lovely clean lazy seq full of cruddy data through some 'fixer-upper' functions

6:08 Raynes: samrat: Blugh.

6:08 Apage43: (map (comp thing1 thing2 …) uglystuff) ?

6:08 samrat: Raynes: I think I've done exactly as the docs said

6:08 rasputnik: essentially this : https://twitter.com/rasputnik/status/335761576583913473

6:08 Apage43: where thingX is a (fn [icky] ..deickify some field..)

6:09 Raynes: samrat: Can you refheap your code sans tokens?

6:09 rasputnik: Apage43: yeah, might be a usecase for the -> macro (never used that before, yay)

6:10 Raynes: samrat: Which part of things is failing? Is the get-token call or the get-session call failing?

6:10 rasputnik: ah, i'll use update-in, it just seems a bit heavy.

6:10 samrat: Raynes: least/write

6:10 Raynes: samrat: So the get-session and get-token calls work fine and you get a key back?

6:11 Apage43: is it two fields exactly?

6:11 you might even

6:12 (map (fn [{:keys [fielda fieldb] :as in}] (merge in {:fielda (demangle fielda) :fieldb (demangle fieldb)})) ickyseq)

6:12 samrat: Raynes: yup. https://www.refheap.com/paste/14756

6:14 rasputnik: Apage43: i'll need a demanglea and demangleb , but yeah that'll work

6:14 this is that part where the code bloats up

6:14 Apage43: right, didn't know whether the input was ugly in the same way or a different way

6:14 rasputnik: then tomorrow i get an aha and delete 50% of it. the code collapses like a dying star emitting awesome. you know the drill.

6:14 Apage43: mmhm

6:15 Raynes: samrat: Reproduced. One moment.

6:15 Apage43: deleted code is best code

6:15 rasputnik: Apage43: learnt that back doing 4clojure, i'd write 30-odd lines of crap, look at someone elses answers and it'd be 20 characters.

6:15 callen: Raynes: ticket acquired.

6:16 rasputnik: ok, i'll get this done. thanks all.

6:16 Raynes: callen: We're gonna have funs.

6:16 Apage43: fewer places for bugs to hide

6:17 callen: Raynes: aye, just need to figure out where to stay now.

6:18 Raynes: Your car, dude. That's the hipster way of life.

6:19 samrat: Figured out the issue. It's because (:key session) doesn't work. It's under another level of nesting. Currently thinking of how best to fix it.

6:20 rasputnik: Apage43: "no code is better than no code"

6:23 Raynes: samrat: Take a look at the documentation now. If you follow it this time it should work.

6:24 Can nobody make a bloody consistent /rest API? Really?

6:24 Christ.

6:24 samrat: Raynes: ok, thanks. working for me now

6:26 Raynes: samrat: Just release 0.1.4 to make the (:session …) bit not necessary so now the old documentation works. Sorry. :p

6:27 released*

6:27 Pupnik-: hey Raynes why does (doc def) throw an exception with lazybot, while (doc defn) or (doc defmacro) don't?

6:27 Raynes: &(doc def)

6:27 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

6:27 Raynes: &(doc defn)

6:27 lazybot: ⇒ "Macro ([name doc-string? attr-map? [params*] prepost-map? body] [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?]); Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with any doc-string or attrs added to the... https://www.refheap.com/paste/14757

6:27 Raynes: Because of the way the tester is designed in this case.

6:27 The symbol 'def' is blacklisted.

6:28 So when it sees 'def' it immediately throws an exception.

6:28 The other things work because they aren't 'def' and aren't explicitly blacklisted.

6:28 But they still can't be used, because if they are used they will expand to a call to 'def' and thus trigger the alarm.

6:28 It's pretty complicated.

6:28 Pupnik-: ah, makes sense

6:29 samrat: Raynes: thanks

6:29 Raynes: samrat: Thanks for pointing out the issue!

6:30 callen: Sorry I'm not more helpful on the stays stuff. I have exactly nothing. I don't even have a bed or a couch. No furniture at all. You'd be more comfortable in your car for real.

6:30 callen: Raynes: np at all, I'm wondering if you know of any decent hotels in the area.

6:31 Raynes: I'm assuming you had to stay somewhere to interview.

6:31 Raynes: Never had to interview. I was an intern so I already had the job.

6:31 I stayed at a place in Hollywood for 2 months before getting this place.

6:31 But it was a sublease deal with a random guy and not a hotel.

6:31 Airbnb is pretty great for short term chepo places.

6:31 cheapo*

6:32 And not-so-cheapo nice places.

6:32 * callen nods

6:32 Raynes: I have no clue about hotels.

6:32 Someone who has lived here longer would have to provide input about that.

6:32 callen: Raynes: relative to the stadium and your own location, what area should I look for in Airbnb?

6:32 Raynes: I live in West LA and the venue for Imagine Dragons is in Hollywood.

6:33 Anywhere between or around those areas would be fine.

6:33 * callen nods

6:33 * Raynes feels useless.

6:34 callen: Raynes: no that's quite helpful. I can take it from there. I'm just hoping I won't still be sick when I visit.

6:35 Raynes: Sick with what?

6:35 * Raynes calls the CDC and tells them to prep the vans.

6:37 callen: Raynes: I'm not really sure. Lots of weakness and shakes. Might be from lifestyle.

6:37 Raynes: Too many drugs?

6:37 Sorry, this isn't funny.

6:37 callen: Raynes: I didn't want it to seem like a humblebrag, so I wasn't specific but sleep/diet/exercise.

6:39 I'm not trying to be "hardcore" or anything, I've just been trying to make progress and haven't been taking care of myself as well as I should've.

6:39 Raynes: callen: There was a whole month where I thought I had a brain tumor because I was dizzy the whole time. Saw a doctor and even ended up having an MRI. Scariest month of my life (side by side with my first month in LA).

6:39 callen: Raynes: was it anything serious?

6:40 dizziness is part of what I'm experiencing.

6:41 Raynes: callen: It just went away and hasn't come back.

6:41 But it lasted a month which blew my mind.

6:41 callen: Is it room spinning stuff?

6:42 callen: Raynes: no, but I have trouble standing when it happens. I don't think the dizziness is the worst part, just the weakness and shakes.

6:44 mthvedt: callen: not to be that guy, but have you seen a doctor

6:46 callen: mthvedt: I had a physical done recently prior to this starting, they knew at the time I would be upping the ante

6:46 on diet/exercise and said nothing.

6:47 Raynes: If you think it's lifestyle changes then it probably is.

6:47 callen: You might consider having your blood sugar checked. Or buying a checker and doing it.

6:47 What you describe can sometimes come along with hypoglycemia.

6:47 callen: Raynes: my mother has hypoglycemia

6:48 I have a somewhat conflicted relationship with the subject, I'm trying to run a low-calorie/low-GI diet.

6:48 mthvedt: so your doctor doesn't know about this?

6:48 Raynes: I don't think hypoglycemia is hereditary fwiw.

6:49 callen: I guess not but when I got checked, my blood sugar was perfectly normal.

6:49 I wasn't high nor low

6:49 and my historical BS seemed within norm ranges too

6:49 in fact the only thing "wrong" with me was a fairly shallow test of my LDL, which is from something perfectly normal and temporary anyway.

6:49 mthvedt: well, i think emailing your doctor should be the first order of business

6:50 Raynes: Whoa

6:50 Emailing?

6:50 Apage43: as in LDL was *lower* than normal?

6:50 Raynes: You can do that with doctors?

6:50 callen: there's nothing to fix nor be concerned about, I'm just moaning.

6:50 Raynes: Must be them fancy Californian doctors.

6:50 callen: Apage43: higher, for expected and temporary reasons.

6:50 mthvedt: i lived in chicago

6:50 Apage43: ah

6:50 mthvedt: we're modern here

6:50 callen: 'ish

6:51 mthvedt: once I adapt to my current pace I'll be fine.

6:51 Apage43: higher is typically not worth worrying about unless accompanied by other stuff

6:51 mthvedt: callen: if you think it's a lifestyle issue, don't adapt

6:51 overtraining your brain/work habits is just as bad as overtraining your body

6:52 callen: I don't think I'm over-training too badly, I'm doing 9-10 miles and 2-3 gym lifting visits a week

6:52 or at all, for that matter.

6:52 mthvedt: oh, sorry, i got your words switched further up.

6:53 callen: mthvedt: yeah it's insomnia + few calories + exercise

6:53 mthvedt: rest is important for gainz

6:54 callen: mthvedt: I'm cutting, hence misery.

6:54 mthvedt: invariant under sign flip

6:54 callen: cutting + running + lifting is a special hell I wouldn't wish on my worst enemy

6:54 I have a hard time even getting dressed

6:55 the problem is I'm a huge bitch so I need to moan about it :P

6:56 mthvedt: that still doesn't sound healthy, although i am a non expert on cutting.

6:57 callen: it's unpleasant but I have enough fat that I'm in no real danger.

6:57 The obese can get away with not eating at all except for water and vitamins for weeks and months on end.

6:59 mthvedt: still, chronic overstress on your body can have long term consequences

6:59 callen: so can being in bad shape

7:01 mthvedt: yes, but health:exercise is not a linear relationship. there's diminishing returns and, eventually, a maximum point

7:06 Raynes: #nutrition

7:09 (just kidding, nobody is here)

7:16 mthvedt: is there no unchecked version of number comparisons

7:19 Okasu: Raynes: : stats/##nutrition: +o[1] +v[0] -o[44] - total: 45

7:19 Apage43: mthvedt: what would it not check?

7:20 mthvedt: agape43: if you dig into the clojure code it casts and boxes things

7:20 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L218

7:21 hang on, that's wrong

7:21 that's a code generation piece for an :inline

7:22 no, i was right the first time. that's the actual fn

7:23 i was tracing this code, and there's a weirdly high number of method calls and object constructions for comparing two longs. seems wrong

7:24 Apage43: looks like it has overloads for primitive types https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L3710

7:25 .. sort of

7:25 mthvedt: i'm looking at the inliner now… it seems to go away for some spots but not others.

7:25 Apage43: nothing for (long, long), just for (long, double) or (long, Object) or either flipped

7:26 mthvedt: maybe i think i have a primitive where i actually don't somewhere

7:26 Apage43: perhaps, found the long, long one. Just further up https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L1775

7:30 something's probably causing it to box, but it shouldn't be < (unless inlining isn't happening)

7:31 mthvedt: well, i fixed the boxing, but it didn't help, because there's more boxing further up

7:32 i mean it did help a little

7:32 but its not what i wanted

8:42 Glenjamin: To release a lib as EPL, do I just slap an EPL licence on it, or are there some other steps?

8:57 noncom: hi, in my program i take data from audio sample buffer, and that operation shows down the execution from 1500 fps to 100 fps in my program. Asking the buffer array of the numbers is what takes so long. But I do not need that data more often than 60fps. What is the best way to split the threads and put the data acquisition in a separate thread, so that my main thread will not slow down?

8:58 i guess i better use an agent for that?

8:58 but then how do I avoid unnecessary calls for data update?

9:03 echo-area: Is there anyone in NYC? How long does it normally take to go to Adams Street from Midtown?

9:04 I know this is off-topic. Sorry.

9:04 noncom: i will try it with promises

9:16 bruceadams: Glenjamin: sure, so long as you wrote the lib, or have clear permission from whoever wrote it.

9:16 Glenjamin: cool, thanks

9:23 clojure-new: hello

9:25 is there any markuplanguage->html library for clojure? I have form and in this form user can type things, what i want is after user submits this form parse it and transfrom into syntaxhightlighted formmatted text.

9:25 or maybe there is better approach to this, not sure

9:25 can you recommend something?

9:35 bruceadams: clojure-new: http://refheap.com does syntax highlighting of many programming languages, using the pygments library, code here: https://github.com/Raynes/refheap

9:39 clojure-new: i think i should use this one http://softwaremaniacs.org/soft/highlight/en/ but what approach do you recommend? Strip all html tags -> detect if inputs includes somthing like [[[code]]][[[/code]]] -> wrap it in div with id="highlight" -> hightlight with some highleghter

9:39 how this sounds?

10:01 how can i escape html in clojure?

10:01 is there lib for that

10:04 jjttjj: clojure-new: https://github.com/yogthos/markdown-clj

10:04 is that what you're looking for?

10:04 see also: http://daringfireball.net/projects/markdown/

10:06 clojure-new: jjttjj: no, i'm looking for library for santize user input

10:06 to be morem presise - escape html from user input

10:10 ,(-> "<h1>test</h1>" str (.replace "&" "&amp;") (.replace "<" "&lt;") (.replace ">" "&gt;")))

10:11 clojurebot: "&lt;h1&gt;test&lt;/h1&gt;"

10:11 clojure-new: how do you think guys, is it secure?

10:12 it is not efficient, thats for sure

10:14 xeqi: basically what hiccup does, https://github.com/weavejester/hiccup/blob/1.0.2/src/hiccup/util.clj#L53

10:16 clojure-new: xeqi: thanks

10:21 m0smith: is anyone using nrepl-ritz?

10:22 kmicu: y

10:29 noncom: what is clojure's syntactic convention for getters?

10:29 for naming them i mean

10:33 bbloom: noncom: what's a "getter" exactly in the context of clojure?

10:34 noncom: bbloom: well, yeah, it sound more like oop-ish, but think of specific functions that get specific keys/values from maps of a known format

10:35 bbloom: ahh.. maybe it is more useful to name them according to their role? like 'extract-building-costs' or 'building-costs-of' or smth?

10:36 or should it simply be 'building-costs'? but that name seems somewhat unclear

10:36 ddellacosta: is there any way to figure out what lein profile I'm running under in my actual app/lib? Or is that considered bad form for any reason?

10:36 bbloom: noncom: keywords == getters for simple keys

10:36 noncom: (:first-name {:first-name "Brandon" :last-name "Bloom})

10:36 ,(:first-name {:first-name "Brandon" :last-name "Bloom})

10:36 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading string>

10:36 bbloom: ,(:first-name {:first-name "Brandon" :last-name "Bloom"})

10:37 clojurebot: "Brandon"

10:37 noncom: bbloom: yeah, but i want to extract comples patterns (subtrees)

10:37 * bbloom needs some coffee

10:37 noncom: bbloom: i just had a cup of coffee :D

10:37 i just thought maybe there is some naming convention like with the '?' postfix

10:37 for boolean returning funs

10:38 bbloom: noncom: some people use the "get-" prefix, but i don't think it's necessary at all

10:38 in fact, it's mostly redundant

10:39 noncom: yeah, probably, most of the times it is

10:40 Glenjamin: ddellacosta: you're usually better using environ

10:40 ddellacosta: Glenjamin: yeah, I'm using an environment variable now, but it irks me that I'm setting that plus using test profile, for example

10:41 Glenjamin: mostly 'cause I forget to set the environ sometimes. Doh.

10:41 Glenjamin: you can have the environment variables in the project.clj

10:41 ddellacosta: Glenjamin: ah, that was the magic sauce I was looking for. Thanks, I'll look into that!

10:41 Glenjamin: i've got things like :force-ssl under :production

10:41 https://github.com/weavejester/environ

10:42 ddellacosta: Glenjamin: oh, I thought you mean like, environment variables--you were talking about something else entirely. Gotcha!

10:42 very cool, thanks.

10:42 Glenjamin: that lib wraps up a few similar things under one accessor :)

10:43 ddellacosta: That is perfect, *exactly* what I was looking for.

10:43 I'm trying to set a test db vs. dev db, and keep accidentally wiping my dev db 'cause I can't remember to set the frigging variable. This will save me lots of pain.

10:44 Glenjamin: ah, for DB credentials i'd usually keep them out of version control

10:44 but i've got a few files I source into my bash prompt to set up the env variables

10:45 or you could use an alias to only set the environment variables when you need them - depends how strict you want to be about config :)

11:18 gfredericks: i've just published my spies lib if you're still looking for something like that - https://github.com/glenjamin/q

11:25 rlb: if you need to force a file sync, is it reasonable to just create a FileChannel yourself and use force, or is there a better way?

11:57 jaley: I want an API i'm writing to be called like this: (arrange-images images), or (arrange-images images :fast-but-ugly-method), (arrange-images images :slow-but-pretty-method), etc. I'd also like to plug in other implementations later… feels like multi methods? I just kind figure out how to make them do that

11:58 llasram: jaley: Looks exactly like multimethods

11:59 Do give some thought to argument-order though. There's some benefit to having the primary dispatch token come first -- `partial` etc

11:59 But multimethods give you the flexibility to do it however you want

12:01 Glenjamin: i'm using speclj to run my tests - it defines a lein task which calls leiningen.core.main/exit with the exit code - when I use this inside with-profile it causes an exception

12:01 what's the correct way to handle this case?

12:02 jaley: llasram: ok, that's what I thought. but… how? what would the dispatch function look like?

12:03 llasram: jaley: (fn [images algo] algo) should do it

12:04 There's no magic

12:04 jaley: then my methods take the same args?

12:04 llasram: Then (fn [algo & args] algo)

12:04 Another reason to put the dispatch-token first :-)

12:04 jaley: so, if i take your advice and move alto first

12:05 Glenjamin: (fn [images & [algo]] algo) will work

12:05 llasram: Or really (fn [images algo & args] algo) would work too

12:05 jaley: right, but isn't it the case that the defmethods receive exactly the args the dispatch fn received?

12:05 so they need to ignore the first arg?

12:05 Glenjamin: correct

12:06 jaley: (defmethod foo :some-implementation [_ images] …) ; for example?

12:06 this is what made me think maybe I was doing it wrong.. :P

12:07 llasram: That's the way the method mungles

12:09 jaley: ok cool, that'll do it. thanks guys

13:45 yogthos: technomancy: hey any chance you could nuke the luminus-template repo for me again? :)

13:45 technomancy: it's getting a bit big again :)

13:50 wink: yogthos: ah, got a sec for some luminus/general questions? :)

13:50 yogthos: wink: yeah sure

13:51 wink: yogthos: I'm unsure about how to handle optional GET-parameters. Like.. talking to a haskell user regarding the Request monad in yesod, if you know that?

13:52 yogthos: wink: uhm not really familiar with that one, can you give an example?

13:52 wink: yogthos: code example is https://github.com/winks/multiplex/blob/master/src/multiplex/routes/home.clj#L189

13:52 optional page=x&limit=y

13:53 that need to be passed inside quite a few functions. and it's about how to do it beautifully, not just "it works"

13:53 yogthos: wink: I think in that case you might want to grab the full request instead of destructuring

13:53 wink: (GET "/user/:username" req-map ...)

13:53 wink: yogthos: but I'm not mistaken and libnoir has anything to work with requests specifically?

13:53 I'd hate to pass the request-map everywhere

13:54 yogthos: wink: that part's mostly handled by compojure

13:54 wink: but it's kind of "grab something from the global state per-request"

13:54 yogthos: wink: it does have a context

13:54 wink: http://weavejester.github.io/compojure/compojure.core.html#var-context

13:54 wink: sounds like that might be what you're looking for?

13:55 ambrosebs: Someone might enjoy this: core.typed workshop from YOW! Lambda Jam http://www.youtube.com/watch?v=ZW7HinnoGhk

13:59 wink: yogthos: thanks a lot, will have a look

13:59 yogthos: wink: cool stuff

14:28 arrdem: how would you guys suggest getting my feet wet with clojure.core's implementation?

14:29 besides just a git clone and two weeks with code and coffee :p

14:34 mhr: Hi, is there something like socketstream/meteor/derbyjs for clojure/clojurescript?

14:39 addittionally, I want to use clojure, but I'm concerned that if I use clojure for a gui-based app, it'll be slow because it's using java, so is there a port of clojure using C or C++?

14:41 murphy_: good afternoon! I realize I'm a bit out of date here, but if I'm looking for help with setting up vimclojure, is this the right place to ask?

14:41 Or should I give up on vimclojure since it's a dead project and use fireplace instead?

14:41 (I've liked using vimclojure in the past)

14:42 ianeslick: mhr: Depends on the GUI

14:42 Java can be plenty fast, depending on what you need it to do.

14:42 mhr: yeah, I realize, but in my experience using java-based apps (I haven't made any java apps before), they seem to lag

14:43 I can't really point to a specific application

14:43 ianeslick: mhr: Are you thinking about Eclipse, for example?

14:43 n_b: Is your experience Eclipse? That's not a representative sample

14:43 mhr: nope, like I said, never made a java app before, so never used eclipse

14:43 ianeslick: mhr: For web, there is Pedestal, although it's still a little immature

14:43 mhr: my main question is: is there a C/C++ port of clojure?

14:43 ianeslick: mhr: Short answer is no.

14:43 mhr: what's the long answer? :P

14:44 n_b: Why use Clojure and not Chicken Scheme or similar?

14:44 mhr: pedestal, cool I'll look into that

14:45 good question. clojure seems to have the better community from what I've read

14:45 there's not exactly huge Chicken Scheme or Racket conferences

14:48 ianeslick: mhr: Clojure has quite a few improvements on the old Scheme / Lisp systems, but most importantly can interoperate with the massive base of Java libraries and applications.

14:49 hyPiRion: I think the most important part is that it has a large library base and is more pure/immutable/simple than any other

14:49 mhr: isn't that only useful if I'm coming from the java world and I am already familiar with all those libraries?

14:49 ianeslick: mhr: There is no fundamental reason why Java/Clojure has to be that much slower than C/C++, but it is easier to design slower systems in Java. Also, there isn't yet a good way (that I"m aware of) to tap native UI kits easily from the Java system. Although Win 8 apparently makes JS a first class language, so with some tooling pain you could use Clojurescript.

14:50 mhr: If you know the C/C++ landscape really well, then you might be better look into an Embeddable Scheme, or Lua, or something like that.

14:51 TEttinger: yeah LuaJIT is absurdly fast

14:51 kinda doesn't help with threads thougg

14:52 mhr: haha I don't, I'm actually just learning C right now as a matter of fact. I think it'd be cool to be able to make a C-speed clojure gui application, particularly because clojure has all those concurrency advantages

14:53 hyPiRion: check out clojure-metal in 6 months or so

14:54 n_b: Many of those concurrency advantages are built on top of very powerful JVM tech.

14:54 TEttinger: yeah, that's true

14:54 hyPiRion: tbaldridge has a very straight plan on how to get it working properly

14:54 n_b: Like are reducers in cljs yet?

14:56 mhr: clojure-metal is exactly what I'm looking for, thanks

14:56 hmmm...maybe not...

14:56 r0bglees0n: isn't the JVM really fast though?

14:56 lfranchi: is there an idiomatic way in clojure to, given a list of ints, search for a subsequents of ints? e.g. 1 2 3 4 in '(2 4 1 2 3 4 9 9(

14:59 ianeslick: I think the idea that C is alot faster is mostly a red herring these days. Very few applications really require that degree of low level performance, and usually only in a small portion of the code.

15:00 You pay alot more to write an application in C - of course if you could have a Clojure no the metal it would remove some of the overhead and allow you to use native frameworks like Cocoa, etc more easily.

15:01 mhr: I was thinking that the easiest way to make a C-speed clojure is to simply write a compiler for clojure in chicken scheme (because there's already a ton of already-included primitives that both scheme and clojure share) and then bootstrap it

15:02 Okasu: mhr: https://github.com/takeoutweight/clojure-scheme

15:03 n_b: What is your application doing that speed is so paramount?

15:03 cbp`: lfranchi: That's a dynamic programming problem. No real straightforward implementation unless you wanna turn them to strings and use regex I guess. But java's regex are a bit slow I think.

15:03 nightfly: I would really love to see a selfhosting clojure native clojure with less reliance on a "host" language.

15:03 mhr: nothing, I just want to get speed as a given so I don't have to worry about it

15:06 Okasu: that's only cljs->scheme->C

15:08 cbp`: Wait not dynamic programming

15:08 just pattern matching

15:09 Still not the easiest algorithm :P

15:09 lfranchi: cbp`: yeah i'll do it the boring way

15:11 n_b: the way I'd do it is a recursive take-while or similar, but I'm not great at that sort of problem

15:12 cbp`: If you wanna implement a linear time algorithm you can check out these videos: http://nptel.iitm.ac.in/courses/106101060/14

15:12 lfranchi: yeah i can just do it with drop-while i think

15:12 cbp`: Naive implementation is O(n^2) irrc

15:12 lfranchi: take + dropwhile

15:13 i don'tneed to win any benchmarks :)

15:13 cbp`: Well as long as it isn't a very important process :P

15:14 O(n*m) i mean

15:17 hyPiRion: lfranchi: subsequence or substring?

15:31 jjttjj: is there a replacement in noir-lib for noir.util.test/with-noir?

15:31 lib-noir i mean

16:01 gfredericks: am I weird for using :type metadata on my own defrecord?

16:07 jtoy: anyone here using clojure and vim as their main environment? I had some questions on how to be most productive in vim

16:08 wink: jtoy: I am using this and I am totally the wrong person to ask, because I don't actually like this environment :P

16:09 jtoy: i use vim to edit, and while i am testing different pieces of code, i also have a repl in a terminal and reload the class and then rerun the function, i am doing this all day and seems kind of ineefficient

16:10 i know in emacs ppl have a live connection to the repl

16:11 llasram: jtoy: I don't use vim myself, but we just did a "dev enviroments workshop" in the Atlanta Clojure meetup group, and got see vim fireplace

16:11 jtoy: As far as I can tell, it has nearly complete parity with what you can do in Emacs

16:11 You get a running REPL, into which you directly chuck stuff from your editor

16:12 jtoy: llasram: do you know if there was a video of that?

16:12 llasram: No... We're not quite that slick (yet), I'm afraid :-)

16:12 jtoy: i've heard of the concept , but i want to see it in action

16:12 llasram: It appears to be very easy to set up though

16:12 jtoy: seems like clojure and vim is like going against the ide

16:12 tide

16:13 llasram: I would have said that prior to foreplay/fireplace. But like I said -- they look to have largely the same features

16:16 wink: http://clojure-doc.org/articles/tutorials/vim_fireplace.html looks good

16:18 as of yet I haven't managed to work in a useful speed in emacs

16:26 jtoy: thx

16:37 ysawej: Hi all

16:38 how do I access "getAlgorithms" method of Provider.Service? http://docs.oracle.com/javase/6/docs/api/java/security/Provider.Service.html

16:39 I tried (import '(java.security Provider)) then used (Provider.Service/getAlgorithms) but that doesn't work

16:39 *getAlgorithm

16:39 llasram: ysawej: Inner classes are a Java fiction. Their real JVM names are Outer$Inner

16:39 ysawej: oh!

16:40 llasram: So probably importing Provider$Service, then calling Provider$Service/getAlgorithms

16:40 ysawej: I still feel new to clojure :)

16:41 also, it is a static class

16:42 llasram: Gotta learn something new each day!

16:42 ysawej: so how does I access Provider$Service/getAlgorithm

16:43 llasram: Just like you would any other class + static method. This class just happens to have a '$' in the name

16:43 ysawej: yeah.. I have been using the immutable part of clojure for sometime, got to start delving into the "states" and also java interop

16:44 llasram: Oh, It's not a static method

16:45 So yeah, like I said above, only s,static,, :-)

16:48 ysawej: yup.. looks like I'll have to create a new Instance, then get algorithms, etc.. I'll could rather use java.security.Key/getAlgorithm

16:49 thanks llasram !

16:49 llasram: np!

17:09 jtoy: anyway to see the last results from fireplace? i closed the window by accident

17:11 llasram: jtoy: Can you evaluate the value of `*1`?

17:11 I'm actually not sure of the process of how those get set in REPL sessions, but might work

17:21 gfredericks: ,#'*1

17:21 clojurebot: #'clojure.core/*1

17:26 tomoj: gfredericks: does sound a bit weird..

17:27 gfredericks: tomoj: ah well :)

17:27 tomoj: might the :type have different values for a single record type?

17:28 gfredericks: yeah I only have one record actually

17:29 Glenjamin: oh, gfredericks - are you still looking for a stubs/spies lib?

17:29 gfredericks: Glenjamin: not actively

17:29 I remember there being a decent one last time I heard of the topic

17:29 Glenjamin: published mine today if you're after one again - https://github.com/glenjamin/q

17:29 it's based off bond, but with more helper functions

17:30 gfredericks: ah bond was the one I remembered

17:32 Glenjamin: looks like good stuff

17:37 is it wrong to say that a java method call is polymorphic in all the arguments (including 'this')?

17:38 I guess the "dispatch" on the non-this args is always done at compile-time

17:38 maybe that's the main difference

17:42 callen: Raynes: http://www.youtube.com/watch?v=xzQvGz6_fvA

18:04 jtoy: im doing a new clojure project that will need to have a persistent backend, any recomendations that fit better with clojure, this is a toy project

18:06 gfredericks: jtoy: probably whatever you have an easiest time setting up :)

18:06 jcrossley3: jtoy: a lot fit well with clojure, but datomic is prolly the current hotness

18:07 jtoy: i normally use postgresql

18:07 gfredericks: I use postgres with java.jdbc and honeysql at work

18:07 jtoy: all my clojure projects have been processing files on disk, never worked with any persistent dbs before, i assume its mostly the same as other languages except for immutable issues

18:08 gfredericks: you mean a lack of ORM issues

18:09 jtoy: ? I've used both orms and raw db drivers, i'd rather use an orm for the almost all queries

18:09 gfredericks: there's more than those two options

18:09 honeysql+java.jdbc is a lot different from raw db drivers

18:09 jtoy: I mean in other languages, not clojure

18:10 gfredericks: sure; I just meant that most of the complexity in other languages is trying to make ORMs work

18:10 jtoy: honeysql looks pretty cool

18:11 gfredericks: does honeysql do inserts? according to this https://github.com/jkk/honeysql it doesnt

18:11 gfredericks: correct

18:11 because java.jdbc is not terrible about inserts

18:12 traditionally the worst thing about java.jdbc is writing SELECT queries

18:12 if you want any kind of composability you end up doing the awfullest of string manipulations

18:12 jtoy: i would like to use a solution where i dont have to write any java, i've never written any java

18:14 gfredericks: I don't think java.jdbc involves much

18:14 none that I can think of off the top of my head

18:14 I assume by "java" you mean "java interop"

18:14 not literally java code

18:15 jtoy: i havent written any java code at all, i have done some java interop code, but that assumes i've written java, which i havent so that part can be slow at times

18:15 gfredericks: my hunch is all you really need to understand is the jvm object model

18:15 which is a lot simpler than e.g. ruby's

18:16 jtoy: i came from ruby before clojure, i really like ruby and clojure, dont like java much

18:16 i will use honeysql and jva.jdbc with sqlite for this project, thanks!

18:17 Raynes: bleh

18:17 gfredericks: np

18:17 jtoy: Raynes: why?

18:17 Raynes: jtoy: MongoDB is tons of fun.

18:17 jtoy: Raynes: i used mongodb for a proejct a few years ago, experience the disapearring data and never came back

18:18 Raynes: You said this was a toy project.

18:19 In any case, I haven't had the disappearing data experience. *shrug*

18:19 gfredericks: Raynes: quick go check

18:20 jtoy: Raynes: true

18:20 trying to understand datomic, if i use the free edition, is my data not persistant?

18:20 Raynes: Nonetheless, you can use whatever you want of course.

18:20 Trying to understand datomic is a full time position.

18:21 callen: Good tune.

18:21 gfredericks: jtoy: it is persistent

18:21 in some kind of embedded jvm database

18:21 jtoy: Raynes: ok, so I guess I wont try that "new hotness" then

18:21 AWizzArd: I want: (defmulti foo #(class (first %)) and (defmethod foo Integer [& ints] (...)) When I now call (foo (int 10) (int 20)) I get an arity error. Ideas?

18:22 gfredericks: AWizzArd: you need the dispatch function to be variadic

18:22 llasram: Yeah, try e.g. #(class (first &%))

18:22 gfredericks: %&

18:22 AWizzArd: ah, sure

18:22 jtoy: i dont really understand why its so great anyway

18:22 llasram: Er, typo

18:22 Thanks

18:22 Glenjamin: &% does variadic on #() ? thats ugly :(

18:22 lazybot: java.lang.RuntimeException: Unable to resolve symbol: % in this context

18:23 llasram: Glenjamin: %& -- I typoed

18:23 callen: jtoy: the free edition has limited durability AFAIK

18:23 Glenjamin: oh, makes a bit more sense, but still a bit arcane

18:23 Raynes: Glenjamin: Well, you don't have to use it.

18:23 Glenjamin: mm

18:23 Raynes: There aren't many options for short forms like this.

18:24 If it looks too bad, you can always just use (fn [] ..)

18:24 jtoy: callen: that makes it even harder to test then :(

18:24 Glenjamin: yeah, i think (fn [x & xs] x) is a bit clearer

18:24 jtoy: sqlite it is

18:25 gfredericks: callen: limited durability?

18:26 Glenjamin: jtoy: http://sqlkorma.com/ might be worth a look

18:30 callen: jtoy: just use sqlkorma and PostgreSQL

18:32 Raynes: Or if you leave and just go do your project you might actually get it done with something because if you stick around here asking what you should use everybody is just going to give you different answers and make you even more indecisive. :p

18:32 callen: jtoy: follow Raynes' advice, but use PostgreSQL and sqlkorma.

18:32 Raynes: ~guards

18:32 clojurebot: SEIZE HIM!

18:32 Glenjamin: i hear rethinkDB is cool...

18:33 Raynes: Yeah, but callen hasn't finished his driver yet.

18:33 :D

18:33 yogthos: GOOD DAY TO YOU SIR.

18:34 jtoy: which is better sqlkorma or honeysql ?

18:35 Glenjamin: korma has a nicer website

18:36 wink: korma needs some doc updates

18:36 I found it awfully hard to jump into

18:37 but after that hurdle I'm quite happy

18:37 callen: jtoy: korma is superior.

18:40 cbp`: macros overused :-(

18:40 need literal SQL :D

18:42 callen ! when are you gonna put me to work :-D?

19:12 AWizzArd: Is there a better way than (instance? (class (double-array 0)) my-double-array)?

19:41 llasram: ##(Class/forName "[D")

19:41 lazybot: ⇒ [D

20:11 muhoo: callen: superior how?

20:12 ok, is there a lein plugin that will make a lein template out of an existing project?

20:13 Raynes: &(l/parse-fragment "<p>fragment!</p>")

20:13 lazybot: ⇒ ([{:type :element, :attrs nil, :tag :p, :content ["fragment!"]} nil])

20:14 Raynes: It just occurred to me that you can use laser from lazybot cause it's a dependency. :D

20:22 Sgeo: laser?

20:27 Raynes: Sgeo: https://github.com/Raynes/laser

20:28 jimkcar: is there a way to do a deftype with a type-hinted and unsynchronized mutable argument?

20:28 Sgeo: Any relation to lenses?

20:28 gfredericks: jimkcar: do the deftype docs not say so?

20:30 jimkcar: i don't see that it says they're mutually exclusive

20:30 I think its me not understanding the correct syntax

20:35 (deftype Foo [^{:unsynchronized-mutable true **type-hint**} myarg])

20:35 not sure what to use in the **type-hint** area. it's a map, so what is the key for a type hint?

20:36 gfredericks: jimkcar: you can use multiple metadata syntaxes together

20:36 but it's also good to know that ##(meta (read-string "^Foo bar"))

20:36 lazybot: ⇒ {:tag Foo}

20:36 gfredericks: ^ you could probably use :tag as well

20:37 (deftype Foo [^ItsClass ^{:unsynchronized-mutable true} myarg] ...)

20:43 jimkcar: @gfredericks thanks. now it seems to not like that ^ItsClass is a defrecord type

20:44 gfredericks: o_O

20:44 is it from another namespace? do you need to :import it?

20:44 nerdfunk: hi there

20:46 jimkcar: yeah I keep going in circles with that. this is in myapp.somens and i'm doing a :require myapp.core :as core and it wont find core/ItsClass

20:46 not sure if that makes sense.

20:46 gfredericks: it does

20:46 classes still have to be imported

20:47 as java classes

20:47 classic gotcha

20:48 jimkcar: I see, so even though its clojure, I still have to import it.

20:48 gfredericks: exactly

20:49 jimkcar: and my :require is just pulling in all the defn from there

20:49 gfredericks: yeah, the vars

20:49 jimkcar: not the deftypes and defrecords

20:49 gfredericks: right, not the classes

20:50 though for a (defrecord Foo ...) you'll get vars called ->Foo and map->Foo

20:50 and those will be :require'd as normal

20:51 jimkcar: I know map->Foo, but what's up with ->Foo

20:51 ?

20:51 gfredericks: for (defrecord Foo [a b c]) it is equiv to (defn ->Foo [a b c] (Foo. a b c))

20:52 pretty much identical to the constructor, but it's a var/fn so more flexible

20:52 jimkcar: So the Foo. doesn't get pulled in with the require?

20:54 gfredericks: right. that's just an interop form for the class's constructor

20:55 jimkcar: so should I be using ->Foo instead of Foo. everywhere?

20:55 gfredericks: may as well; it's easier

20:56 only reason I can think of to use Foo. is if you're trying to squeeze every last cent out of your perf

20:57 jimkcar: ok, it at least makes things consistent between files

20:58 gfredericks: ->Foo also lets you do aspect-oriented things like adding preconditions

21:00 so seems like good practice in general to avoid the constructor

21:00 jimkcar: Because it's a full-on IFn, not a Java Constructor method?

21:01 gfredericks: right

21:01 jimkcar: got it

21:02 now all I'm getting is a ClassNotFoundException I'm importing it.

21:03 gfredericks: I'm out of ideas then. You could post a code sample.

21:03 jimkcar: the exception is in the typehint

21:03 sure, I'll try

21:04 gfredericks: (refheap.com)

21:20 jimkcar: @gfredericks https://www.refheap.com/paste/14772

21:20 gfredericks: jimkcar: ah ha

21:21 the :as core does not apply to the imported class. You should be able to refer to it as simply ^MyType

21:22 jimkcar: shouldn't the fully qualified work too? i.e. ^my-app.core.MyType

21:22 gfredericks: yep

21:22 jimkcar: I've been trying all kinds of stuff, but its not working

21:23 * gfredericks pastes into his repl

21:23 gfredericks: oh whoops

21:24 fully qualified would be my_app.core.MyType

21:24 i.e., the classname has underscores in it

21:24 because java packages can't have dashes

21:24 the thing is coming all the way from javaland and it got beat up there

21:24 so that applies to the :import as well

21:25 yeah the whole thing works for me after those tweaks

21:26 jimkcar: yep, all is right with the world as far as that goes. Thanks

21:27 gfredericks: :) np

21:27 clojure is just a giant pile of leaky abstractions

21:27 jimkcar: ugh, now more....

21:28 in that last deftype, in the domorestuff i'm trying to do this .... (dostuff somearg)

21:28 using the protocol fn from the other namspace isn't working

21:30 gfredericks: should it be (core/dostuff somearg)?

21:31 jimkcar: yep! ;)

21:31 gfredericks: eventually it all starts to seem internally consistent

21:32 amalloy: hah. what a nice summing-up of computer science as a whole, gfredericks

21:32 jimkcar: wondering if I should change my app base namespace just out of spite

21:32 gfredericks: amalloy: consistent or leaky?

21:32 jimkcar: both. lol

21:34 thanks again for the help gfredericks

22:57 avishai: two newb questions

22:57 are binding vars visible to other threads? e.g. agents

22:58 brehaut: yes and no

22:58 llasram: Dynamic var bindings are explicitly thread-local, but see `bound-fn`

22:59 nightfly: Really? Hows the behavior if you create a thread within a binding?

22:59 llasram: The new thread sees the root binding

23:00 nightfly: That's kinda disappointing to me, but understandable.

23:01 brehaut: llasram: im not sure thats right

23:01 llasram: brehaut: Oh?

23:02 brehaut: llasram: i just tested it with (def ^:dynamic d 1) @(future d) #_ 1 (binding [d 2] @(future d)) #_ 2

23:03 llasram: Yeah, so 1.3 made things weird with `binding-conveyor-fn`, which is used by several things like send-off and future-call

23:03 brehaut: could be ive missed some semantics of futures, but im i think that test case is correct

23:03 right, so if i had used Thread. it would have been different

23:03 llasram: Those Clojure-specific constructs will carry along the thread binding frame of where they are defined

23:03 Exactly

23:04 But IMHO it's a misfeature which just makes dynamic scope even more difficult to reason about

23:04 (the behavior of `future`, not raw `Thread.` seeing the root bindings)

23:05 brehaut: (binding [d 2] (let [p (promise)] (.start (Thread. #(deliver p d))) @p)) #_ 1

23:05 as you suggest

23:05 nightfly: That's really whacky behavior

23:06 brehaut: how did binding conveyance work prior to 1.3?

23:06 im sure that since pre 1.0 the docs have suggested the thread locals behave as per the future and send examples

23:07 llasram: Hmm

23:07 brehaut: (first guess suggests that you could do it relatively easily, but it'd be slow as hell)

23:08 avishai: what if i don't do (def)

23:08 just (binding [d 3] (send a something))

23:08 brehaut: avishai: if you want thread shared mutable values, defs are probably the wrong choice anyway. look at atoms and refs

23:08 avishai: i want a shared config

23:08 atom seems overkill

23:08 llasram: brehaut: My reading of the clojure git logs doesn't show any obvious-to-me earlier binding conveyance, but I only started using Clojure w/ 1.3, so I don't know

23:09 avishai: another option is promise

23:09 brehaut: avishai: atoms are extremely the right choice

23:09 avishai: really? my gut said promises

23:09 Apage43: config seems like something you might want to change later

23:09 brehaut: depends if you want them to change

23:09 Apage43: which promises don't get you

23:09 avishai: no

23:09 brehaut: llasram: im running on recollections of the docs not actual trying it out, so who knows :P

23:09 avishai: i just populate the config in main

23:10 Apage43: at any rate, promises *do* get you that anything that tries to read it will block until its delivered

23:11 avishai: so, just to get my story straight:

23:11 Apage43: which might be what you want if you might be spooling off workers before you've loaded it

23:11 avishai: binding is thread local

23:11 and agents/futures dont see the values from it

23:11 they see the value from root binding established by def

23:11 brehaut: avishai they _do_ see values if you use future, future-call and send

23:12 Apage43: well, futures do

23:12 avishai: and if there is no def, they see.... what?

23:12 Apage43: creating a future captures the current bindings at the point it was created

23:12 llasram: What is the sound of one thread binding?

23:13 Apage43: avishai, if that name is not def'd anywhere the code won't compile

23:13 avishai: i should write a few test programs to get familiar i guess

23:13 10x

23:13 another question

23:14 suppose i have a program, which uses agents for parallelization

23:14 consume from q -> process message -> analyze -> send emails

23:14 send emails function is all about side effects

23:15 it feels wrong to use agents send-off for it

23:15 brehaut: avishai: also read the clojure.org docs on vars, refs, agents and atoms

23:15 llasram: That is one thing the clojure.org docs are definitely good for

23:15 avishai: since its state mutation is really artificial, the state change is really just to mark side effects happened

23:16 perhaps a watch is a better fit?

23:16 brehaut: ive forgotten who wrote the great java exectuors from clojure perspective blog post

23:16 llasram: Or just a thread pool

23:17 Oh, I'd be interested in reading that as well, brehaut

23:17 brehaut: http://blog.raek.se/2011/01/24/executors-in-clojure/

23:17 i think thats the one i was thinking of

23:17 maybe raek_ will jump in

23:19 ysawej: Hi all, what happend to data.codec

23:19 I want to use base64 encode/decode methods

23:20 brehaut: ysawej: looking at the github, its currently a snapshot only

23:21 you'll need the central snapshot repo in your project.clj

23:21 llasram: Efficient base64 in pure Clojure is cool and all, but any reason not to just use commons-codec etc?

23:22 brehaut: llasram: none that i have seen; i used commons-codec and it seems completely fine

23:22 :repositories {"sonatype-snapshots" "https://oss.sonatype.org/content/repositories/snapshots/&quot;}

23:23 https://oss.sonatype.org/index.html#nexus-search;quick~data.codec

23:25 avishai: hmm:

23:25 user=> (def ^:dynamic test1 0)

23:25 #'user/test1

23:25 user=> (binding [test1 1] (send a #(conj % test1)))

23:25 ‏#<Agent@21be6e23: [1]>

23:25 user=> (binding [test1 1] (send-off a #(conj % test1)))

23:25 ‏#<Agent@21be6e23: [1 1]>

23:25 user=> (send-off a #(conj % test1))

23:25 ‏#<Agent@21be6e23: [1 1 0]>

23:26 ysawej: okay, I was able to use it

23:26 thank u brehaut

23:26 avishai: it seems agents do see the binding changes

23:26 ysawej: when will these libraries make into clojure core

23:26 ?

23:26 brehaut: ysawej: the commons stuff is really easy to use though; its just two static methods

23:26 ysawej: yep

23:27 brehaut: contrib makes no garuntees or promises about a library moving to core

23:27 http://dev.clojure.org/display/doc/Clojure+Contrib for more

23:27 ysawej: yeah. but I feel there are many libraries for clojure in github, and its hard to differentiate well-designed ones from hacky ones

23:28 brehaut: contrib isnt exactly about highlighting projects as great

23:28 its more about licensing and copyright, and a more formal process

23:29 quality is an accidental consideration

23:29 (licensing and copyright mean it _can_ be promoted clojure, not that it will)

23:29 hiredman: contrib libraries can end up being light weight due to the dependency policies

23:30 brehaut: hiredman: dependancy policies?

23:30 hiredman: at least for a while there was a 3rd party dependency ban

23:30 maybe still?

23:31 brehaut: huh. unsurprisingly the confluence doesnt state this in a super obvious place

23:32 llasram: I think all dependencies need to be in Maven Central or at least Sonatype. No Clojars-only deps. But that's just a vague recollection from list-chatter surrounding the release of core.types

23:32 s,core.types,core.typed,

23:41 brehaut: ambrosebs: how did lambda jam go?

23:41 ambrosebs: brehaut: good thanks!

23:42 adu: lambda jam?

23:42 sounds awesome

23:42 brehaut: good turn out to the core.typed stuff?

23:42 adu: depends, sometimes it tastes a lot like birds

23:43 ambrosebs: brehaut: Yes, I was pleased. About ~110 ppl at the conference total, 3 tracks, probably about 20-30 people in the workshop.

23:43 brehaut: nice!

23:44 ambrosebs: brehaut: Scala and Haskell dominated as topics, so I wasn't sure how strong the Clojure presence would be.

23:44 brehaut: all those haskell and scala nerds probably had Opinions?

23:44 ambrosebs: Was pleasantly surprised.

23:44 brehaut: heh :)

23:44 ambrosebs: They weren't very vocal about them :P

23:45 brehaut: did you see the workshop I posted?

23:45 brehaut: i saw the link, but i havent had a chance to watch it yet

23:45 swamped with work :/

23:45 (he says, while blathering in irc)

23:45 ambrosebs: :D

23:47 avishai: i'd like to re-raise my question about using agents for side effects

23:47 is that a good fit or is a watcher a better fit?

23:51 brehaut: or a threadpool, as suggested earlier

Logging service provided by n01se.net