#clojure log - May 25 2013

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

0:16 callen: ecallen: okay. we're going to end up doing battle.

0:17 amalloy: see if you can get tieTYT2 and tieTYT to fight to the death too

0:18 thou shalt not mess up my tab-completion

0:19 callen: amalloy: it's just him being lazy about a shell, no?

0:19 ecallen is somebody else.

0:20 amalloy: I found out not long ago that some people don't use tab completion. I was hella confused.

0:20 amalloy: when i started using irc, i was new enough to the unix thing that i didn't instinctively try tab-completion

0:21 i might have tried intellisense

0:21 tomjack: so baffles me

0:22 ok so apparently you're not getting highlighted everytime anyone says so, but everytime I say so it is in bold

0:22 testing ignoring so

0:23 no joy :(

0:23 amalloy: oh yeah, erc highlights nicks mid-message. not a feature i'm a fan of

0:25 tomjack: erc trolls could just join a bunch of bot accounts going down the dictionary in frequency order

0:25 /nick every /nick word /nick I /nick fucking /nick type /nick is /nick bold

0:38 seangrove: tomjack: Yeah, I've noticed that too

0:39 Was imagining growl hooked up to that irc client...

0:46 devn: man, i totally take pagination for granted

0:46 rolling pagination by hand sucks

0:47 Could a decent library be written for it? Or is the whole web development story in clojure still too fragmented to allow it?

0:48 tomjack: what does pagination mean

0:49 incidentally pagination strikes me as something datomic is not good at

0:49 devn: <<- <- 15 16 17 18 19 20 21 22 23 24 -> ->>

0:49 tomjack: but maybe I haven't figured it out yet

0:49 oh, wow

0:49 devn: tomjack: this is about displaying the number of results on a web page

0:49 tomjack: I hate those things

0:49 devn: haha

0:50 well, would you rather see 1 2 3 4 ... 100000 on a website?

0:50 tomjack: I dunno

0:50 rbarraud: seen arbscht_

0:50 tomjack: I was thinking prev/next should be enough, but maybe not always

0:50 but who ever says "oh ok I'm on page 16, next I want to see page 22"

0:50 devn: prev/next is bummer usability

0:51 tomjack: because you might know your result is on page 22

0:51 and it's a sense of how many results were returned

0:51 tomjack: how? you did the query already before?

0:51 yeah, that makes sense

0:51 technomancy: if you do pagination without meta rel=next/prev you should feel a deep and abiding sense of shame

0:51 devn: "n pages of results" versus "1,240,495 results"

0:51 technomancy: </psa>

0:52 tomjack: I just always go through page by page I think

0:52 except gist

0:52 devn: technomancy: heh, i would have messed that up.

0:52 tomjack: then I jump around some

0:52 and it's always a nightmare cus I have no clue what page it's on

0:53 devn: technomancy: you don't know shame... https://gist.github.com/devn/1688d08c688d6c6ed431

0:53 that's me right now, just trying to nail down conditions and see it work before i factor it

0:53 tomjack: technomancy: because of the harm you cause to the 16 people using conkeror?

0:54 technomancy: tomjack: anyone not using a browser designed by simians

0:54 tomjack: I guess there are probably bots using it

0:54 devn: hahaha, oh conkeror

0:54 technomancy: "why should I change my name? he's the one that sucks"

0:54 devn: i so wanted to believe in the promise of conkeror

0:54 but that community is dead

0:54 technomancy: this is just basic web metadata

0:54 devn: technomancy: *nod*

0:55 technomancy: if your browser doesn't expose it, your browser is ridiculous

0:55 like with the conical hat and everything

0:55 devn: dunse. it's french.

0:55 technomancy: checkered jester outfit

0:55 devn: bells on the curled shoes

0:55 technomancy: now you're getting it

0:56 devn: technomancy: is it a crazy idea to try and provide a basic pagination library?

0:57 technomancy: devn: it bugs me

0:57 devn: technomancy: im just looking for a second opinion here. because i mean, if people provided their own search/db functions to "fill in the blank" for a few pieces of data, that should be agnostic enough for general use, right?

0:57 technomancy: because if you could make drop on a lazy seq just skip the act of generating elements, it would be easy

0:57 devn: but then again, i guess the problem is: "do you use hiccup, enlive, etc?"

0:57 technomancy: but I think there are subtle pitfalls that make that infeasible

0:58 devn: technomancy: could you give me a more conrete example?

0:58 concrete

0:58 tomjack: I don't see what functions would go in a pagination library

0:58 maybe a protocol?

0:58 devn: tomjack: mehhhhh, seems so heavy-weight

0:59 tomjack: it's weird

0:59 tomjack: I could understand if you define a new kind of data structure which you implement by different sources

0:59 rbarraud: arbscht_: There's a discussion on Twitter re. AKL meetups for FP - you might wanna have a look?

0:59 technomancy: "here's a seq, here's a page number, here's a page size: linky linky"

1:00 you could do that with lazy seqs, but it'd be wasteful

1:00 devn: technomancy: wasteful shmasteful

1:00 ToBeReplaced: i might be doing something silly... how can I change (or update) the nth value in a Cons?

1:00 tomjack: Sorted ?

1:00 devn: technomancy: err that's sort of naive though right?

1:00 technomancy: what about in the case of showing a use X pages regardless of the page they're on?

1:00 user*

1:01 tomjack: &(.entryKey (sorted-map 3 4 5 6) (first {3 4}))

1:01 lazybot: ⇒ 3

1:01 tomjack: that's odd

1:01 devn: so if you're on the last page you see <<- <- 90 91 92 93 94 95 96 97 98 99 100

1:01 technomancy: devn: if drop could be made to prevent actual seq element generation you could do it

1:01 but seqs aren't lazy enough

1:01 tomjack: Sorted has seqFrom which seems useful

1:02 oh I see entryKey ignores the data in the Sorted

1:02 devn: technomancy: hmm, sorry im dense tonight, but how do you mean more lazy? im staring at the source for drop now.

1:04 technomancy: if there were like a "super-drop" that could indicate to whatever was producing the seq to not even bother generating the elements that it was going to discard

1:04 devn: technomancy: oh i get you now

1:05 so it stands that you *can* do what you're saying

1:05 it's just wasteful

1:05 technomancy: yeah

1:05 devn: okay okay, I thought you were saying it couldn't be done

1:05 technomancy: I asked rich and he told me why super-drop couldn't really be implemented

1:05 but it was subtle, so I forgot

1:06 devn: shit. i want super drop.

1:06 tomjack: where is the problem, in clojure or in any data structure which would try to implement super drop?

1:06 I mean super drop is basically seqFrom, yes?

1:06 technomancy: tomjack: every lazy seq at its root has a call to clojure.core/lazy-seq

1:06 tomjack: oh, for lazy seqs?

1:06 technomancy: I think there are issues of dynamic scope around how super-drop would communicate its intent to lazy-seq

1:07 tomjack: yeah super-drop doesn't make any sense at all to me for a lazy seq

1:07 devn: WWHD? What Would Haskell Do?

1:07 technomancy: haskell is fully lazy

1:08 so you get super-drop for free

1:08 tomjack: huh?

1:08 I see

1:08 you're saying like (super-drop 10 (map f coll)) would skip 10 f calls

1:09 technomancy: aye

1:09 devn: i dont fully get the fully lazy distinction -- i guess i dont know laziness any other way than the way ive learned in clojure

1:09 tomjack: you still have to walk through the skeleton of the seq sequentially

1:10 I was thinking of a super-drop that lets you do (drop n coll) in constant time

1:10 devn: like the principle of what we're talking about i totally get

1:10 tomjack: ..near-constant .. or maybe just log :(

1:10 devn: but i dont know how haskell avoids that

1:11 * devn finds himself here: http://en.wikibooks.org/wiki/Haskell/Laziness#Lazy_and_strict_functions

1:13 devn: so Clojure is "strict" and Haskell is "nonstrict"?

1:13 tomjack: an unrealized value is ⊥. then there is (⊥,⊥), a pair of two unrealized values. or (a,⊥) or (⊥,b). you can build lists out of pairs like cons cells

1:13 in clojure lazy seqs specifically make the skeleton of seqs lazy

1:14 technomancy: devn: haskell is lazy-everywhere, clojure is lazy in seqs only

1:14 tomjack: but there is no (⊥,⊥)

1:14 you realize the lazy seq, ⊥, and get back (a,⊥)

1:14 technomancy: devn: yeah, but haskell people will say strict vs eager

1:14 devn: http://en.wikibooks.org/wiki/Haskell/Laziness#Nonstrictness_versus_Laziness

1:14 tomjack: then you realize the rest and you have (a,(b,⊥))

1:15 devn: technomancy: i see what you mean now.

1:15 tomjack: thanks to you also

1:15 tomjack: you _could_ count the seq by just realizing (⊥,(⊥,⊥)) etc

1:16 I wonder what happens if you try representable functors with vectors as the primitive instead of cons pairs

1:16 devn: tomjack: i needed to re-read your explanation

1:16 that makes good sense

1:16 tomjack: or reducers rather?

1:16 devn: damn category theory wonks! ;)

1:17 i need to catch up on our category theory book club

1:17 tomjack: I can only hope to grow up to be a category theory wonk :(

1:17 devn: "The Order of the Lambda"

1:17 ^-our book club

1:17 i intend to purchase the meetup organizer a robe with a lambda on it

1:17 tomjack: and a fez?

1:18 devn: no, not that kind of robe

1:18 much more monk-like

1:18 tomjack: ah :)

1:19 devn: My only hangup is honestly the notation. I find myself spending a lot of time trying to recall what means what.

1:19 tomjack: I think the problem with super-drop is indicative of the execution concerns bundled into lazy seqs

1:19 I worry that someday I will start writing haskell code :(

1:19 devn: why worry about that? I think it's a really great language.

1:20 based on the little I know of it, of course

1:20 i used to use xmonad and learned enough to get around, but it was mostly understanding through copying, not inventing from scratch

1:21 https://github.com/xich/scotty

1:21 the tiny example there makes me happy

1:23 tomjack: `newtype ScottyM a = S { runS :: StateT ScottyState IO a }`

1:24 `data ScottyState = ScottyState { middlewares :: [Middleware], routes :: [Middleware] }`

1:24 `type Middleware = Application -> Application`

1:24 `type Application = Request -> ResourceT IO Response`

1:24 devn: heh

1:24 I hear you.

1:25 I'm just saying, that doesn't make it wrong.

1:25 tomjack: wait, what?

1:25 scotty or haskell?

1:25 devn: either, i got the impression you were demonstrating the ceremony

1:25 tomjack: I have adjusted enough to be comfortable with that much of haskell

1:26 those types just don't look interesting to me

1:26 devn: in what sense?

1:26 what makes a type interesting?

1:27 tomjack: ScottyM looks like it says "ok we've got get/put on the routes and middlewares, and then ANYTHING CAN HAPPEN"

1:27 I don't think that is the type I want for my web application..

1:28 technomancy: listen tomjack how else are you supposed to implement zombocom in scotty

1:28 anything CAN happen

1:29 tomjack: :)

1:29 "the only limit is yourself" I never noticed how great that line is

1:29 devn: technomancy: anything at all

1:30 technomancy: sweet, latest hacks are a go: https://www.youtube.com/watch?v=sIgHVmCLIQE

1:30 tomjack: conal apparently doesn't like dependent types, but I kind of want to make a dependently-typed lisp

1:31 devn: technomancy: nicd

1:31 nice*

1:31 you bringing it to the conj. i want to see a clojure/conj battlebots event between you and hiredman

1:32 technomancy: better not; mine is racket-powered

1:32 devn: haha

1:32 technomancy: that's cool

1:33 technomancy: "it's fine; it's fine; we're all lispers here"

1:35 actually will probably end up running it from scratch so the kids can control it

1:36 devn: technomancy: N is a pretty smart 5 year old. :)

