#clojure logs

2013-05-25

00:16callenecallen: okay. we're going to end up doing battle.
00:17amalloysee if you can get tieTYT2 and tieTYT to fight to the death too
00:18amalloythou shalt not mess up my tab-completion
00:19callenamalloy: it's just him being lazy about a shell, no?
00:19callenecallen is somebody else.
00:20callenamalloy: I found out not long ago that some people don't use tab completion. I was hella confused.
00:20amalloywhen i started using irc, i was new enough to the unix thing that i didn't instinctively try tab-completion
00:21amalloyi might have tried intellisense
00:21tomjackso baffles me
00:22tomjackok so apparently you're not getting highlighted everytime anyone says so, but everytime I say so it is in bold
00:22tomjacktesting ignoring so
00:23tomjackno joy :(
00:23amalloyoh yeah, erc highlights nicks mid-message. not a feature i'm a fan of
00:25tomjackerc trolls could just join a bunch of bot accounts going down the dictionary in frequency order
00:25tomjack /nick every /nick word /nick I /nick fucking /nick type /nick is /nick bold
00:38seangrovetomjack: Yeah, I've noticed that too
00:39seangroveWas imagining growl hooked up to that irc client...
00:46devnman, i totally take pagination for granted
00:46devnrolling pagination by hand sucks
00:47devnCould a decent library be written for it? Or is the whole web development story in clojure still too fragmented to allow it?
00:48tomjackwhat does pagination mean
00:49tomjackincidentally pagination strikes me as something datomic is not good at
00:49devn<<- <- 15 16 17 18 19 20 21 22 23 24 -> ->>
00:49tomjackbut maybe I haven't figured it out yet
00:49tomjackoh, wow
00:49devntomjack: this is about displaying the number of results on a web page
00:49tomjackI hate those things
00:49devnhaha
00:50devnwell, would you rather see 1 2 3 4 ... 100000 on a website?
00:50tomjackI dunno
00:50rbarraudseen arbscht_
00:50tomjackI was thinking prev/next should be enough, but maybe not always
00:50tomjackbut who ever says "oh ok I'm on page 16, next I want to see page 22"
00:50devnprev/next is bummer usability
00:51devntomjack: because you might know your result is on page 22
00:51devnand it's a sense of how many results were returned
00:51tomjackhow? you did the query already before?
00:51tomjackyeah, that makes sense
00:51technomancyif you do pagination without meta rel=next/prev you should feel a deep and abiding sense of shame
00:51devn"n pages of results" versus "1,240,495 results"
00:51technomancy</psa>
00:52tomjackI just always go through page by page I think
00:52tomjackexcept gist
00:52devntechnomancy: heh, i would have messed that up.
00:52tomjackthen I jump around some
00:52tomjackand it's always a nightmare cus I have no clue what page it's on
00:53devntechnomancy: you don't know shame... https://gist.github.com/devn/1688d08c688d6c6ed431
00:53devnthat's me right now, just trying to nail down conditions and see it work before i factor it
00:53tomjacktechnomancy: because of the harm you cause to the 16 people using conkeror?
00:54technomancytomjack: anyone not using a browser designed by simians
00:54tomjackI guess there are probably bots using it
00:54devnhahaha, oh conkeror
00:54technomancy"why should I change my name? he's the one that sucks"
00:54devni so wanted to believe in the promise of conkeror
00:54devnbut that community is dead
00:54technomancythis is just basic web metadata
00:54devntechnomancy: *nod*
00:55technomancyif your browser doesn't expose it, your browser is ridiculous
00:55technomancylike with the conical hat and everything
00:55devndunse. it's french.
00:55technomancycheckered jester outfit
00:55devnbells on the curled shoes
00:55technomancynow you're getting it
00:56devntechnomancy: is it a crazy idea to try and provide a basic pagination library?
00:57technomancydevn: it bugs me
00:57devntechnomancy: 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?
00:57technomancybecause if you could make drop on a lazy seq just skip the act of generating elements, it would be easy
00:57devnbut then again, i guess the problem is: "do you use hiccup, enlive, etc?"
00:57technomancybut I think there are subtle pitfalls that make that infeasible
00:58devntechnomancy: could you give me a more conrete example?
00:58devnconcrete
00:58tomjackI don't see what functions would go in a pagination library
00:58tomjackmaybe a protocol?
00:58devntomjack: mehhhhh, seems so heavy-weight
00:59devntomjack: it's weird
00:59tomjackI could understand if you define a new kind of data structure which you implement by different sources
00:59rbarraudarbscht_: There's a discussion on Twitter re. AKL meetups for FP - you might wanna have a look?
00:59technomancy"here's a seq, here's a page number, here's a page size: linky linky"
01:00technomancyyou could do that with lazy seqs, but it'd be wasteful
01:00devntechnomancy: wasteful shmasteful
01:00ToBeReplacedi might be doing something silly... how can I change (or update) the nth value in a Cons?
01:00tomjackSorted ?
01:00devntechnomancy: err that's sort of naive though right?
01:00devntechnomancy: what about in the case of showing a use X pages regardless of the page they're on?
01:00devnuser*
01:01tomjack&(.entryKey (sorted-map 3 4 5 6) (first {3 4}))
01:01lazybot⇒ 3
01:01tomjackthat's odd
01:01devnso if you're on the last page you see <<- <- 90 91 92 93 94 95 96 97 98 99 100
01:01technomancydevn: if drop could be made to prevent actual seq element generation you could do it
01:01technomancybut seqs aren't lazy enough
01:01tomjackSorted has seqFrom which seems useful
01:02tomjackoh I see entryKey ignores the data in the Sorted
01:02devntechnomancy: hmm, sorry im dense tonight, but how do you mean more lazy? im staring at the source for drop now.
01:04technomancyif 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
01:04devntechnomancy: oh i get you now
01:05devnso it stands that you *can* do what you're saying
01:05devnit's just wasteful
01:05technomancyyeah
01:05devnokay okay, I thought you were saying it couldn't be done
01:05technomancyI asked rich and he told me why super-drop couldn't really be implemented
01:05technomancybut it was subtle, so I forgot
01:06devnshit. i want super drop.
01:06tomjackwhere is the problem, in clojure or in any data structure which would try to implement super drop?
01:06tomjackI mean super drop is basically seqFrom, yes?
01:06technomancytomjack: every lazy seq at its root has a call to clojure.core/lazy-seq
01:06tomjackoh, for lazy seqs?
01:06technomancyI think there are issues of dynamic scope around how super-drop would communicate its intent to lazy-seq
01:07tomjackyeah super-drop doesn't make any sense at all to me for a lazy seq
01:07devnWWHD? What Would Haskell Do?
01:07technomancyhaskell is fully lazy
01:08technomancyso you get super-drop for free
01:08tomjackhuh?
01:08tomjackI see
01:08tomjackyou're saying like (super-drop 10 (map f coll)) would skip 10 f calls
01:09technomancyaye
01:09devni dont fully get the fully lazy distinction -- i guess i dont know laziness any other way than the way ive learned in clojure
01:09tomjackyou still have to walk through the skeleton of the seq sequentially
01:10tomjackI was thinking of a super-drop that lets you do (drop n coll) in constant time
01:10devnlike the principle of what we're talking about i totally get
01:10tomjack..near-constant .. or maybe just log :(
01:10devnbut i dont know how haskell avoids that
01:13devnso Clojure is "strict" and Haskell is "nonstrict"?
01:13tomjackan 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
01:13tomjackin clojure lazy seqs specifically make the skeleton of seqs lazy
01:14technomancydevn: haskell is lazy-everywhere, clojure is lazy in seqs only
01:14tomjackbut there is no (⊥,⊥)
01:14tomjackyou realize the lazy seq, ⊥, and get back (a,⊥)
01:14technomancydevn: yeah, but haskell people will say strict vs eager
01:14devnhttp://en.wikibooks.org/wiki/Haskell/Laziness#Nonstrictness_versus_Laziness
01:14tomjackthen you realize the rest and you have (a,(b,⊥))
01:15devntechnomancy: i see what you mean now.
01:15devntomjack: thanks to you also
01:15tomjackyou _could_ count the seq by just realizing (⊥,(⊥,⊥)) etc
01:16tomjackI wonder what happens if you try representable functors with vectors as the primitive instead of cons pairs
01:16devntomjack: i needed to re-read your explanation
01:16devnthat makes good sense
01:16tomjackor reducers rather?
01:16devndamn category theory wonks! ;)
01:17devni need to catch up on our category theory book club
01:17tomjackI can only hope to grow up to be a category theory wonk :(
01:17devn"The Order of the Lambda"
01:17devn^-our book club
01:17devni intend to purchase the meetup organizer a robe with a lambda on it
01:17tomjackand a fez?
01:18devnno, not that kind of robe
01:18devnmuch more monk-like
01:18tomjackah :)
01:19devnMy only hangup is honestly the notation. I find myself spending a lot of time trying to recall what means what.
01:19tomjackI think the problem with super-drop is indicative of the execution concerns bundled into lazy seqs
01:19tomjackI worry that someday I will start writing haskell code :(
01:19devnwhy worry about that? I think it's a really great language.
01:20devnbased on the little I know of it, of course
01:20devni used to use xmonad and learned enough to get around, but it was mostly understanding through copying, not inventing from scratch
01:21devnhttps://github.com/xich/scotty
01:21devnthe tiny example there makes me happy
01:23tomjack`newtype ScottyM a = S { runS :: StateT ScottyState IO a }`
01:24tomjack`data ScottyState = ScottyState { middlewares :: [Middleware], routes :: [Middleware] }`
01:24tomjack`type Middleware = Application -> Application`
01:24tomjack`type Application = Request -> ResourceT IO Response`
01:24devnheh
01:24devnI hear you.
01:25devnI'm just saying, that doesn't make it wrong.
01:25tomjackwait, what?
01:25tomjackscotty or haskell?
01:25devneither, i got the impression you were demonstrating the ceremony
01:25tomjackI have adjusted enough to be comfortable with that much of haskell
01:26tomjackthose types just don't look interesting to me
01:26devnin what sense?
01:26devnwhat makes a type interesting?
01:27tomjackScottyM looks like it says "ok we've got get/put on the routes and middlewares, and then ANYTHING CAN HAPPEN"
01:27tomjackI don't think that is the type I want for my web application..
01:28technomancylisten tomjack how else are you supposed to implement zombocom in scotty
01:28technomancyanything CAN happen
01:29tomjack:)
01:29tomjack"the only limit is yourself" I never noticed how great that line is
01:29devntechnomancy: anything at all
01:30technomancysweet, latest hacks are a go: https://www.youtube.com/watch?v=sIgHVmCLIQE
01:30tomjackconal apparently doesn't like dependent types, but I kind of want to make a dependently-typed lisp
01:31devntechnomancy: nicd
01:31devnnice*
01:31devnyou bringing it to the conj. i want to see a clojure/conj battlebots event between you and hiredman
01:32technomancybetter not; mine is racket-powered
01:32devnhaha
01:32devntechnomancy: that's cool
01:33technomancy"it's fine; it's fine; we're all lispers here"
01:35technomancyactually will probably end up running it from scratch so the kids can control it
01:36devntechnomancy: N is a pretty smart 5 year old. :)
01:37gaspar09how can I make a list of functions, iterate over them and invoke them? example, in javascript i can do:
01:37gaspar09var 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)); }
01:37gaspar09how should i do that in clojure?
01:37devntechnomancy: Hearing a five year old saying "LEDs" cracks me up.
01:38technomancydevn: 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
01:38technomancybut yeah, we have a lot of fun with that kind of stuff
01:38devnhey, he's right to be skeptical. I think breadboards are confusing like that.
01:39technomancybreadboards make me nervous not having version control
01:39devnhaha -- man, that's a great idea
01:39technomancyhe hasn't done the breadboard much; mostly he sticks to snap circuits
01:40technomancyit cracks me up how he's so sure of himself in that video though
01:40technomancy"no, I *know* it will work when I switch this"
01:41devnin the debugging video?
01:41technomancyright
01:41devnhaha yeah
01:41devn"I got it, dude."
01:41devn"Bro, do you even build circuits?"
01:41technomancyheh
01:41technomancyok, time to head off
01:41devnhave a good one technomancy
01:42technomancypeace be with you
01:42devn:)
01:43tomjackhttps://github.com/agda/agda-frp-js/blob/master/demo/agda/FRP/JS/Demo/Calculator/Model.agda
01:44tomjackhttps://github.com/pedestal/pedestal/blob/master/app/test/clj/io/pedestal/test/app.clj#L131
03:04zRecursivewhere is clojure*.jar after `lein repl` ?
03:11devnzRecursive: what do you mean?
03:11devnyou mean where does it put the dependency on clojure*.jar?
03:11devnthe path to that file?
03:12zRecursiveyeah
03:12devn~/.mw
03:12clojurebotNo entiendo
03:12devnoops
03:12devn~/.m2
03:12clojurebotI don't understand.
03:12zRecursivedevn: no ~/.m2
03:13devnzRecursive: how did you install lein?
03:13devnjust curl and put it on your PATH?
03:13zRecursivedownload lein.txt and mv it it lein
03:13zRecursivechmod +x ~/bin/lein
03:14zRecursivethen `lein repl` works
03:15zRecursivebut i am curious where lein put those jar files ?
03:16zRecursiveFYI, `lein repl` reports: nREPL server started on port 42516\n REPL-y 0.1.10\n Clojure 1.5.1
03:24tomjack~/.m2/repository/org/clojure/clojure/
03:24clojurebotExcuse me?
03:25zRecursivetomjack: my my freebsd box, there is no ~/.m2, weird !
03:26tomjackhmm
03:26tomjack`lein repl` maybe just uses the uberjar in ~/.lein/self-installs/ ?
03:26tomjackif you go into a project and do `lein repl`, the deps should wind up in ~/.m2..
03:27zRecursivels .lein/self-installs/ => leiningen-2.1.3-standalone.jar
03:27lazybotbin boot data media mnt opt root sbin selinux swap sys
03:27tomjackwhat
03:27tomjackif you `jar tf ~/.lein/self-installs/leiningen-2.1.3-standalone.jar` you'll see it contains clojure
03:28tomjackjust confirmed I think that that is what `lein repl` uses
03:28zRecursivetomjack: yeah, it is there
03:29tomjacklazybot: ls bin
03:30zRecursivetomjack: i would like downloading clojure manually
03:31tomjackthe chef cookbook I saw the other day just downloaded leiningen-2.1.3-standalone.jar and put it in the proper place
03:35zRecursivemaybe it is convenient to upgrade ?
05:16noahlz##(println "test")
05:16lazybot⇒ test nil
05:35GeoffSKhow do i (if i should) set my dependency to github rather than clojars? (newbie)
05:38noahlzusing leiningen?
05:38GeoffSKyes.
05:38noahlzlein 2 uses Apache Maven style repositories
05:39noahlzif you need something that is on github and not in clojars yet
05:39noahlzdo
05:39noahlzgit clone <github project>
05:39noahlzcd github-project
05:39noahlzlein install
05:39GeoffSKclj-mail - seems to be behind
05:39noahlzthen it is availble to you locally as long as you declare the development version in your project.clj
05:40GeoffSKsounds good. thanks
05:41GeoffSKperfect. thanks heaps.
05:41noahlznp
06:06noahlzlein outdated
06:06noahlzjava.lang.IllegalStateException: Cannot fetch next ArtifactInfo
06:06noahlzwtf?
06:07noahlzhas anybody here used ring-middleware-format?
07:15sandbags2Does anyone know whether the clojuredocs.org dataset is available for download (to use the site offline)?
07:20Okasuhttps://github.com/zkim/clojuredocs Meh, Ruby 40%.
07:20Okasusandbags2: Not related to your question.
07:23sandbags2Okasu: yes i cloned the site, but the repo doesn't contain the dataset
07:23sandbags2i was also tickled that it's a Rails app
07:24sandbags2ah
07:24sandbags2stupid
07:24sandbags2i cloned it but didn't read the README
07:24sandbags2which, of course, has the instructions
07:26sandbags2oh, 2 years old download though
07:26antares_Okasu, sandbags2: a new version badly needs capable hands, see github.com/clojuredocs
07:27sandbags2antares_: presumably a new version isn't going to be Rails though?
07:27sandbags2as it happens when doing OO ruby is my preferred language
07:27sandbags2but my guess is that any new docs site would be using a clojure framework... and i'm a clojure neophyte
07:28antares_sandbags2: presumably it won't
07:29Okasuantares_: I'm currently working on clojure wiki enginge, hopefully it will survive and i'll publish it.
07:29antares_the problem with clojuredocs is not that it's a rails app
07:29antares_but rather that it is locked to a particular version, 1.3
07:29sandbags2of clojure?
07:29sandbags2(i've not looked but it *can't* be locked to Rails 1.3)
07:30sandbags2(although I've been upgrading a Rails 1.x app recently ;-))
07:30Okasusandbags2: Ha-ha, it's about cliojure version not rails. :)
07:30antares_sandbags2: there was no 1.3 version of Rails
07:30sandbags2yes looking at the database schema
07:31antares_only 1.2
07:31sandbags2antares_: i forget, it was a long time ago
07:31Okasuantares_: http://clojure-doc.org/ It's on eisago?
07:31Okasuantares_: What help https://github.com/clojuredocs needs in particular?
07:32sandbags2so the database schema certainly doesn't have a notion of versioning
07:32sandbags2beyond the 'added' string for functions
07:32sandbags2but since it's probably quite a well defined, slow moving, dataset i wouldn't have thought it would be too hard to retrofit
07:33sandbags2is the problem that most Clojure people dont' want to work on a Rails app?
07:33sandbags2if so then it's possible i can help
07:33antares_Okasu: no, it's a markdown site
07:33sandbags2i'm pretty time limited and not short of my own projects that are lying untended
07:34antares_Okasu: I believe the new indexer is mostly ready but the site is barely started. Ask on the mailing list.
07:34sandbags2as long as there are active maintainers i'd certainly try to contribute
07:35antares_sandbags2: the problem is that the original author of eisago is busy with other things
07:35sandbags2last commit 11 months 11 months ago
07:35sandbags2not a hopeful sign
07:36antares_and yes, most Clojure people are not particularly great at web apps, nor many are interested in anything related to documentation
07:36antares_documentation is boring, they say. Logic programming is way more fun.
07:37antares_I don't agree but clojure-doc.org and clojurewerkz.org leave me little time to work on the new clojuredocs.org
07:37sandbags2i 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
07:38antares_sandbags2: in what repo?
07:38sandbags2antares_: i'm not sure what you're asking me
07:38antares_sandbags2: zkim/clojuredocs is no longer developed
07:39sandbags2you mean "in what repo is the last commit 11 months ago?" yes "zkim/clojuredocs"
07:40antares_sandbags2: I'm not asking you, just saying that there is a new version that badly needs capable hands to finish it
07:41sandbags2ok, maybe i am being slow here (always possible)... do you mean the clj-rewrite branch of zkim/clojuredocs?
07:42antares_sandbags2: that thing is no longer being developed
07:44antares_sandbags2: github.com/clojuredocs
07:44antares_is the name not descriptive enough?
07:44antares_the new repo is called eisago
07:44sandbags2antares_: right i looked there when you linked the page but didn't see a project a la clojuredocs
07:44sandbags2ah
07:44antares_cds is clojure-doc.org, with doc guides
07:45sandbags2i read "importer and api" and didn't get as far as "website" :)
09:15@rhickeybbloom: unfortunately the HOF use of channel ops in go is not going to be cljs compliant - this will: https://www.refheap.com/14991
09:17@rhickeyI think we might differentiate the blocking vs parking names
09:18@rhickeybbloom: I don't see this: [16:31:32] bbloom: doesn't really handle the timeout case correctly
09:18@rhickeyseems to handle timeout same as the Go example afaict
09:19@rhickeysingle timeout used multiple times
09:53avishaihi
09:53avishaiquestion about agents
09:54avishaiis there a cap on agents actions queue?
09:54dnolenrhickey: 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?
09:55@rhickeyyes
09:58@rhickeydnolen: yes was for your q
09:58@rhickeyavishai: no
10:12avishairhickey, 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@rhickeyavishai: yes
10:17noncomif 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:30noncomhey, anyone here? :)
10:31hyPiRionnoncom: filter the keys how?
10:33noncomwell 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:34noncombut when i get them with (keys my-map), they're all boxed there
10:34noncomso if i have like 1000 keys... performance drops
10:34hyPiRionnoncom: And you want the keys only? Or a subset of the hash map?
10:35noncomi 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:38hyPiRionoh, humm. Would a sorted set do? Give me one moment.
10:38hyPiRionsorted map*
10:38noncomyou mean array-map?
10:39noncomoh there is sorted-map
10:40noncomummm i looked at the docs, but how can it help me? how do you think i should use it?
10:41hyPiRionsay you want every pair for a map, where the key is above value 5
10:42hyPiRion,(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:42clojurebot([6 \g] [7 \h] [8 \i] [9 \j])
10:43noncomcool! i'll try that out!
10:43hyPiRionEventually, 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:44hyPiRionthat 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:45noncomif i add events to the timeline after it's initial creation, will i have to re-sort the sorted-map?
10:45hyPiRionnoncom: no, if you assoc or conj into a sorted-map, it will place it in a sorted manner
10:46hyPiRion,(assoc (sorted-map) 5 :a 2 :b)
10:46clojurebot{2 :b, 5 :a}
10:46hyPiRion,(assoc (hash-map) 5 :a 2 :b)
10:46clojurebot{2 :b, 5 :a}
10:46hyPiRionoh well, bad example, but I think you get the idea
10:46noncomyeah, nice! i think this is what i am looking for, i'll try that
10:47hyPiRioncool, hopefully it works well :)
10:47noncom:) 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:47lazybotnoncom: Yes, 100% for sure.
10:48hyPiRionnoncom: actually, you can just do (fun)
10:48noncom*eec => exec
10:48noncomoh right
10:48noncomhaha :)
10:48hyPiRionso I think that's the idiomatic approach ;)
10:49noncomfunny, i get this: (map #(%) relevant-events)
10:49noncomfunny-looking :)
10:49hyPiRionheh, yeah
11:01jtoyif 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:03jtoyin a web app i mean
11:12mindbender1what's the option to force lein to resolve deps locally or abort?
11:14hyPiRionmindbender1: :offline? true
11:16mindbender1hyPiRion: thanks
11:16hyPiRionanytime
11:29bbloomrhickey wasn't in the room, but responded to me, so i'll assume he's checking logs….
11:29bbloomrhickey: (take 3 (repeatedly #(second (alt!! :result (<! c) :timeout (<! t))))) does not correctly handle timeouts
11:31bbloomrhickey: 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:32bbloomrhickey … oh wait no. i'm sorry. i'm wrong. i forgot that alt will return nil if none of the channels are ready
11:32bbloommy bad.
11:32jouiswalkerlol
11:33bbloomjouiswalker: this stuff hurts my brain :-P
11:33jouiswalkerno kidding
11:35bbloomthat's what I get for trying to do any real thinking before lunch.
11:37bbloomrhickey: i really like the one-bang vs two-bang versions of the function. that solves my portability concern
11:38jouiswalkeri'm still trying to find a doc for alt ;;
11:39bbloomjouiswalker: https://github.com/clojure/core.async/blob/master/src/clj/core/async.clj#L197
11:43jouiswalkerbizarre
11:46karbakLooking 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:56tomjackhmm, yeah, <!! seems helpful
11:57tomjackI wonder if making the macros resolve properly is a non-goal
11:57tomjackgo macro I mean
11:57tomjackcurrently it seems to qualify as anaphoric to me
11:58tomjacke.g. macroexpansion with syntax-quote will break alt!/<!/>! ?
12:00jouiswalkerhas anyone played with pedestal?
12:00bbloomtomjack: 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:01tomjackI kind of want an alt-case
12:01tomjackbut I get the sense this would be against the grain
12:01tomjackif you tried to write it I think you'd either have ~'alt inside (ew) or it'd break in go
12:02tomjacksince they added case support I'm guessing they're doing (let [[label val] (alt ...)] (case label ...)) too
12:03bbloomtomjack: yeah, that's precisely what i did was the let/case combo
12:03tomjackhmm, I hadn't thought about the details of alt-case
12:03tomjackmaybe it's let-case-alt
12:05tomjackclearly don't want (alt-case :foo (<! foo) (do-foo-thing) :bar (>! bar 42) (do-bar-thing))
12:06bbloomtomjack: yeah, the problem is you need a name for the return value if you're gonna do case
12:18tomjackeasy solution maybe would just be to use clojure.tools.macro/macrolet?
12:19tomjacker, except you can't let qualified names
12:20jtoy?
12:22tomjack'single timeout used multiple times' - does this mean a timeout channel should be a pure 'value' under core.async?
12:22tomjackor just that the google example code is wrong somehow
12:23tomjackoh
12:24tomjackI misread all that
12:26bbloomtomjack: haha yeah, this stuff is hard and alien. it's easy to misread
12:27tomjackI was thinking of like a delay channel I guess
12:27tomjackecho + delay
12:27lazybot+ delay
12:27tomjackrm -rf /opt/lazybot
12:31hyPiRionls
12:31lazybotdata etc home srv swap
12:34tomjackls
12:34lazybotbin data dev etc home opt root sbin src sys tmp var
12:34tomjackodd
12:40Bronsals
12:40lazybotdev home lost+found mnt opt sys
12:41tomjacknot sure if the double bangs are worth it :)
12:41bbloomtomjack: what do you mean?
12:42tomjack<! and >! just look a lot nicer to me
12:42tomjackand \! is a hard one to type for me
12:44tomjackI guess if you're writing portable code you're only using them at the edges anyway
12:47bbloomtomjack: you can just use the single bang versions inside async/go
12:47tomjackyeah
12:47tomjackso at the repl (<!! (go (<! c)))
12:48bbloomoh i see
12:49tomjack>!! is a rocket ship and <!! is a reentering space capsule
12:50hyPiRionquite the analogy you got there
12:53jouiswalker(exit)
12:53jouiswalkeroh woop
12:54tomjackI wonder if you could use nrepl middleware to make <!! work in a cljs repl
13:03mthvedtwhat'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:07tomjackyou don't need a framework, just write functions
13:08tomjackfunctions are already reusable :)
13:10mthvedttomjack: presumably if i'm using a test framework, i've already decided not to use that approach
13:12tomjackpresumably your test framework lets you call functions
13:14mthvedti want the suite to be modular--i don't want to have to invert modularity to be inside the suite. that sounds annoying
13:17mthvedtthe 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:19tomjackI guess maybe a good example use case would be testing mikera/matrix-api impls?
13:19tomjackbut there there is already a dynamic binding for the impl
13:22mthvedttomjack: yeah, a similar use case--multiple impls or something that need to pass the same tests
13:23tomjackif there is a dynamic binding for the impl, it seems easy
13:23tomjackotherwise, it depends on what an 'impl' is I guess
13:24tomjack(I am not suggesting having a dynamic binding for the impl!)
13:25mthvedtwell, you can write your tests s.t. you have a dynamic binding the tests can see
13:27tomjackyeah if 'impl' does not mean 'project' that seems like it could work
13:28mthvedtbut, 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:28mthvedtand have all the reporting and auto test features that something like midje has
13:29mthvedtclojure.test seems to have half-baked modular test suites, but it's not the same
13:29tomjackah, I dunno midje
13:29tomjackand I don't know any good frameworks, to answer your actual question :)
13:29tomjackto not answer.
13:29mthvedt:P
13:33tshauckHi, does anybody know how I might run the postgres bulk copy command from w/i clojure?
13:34tshauckor really, maybe to start how could I run a straight query where there won't be results?
13:35tomjackbbloom: https://www.refheap.com/cf13b39676149317297b9e8b3
13:43AlezandrCan 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:46tomjackAlezandr: don't put a / in your ns name
13:46foobar27Alezandr: remove the parenthesis around cur-dir in the last println statement
13:46tomjacktry it with dirtree.dt
13:48AlezandrThanks! it works after removing '/'
13:49SegFaultAXAlezandr: There is no reason to use (def foo (fn [] ...)). Checkout defn (which is the canonical way to define top level functions)
13:49SegFaultAXfoobar27: Note that cur-dir is a function, he just used def and fn instead of defn.
13:50foobar27SegFaultAX: yes, I saw later on that cur-dir is a fn
13:53AlezandrIt was my try to fix the error, I will use defn , thanks for advice
14:27scottjWas 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:28gfredericksscottj: totally not at all about that
14:28scottjgfredericks: ok thanks
14:29gfredericksI believe the title was Design, Composition, and Performance
14:29murphy_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:29scottjthat's correct. I just checked and see Clojure/West now has a description of his talk
14:29murphy_should I be asking in #vim, or is this the correct place to talk?
14:30scottjmurphy_: this is a fine place to ask
14:30tomjack_with_ riak?
14:30murphy_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:30gfredericksif he said "riak" or "datomic" in that talk it was so irrelevant that I forgot all about it
14:59asalehanyone who could help me \w core.logic?
15:00tomjackanyone?
15:00clojurebotJust 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:01gfredericksasaleh: yes.
15:01asalehwell my problem is a bit complicated, so was first trying if there are some logic folk listening :)
15:02gfredericksclojurebot never seems to acknowledge that possibility
15:03asalehgfredericks, 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:04asalehgfredericks, unfortunately I am not sure how to approach it
15:05gfredericksasaleh: could you elaborate on the sorts of rules and knowledge you're expecting to deal with?
15:05Kowboyi 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:05asalehgfredericks, well, I give two examples here https://groups.google.com/forum/?fromgroups#!topic/clojure/k9loHYzsGvw
15:06gfredericksKowboy: lein 2.1.2?
15:06llasramKowboy: Sounds like your ~/.lein/profiles.clj has some ritz stuff in it?
15:07Kowboythat it does
15:07Kowboymust have tried fixing some othe problem before I upgraded
15:08tomjackbbloom: https://www.refheap.com/879757f050bd86074719e061c
15:08tomjacksurely there's a better way
15:08tomjacknot even sure that will always work..
15:10gfredericksasaleh: my first thought is that you have as input a list of known things
15:11gfredericksand a goal (defn derived [axioms])
15:11gfrederickser
15:11asalehgfredericks, well, my first attempt looked like this https://gist.github.com/AdamSaleh/5650339
15:12gfredericksso lines 2 & 3 are your axioms?
15:13gfredericksI'm imagining that (run* ...) returns all known things
15:13asalehgfredericks, 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:14asalehgfredericks, but run* wouldn't terminate
15:15gfredericksit might for some programs
15:15gfredericksstill pondering this
15:15asalehit just keeps on adding place-holders to my knowledge list
15:15gfredericksI guess we're kind of trying to figure out the structure of a generic formal axiomatic system
15:17asalehgfredericks, I am thinking, that maybe I just can't figure out a decent implication in core.logic :)
15:18gfredericksno no I'm having great fun pondering this
15:18murphy_sorry for more newbie questions, but is there a way I can test that nailgun is connecting to server that is currently running ?
15:18gfredericksI really really want a general solution where you can specify A) derivation rules B) axioms and get out C) theorems
15:18tomjackI've got a tiny start on a first-order logic project
15:18murphy_I have a feeling that that's the reason why my vimclojure isn't working
15:19gfrederickstomjack: 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:20asalehtomjack, do you have sources somewhere? maybe it would help me :)
15:20tomjackI doubt it will help you
15:20llasrammurphy_: 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:20tomjackso far all I have working is generating formulas and terms, and not happy with even that yet
15:21tomjackmy idea was to represent the derivation rules as just data
15:21gfrederickse.g., (defn modus-ponens [i p1 p2] (== p1 [p2 :-> i]))
15:21murphy_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:22murphy_I'll take another gander, look at a screencast
15:22gfrederickstomjack: 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:22tomjackhttps://www.refheap.com/5efa70801ee76390dcb4447e7
15:22tomjackoh and qexp is https://www.refheap.com/df05137c9cf9a8931d425397c (don't like that either)
15:24gfredericks(defn theoremo [i axioms] (conde (membero i axioms) ...something smart here...))
15:24tomjackyeah
15:24tomjackI'm wondering if we need CLP(Set)
15:25asalehwell 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:25gfredericksasaleh: yeah I think that fits where I'm trying to go with it
15:25gfredericksthe recursion is what's tripping me up
15:25tomjackso maybe that's like inductive logic?
15:26gfrederickstomjack: the recursive part you mean?
15:26tomjackI mean you only have [true expr] -> [true expr'] because you never assume something false for contradiction
15:27tomjackhmm but you can still know something to be false
15:27gfrederickswhat's the complement of everyg?
15:29gfredericksman it's super weird that *clojure-version* is dynamic
15:32gfredericksokay I'm gonna scribble out some code
15:36gfredericksw00p got my first divergence :)
15:37hyPiRionhurm
15:37hyPiRionwhy would you set! or bind clojure-version anyway?
15:38gfrederickshyPiRion: only thing I can think of is tricking a lib into doing something
15:38hyPiRionsounds horrible
15:39hyPiRionI mean, that effect may propagate down to some library which you wouldn't trick
15:39hyPiRionwouldn't like to trick*
15:40asalehgfredericks, when you will have something post it :)
15:40gfredericksasaleh: I have something now and am puzzling over why it doesn't work; posting
15:41asalehgfredericks, right now I am at least trying to create simple derivation function f: prev_knowledge -> new_knowledge
15:41gfredericksasaleh: tomjack: https://www.refheap.com/15003
15:42gfredericksprobably could have named the args better
15:42gfrederickss/impl/t/, s/i/impl/
15:42gfredericksoh I see
15:42asalehgfredericks, conde?
15:43gfredericksline 3 should be (== p2 [p1 :-> i])
15:43gfredericksasaleh: you don't know about conde?
15:43gfrederickssweet it worked
15:43asalehgfredericks, great!
15:43gfrederickswhat are some more predicate logic rules?
15:44asalehgfredericks, wait, conde is the thing that stops on the first true clause
15:44asalehgfredericks, only one rule and three axioms :)
15:45gfredericksasaleh: it doesn't stop; it gives multiple ways of succeeding
15:45asalehgfredericks, ah, predicate? there is then the rule that is concerned by \forall quantificator
15:46tshauckhi, 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:46gfrederickstshauck: (query my-db ["SELECT stuff"])?
15:48tomjackhmm, try with axioms [:a :b [:b :-> :c] [:c :-> :d]]
15:48tshauckgfredericks: ya... it keeps saying I'm missing a required param... my statement is (sql/query conn ["SELECT * FROM table"]) so essentially yours
15:50dobry-dengee, i love clojure.core/assert during development
15:51dobry-denhaving to set up unit test boilerplate for trivial dev sanity checks was always a pain
15:51gfrederickstshauck: what says that? a clojure error, or a jdbc error?
15:51llasramdobry-den: You might also care to check out pre- and post-conditions
15:51clojure-newbRaynes: hi, I've got a Laser question if you have time to help out ?
15:52gfredericksdobry-den: also nice is the ability to leave them in your code but turn them off in prod via *assert*
15:53gfrederickstomjack: it derives :d with that set
15:53gfredericksI'm trying to add modus tollens but it's diverging again
15:53tshauckgfredericks: https://gist.github.com/tshauck/5650519 here's the error
15:54tomjackhmm, it doesn't derive :d here
15:54gfrederickstomjack: you're using run with a high enough number?
15:54gfrederickstshauck: makes me think your conn is bad
15:55tomjackoh, d'oh!
15:55tomjackwow run 10 is slow
15:55tomjackoh diverging
15:55tshauckgfredericks: 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:55Raynesclojure-newb: What's up?
15:56clojure-newbRaynes: 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:56tomjackI'd think the recursion needs to be driven by the axioms
15:57gfrederickstomjack: eh?
15:57clojure-newbRaynes: I do a bunch of fragment loading, then transformations over the loaded content etc
15:57Raynesclojure-newb: Can you post the code somewhere for me? Like refheap.com?
15:57tomjackI think I'm imagining corecursion on the axioms instead of recursion on the theorem to be proved
15:58clojure-newbRaynes: sure I'll try to put some stuff together and paste
15:58clojure-newbRaynes: I will throw the stack trace in too
16:01gfredericksuh oh now I'm deriving contradictions
16:01gfrederickswhat the heck is wrong with my modus tollens
16:02gfredericksoh my bad
16:02gfredericksmy axioms contradict
16:08clojure-newbRaynes: I've got some info up at - https://www.refheap.com/15005
16:09RaynesThe line number in this case doesn't really matter because it is likely in a macro.
16:10RaynesAnyways, it looks like you're passing a file into laser somehow.
16:10RaynesAre you calling (l/nodes ..) anywhere?
16:10clojure-newbok, I'm guessing there is some problem in the fragment,,,
16:10RaynesWell, I could probably tell you the problem but I'd need to see all of the relevant code.
16:10clojure-newbno, I'm not calling l/nodes anywhere
16:11clojure-newband its definitely good with 0.1.22
16:12RaynesWhy are you trying to go from 0.1.22 to 0.1.23?
16:13RaynesAll sorts of crazy things were broken in those versions.
16:13RaynesIt's very possible that 0.1.23 was just completely broken and not working.
16:13clojure-newbRaynes: I was trying to upgrade one step at a time
16:13clojure-newbplaying it safe
16:13RaynesIn the case of laser that is definitely not playing it safe. :p
16:13clojure-newbah ok :-)
16:13RaynesIt isn't a very clear upgrade path. I was pretty nuts with stuff in the 0.x.x versions.
16:14RaynesIt was very unstable.
16:14RaynesAnything after 1.x.x is pretty stable.
16:14RaynesSo you don't have much to worry about once you get there.
16:15clojure-newbI'll have a go at upgrading to a 1.x.x - was just worried about so many changes in one go
16:15RaynesSorry :(
16:15RaynesHope it isn't too painful,
16:15clojure-newbno - its my fault, got distracted with work, left it too late etc
16:16clojure-newbTotally appreciate the library, its awesome
16:16clojure-newbusing it on two commercial projects very happily
16:16RaynesAh, that's why you couldn't show the code.
16:16clojure-newbyep
16:16RaynesShould have said so! I totally understand.
16:17RaynesFrom now on if I make big changes I'll jot out upgrade instructions.
16:18clojure-newbto be fair it was only a 0.1.x :-)
16:18RaynesYeah, I was literally putting out as many as 3-4 versions in a day during that cycle, clojure-newb.
16:19RaynesI'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:33darrickwIs 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:34darrickwC-c in vim just disconnects from the command rather than interrupting it.
16:35darrickwThis isn't a vim-specific question. I'm wondering if there is a way to do this, perhaps via nrepl middleware?
16:36clojure-newbRaynes: I'm all good on 1.1.1 - thanks for your help, saved me a ton of time
16:36dobry-den1How come the latest version of lein still generates a project.clj with clojure 1.4.0 instead of 1.5.x?
16:38hyPiRiondobry-den1: huh, you sure? 2.1.3 generates a 1.5.1 version ddependency
16:38foobar27dobry-den1: my lein also generates 1.5.1 clojure deps
16:39dobry-den1i never thought to run 'which lein' until now — it's not even using my homebrew lein. swing and a miss. thanks
16:39foobar27dobry-den1: are you generating a plain new project, or a project from a template?
16:39foobar27ah ok :)
16:42dobry-den1oh, so it's symlinked by brew. looks like the lastest lein on homebrew is still 2.0.0
16:42dobry-den1i'm a scrub.
16:43gfredericksare PC manufacturers pressured to not have an OS-free option because MS is afraid of piracy (rather than linux users)?
16:45AimHereWith software that's part of an ecosystem or infrastructure, having your stuff pirated works in your favour
16:45AimHereMore 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:46gfrederickshaving stuff pirated only works in your favor as long as there's still stigma around piracy for some users
16:46AimHereBill Gates said as much referencing East Asian piracy, at one point, though he had to recant that pretty fast
16:47gfredericksif you use it as an "embrace piracy" argument then it's self-defeating
16:47AimHereWell that or you're willing to change your business model accordingly at some point
16:48gfredericksin any case that's independent of my question
16:48AimHereThere'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:48Pupnik-gfredericks, you can buy plenty of laptops with linux installed instead of windows
16:49gfredericksPupnik-: plenty?
16:49gfredericksthere's nothing substantial I know of besides system76
16:49txdvjust install it yourself
16:49Pupnik-dell
16:49gfrederickstxdv: still paid for windows
16:49txdvo you mean that the laptops have windows prepaid
16:50AimHeregfredericks, 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:50AimHereOfficial story - piracy. Real story - competition.
16:50gfredericksAimHere: so linux is the worry, is what you mean?
16:50hyPiRiongfredericks: oh yeah
16:51callenThe 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:51AimHereWell it'll be a mixture of both, but I'd guess the primary one would be keeping the alternatives from being visible
16:52amalloygfredericks: i dunno about laptops, but you can certainly buy desktops with no os (or even with linux preinstalled)
16:52gfredericksamalloy: laptops are what I'm interested in atm
16:53Pupnik-gfredericks, my bad, they dont seem to do linux anymore
16:53txdvWell, if you build your pc together on your own, you can choose whatever you want
16:53Pupnik-used to be you could get just about any dell laptop you liked with linux
16:53txdvbut yeah, laptops are always preinstalled with windows
16:54hyPiRionunless they are macs
16:54gfredericksPupnik-: yeah I think that's been off for a while
16:54Pupnik-unfortunate
16:55hyPiRiongfredericks: I don't think you'll have to pay more than you'd do without Windows installed -- quite the contrary, I would guess.
16:55hyPiRionOr is it about the time it takes to set up the computer etc.?
16:55txdvhyPiRion: I can find only one laptop on the site I buy stuff from with the optionality of no os and you save 50eu
16:56Pupnik-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&amp;l=en&amp;s=biz
16:57gfredericksPupnik-: now all I need is for it to not be dell :)
16:57hyPiRiontxdv: huh, is that with support?
16:58gfredericksI think acer has a laptop with the mousepad behind the keyboard
16:58gfredericksand the screen can move forward to cover it; seems nice for keyboard-only folk
16:59txdvhyPiRion: no-os or windows
16:59txdvI guess you can say the fully support the NO-OS option
16:59txdv"Hello, I have a black screen" "This is the intended behaviour"
17:00txdvbut as linux user you save 50eu
17:00hyPiRiontxdv: ah
17:00txdvbut it is a low ranged laptop, costs 400 with windows, 350 without
17:00txdvgood student laptop
17:01txdvbut if you go into the high class range, you always have to pay for either windows or macosx
17:01r0bgleesontxdv: hahaha.
17:01txdvwhat is so funny/
17:07mattinPupnik-: ubuntu is harmful these days, they've gone to the dark side and it's virtually the same as recommending MS windows
17:08callenmattin: hardly. Don't be so melodramatic.
17:08callenmattin: it's still an open source stack.
17:09mattincallen: do you see M$ proxying search queries originally intended for your personal desktop out to Amazon. no i didn't think so.
17:09hyPiRionWell, the transition from Ubuntu to, say Debian or Arch, is easier than from Windows to Debian/Arch
17:09txdvmattin: do you mean unity?
17:10gfrederickswoah. I just realized you can change how arbitrary Objs print just by adding :type metadata
17:10txdvWhat specifically about ubuntu is bad?
17:10mattintxdv: yes im referring to unity, which is created by ubuntu developers
17:10txdvi am using the awesome window manager which is created by awesome developers
17:10txdvwith ubuntu
17:10callenmattin: you don't have to use unity. They need to make money somehow to perpetuate the project.
17:10arrdemtxdv: w00t awesome
17:10callenmattin: and don't use "M$", it's fucking infantile.
17:10txdvdoes that make it ok to use ubuntu in such way?
17:10gfredericksI've been using xmonad with ubuntu for a year or so now
17:11callen^^ ditto, but longer.
17:11mattincallen: telling other people their "fucking infantile" is rather infantile in and of itself
17:11txdvthe good thing about ubuntu is its package manager and that it has newer packages than debian
17:11arrdem(dec mattin)
17:11lazybot⇒ -1
17:11llasram(inc matten)
17:11lazybot⇒ 1
17:11callen(dec mattin)
17:11lazybot⇒ -2
17:11gfredericksO_O
17:11arrdemDOWNVOTES SIR
17:12llasram(inc mattin)
17:12lazybot⇒ -1
17:12llasramSpelling
17:12llasramI didn't actually know lazybot supported `dec`ing karma. Not sure I'm a fan
17:13tomjackmattin: so how infantile is calling people "rather infantile"? :)
17:13hyPiRionllasram: Not sure karma is such a good thing regardless
17:13hyPiRionbut yeah, dec should go
17:13mattintomjack: infantile of course ;p
17:13gfrederickstomjack: if we keep this up we can discover milder and milder versions of infantility, and maybe publish a paper or something
17:14mthvedtdo you think infantility is a continuum? or is it like the rationals
17:14gfredericksthe rationals are at least dense so we can always find subtler levels of it
17:14tomjackonce we get to the bottom I suspect we'll just ascend into another dimension, no need to publish :)
17:14hyPiRiongfredericks: Oh, if it has a multiplicative reduction, approaching no infantility is going to take O(log n) time
17:15gfrederickshyPiRion: what the hell
17:15hyPiRion... if one rounds down at certain points
17:15gfredericksnever round down
17:15mthvedtrounding down is infantile
17:15gfredericksooh a parallel series
17:16hyPiRionHumm
17:16gfredericks,(-> 7 (iterate #(/ % 13)) (nth 17))
17:16clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
17:16asalehgfredericks, 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:16gfredericks,(as-> 7 <> (iterate #(/ % 13) <>) (nth <> 17))
17:16clojurebot7/8650415919381337933
17:17llasram(zero-enough? *1) => true
17:17gfredericksllasram: we have infinitely farther to go!
17:17gfredericksfor science!
17:17hyPiRiongfredericks: I'll tell you a secret
17:18hyPiRion,(-> (iterate #(/ % 13) 7) (nth 17)) ; is also a way to write it
17:18clojurebot7/8650415919381337933
17:18ToBeReplacedWhat 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:19gfredericksToBeReplaced: what the heck is that?
17:19hyPiRionToBeReplaced: what would (merge-on-values {:a 1} {:b 2}) do?
17:19arrdemgfredericks: looks like he's looking up on keys...
17:19ToBeReplaced{:a nil}
17:19arrdem*values
17:20hyPiRionwell
17:20gfredericksToBeReplaced: (fn merge-on-values [m1 m2] (into {} (for [[k1 k2] m1] [k1 (m2 k2)])))
17:21ToBeReplacedthat's my implementation right now, yeah... i use map fn but same deal
17:21hyPiRiongfredericks beat me to it
17:21ToBeReplaced(into {} (map (fn [[k v]] [k (m2 v)]) m1))
17:21hyPiRionwhat
17:21jtoyif I have run lein uberjar for my project, how can I load a repl from the jar?
17:21gfredericksjtoy: java -cp my.jar clojure.main
17:22gfredericksor something fancier with nrepl
17:22ToBeReplacedit feels like this kind of re-keying would come up a fair bit; if it hasn't, i'm probably doing things wrong
17:22ToBeReplacedre-valuing*
17:22gfredericksclojurebot: clojure is <reply> you're probably doing things wrong
17:22clojurebotIn Ordnung
17:23hyPiRion,(let [m1 {:foo 1, :bar 2, :baz 3}, m2 {:foo 4, :bar 5}] (->> (keys m1) (map (juxt identity m2)) (into {})))
17:23clojurebot{:foo 4, :bar 5, :baz nil}
17:23hyPiRion~juxt
17:23clojurebotjuxt is the bestest option though if it doesn't weird you out
17:23ToBeReplacedthat's clever
17:24ToBeReplacedi was wondering if this is really just an "update-all"... with m2 being the fn
17:24gfredericksjuxt is the godwin's law of #clojure
17:24hyPiRiongfredericks: hahah
17:24jtoygfredericks: cool, thx
17:26hyPiRionhm
17:27ToBeReplaced,(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:27clojurebot{:baz nil, :bar 5, :foo 4}
17:27ToBeReplacedthen m2 can be any func that udpates a val ... it's an "update-all" i think?
17:27tomjackhmm, you can't put a fresh inside a nafc goal, huh?
17:28hyPiRionooh ooh
17:28tomjackhow do you do simplification style stuff?
17:28tomjacki.e. apply any of these rules if possible, or, if not, then the identity
17:29tomjackor maybe you just always allow the identity and you have to figure out how to find the 'most simple' answers
17:29hyPiRion,(let [m1 {:foo 1, :bar 2, :baz 3}, m2 {:foo 4, :bar 5}] (merge (zipmap (keys m1) (repeat nil)) m2))
17:29clojurebot{:baz nil, :bar 5, :foo 4}
17:30tomjackwell I'm also thinking like normal forms, where allowing the identity would be wrong
17:30tomjackunless no more normalization is required..
17:30ToBeReplacedhyPiRion: m2 should be keyed on vals of m1
17:30tomjacksoft cut? :(
17:31hyPiRionoh, I've totally not understood what you were trying to accomplish
17:31hyPiRionhah, okay
17:33ToBeReplacedyeah; 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:39tomjackdnolen: could it make sense to make an enforceable nomc which just generates a fresh nom?
17:40tomjackI don't quite understand enforceable constraints - looks like fd is hardcoded?
17:40tomjackoh yes I see "we've hard coded finite domains here" now..
17:51gfredericksfor some reason I've never read the wikipedia article on COMEFROM until now
17:51gfredericksprobably it never occurred to me that it deserved an article
17:57dottedmagIs there online judge system which uses recent Clojure? I only found spoj.com, but they are using Clojure 1.1.0
17:59mthvedtgfredericks: it would be easier to find if COMEFROM hyperlinks existed
17:59dottedmagExcept Project Euler.
18:06hyPiRiondottedmag: I haven't found any so far. My best aim is to push mr. Mirzayanov to get it on Codeforces.
18:07dottedmagI have found one: https://www.4clojure.com
18:07hyPiRionoh right
18:07hyPiRionthat's awesome by the way
18:07dottedmagShould be ok for basic training.
18:43alandipertdnolen: ahoy
18:54RaynesDear peoples.
18:54RaynesRefheap, 4clojure, and lazybot are going down for nap time.
18:55tomjacknooooo
18:55RaynesThey will all be back up shortly, hopefully within an hour.
18:55RaynesBut we suck, so anything could happen.
18:56tomjackhaha
19:27Raynes_&(+ 3 3)
19:27lazybot⇒ 6
19:36devnlazybot: welcome home
19:36devnRaynes: you too
19:36Raynesdevn: pssst, and amalloy.
19:37devnassumed. amalloy is the glue that holds this family together.
19:37RaynesMigration went pretty smoothly.
19:37devnwhere'd you guys migrate to?
19:37devnlinode -> ec2?
19:37RaynesGod no.
19:37RaynesLinode wanted to upgrade our stuff so we moved to a new server.
19:38devnwhoa, no need to be offended lol
19:38devnoh yeah, i went through that
19:38devnmine wasn't so smooth
19:38RaynesWe now have 8 cores and 3GB of ram for the same price as we had before for half of that.
19:38devnfailed to boot
19:38devnhad to switch the kernel to something newer (and 64bit)
19:38RaynesWell, I'm in Alan's apartment so we were able to coordinate nicely and get it done quickly. :D
19:38devnhaha, nice.
19:39devnRaynes: what ever happened to clojure-casual?
19:39RaynesNobody cared about it.
19:39devnit was hoppin' for awhile
19:40RaynesI guess while you were on drugs or something.
19:40devn... wat?
19:40RaynesI can't recall it ever being hoppin
19:40devnmaybe im remembering a bit too fondly the early days
19:40RaynesI 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:40amalloyRaynes: you had clojure-casual long before i turned up
19:41RaynesYes, 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:41amalloydoes 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:46tomjackshould reduce on `new Array(1000)` do anything?
19:46tomjack(cljs)
19:47tomjackis it basically dotimes?
19:47tomjacker, no (nth (iterate f start) 1000) ish
19:48tomjackI'd rather have native forEach/some's behavior of skipping holes
19:48arrdemamalloy: if I remember my mongo expriences correclty fetches are lazy
19:48arrdemamalloy: because I had some terribly performing Python code which forced the entire request to be materialized :/
19:49RaynesFriendly 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:50tomjacksince there are no holes in java arrays it's unclear what cljs should do about them..
20:00alandipertRaynes, amalloy would reifn/deftypefn be welcome additions to useful?
20:00alandipertuseful rocks btw
20:21amalloyalandipert: i don't know what those are. shortcuts for reifying IFn?
20:23callenarrdem: sometimes it's the db abstraction layer fucking you on that.
20:23callenarrdem: but you shouldn't use Mongo anyway :P
20:26alandipertamalloy: correct
20:26Raynescallen: Did you decide when to come down yet?
20:30arrdemcallen: I forget, what is the common "use this instead" answer?
20:32gfredericksis it worth optimizing calling subvec on a subvec?
20:32arrdemgfredericks: probably not
20:33arrdemwell... no the compiler shouldn't pick that up :/ may be worthwhile
20:33amalloyalandipert: 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:35alandipertamalloy: np
20:49callengfredericks: I always end up rather unhappy whenever I am forced to do that.
20:58gfredericksarrdem: nevermind, it's already optimized; just not where I expected
22:24arrdemhas anyone looked at adding metadata to numeric types?
22:28tomjackoh man
22:29tomjackI had (+ x 1) instead of (+ x0 1), no warnings, just NaN
22:30Raynesarrdem: You can look at it but you still can't do it.
22:31arrdemRaynes: that's what I was afraid of...
22:31arrdemI reeeeealy don't want to end up with my own set of numeric objects just for this...
22:33arrdemoh well guess I'll just do an [expr meta] pair throughout my code :/
22:34tomjackoh I was getting warnings I just didn't realize my terminal was C-z'd
23:27holohi
23:37kanweianyone ever run into this problem?
23:37kanweiCompiling ClojureScript.
23:37kanweiException in thread "main" java.lang.RuntimeException: No such var: json/pprint, compiling:(cljs/source_map.clj:142:7)
23:41holokanwei, I never ran into such a thing, but i'm newbie enough about cljs. consider running `lein cljsbuild clean` just in case
23:50tomjackdata.json didn't used to be a dependency for clojurescript, maybe related