1:37 gaspar09: how can I make a list of functions, iterate over them and invoke them? example, in javascript i can do:

1:37 var add = function(a,b){return a + b}; var sub = function(a,b){return a - b}; var mul = function(a,b){return a * b}; var functions = [add, sub, mul]; for (var f in functions) { console.log(functions[f](4,3)); }

1:37 how should i do that in clojure?

1:37 devn: technomancy: Hearing a five year old saying "LEDs" cracks me up.

1:38 technomancy: devn: I didn't show the part where five minutes earlier he thought maybe the circuit wasn't working because "maybe there aren't enough wires" =D

1:38 but yeah, we have a lot of fun with that kind of stuff

1:38 devn: hey, he's right to be skeptical. I think breadboards are confusing like that.

1:39 technomancy: breadboards make me nervous not having version control

1:39 devn: haha -- man, that's a great idea

1:39 technomancy: he hasn't done the breadboard much; mostly he sticks to snap circuits

1:40 it cracks me up how he's so sure of himself in that video though

1:40 "no, I *know* it will work when I switch this"

1:41 devn: in the debugging video?

1:41 technomancy: right

1:41 devn: haha yeah

1:41 "I got it, dude."

1:41 "Bro, do you even build circuits?"

1:41 technomancy: heh

1:41 ok, time to head off

1:41 devn: have a good one technomancy

1:42 technomancy: peace be with you

1:42 devn: :)

1:43 tomjack: https://github.com/agda/agda-frp-js/blob/master/demo/agda/FRP/JS/Demo/Calculator/Model.agda

1:44 https://github.com/pedestal/pedestal/blob/master/app/test/clj/io/pedestal/test/app.clj#L131

3:04 zRecursive: where is clojure*.jar after `lein repl` ?

3:11 devn: zRecursive: what do you mean?

3:11 you mean where does it put the dependency on clojure*.jar?

3:11 the path to that file?

3:12 zRecursive: yeah

3:12 devn: ~/.mw

3:12 clojurebot: No entiendo

3:12 devn: oops

3:12 ~/.m2

3:12 clojurebot: I don't understand.

3:12 zRecursive: devn: no ~/.m2

3:13 devn: zRecursive: how did you install lein?

3:13 just curl and put it on your PATH?

3:13 zRecursive: download lein.txt and mv it it lein

3:13 chmod +x ~/bin/lein

3:14 then `lein repl` works

3:15 but i am curious where lein put those jar files ?

3:16 FYI, `lein repl` reports: nREPL server started on port 42516\n REPL-y 0.1.10\n Clojure 1.5.1

3:24 tomjack: ~/.m2/repository/org/clojure/clojure/

3:24 clojurebot: Excuse me?

3:25 zRecursive: tomjack: my my freebsd box, there is no ~/.m2, weird !

3:26 tomjack: hmm

3:26 `lein repl` maybe just uses the uberjar in ~/.lein/self-installs/ ?

3:26 if you go into a project and do `lein repl`, the deps should wind up in ~/.m2..

3:27 zRecursive: ls .lein/self-installs/ => leiningen-2.1.3-standalone.jar

3:27 lazybot: bin boot data media mnt opt root sbin selinux swap sys

3:27 tomjack: what

3:27 if you `jar tf ~/.lein/self-installs/leiningen-2.1.3-standalone.jar` you'll see it contains clojure

3:28 just confirmed I think that that is what `lein repl` uses

3:28 zRecursive: tomjack: yeah, it is there

3:29 tomjack: lazybot: ls bin

3:30 zRecursive: tomjack: i would like downloading clojure manually

3:31 tomjack: the chef cookbook I saw the other day just downloaded leiningen-2.1.3-standalone.jar and put it in the proper place

3:35 zRecursive: maybe it is convenient to upgrade ?

5:16 noahlz: ##(println "test")

5:16 lazybot: ⇒ test nil

5:35 GeoffSK: how do i (if i should) set my dependency to github rather than clojars? (newbie)

5:38 noahlz: using leiningen?

5:38 GeoffSK: yes.

5:38 noahlz: lein 2 uses Apache Maven style repositories

5:39 if you need something that is on github and not in clojars yet

5:39 do

5:39 git clone <github project>

5:39 cd github-project

5:39 lein install

5:39 GeoffSK: clj-mail - seems to be behind

5:39 noahlz: then it is availble to you locally as long as you declare the development version in your project.clj

5:40 GeoffSK: sounds good. thanks

5:41 perfect. thanks heaps.

5:41 noahlz: np

6:06 lein outdated

6:06 java.lang.IllegalStateException: Cannot fetch next ArtifactInfo

6:06 wtf?

6:07 has anybody here used ring-middleware-format?

7:15 sandbags2: Does anyone know whether the clojuredocs.org dataset is available for download (to use the site offline)?

7:20 Okasu: https://github.com/zkim/clojuredocs Meh, Ruby 40%.

7:20 sandbags2: Not related to your question.

7:23 sandbags2: Okasu: yes i cloned the site, but the repo doesn't contain the dataset

7:23 i was also tickled that it's a Rails app

7:24 ah

7:24 stupid

7:24 i cloned it but didn't read the README

7:24 which, of course, has the instructions

7:26 oh, 2 years old download though

7:26 antares_: Okasu, sandbags2: a new version badly needs capable hands, see github.com/clojuredocs

7:27 sandbags2: antares_: presumably a new version isn't going to be Rails though?

7:27 as it happens when doing OO ruby is my preferred language

7:27 but my guess is that any new docs site would be using a clojure framework... and i'm a clojure neophyte

7:28 antares_: sandbags2: presumably it won't

7:29 Okasu: antares_: I'm currently working on clojure wiki enginge, hopefully it will survive and i'll publish it.

7:29 antares_: the problem with clojuredocs is not that it's a rails app

7:29 but rather that it is locked to a particular version, 1.3

7:29 sandbags2: of clojure?

7:29 (i've not looked but it *can't* be locked to Rails 1.3)

7:30 (although I've been upgrading a Rails 1.x app recently ;-))

7:30 Okasu: sandbags2: Ha-ha, it's about cliojure version not rails. :)

7:30 antares_: sandbags2: there was no 1.3 version of Rails

7:30 sandbags2: yes looking at the database schema

7:31 antares_: only 1.2

7:31 sandbags2: antares_: i forget, it was a long time ago

7:31 Okasu: antares_: http://clojure-doc.org/ It's on eisago?

7:31 antares_: What help https://github.com/clojuredocs needs in particular?

7:32 sandbags2: so the database schema certainly doesn't have a notion of versioning

7:32 beyond the 'added' string for functions

7:32 but since it's probably quite a well defined, slow moving, dataset i wouldn't have thought it would be too hard to retrofit

7:33 is the problem that most Clojure people dont' want to work on a Rails app?

7:33 if so then it's possible i can help

7:33 antares_: Okasu: no, it's a markdown site

7:33 sandbags2: i'm pretty time limited and not short of my own projects that are lying untended

7:34 antares_: Okasu: I believe the new indexer is mostly ready but the site is barely started. Ask on the mailing list.

7:34 sandbags2: as long as there are active maintainers i'd certainly try to contribute

7:35 antares_: sandbags2: the problem is that the original author of eisago is busy with other things

7:35 sandbags2: last commit 11 months 11 months ago

7:35 not a hopeful sign

7:36 antares_: and yes, most Clojure people are not particularly great at web apps, nor many are interested in anything related to documentation

7:36 documentation is boring, they say. Logic programming is way more fun.

7:37 I don't agree but clojure-doc.org and clojurewerkz.org leave me little time to work on the new clojuredocs.org

7:37 sandbags2: i could certainly help, i'm less active in Rails than I was but I've been doing it a long time, but i'm not in a position to become maintainer of an app like this

7:38 antares_: sandbags2: in what repo?

7:38 sandbags2: antares_: i'm not sure what you're asking me

7:38 antares_: sandbags2: zkim/clojuredocs is no longer developed

7:39 sandbags2: you mean "in what repo is the last commit 11 months ago?" yes "zkim/clojuredocs"

7:40 antares_: sandbags2: I'm not asking you, just saying that there is a new version that badly needs capable hands to finish it

7:41 sandbags2: ok, maybe i am being slow here (always possible)... do you mean the clj-rewrite branch of zkim/clojuredocs?

7:42 antares_: sandbags2: that thing is no longer being developed

7:44 sandbags2: github.com/clojuredocs

7:44 is the name not descriptive enough?

7:44 the new repo is called eisago

7:44 sandbags2: antares_: right i looked there when you linked the page but didn't see a project a la clojuredocs

7:44 ah

7:44 antares_: cds is clojure-doc.org, with doc guides

7:45 sandbags2: i read "importer and api" and didn't get as far as "website" :)

9:15 rhickey: bbloom: unfortunately the HOF use of channel ops in go is not going to be cljs compliant - this will: https://www.refheap.com/14991

9:17 I think we might differentiate the blocking vs parking names

9:18 bbloom: I don't see this: [16:31:32] bbloom: doesn't really handle the timeout case correctly

9:18 seems to handle timeout same as the Go example afaict

9:19 single timeout used multiple times

9:53 avishai: hi

9:53 question about agents

9:54 is there a cap on agents actions queue?

9:54 dnolen: rhickey: I'm assuming for broadcast (thinking events in CLJS) you do what you'd do in Go, keep a list of channels and write to them yourself?

9:55 rhickey: yes

9:58 dnolen: yes was for your q

9:58 avishai: no

10:12 avishai: rhickey, so if i want to make sure there aren't too many actions queued, i should stick a bounded queue in the middle, right?

10:12 rhickey: avishai: yes

10:17 noncom: if i have a hashmap with float or integer keys, they're boxed, right? is there any good advice on speed-up if i need to filter the keys?

10:30 hey, anyone here? :)

10:31 hyPiRion: noncom: filter the keys how?

10:33 noncom: well like if they are in a range. for example, keys are [3 8 28 19 50 33 44] and i filter like #(and (< 20 %) (> 40 %))

10:34 but when i get them with (keys my-map), they're all boxed there

10:34 so if i have like 1000 keys... performance drops

10:34 hyPiRion: noncom: And you want the keys only? Or a subset of the hash map?

10:35 noncom: i need the values associated to the keys. background: the map stores events on a timeline in pairs (millisecond event-fn) and i want to be able to execute events in the time range passed for the latest frame

10:38 hyPiRion: oh, humm. Would a sorted set do? Give me one moment.

10:38 sorted map*

10:38 noncom: you mean array-map?

10:39 oh there is sorted-map

10:40 ummm i looked at the docs, but how can it help me? how do you think i should use it?

10:41 hyPiRion: say you want every pair for a map, where the key is above value 5

10:42 ,(let [amap (sorted-map 1 \b, 2 \c, 3 \d, 4 \e, 5 \f, 6 \g, 7 \h, 8 \i, 9 \j)] (subseq amap > 5))

10:42 clojurebot: ([6 \g] [7 \h] [8 \i] [9 \j])

10:43 noncom: cool! i'll try that out!

10:43 hyPiRion: Eventually, you got some end-key and end-test, but I'm not entirely sure how those work. Regardless, subseq should be very fast and should only look at part of the map

10:44 that is, if you only want to look at a sequential part of the map, then subseq can do that in a very fast manner

10:45 noncom: if i add events to the timeline after it's initial creation, will i have to re-sort the sorted-map?

10:45 hyPiRion: noncom: no, if you assoc or conj into a sorted-map, it will place it in a sorted manner

10:46 ,(assoc (sorted-map) 5 :a 2 :b)

10:46 clojurebot: {2 :b, 5 :a}

10:46 hyPiRion: ,(assoc (hash-map) 5 :a 2 :b)

10:46 clojurebot: {2 :b, 5 :a}

10:46 hyPiRion: oh well, bad example, but I think you get the idea

10:46 noncom: yeah, nice! i think this is what i am looking for, i'll try that

10:47 hyPiRion: cool, hopefully it works well :)

10:47 noncom: :) one more question: so as values i store fns. those fns take no args. what is the idiomatic way to eec them? (apply fun [])???

10:47 lazybot: noncom: Yes, 100% for sure.

10:48 hyPiRion: noncom: actually, you can just do (fun)

10:48 noncom: *eec => exec

10:48 oh right

10:48 haha :)

10:48 hyPiRion: so I think that's the idiomatic approach ;)

10:49 noncom: funny, i get this: (map #(%) relevant-events)

10:49 funny-looking :)

10:49 hyPiRion: heh, yeah

11:01 jtoy: if I wanted to add CRUD to a db I have, what would be the fastest way to do that in clojure? if there is some library that can do it automatically, that would be great as I want to do as little as possible

11:03 in a web app i mean

11:12 mindbender1: what's the option to force lein to resolve deps locally or abort?

11:14 hyPiRion: mindbender1: :offline? true

11:16 mindbender1: hyPiRion: thanks

11:16 hyPiRion: anytime

11:29 bbloom: rhickey wasn't in the room, but responded to me, so i'll assume he's checking logs….

11:29 rhickey: (take 3 (repeatedly #(second (alt!! :result (<! c) :timeout (<! t))))) does not correctly handle timeouts

11:31 rhickey: the take 3 will block until it gets 3 items. let's say a three of your backends are down. You'll get the timeout, which will produce the sequence (nil …) but you're taking 3 items, so you'll block. if the backends never respond, you'll never be able to take 3

11:32 rhickey … oh wait no. i'm sorry. i'm wrong. i forgot that alt will return nil if none of the channels are ready

11:32 my bad.

11:32 jouiswalker: lol

11:33 bbloom: jouiswalker: this stuff hurts my brain :-P

11:33 jouiswalker: no kidding

11:35 bbloom: that's what I get for trying to do any real thinking before lunch.

11:37 rhickey: i really like the one-bang vs two-bang versions of the function. that solves my portability concern

11:38 jouiswalker: i'm still trying to find a doc for alt ;;

11:39 bbloom: jouiswalker: https://github.com/clojure/core.async/blob/master/src/clj/core/async.clj#L197

11:43 jouiswalker: bizarre

11:46 karbak: Looking to do some minimal XML parsing and emitting - what's the difference between clojure.xml and clojure.data.xml (other than the the former seems to be part of core)?

11:56 tomjack: hmm, yeah, <!! seems helpful

11:57 I wonder if making the macros resolve properly is a non-goal

11:57 go macro I mean

11:57 currently it seems to qualify as anaphoric to me

11:58 e.g. macroexpansion with syntax-quote will break alt!/<!/>! ?

12:00 jouiswalker: has anyone played with pedestal?

12:00 bbloom: tomjack: yeah, i dunno what they are gonna do about that. maybe come up with a use case that seems useful and breaks & then they'll enhance alt :-)

12:01 tomjack: I kind of want an alt-case

12:01 but I get the sense this would be against the grain

12:01 if you tried to write it I think you'd either have ~'alt inside (ew) or it'd break in go

12:02 since they added case support I'm guessing they're doing (let [[label val] (alt ...)] (case label ...)) too

12:03 bbloom: tomjack: yeah, that's precisely what i did was the let/case combo

12:03 tomjack: hmm, I hadn't thought about the details of alt-case

12:03 maybe it's let-case-alt

12:05 clearly don't want (alt-case :foo (<! foo) (do-foo-thing) :bar (>! bar 42) (do-bar-thing))

12:06 bbloom: tomjack: yeah, the problem is you need a name for the return value if you're gonna do case

12:18 tomjack: easy solution maybe would just be to use clojure.tools.macro/macrolet?

12:19 er, except you can't let qualified names

12:20 jtoy: ?

12:22 tomjack: 'single timeout used multiple times' - does this mean a timeout channel should be a pure 'value' under core.async?

12:22 or just that the google example code is wrong somehow

12:23 oh

12:24 I misread all that

12:26 bbloom: tomjack: haha yeah, this stuff is hard and alien. it's easy to misread

12:27 tomjack: I was thinking of like a delay channel I guess

12:27 echo + delay

12:27 lazybot: + delay

12:27 tomjack: rm -rf /opt/lazybot

12:31 hyPiRion: ls

12:31 lazybot: data etc home srv swap

12:34 tomjack: ls

12:34 lazybot: bin data dev etc home opt root sbin src sys tmp var

12:34 tomjack: odd

12:40 Bronsa: ls

12:40 lazybot: dev home lost+found mnt opt sys

12:41 tomjack: not sure if the double bangs are worth it :)

12:41 bbloom: tomjack: what do you mean?

12:42 tomjack: <! and >! just look a lot nicer to me

12:42 and \! is a hard one to type for me

12:44 I guess if you're writing portable code you're only using them at the edges anyway

12:47 bbloom: tomjack: you can just use the single bang versions inside async/go

12:47 tomjack: yeah

12:47 so at the repl (<!! (go (<! c)))

12:48 bbloom: oh i see

12:49 tomjack: >!! is a rocket ship and <!! is a reentering space capsule

12:50 hyPiRion: quite the analogy you got there

12:53 jouiswalker: (exit)

12:53 oh woop

12:54 tomjack: I wonder if you could use nrepl middleware to make <!! work in a cljs repl

13:03 mthvedt: what's a good framework for testing with reusable test suites, like if you want to test n implementations of something with 1 test suite

13:07 tomjack: you don't need a framework, just write functions

13:08 functions are already reusable :)

13:10 mthvedt: tomjack: presumably if i'm using a test framework, i've already decided not to use that approach

13:12 tomjack: presumably your test framework lets you call functions

13:14 mthvedt: i want the suite to be modular--i don't want to have to invert modularity to be inside the suite. that sounds annoying

13:17 the structure of the suite also matters for reporting; if your brain can't quickly parse the reports you're just doing cargo-cult test driven development.

13:19 tomjack: I guess maybe a good example use case would be testing mikera/matrix-api impls?

13:19 but there there is already a dynamic binding for the impl

13:22 mthvedt: tomjack: yeah, a similar use case--multiple impls or something that need to pass the same tests

13:23 tomjack: if there is a dynamic binding for the impl, it seems easy

13:23 otherwise, it depends on what an 'impl' is I guess

13:24 (I am not suggesting having a dynamic binding for the impl!)

13:25 mthvedt: well, you can write your tests s.t. you have a dynamic binding the tests can see

13:27 tomjack: yeah if 'impl' does not mean 'project' that seems like it could work

13:28 mthvedt: but, like in the matrix example, say you want someone to come along with a custom matrix implementation, and write (deftest (binding [*impl* foo-impl] (test.suite/run-tests)))

13:28 and have all the reporting and auto test features that something like midje has

13:29 clojure.test seems to have half-baked modular test suites, but it's not the same

13:29 tomjack: ah, I dunno midje

13:29 and I don't know any good frameworks, to answer your actual question :)

13:29 to not answer.

13:29 mthvedt: :P

13:33 tshauck: Hi, does anybody know how I might run the postgres bulk copy command from w/i clojure?

13:34 or really, maybe to start how could I run a straight query where there won't be results?

13:35 tomjack: bbloom: https://www.refheap.com/cf13b39676149317297b9e8b3

13:43 Alezandr: Can someone help me, I'm new in clojure. I try to run simple app, but I getting the error which I don't know how to resolve. Please take a look http://pastebin.com/juqZdyKd what is wrong?

13:46 tomjack: Alezandr: don't put a / in your ns name

13:46 foobar27: Alezandr: remove the parenthesis around cur-dir in the last println statement

13:46 tomjack: try it with dirtree.dt

13:48 Alezandr: Thanks! it works after removing '/'

13:49 SegFaultAX: Alezandr: There is no reason to use (def foo (fn [] ...)). Checkout defn (which is the canonical way to define top level functions)

13:49 foobar27: Note that cur-dir is a function, he just used def and fn instead of defn.

13:50 foobar27: SegFaultAX: yes, I saw later on that cur-dir is a fn

13:53 Alezandr: It was my try to fix the error, I will use defn , thanks for advice

14:27 scottj: Was Rich's talk at Clojure/West on Using Datomic with Riak? He mentioned he was going to give the same talk at a couple other venues and apparently this is the talk he gave at Ricon.io East which appears it might have videos up before Clojure/West.

14:28 gfredericks: scottj: totally not at all about that

14:28 scottj: gfredericks: ok thanks

14:29 gfredericks: I believe the title was Design, Composition, and Performance

14:29 murphy_: hi - this may be the wrong place to be asking the question, but I'm trying to install the vimclojure plugin and when I'm running it, I'm getting a "could not determine namespace" error

14:29 scottj: that's correct. I just checked and see Clojure/West now has a description of his talk

14:29 murphy_: should I be asking in #vim, or is this the correct place to talk?

14:30 scottj: murphy_: this is a fine place to ask

14:30 tomjack: _with_ riak?

14:30 murphy_: ok. Thanks! I'm a bit confused since I'm able to get it running fine on a different machine, and I'm having a hard time finding what the diff is

14:30 gfredericks: if he said "riak" or "datomic" in that talk it was so irrelevant that I forgot all about it

14:59 asaleh: anyone who could help me \w core.logic?

15:00 tomjack: anyone?

15:00 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

15:01 gfredericks: asaleh: yes.

15:01 asaleh: well my problem is a bit complicated, so was first trying if there are some logic folk listening :)

15:02 gfredericks: clojurebot never seems to acknowledge that possibility

15:03 asaleh: gfredericks, I am trying to write something like a knowledge derivation program, would like to input it some rules, some initial knowledge and then let it derive the rest

15:04 gfredericks, unfortunately I am not sure how to approach it

15:05 gfredericks: asaleh: could you elaborate on the sorts of rules and knowledge you're expecting to deal with?

15:05 Kowboy: i just did a lein self-install, followed by lein repl... and I get "Unable to resolve var: ritz.nrepl.middleware.doc/wrap-doc in this context"

15:05 asaleh: gfredericks, well, I give two examples here https://groups.google.com/forum/?fromgroups#!topic/clojure/k9loHYzsGvw

15:06 gfredericks: Kowboy: lein 2.1.2?

15:06 llasram: Kowboy: Sounds like your ~/.lein/profiles.clj has some ritz stuff in it?

15:07 Kowboy: that it does

15:07 must have tried fixing some othe problem before I upgraded

15:08 tomjack: bbloom: https://www.refheap.com/879757f050bd86074719e061c

15:08 surely there's a better way

15:08 not even sure that will always work..

15:10 gfredericks: asaleh: my first thought is that you have as input a list of known things

15:11 and a goal (defn derived [axioms])

15:11 er

15:11 * gfredericks confuses the heck out of himself

15:11 asaleh: gfredericks, well, my first attempt looked like this https://gist.github.com/AdamSaleh/5650339

15:12 gfredericks: so lines 2 & 3 are your axioms?

15:13 I'm imagining that (run* ...) returns all known things

15:13 asaleh: gfredericks, that is how I tried to specify the initial knowledge, and the conde is the implication [I know private-key -> I can send encrypted messaga]

15:14 gfredericks, but run* wouldn't terminate

15:15 gfredericks: it might for some programs

15:15 still pondering this

15:15 asaleh: it just keeps on adding place-holders to my knowledge list

15:15 gfredericks: I guess we're kind of trying to figure out the structure of a generic formal axiomatic system

15:17 asaleh: gfredericks, I am thinking, that maybe I just can't figure out a decent implication in core.logic :)

15:18 gfredericks: no no I'm having great fun pondering this

15:18 murphy_: sorry for more newbie questions, but is there a way I can test that nailgun is connecting to server that is currently running ?

15:18 gfredericks: I really really want a general solution where you can specify A) derivation rules B) axioms and get out C) theorems

15:18 tomjack: I've got a tiny start on a first-order logic project

15:18 murphy_: I have a feeling that that's the reason why my vimclojure isn't working

15:19 gfredericks: tomjack: so a derivation rule is a goal with a derived theorem as the first arg and either varargs after that or a list of input theorems as the second arg?

15:20 asaleh: tomjack, do you have sources somewhere? maybe it would help me :)

15:20 tomjack: I doubt it will help you

15:20 llasram: murphy_: I don't use vim, but have you checked out fireplace? Drops the need for the nailgun stuff. Just uses nrepl, like for Emacs and Eclipse CCW

15:20 tomjack: so far all I have working is generating formulas and terms, and not happy with even that yet

15:21 my idea was to represent the derivation rules as just data

15:21 gfredericks: e.g., (defn modus-ponens [i p1 p2] (== p1 [p2 :-> i]))

15:21 murphy_: hrm. I did take a look at it, but I had been using vimclojure on another machine and was hoping that I could get it set up my other one , as I had gotten used to it

15:22 I'll take another gander, look at a screencast

15:22 gfredericks: tomjack: just gotta figure out how to write a meta-goal that has a list of goals (i.e., derivation rules) and uses them somehow

15:22 tomjack: https://www.refheap.com/5efa70801ee76390dcb4447e7

15:22 oh and qexp is https://www.refheap.com/df05137c9cf9a8931d425397c (don't like that either)

15:24 gfredericks: (defn theoremo [i axioms] (conde (membero i axioms) ...something smart here...))

15:24 tomjack: yeah

15:24 I'm wondering if we need CLP(Set)

15:25 asaleh: well my derivation rules are relatively simple, basically I am checking whether some of my past knowledge match some structure and based on that I create new kowledge...

15:25 gfredericks: asaleh: yeah I think that fits where I'm trying to go with it

15:25 the recursion is what's tripping me up

15:25 tomjack: so maybe that's like inductive logic?

15:26 gfredericks: tomjack: the recursive part you mean?

15:26 tomjack: I mean you only have [true expr] -> [true expr'] because you never assume something false for contradiction

15:27 hmm but you can still know something to be false

15:27 gfredericks: what's the complement of everyg?

15:29 man it's super weird that *clojure-version* is dynamic

15:32 okay I'm gonna scribble out some code

15:36 w00p got my first divergence :)

15:37 hyPiRion: hurm

15:37 why would you set! or bind clojure-version anyway?

15:38 gfredericks: hyPiRion: only thing I can think of is tricking a lib into doing something

15:38 hyPiRion: sounds horrible

15:39 I mean, that effect may propagate down to some library which you wouldn't trick

15:39 wouldn't like to trick*

15:40 asaleh: gfredericks, when you will have something post it :)

15:40 gfredericks: asaleh: I have something now and am puzzling over why it doesn't work; posting

15:41 asaleh: gfredericks, right now I am at least trying to create simple derivation function f: prev_knowledge -> new_knowledge

15:41 gfredericks: asaleh: tomjack: https://www.refheap.com/15003

15:42 probably could have named the args better

15:42 s/impl/t/, s/i/impl/

15:42 oh I see

15:42 asaleh: gfredericks, conde?

15:43 gfredericks: line 3 should be (== p2 [p1 :-> i])

15:43 asaleh: you don't know about conde?

15:43 sweet it worked

15:43 asaleh: gfredericks, great!

15:43 gfredericks: what are some more predicate logic rules?

15:44 asaleh: gfredericks, wait, conde is the thing that stops on the first true clause

15:44 gfredericks, only one rule and three axioms :)

15:45 gfredericks: asaleh: it doesn't stop; it gives multiple ways of succeeding

15:45 asaleh: gfredericks, ah, predicate? there is then the rule that is concerned by \forall quantificator

15:46 tshauck: hi, does anybody know how I can execute an aritrary query against postgres... I'm trying with https://github.com/clojure/java.jdbc and the query funtion specificially, but acn't seem to get it

15:46 gfredericks: tshauck: (query my-db ["SELECT stuff"])?

15:48 tomjack: hmm, try with axioms [:a :b [:b :-> :c] [:c :-> :d]]

15:48 tshauck: gfredericks: ya... it keeps saying I'm missing a required param... my statement is (sql/query conn ["SELECT * FROM table"]) so essentially yours

15:50 dobry-den: gee, i love clojure.core/assert during development

15:51 having to set up unit test boilerplate for trivial dev sanity checks was always a pain

15:51 gfredericks: tshauck: what says that? a clojure error, or a jdbc error?

15:51 llasram: dobry-den: You might also care to check out pre- and post-conditions

15:51 clojure-newb: Raynes: hi, I've got a Laser question if you have time to help out ?

15:52 gfredericks: dobry-den: also nice is the ability to leave them in your code but turn them off in prod via *assert*

15:53 tomjack: it derives :d with that set

15:53 I'm trying to add modus tollens but it's diverging again

15:53 tshauck: gfredericks: https://gist.github.com/tshauck/5650519 here's the error

15:54 tomjack: hmm, it doesn't derive :d here

15:54 gfredericks: tomjack: you're using run with a high enough number?

15:54 tshauck: makes me think your conn is bad

15:55 tomjack: oh, d'oh!

15:55 wow run 10 is slow

15:55 oh diverging

15:55 tshauck: gfredericks: I'm starting to think that as well... I'll bang my head on that for a minute and may be back... thanks for the help

15:55 Raynes: clojure-newb: What's up?

15:56 clojure-newb: Raynes: is some trouble I've run into upgrading from 0.1.22 to 0.1.23 (I know, sorry its old versions!) - I now get a 'clojure.lang.ExceptionInfo: Not a valid node: #<File /Users/me/path/frag-file.html> {:dom #<File /Users/me/path/frag-file.html>}'

15:56 tomjack: I'd think the recursion needs to be driven by the axioms

15:57 gfredericks: tomjack: eh?

15:57 clojure-newb: Raynes: I do a bunch of fragment loading, then transformations over the loaded content etc

15:57 Raynes: clojure-newb: Can you post the code somewhere for me? Like refheap.com?

15:57 tomjack: I think I'm imagining corecursion on the axioms instead of recursion on the theorem to be proved

15:58 clojure-newb: Raynes: sure I'll try to put some stuff together and paste

15:58 Raynes: I will throw the stack trace in too

16:01 gfredericks: uh oh now I'm deriving contradictions

16:01 what the heck is wrong with my modus tollens

16:02 oh my bad

16:02 my axioms contradict

16:08 clojure-newb: Raynes: I've got some info up at - https://www.refheap.com/15005

16:09 Raynes: The line number in this case doesn't really matter because it is likely in a macro.

16:10 Anyways, it looks like you're passing a file into laser somehow.

16:10 Are you calling (l/nodes ..) anywhere?

16:10 clojure-newb: ok, I'm guessing there is some problem in the fragment,,,

16:10 Raynes: Well, I could probably tell you the problem but I'd need to see all of the relevant code.

16:10 clojure-newb: no, I'm not calling l/nodes anywhere

16:11 and its definitely good with 0.1.22

16:12 Raynes: Why are you trying to go from 0.1.22 to 0.1.23?

16:13 All sorts of crazy things were broken in those versions.

16:13 It's very possible that 0.1.23 was just completely broken and not working.

16:13 clojure-newb: Raynes: I was trying to upgrade one step at a time

16:13 playing it safe

16:13 Raynes: In the case of laser that is definitely not playing it safe. :p

16:13 clojure-newb: ah ok :-)

16:13 Raynes: It isn't a very clear upgrade path. I was pretty nuts with stuff in the 0.x.x versions.

16:14 It was very unstable.

16:14 Anything after 1.x.x is pretty stable.

16:14 So you don't have much to worry about once you get there.

16:15 clojure-newb: I'll have a go at upgrading to a 1.x.x - was just worried about so many changes in one go

16:15 Raynes: Sorry :(

16:15 Hope it isn't too painful,

16:15 clojure-newb: no - its my fault, got distracted with work, left it too late etc

16:16 Totally appreciate the library, its awesome

16:16 using it on two commercial projects very happily

16:16 Raynes: Ah, that's why you couldn't show the code.

16:16 clojure-newb: yep

16:16 Raynes: Should have said so! I totally understand.

16:17 From now on if I make big changes I'll jot out upgrade instructions.

16:18 clojure-newb: to be fair it was only a 0.1.x :-)

16:18 Raynes: Yeah, I was literally putting out as many as 3-4 versions in a day during that cycle, clojure-newb.

16:19 I'd do something and it would seem to work and then I'd actually try to use it and be like "Shit, that doesn't work." and go fix it and repeat. Which is why it's dangerous to upgrade one version at a time. :p

16:33 darrickw: Is there a way to interrupt an nrepl thread that has run away from me in vim (via fireplace)? I'd like to be able to kill it the same way I could kill -9 a running job in the shell for instance.

16:34 C-c in vim just disconnects from the command rather than interrupting it.

16:35 This isn't a vim-specific question. I'm wondering if there is a way to do this, perhaps via nrepl middleware?

16:36 clojure-newb: Raynes: I'm all good on 1.1.1 - thanks for your help, saved me a ton of time

16:36 dobry-den1: How come the latest version of lein still generates a project.clj with clojure 1.4.0 instead of 1.5.x?

16:38 hyPiRion: dobry-den1: huh, you sure? 2.1.3 generates a 1.5.1 version ddependency

16:38 foobar27: dobry-den1: my lein also generates 1.5.1 clojure deps

16:39 dobry-den1: i never thought to run 'which lein' until now — it's not even using my homebrew lein. swing and a miss. thanks

16:39 foobar27: dobry-den1: are you generating a plain new project, or a project from a template?

16:39 ah ok :)

16:42 dobry-den1: oh, so it's symlinked by brew. looks like the lastest lein on homebrew is still 2.0.0

16:42 i'm a scrub.

16:43 gfredericks: are PC manufacturers pressured to not have an OS-free option because MS is afraid of piracy (rather than linux users)?

16:45 AimHere: With software that's part of an ecosystem or infrastructure, having your stuff pirated works in your favour

16:45 More people pirating Microsoft Office, say, means more people using Windows, more people with sellable Microsoft Office skills, more demand for legit copies of Office, more chance they'll teach other people how to use Office, and so on

16:46 gfredericks: having stuff pirated only works in your favor as long as there's still stigma around piracy for some users

16:46 AimHere: Bill Gates said as much referencing East Asian piracy, at one point, though he had to recant that pretty fast

16:47 gfredericks: if you use it as an "embrace piracy" argument then it's self-defeating

16:47 AimHere: Well that or you're willing to change your business model accordingly at some point

16:48 gfredericks: in any case that's independent of my question

16:48 AimHere: There's no stigma about 'pirating' Red Hat (i.e. giving away copies to all and sundry) because Red Hat doesn't make money the same way Microsoft does

16:48 Pupnik-: gfredericks, you can buy plenty of laptops with linux installed instead of windows

16:49 gfredericks: Pupnik-: plenty?

16:49 there's nothing substantial I know of besides system76

16:49 txdv: just install it yourself

16:49 Pupnik-: dell

16:49 gfredericks: txdv: still paid for windows

16:49 txdv: o you mean that the laptops have windows prepaid

16:50 AimHere: gfredericks, you were asking why there wasn't an OS-free option - the point I was making was that having a pirated copy of Windows on a machine was better for Microsoft than having a copy of Linux or OpenBSD on there, so the answer is 'no'

16:50 Official story - piracy. Real story - competition.

16:50 gfredericks: AimHere: so linux is the worry, is what you mean?

16:50 hyPiRion: gfredericks: oh yeah

16:51 callen: The reason that Microsoft went the direction they did (consumption focused) with Windows 8 is that they've lost the "makers" to OS X and Linux.

16:51 AimHere: Well it'll be a mixture of both, but I'd guess the primary one would be keeping the alternatives from being visible

16:52 amalloy: gfredericks: i dunno about laptops, but you can certainly buy desktops with no os (or even with linux preinstalled)

16:52 gfredericks: amalloy: laptops are what I'm interested in atm

16:53 Pupnik-: gfredericks, my bad, they dont seem to do linux anymore

16:53 txdv: Well, if you build your pc together on your own, you can choose whatever you want

16:53 Pupnik-: used to be you could get just about any dell laptop you liked with linux

16:53 txdv: but yeah, laptops are always preinstalled with windows

16:54 hyPiRion: unless they are macs

16:54 gfredericks: Pupnik-: yeah I think that's been off for a while

16:54 Pupnik-: unfortunate

16:55 hyPiRion: gfredericks: I don't think you'll have to pay more than you'd do without Windows installed -- quite the contrary, I would guess.

16:55 Or is it about the time it takes to set up the computer etc.?

16:55 txdv: hyPiRion: I can find only one laptop on the site I buy stuff from with the optionality of no os and you save 50eu

16:56 Pupnik-: gfredericks, you can get a super secret developer edition laptop with ubuntu http://www.dell.com/Learn/us/en/555/campaigns/xps-linux-laptop?c=us&l=en&s=biz

16:57 gfredericks: Pupnik-: now all I need is for it to not be dell :)

16:57 hyPiRion: txdv: huh, is that with support?

16:58 gfredericks: I think acer has a laptop with the mousepad behind the keyboard

16:58 and the screen can move forward to cover it; seems nice for keyboard-only folk

16:59 txdv: hyPiRion: no-os or windows

16:59 I guess you can say the fully support the NO-OS option

16:59 "Hello, I have a black screen" "This is the intended behaviour"

17:00 but as linux user you save 50eu

17:00 hyPiRion: txdv: ah

17:00 txdv: but it is a low ranged laptop, costs 400 with windows, 350 without

17:00 good student laptop

17:01 but if you go into the high class range, you always have to pay for either windows or macosx

17:01 r0bgleeson: txdv: hahaha.

17:01 txdv: what is so funny/

17:07 mattin: Pupnik-: ubuntu is harmful these days, they've gone to the dark side and it's virtually the same as recommending MS windows

17:08 callen: mattin: hardly. Don't be so melodramatic.

17:08 mattin: it's still an open source stack.

17:09 mattin: callen: do you see M$ proxying search queries originally intended for your personal desktop out to Amazon. no i didn't think so.

17:09 hyPiRion: Well, the transition from Ubuntu to, say Debian or Arch, is easier than from Windows to Debian/Arch

17:09 txdv: mattin: do you mean unity?

17:10 gfredericks: woah. I just realized you can change how arbitrary Objs print just by adding :type metadata

17:10 txdv: What specifically about ubuntu is bad?

17:10 mattin: txdv: yes im referring to unity, which is created by ubuntu developers

17:10 txdv: i am using the awesome window manager which is created by awesome developers

17:10 with ubuntu

17:10 callen: mattin: you don't have to use unity. They need to make money somehow to perpetuate the project.

17:10 arrdem: txdv: w00t awesome

17:10 callen: mattin: and don't use "M$", it's fucking infantile.

17:10 txdv: does that make it ok to use ubuntu in such way?

17:10 gfredericks: I've been using xmonad with ubuntu for a year or so now

17:11 callen: ^^ ditto, but longer.

17:11 mattin: callen: telling other people their "fucking infantile" is rather infantile in and of itself

17:11 txdv: the good thing about ubuntu is its package manager and that it has newer packages than debian

17:11 arrdem: (dec mattin)

17:11 lazybot: ⇒ -1

17:11 llasram: (inc matten)

17:11 lazybot: ⇒ 1

17:11 callen: (dec mattin)

17:11 lazybot: ⇒ -2

17:11 gfredericks: O_O

17:11 arrdem: DOWNVOTES SIR

17:12 llasram: (inc mattin)

17:12 lazybot: ⇒ -1

17:12 llasram: Spelling

17:12 I didn't actually know lazybot supported `dec`ing karma. Not sure I'm a fan

17:13 tomjack: mattin: so how infantile is calling people "rather infantile"? :)

17:13 hyPiRion: llasram: Not sure karma is such a good thing regardless

17:13 but yeah, dec should go

17:13 mattin: tomjack: infantile of course ;p

17:13 gfredericks: tomjack: if we keep this up we can discover milder and milder versions of infantility, and maybe publish a paper or something

17:14 mthvedt: do you think infantility is a continuum? or is it like the rationals

17:14 gfredericks: the rationals are at least dense so we can always find subtler levels of it

17:14 tomjack: once we get to the bottom I suspect we'll just ascend into another dimension, no need to publish :)

17:14 hyPiRion: gfredericks: Oh, if it has a multiplicative reduction, approaching no infantility is going to take O(log n) time

17:15 gfredericks: hyPiRion: what the hell

17:15 hyPiRion: ... if one rounds down at certain points

17:15 gfredericks: never round down

17:15 mthvedt: rounding down is infantile

17:15 gfredericks: ooh a parallel series

17:16 hyPiRion: Humm

17:16 gfredericks: ,(-> 7 (iterate #(/ % 13)) (nth 17))

17:16 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

17:16 asaleh: gfredericks, tomjack, I changed my approach ... just using a simple function to do a breadth first search on my knowledge :) https://gist.github.com/AdamSaleh/5650792

17:16 gfredericks: ,(as-> 7 <> (iterate #(/ % 13) <>) (nth <> 17))

17:16 clojurebot: 7/8650415919381337933

17:17 llasram: (zero-enough? *1) => true

17:17 gfredericks: llasram: we have infinitely farther to go!

17:17 for science!

17:17 hyPiRion: gfredericks: I'll tell you a secret

17:18 ,(-> (iterate #(/ % 13) 7) (nth 17)) ; is also a way to write it

17:18 clojurebot: 7/8650415919381337933

17:18 ToBeReplaced: What is the right way to accomplish (merge-on-values {:foo :FOO :bar :BAR :baz :BAZ} {:FOO 1 :BAR 2}) -> {:foo 1 :bar 2 :baz nil}

17:19 gfredericks: ToBeReplaced: what the heck is that?

17:19 hyPiRion: ToBeReplaced: what would (merge-on-values {:a 1} {:b 2}) do?

17:19 arrdem: gfredericks: looks like he's looking up on keys...

17:19 ToBeReplaced: {:a nil}

17:19 arrdem: *values

17:20 hyPiRion: well

17:20 gfredericks: ToBeReplaced: (fn merge-on-values [m1 m2] (into {} (for [[k1 k2] m1] [k1 (m2 k2)])))

17:21 ToBeReplaced: that's my implementation right now, yeah... i use map fn but same deal

17:21 hyPiRion: gfredericks beat me to it

17:21 ToBeReplaced: (into {} (map (fn [[k v]] [k (m2 v)]) m1))

17:21 hyPiRion: what

17:21 jtoy: if I have run lein uberjar for my project, how can I load a repl from the jar?

17:21 gfredericks: jtoy: java -cp my.jar clojure.main

17:22 or something fancier with nrepl

17:22 ToBeReplaced: it feels like this kind of re-keying would come up a fair bit; if it hasn't, i'm probably doing things wrong

17:22 re-valuing*

17:22 gfredericks: clojurebot: clojure is <reply> you're probably doing things wrong

17:22 clojurebot: In Ordnung

17:23 hyPiRion: ,(let [m1 {:foo 1, :bar 2, :baz 3}, m2 {:foo 4, :bar 5}] (->> (keys m1) (map (juxt identity m2)) (into {})))

17:23 clojurebot: {:foo 4, :bar 5, :baz nil}

17:23 hyPiRion: ~juxt

17:23 clojurebot: juxt is the bestest option though if it doesn't weird you out

17:23 ToBeReplaced: that's clever

17:24 i was wondering if this is really just an "update-all"... with m2 being the fn

17:24 gfredericks: juxt is the godwin's law of #clojure

17:24 hyPiRion: gfredericks: hahah

17:24 jtoy: gfredericks: cool, thx

17:26 hyPiRion: hm

17:27 ToBeReplaced: ,(let [m1 {:foo 1, :bar 2, :baz 3}, m2 {1 4, 2 5}] (reduce-kv (fn [acc k v] (assoc acc k (m2 v))) {} m1))

17:27 clojurebot: {:baz nil, :bar 5, :foo 4}

17:27 ToBeReplaced: then m2 can be any func that udpates a val ... it's an "update-all" i think?

17:27 tomjack: hmm, you can't put a fresh inside a nafc goal, huh?

17:28 hyPiRion: ooh ooh

17:28 tomjack: how do you do simplification style stuff?

17:28 i.e. apply any of these rules if possible, or, if not, then the identity

17:29 or maybe you just always allow the identity and you have to figure out how to find the 'most simple' answers

17:29 hyPiRion: ,(let [m1 {:foo 1, :bar 2, :baz 3}, m2 {:foo 4, :bar 5}] (merge (zipmap (keys m1) (repeat nil)) m2))

17:29 clojurebot: {:baz nil, :bar 5, :foo 4}

17:30 tomjack: well I'm also thinking like normal forms, where allowing the identity would be wrong

17:30 unless no more normalization is required..

17:30 ToBeReplaced: hyPiRion: m2 should be keyed on vals of m1

17:30 tomjack: soft cut? :(

17:31 hyPiRion: oh, I've totally not understood what you were trying to accomplish

17:31 hah, okay

17:33 ToBeReplaced: yeah; the whole op is just "update-values"... (defn update-vals [m f & args] (reduce-kv (fn [acc k v] (assoc acc k (apply f v args))) {} m))

17:39 tomjack: dnolen: could it make sense to make an enforceable nomc which just generates a fresh nom?

17:40 I don't quite understand enforceable constraints - looks like fd is hardcoded?

17:40 oh yes I see "we've hard coded finite domains here" now..

17:51 gfredericks: for some reason I've never read the wikipedia article on COMEFROM until now

17:51 probably it never occurred to me that it deserved an article

17:57 dottedmag: Is there online judge system which uses recent Clojure? I only found spoj.com, but they are using Clojure 1.1.0

17:59 mthvedt: gfredericks: it would be easier to find if COMEFROM hyperlinks existed

17:59 dottedmag: Except Project Euler.

18:06 hyPiRion: dottedmag: I haven't found any so far. My best aim is to push mr. Mirzayanov to get it on Codeforces.

18:07 dottedmag: I have found one: https://www.4clojure.com

18:07 hyPiRion: oh right

18:07 that's awesome by the way

18:07 dottedmag: Should be ok for basic training.

18:43 alandipert: dnolen: ahoy

18:54 Raynes: Dear peoples.

18:54 Refheap, 4clojure, and lazybot are going down for nap time.

18:55 tomjack: nooooo

18:55 Raynes: They will all be back up shortly, hopefully within an hour.

18:55 But we suck, so anything could happen.

18:56 tomjack: haha

19:27 Raynes_: &(+ 3 3)

19:27 lazybot: ⇒ 6

19:36 devn: lazybot: welcome home

19:36 Raynes: you too

19:36 Raynes: devn: pssst, and amalloy.

19:37 devn: assumed. amalloy is the glue that holds this family together.

19:37 Raynes: Migration went pretty smoothly.

19:37 devn: where'd you guys migrate to?

19:37 linode -> ec2?

19:37 Raynes: God no.

19:37 Linode wanted to upgrade our stuff so we moved to a new server.

19:38 devn: whoa, no need to be offended lol

19:38 oh yeah, i went through that

19:38 mine wasn't so smooth

19:38 Raynes: We now have 8 cores and 3GB of ram for the same price as we had before for half of that.

19:38 devn: failed to boot

19:38 had to switch the kernel to something newer (and 64bit)

19:38 Raynes: Well, I'm in Alan's apartment so we were able to coordinate nicely and get it done quickly. :D

19:38 devn: haha, nice.

19:39 Raynes: what ever happened to clojure-casual?

19:39 Raynes: Nobody cared about it.

19:39 devn: it was hoppin' for awhile

19:40 Raynes: I guess while you were on drugs or something.

19:40 devn: ... wat?

19:40 Raynes: I can't recall it ever being hoppin

19:40 devn: maybe im remembering a bit too fondly the early days

19:40 Raynes: I mean it was basically a place for amalloy and I to talk about non Clojure stuff. We just started using #4clojure for it instead. :p

19:40 amalloy: Raynes: you had clojure-casual long before i turned up

19:41 Raynes: Yes, and it ended up being a place for you and I to talk about non Clojure stuff because nobody really used it except for us.

19:41 amalloy: does anyone know whether sequences that congomongo fetches are lazy? like, if i (doseq [x (fetch :collection ...)]] ...), is that going to hold the entire collection in memory at once, or iterate through it?

19:46 tomjack: should reduce on `new Array(1000)` do anything?

19:46 (cljs)

19:47 is it basically dotimes?

19:47 er, no (nth (iterate f start) 1000) ish

19:48 I'd rather have native forEach/some's behavior of skipping holes

19:48 arrdem: amalloy: if I remember my mongo expriences correclty fetches are lazy

19:48 amalloy: because I had some terribly performing Python code which forced the entire request to be materialized :/

19:49 Raynes: Friendly note: I am not aware of a time when devn was or has ever been on drugs. Apparently my above comment was misconstrued as me declaring that he was, at some point, on drugs. It was merely for amusement.

19:50 tomjack: since there are no holes in java arrays it's unclear what cljs should do about them..

20:00 alandipert: Raynes, amalloy would reifn/deftypefn be welcome additions to useful?

20:00 useful rocks btw

20:21 amalloy: alandipert: i don't know what those are. shortcuts for reifying IFn?

20:23 callen: arrdem: sometimes it's the db abstraction layer fucking you on that.

20:23 arrdem: but you shouldn't use Mongo anyway :P

20:26 alandipert: amalloy: correct

20:26 Raynes: callen: Did you decide when to come down yet?

20:30 arrdem: callen: I forget, what is the common "use this instead" answer?

20:31 * arrdem is still backending 5 or 6 projects with mongo 'cause they are tiny and he doesn't care

20:32 gfredericks: is it worth optimizing calling subvec on a subvec?

20:32 arrdem: gfredericks: probably not

20:33 well... no the compiler shouldn't pick that up :/ may be worthwhile

20:33 amalloy: alandipert: i dunno, all these shortcuts for things like reifn don't really compose well. like, useful has a defmap already (i think it was a mistake to add it, but oh well), which is a shortcut for defining map-ish deftypes. there's no way to combine that with deftypefn or other similar tricks

20:35 alandipert: amalloy: np

20:41 * gfredericks does a bunch of typecasting

20:49 callen: gfredericks: I always end up rather unhappy whenever I am forced to do that.

20:56 * gfredericks maintains his morale

20:58 gfredericks: arrdem: nevermind, it's already optimized; just not where I expected

22:24 arrdem: has anyone looked at adding metadata to numeric types?

22:28 tomjack: oh man

22:29 I had (+ x 1) instead of (+ x0 1), no warnings, just NaN

22:30 Raynes: arrdem: You can look at it but you still can't do it.

22:31 arrdem: Raynes: that's what I was afraid of...

22:31 I reeeeealy don't want to end up with my own set of numeric objects just for this...

22:33 oh well guess I'll just do an [expr meta] pair throughout my code :/

22:34 tomjack: oh I was getting warnings I just didn't realize my terminal was C-z'd

23:27 holo: hi

23:37 kanwei: anyone ever run into this problem?

23:37 Compiling ClojureScript.

23:37 Exception in thread "main" java.lang.RuntimeException: No such var: json/pprint, compiling:(cljs/source_map.clj:142:7)

23:41 holo: kanwei, I never ran into such a thing, but i'm newbie enough about cljs. consider running `lein cljsbuild clean` just in case

23:50 tomjack: data.json didn't used to be a dependency for clojurescript, maybe related

Logging service provided by n01se.net