#clojure logs

2015-04-02

00:54irctc_Hi, I am new to clojure, wanna to implement 'interleave' but get stuck....anyone helps me: http://stackoverflow.com/questions/29404906/clojure-practice-interleave-outofmemoryerror
00:54irctc_?
01:02justin_smithirctc_: a small thing - (conj (conj a b) c) is the same as (conj a b c)
01:03justin_smithirctc_: on every recursion, your col1 and col2 are the same value
01:03justin_smithperhaps you meant to do first in a let inside the loop
01:03justin_smithor use destructuring
01:13justin_smithanswered on SO
01:28irctc_I am trying not to use reference &
04:12borkdudeordnungswidrig I want to serve up an s3 url with a redirect from my api at GET /picture, so anyone having an <img src="/picture"/> gets the picture from s3. is there a normal way to accomplish this with liberator or should I use ring-response
04:37borkdudejustin_smith do you know how to put an object with amazonica to set it public? I don't want to do this by default, but in some cases
04:41ordnungswidrigborkdude: I guess using plain ring-redirect would be easier. But liberator can do that, you need to return true from :moved-permanently? or :moved-temporarily? and set the :location in the context.
04:42ordnungswidrigborkdude: i.e. you can return {:location "http://whatever-s3-url/buck/pig.jpg&quot;} from those decisions
04:42borkdudeordnungswidrig ah I tried returning {:location ...} in :moved-temporarily? but that didn't work somehow
04:42borkdudeordnungswidrig with a get request
04:42borkdudeordnungswidrig anyway I used this now (fn [ctx]
04:42borkdude (ring-response
04:42borkdude (redirect (str (::s3-url ctx)))))
04:42borkdudein handle-ok
04:43ordnungswidrigI guess you would need to return false from :exists? and true from :existed?
04:44ordnungswidrigborkdude: that's not very intuitive, I must admit :-)
04:44borkdudeordnungswidrig in exists? I return {::s3-url ...}
04:44borkdudeif the file indeed exists
04:45ordnungswidrigborkdude: if you want to redirect on get, then exists must return false.
04:45borkdudeordnungswidrig you mean by spec or by liberator?
04:46borkdudeordnungswidrig it works now I must say
04:46ordnungswidrigborkdude: in liberator. Here's an example: https://gist.github.com/ordnungswidrig/d9013659e1f7a80ea584
04:46borkdudeordnungswidrig ah ok
04:47borkdudeordnungswidrig I'm not sure if that is correct to say if something moved permanently when you're just saying: yes, it exists, but the file is on s3?
04:48ordnungswidrigThe :exists? callback called from the view of the liberator resource. If the client should look somewhere else it makes sense to do that only if the resource does not exist.
04:50borkdudeordnungswidrig I look at it this way: the resource does exist, because the client uploaded a file (which I delegate to s3). When the user requests the resource, I return the s3 url. I only use the redirect to make it easier for the client. But maybe this is not the correct way to look at it then.
04:51ordnungswidrigborkdude: interesting case. that means the resource exists at your host, say, a DELETE request would go there, but you want to server GETs from a different location
04:51ordnungswidrigborkdude: right?
04:52borkdudeordnungswidrig right
04:53ordnungswidrigborkdude: https://tools.ietf.org/html/rfc7231#section-6.4.4
04:54borkdudeordnungswidrig it seems the only way to get to 303 is via post in liberator?
04:55ordnungswidrigborkdude: yes, only for posit right now. the spec it talks about 303 for GET requests. I think that's something that's missing in liberator, maybe ":other-location?" that comes before :multiple-representation?
04:56borkdudesounds good to me
05:00ordnungswidrigborkdude: dare to file an issue?
05:00borkdudeordnungswidrig yes, I'll do
05:05borkdudeordnungswidrig https://github.com/clojure-liberator/liberator/issues/205
05:06ordnungswidrigborkdude: hurray!
05:06mrchancehi! I have a dependency problem that is driving me crazy. I want to use lein gorilla, but still use the latest cider nrepl. For some reason though, it always pulls tools.nrepl 0.2.6 and cider-nrepl 0.8.1 even though I excluded them where possible
05:06mrchanceAny ideas?
05:09mrchancealso, lein deps :tree lists nrepl 0.2.6 as a top level dependency for whatever reason, it's definitely not in my project.clj
05:13ordnungswidrigmrchance: is it in your ~/.lein/profiles.clj?
05:15mrchanceordnungswidrig: no, profiles only has a single plugin in it, the cider-nrepl 0.9.0 snapshot
05:17mrchanceaha, this might be related: https://github.com/technomancy/leiningen/issues/1569
05:40TEttingercfleming: I'm taking the leap. I'm installing Cursive for the first time. I'll let you know my first impressions when it gets up and running
05:41cflemingTEttinger: I'm trying to figure out whether Cursive is the red pill or the blue pill
05:42mrchanceok, for anyone interested... :dependencies ^:replace {foo...} fixed it for me
05:42TEttingerI do take a lot of pills
05:42cflemingTEttinger: But either way, great, very interested to know how you find it!
05:44cflemingTEttinger: Are you used to vim or Emacs? Or something else?
05:44TEttingerlight table and nightcode
05:44TEttingerand a lot of jEdit
05:45cflemingAh ok - hopefully won't be too much of a shock then
05:45TEttingerthe last straw with nightcode was looking in the task manager and seeing that using the IDE to stop processes wasn't actually ending the process
05:45TEttingerso I had something like 13 clojure apps open in various broken states
05:45cflemingWhat's your opinion on the light table inline eval?
05:46TEttingerit never worked for me
05:46TEttingerI was doing stuff that needed weird thread things
05:46cflemingOk
05:46cflemingJust curious
05:46TEttingereither stuff needed the opengl render context stuff that I don't claim to understand, or had to be on the swing render thread
05:46TEttingerand that apparently didn't work with inline eval
05:47cflemingNo, it wouldn't, since the evaluation is asychronous
05:47cflemingYou'd get back the results of putting something into an executor or whatever - probably nil
05:52eglimrchance: what exactly did you add to your project.clj?
05:55mrchanceegli: just a ^:replace metadata tag to my dependencies
05:57mrchanceegli: according to the issues, this might work too {:profiles {:base {:dependencies ^:replace []}}}
05:58mrchanceI am curious how other people deal with this... If you use the latest standard elpa package, you are bound to have this problem with older cider versions all the time
05:59mrchanceI couldn't ignore it either because it broke things like cider completion...
06:00mrchanceand this problem doesn't seem limited to projects involving gorilla-repl
06:03oluapIs clojure a good first programming language? I only know html/css and did some basic tutorials about python, ruby and javascript .
06:04dstocktonoluap: probably, it has simple syntax
06:04dstocktonmight ruin other languages for you
06:04mrchanceoluap: I'd say yes, easy to set up and try, and simple syntax
06:04mrchancealso what dstockton said ^^
06:05mrchancecertainly made programming python a lot less fun for me :)
06:10oluapI was searching the interwebs for some beginner stuff on clojure but I had no luck do far. It seems that every tutorial/books are geared to programmers and not for beginners
06:11mrchanceoluap: true, that is a bit rare. You can try the basics here: http://www.tryclj.com/
06:13mrchanceThere are also some good books, "Clojure programming" or "Clojure in Action" that should be suitable to beginners
06:13dstocktonoluap: you made it to #clojure, i don't believe you're such a beginner
06:14mavbozomrchance, no problem with me doing lein new gorilla-test and adding :plugins [[lein-gorilla "0.3.4" :exclusions [[cider/cider-nrepl]]] ] in my project repl
06:15mavbozomrchance, lein deps :tree list [cider/cider-nrepl "0.8.2"] (my current cider-nrepl plugin) at the top level
06:15mavbozos/project repl/project.clj/
06:16mavbozomrchance, also it list [org.clojure/tools.nrepl "0.2.7"] which is what I currently use
06:17mrchancemavbozo: hm, for me emacs still says "WARNING: CIDER requires nREPL 0.2.7 to work properly"
06:18mrchancemavbozo: my last line of deps :tree output says: [org.clojure/tools.nrepl "0.2.6" ... ]
06:19mavbozomrchance, no warning from when connecting from emacs's cider
06:20mrchancemavbozo: weird, what could it be? my leiningen is 2.5.1
06:20mavbozomrchance: ah, maybe because I had :dependencies [[org.clojure/tools.nrepl "0.2.7"]] in my :user key in ~/.lein/profiles.clj
06:20mrchancemavbozo: possible :)
06:20mavbozos/had/have/
06:21oluapdstockton: What do you mean by that?
06:21mrchancebut I would be happy if that was sufficient
06:21mrchancelemme try
06:23mrchancemavbozo: ok, that combination works too. Nice! Maybe I messed up somewhere else earlier
06:24mrchancemavbozo: although I do find it a bit silly that you need to put in an explicit nrepl dependency when cider requires it to work correctly
06:25mavbozooluap, these days, it's rare seeing a beginner programmer who knows IRC
06:26mrchancerequires a later version, I mean
06:27oluapmavbozo: I am no computer illiterate and i am not that young :)
06:33elvis4526How can I see what a macro will generate ?
06:33elvis4526i'll try (macroexpand-1)
06:34ordnungswidrigelvis4526: ,(macroexpand-1 '(defn foo []))
06:34ordnungswidrig,(macroexpand-1 '(defn foo []))
06:34clojurebot(def foo (clojure.core/fn ([])))
06:37elvis4526Okay. Then I don't get why this http://pastie.org/10069423 only return map.
06:38elvis4526where is the rest of the body ?
06:38ordnungswidrigelvis4526: what do you want to achieve?
06:38elvis4526I'm trying to understand macros
06:38elvis4526I had a map that had function as value
06:39elvis4526and I wanted to "inject" something redundant to each function as the first arg.
07:44eglimrchance: I used to have my work environment change from under me when doing cider upgradesI just stick to stable cider
07:44eglinow I just stick to stable cider
07:45eglii.e. set package-archives to melpa-stable
07:45eglimrchance: and thanks for the ^:replace stuff. I'll try it out
07:55gfrederickselvis4526: you passed the symbol map to postwalk
07:55gfredericksbecause of the quote on line 9
07:56gfredericks,(clojure.walk/postwalk #(if (list? %) "" %) 'map)
07:57clojurebot#error{:cause "clojure.walk", :via [{:type java.lang.ClassNotFoundException, :message "clojure.walk", :at [java.net.URLClassLoader$1 run "URLClassLoader.java" 366]}], :trace [[java.net.URLClassLoader$1 run "URLClassLoader.java" 366] [java.net.URLClassLoader$1 run "URLClassLoader.java" 355] [java.security.AccessController doPrivileged "AccessController.java" -2] [java.net.URLClassLoader findClass "...
07:57gfredericks,(require 'clojure.walk)
07:57clojurebotnil
07:57gfredericks,(clojure.walk/postwalk #(if (list? %) "" %) 'map)
07:57clojurebotmap
08:27borkdudeI am adding type hints to this call: (PutObjectRequest. ^String bucket key ^String file)
08:27borkdudebut I'm still getting "call to constructor cannot be resolved"
08:28borkdudeargh, File
08:28borkdudehmm, still not working when changed to file
08:29borkdudewhoops
08:29borkdudeI forgot one I see. fixed
09:09timvisherlein is consistently attempting to retrieve `-SNAPSHOT` deps from all repos (including `releases`) and non `-SNAPSHOT` deps from all repos (including `snapshots`).
09:09timvisherspecifically for our private repo
09:10timvisheri thought that the only special thing that needed to be done to not get that behavior was to name the repos as `snapshots` and `releases`.
09:10timvisheris that not the case?
09:10timvisherspecifically, i want to avoid trying to retrieve released deps from `snapshots` and snapshot deps from `releases` (because obviously they're not there)
09:11noncompeople who have used Neo4j with clojure, tell me please, what should i use, neocons or borneo for the db driver lib?
09:17timvisher!rng neocons|borneo
09:17timvisherheh. this isn't #nethack...
09:17timvisher,(doc rand-nth)
09:17clojurebot"([coll]); Return a random element of the (sequential) collection. Will have the same performance characteristics as nth for the given collection."
09:17timvisher,(rand-nth ["neocons" "borneo"])
09:17clojurebot"borneo"
09:18timvisherborneo it is :)
09:23timvisherbah
09:23timvisheri do not understand classpaths
09:23timvisherthis much is clear
09:24timvisherwhere can i go to read about this?
09:25mrchancetimvisher: what exactly is the problem? Naming the repos doesn't make a difference, as far as I know it's decided by the artifact version string
09:26John-kkk3b FREE STEAM GAMES http://tinyurl.com/ptv3gfv
09:27mrchancetimvisher: look at https://github.com/technomancy/leiningen/blob/master/sample.project.clj , specifically the repositories section, it has some keys like :snapshots false, don't know if that helps
09:27TEttingerdoesn't sound like spam at all!
09:27mrchanceTEttinger: I know, right? Let's totally click that!
09:27kaiyinhttps://gist.github.com/kindlychung/d8fe3270366dbda4703c why do i keep getting this error?
09:28timvisherhttps://github.com/technomancy/leiningen/blob/master/sample.project.clj#L94-L95
09:29timvishermrchance: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L94-L95
09:29timvishersetting those keys manually as well doesn't seem to change anything
09:30timvisherbut that's where i'm getting my info from
09:33noncomkaiyin: coz your filter predicate on line 85 accepts 0 args
09:33noncomkaiyin: but filter tries to pass 1 arg to it
09:34kaiyinoh. i see.
09:35noncomalso, you can name the fns like (fn my-pred-fn [_] (your-predicate-goes-here)) so that the stack trace will show the actual fn name that caused the error
09:35kaiyinnoncom: cool, thanks
09:38mrchancetimvisher: hm, ok, in that case I don't know ^^
09:40noncomtimvisher: uh, and i went with neocons as of now.. based on same random choice :)
09:40noncomkaiyin: hey, what's the wumpus game btw?
09:41justin_smithborkdude: I haven't used amizonica, but there should be some operation that sets the access perms for a file, in clj-aws-s3 the function is called "grant"
09:41noncomwill it be playable anytime?
09:42borkdudejustin_smith I figured it out via native Java for now
09:42justin_smithOK
09:42borkdudejustin_smith is it true that you have to set the content-type manually when uploading files to s3?
09:42kaiyinnoncom: it's a dummy game from the land of lisp book. :)
09:43justin_smithborkdude: I always have
09:43borkdudeok
09:44noncomkaiyin: eh, i was hoping to see one more clojure game! :D google images show loads of appetizing images on "wumpus" query.. :) awakens something nethacky inside, from looking at the pics..
09:45justin_smithnoncom: hunt the wumpus is an old school unix classic text UI game
09:47noncomoh.. i totally missed all that stuff..
10:51jasppCan you break down this simple problem? (def v [[:col1 :up] [:col2 :dn] [:col3]]) convert to "col1 up, col2 dn, col3" Going in circles with nested map calls, reduce, join.
10:52jasppWhat's the functional thought process when looking at this..?
10:54mgaarejaspp: try to think about the end result and define it in terms of the input, first
10:54hyPiRionjaspp: Try to find an implementation where as many parts are independent of each other – for instance, converting [:col1 :up] to "col1 up" is independent of the other two pieces
10:54hyPiRionAnd converting :col1 to "col1" is independent of converting :up to "up"
10:55hyPiRionalso, a good tip
10:55hyPiRion,(require '[clojure.string :as s])
10:55clojurebotnil
10:55hyPiRion,(s/join ", " ["foo" "bar" "baz"])
10:55clojurebot"foo, bar, baz"
10:56timvisherhyPiRion: can you describe how i would go about removing side-effecty tests from my classpath in lein?
10:56timvisherif you've got a moment?
10:56timvishermy problem is that when they're loaded they do some registry stuff that they probably shouldn't but they do it anyway, and i thought i could solve it by using `:test-paths`
10:57timvisherbut when i do that, the whole classpath seems to go bananas and the tests can't find anything
10:57hyPiRiontimvisher: that sounds like a bug
10:57jasppmgaare: not quite sure what you mean.
10:58hyPiRiontimvisher: so if you have {:profiles {:foo {:test-paths ["another-test-path"]}}} and you do `lein with-profile +foo test` it just borks up?
10:59mgaarejaspp: for me, anyway, it helps with breaking something down into its steps. in this case something like, "take a vector of vector of keywords, and return a string where each subvector's contents are converted into space-separated strings, and subvectors are separated by a comma and space"
10:59timvisherhyPiRion: ok. i'm understanding things correctly though right? each entry in `:test-paths ["some/deep/structure"]` and source is in `src`. so now i have `src/ns/foo/bar.clj` and `some/deep/sructure/ns/foo/bar_test.clj` and in `bar_test.clj` i `(:require [ns.foo.bar]` it should resolve just fine
11:00timvisheri.e. path-roots assoc their contents at the classpath root? (← is my mental model of classpaths...)
11:00mgaarejaspp: it starts to naturally bring out the breakdown of operations involved, describing it like that
11:01hyPiRiontimvisher: yes
11:01LicenserGood afternoon folks! I was wondering if someone can give me a pointer I'm working on a CLJS/Om app and part of it is filtering a table. This filter is for some reason horribly slow. (as in >1s) even on tables with 20 elements. Which is unbelievable slow and I'm totally out of ideas where to look.
11:01timvisherhyPiRion: _excellent_. i will see if i can produce a minimal example project then that exhibits this behavior.
11:01timvisherand submit it as an issue if i can :)
11:01mgaareLicenser: perhaps a gist?
11:02jasppmgaare: thanks.
11:02hyPiRiontimvisher: thanks!
11:02Licensermgaare good point :) I can actually do one better it's all OSS so https://github.com/project-fifo/jingles2/blob/c4db40629a22fbea97eb10ce7c5267c4ee46ebc0/src/cljs/jingles/list.cljs#L261 is the actual code doing it
11:02jaspphyPiRion: thanks
11:03Licenserthe sort-and-paginate (which handles sorting, filtering and pagiation) seems to take ~10ms
11:03hyPiRionnp
11:04sobelLicenser: for what data size?
11:06Licenserthe list is 15 elements bytes long but the underlying data are ~20kb of json
11:07Licenserbut the whole 20kb ar't rndered
11:07GlenjaminLicenser: it's tricky to tell, as i'm more used to react than om
11:08Glenjaminbut i think you need a key prop on the list of elements
11:08Glenjaminso react knows to re-order, instead of rebuild
11:08LicenserGlenjamin that's an itneresting pointer let me try that
11:08sobel20k is how many elements?
11:08Licenser15
11:08Glenjamini don't know how you do that in om, but that's likely to be the problem, if the sort is fast but the redraw is slow
11:10Licenserthere seems to be a :react-key call
11:10Licensers/call/keyword/
11:14Glenjaminsounds like the one
11:14Licenserthanks mate I'll investigate that!
11:15jasppmgaare: hyPiRion: (s/join ", " (map #(->> % (map name) (s/join " ")) [[:a :b] [:c :d] [:e]]))
11:15jasppmgaare: hyPiRion: => "a b, c d, e"
11:16justin_smithjaspp: I think I would replace your nested map with a mapcat before doing the string/join
11:17justin_smitherr, (mapcat #(map name ...) ...)
11:19jasppjustin_smith: thanks for the tip, will try that.
11:34noncomdid anyone use neocons for neo4j? i have a simple question on querying relations
12:07geirbyhello
12:07mavbozohello
12:08justin_smith~hello
12:08clojurebotBUENOS DING DONG DIDDLY DIOS, fRaUline justin_smith
12:09justin_smithhttp://thebarking.com/wp-content/uploads/2014/09/lionel-poster.jpg
12:10geirbyis there a way to fix a staircased code? I ended up having "(reduce ...(assoc ..(reduce ... (assoc (reduce ..." when transforming a map
12:10justin_smithgeirby: -> / ->> help a lot
12:10justin_smithas do let blocks
12:10justin_smithlet in clojure is like let* in other lisps, you can refer back to prior definitions
12:11geirbycheers, I'll give it a try
12:12sobelso, recommendations on logging approaches/tools?
12:12justin_smithsobel: timbre is good
12:13sobelwhat's idiomatic for logging? when i wrote OO i just littered my member fcns with log stmts
12:13sobelis there some clever trick that's clojury i might not think of as a noob?
12:14justin_smithwhy would it requier a trick? logging is by definition imperative
12:15justin_smithI mean there are things like doto that act on a thing and then return the thing, I guess
12:15justin_smith,(doto 42 println)
12:15clojurebot42\n42
12:16sobelhafta ask
12:16gfrederickssobel: I sometimes use aspect-oriented tactics to logging
12:16gfrederickslike you can do a lot via alter-var-root
12:16gfredericksor the robert.hooke lib
12:17sobelgfredericks: i understand AOP more-or-less mechanically and did some with artifacts like Spring and annotations in Java but I don't know what it looks like in Clojure
12:17justin_smith(doc alter-var-root)
12:17clojurebot"([v f & args]); Atomically alters the root binding of var v by applying f to its current value plus any args"
12:18justin_smithsobel: so you repleace foo with a function that logs, then calls foo with the args, then logs again. maybe
12:18sobelah ok
12:18gfrederickssobel: I think it's probably worth jumping straight to robert.hooke though
12:18sobeli'm starting to agree with that
12:18gfredericksalter-var-root has too many pitfalls to bother with
12:18gfredericksmainly figuring out how to not accidentally wrap your function twice
12:19sobeli don't need more language risk at this point
12:19sobel:)
12:19justin_smithgfredericks: does it provide a way to undo the wrapping? that's another gotcha with alter-var-root
12:19gfredericksjustin_smith: totes
12:19gfrederickspermanently or temporarily
12:20justin_smithgfredericks: here's a fun one, I was playing around and decided to use alter-var-root to wrap some, turns out that apply calls some and I had apply inside the wrapping code
12:21justin_smithI mean naturally you would use apply if you are using alter-var-root
12:21gfredericksso natural
12:22sobelalrighty, i remember reading about robert.hooke and thinking it was a lot more than i needed but it's very attractive now
12:23gfredericksI wish there was a good structured logging library that also had a set of helpers hooks or something for that kind of use
12:23justin_smithsobel: it's actually a pretty small lib, LOC wise
12:23gfredericksI've thought about it some though and am not sure what a good API for that would be
12:23justin_smithgfredericks: doesn't timbre have some of that?
12:24arohnerI'm having trouble getting cider and clojure-mode (re) installed. When I (require 'cider), I get "no such file or directory" "dash". According to package-list-packages, dash is installed
12:24justin_smithgfredericks: no, there's something else I was thinking of...
12:24gfredericksjustin_smith: is timbre even structured?
12:25justin_smithI don't think so
12:25gfredericksthen I don't even
12:25justin_smithgfredericks: so you're thinking of maybe timbre + structured + tools.trace ?
12:25gfrederickswell you'd want a lot of options around how you attach logging to a function
12:26gfredericksin terms of before/after, how you decide which args+return to log, what about exceptions
12:26sobelthe naming puns in clojure-land are pretty much consant amusement for me.
12:27wes_Hello
12:27justin_smith~hello wes_
12:27clojurebotIt's greek to me.
12:29wes__So, when I do lein run, my -main function fails to find my other functions (in the same file). Why is this?
12:29gfredericksjustin_smith: and I feel like any decent such lib would have to like copypaste its serializer too, whether json or edn
12:29gfrederickswes__: what's the error message?
12:29justin_smithwes__: something else is wrong
12:30wes__Attempting to call unbound fn: #'myapp.core/make-new-frame
12:30justin_smithwes__: how and where do you define make-new-frame?
12:31wes__just below (defn -main ...)
12:31justin_smithwes__: that doesn't work
12:31wes__oh, it compiles from the top down?
12:31justin_smithyes
12:32justin_smithwes__: so that the repl and files will work the same way
12:32justin_smithit actually simplifies things in that way
12:35sobeljustin_smith: do you know/see any reason why i couldn't use timbre and robert.hooke together?
12:35wes__ok. What do you do if you have two mutually recursive functions? They call each other. Won't you get errors?
12:36justin_smithwes__: for mutual recursion we have letfn or declare
12:36justin_smithsobel: seems like you could combine them, sure
12:36sobelimperative logging, integrated as aspects
12:36justin_smithsobel: and throw in cheshire to make the nifty thing gfredericks wants maybe :)
12:37sobelgreat. thanks for support, too. it's been a luxury to have basic guidance while i code in a new-to-me language. i haven't wasted an hour on newb stuff yet, other than basic learning of the language.
12:37justin_smithgfredericks: actually, yeah, I bet we could combine timbre, cheshire, and robert.hooke to make a really easy aspect oriented structured logger
12:37justin_smithit would be straightforward I think
12:38justin_smithsobel: glad we could help
12:38sobelah, i have no need for JSON output right now. this needs to be human readable.
12:38wes__Thanks for the help, Justin
12:38justin_smiththen surely you'll want XML then
12:38justin_smithwes__: np
12:38sobelnow that's just inhumane
12:38justin_smithyou're the one who brought up "human readable"
12:38justin_smithhaha
12:39sobel=)
12:40gfrederickslog in json, get human readability w/ jq
12:40justin_smithgfredericks: fuck it, I'm gonna try making that logging lib.
12:40gfredericksjustin_smith: yeah, fuck it.
12:41gfredericksjustin_smith: make sure to paste in the cheshire code so you can provide default seralizations
12:41justin_smithhuh?
12:41justin_smithwhy would that require pasting?
12:42gfredericksso you don't stomp on the user's ability to use cheshire for something else
12:42justin_smithis this some terrible thing about cheshire I am about to learn?
12:42justin_smithahh
12:42gfredericksnothing you didn't already know
12:42gfredericksjust that its extension points are global modifications yay
12:42gfrederickssame as clj's printer
12:42justin_smithgfredericks: I wonder if I can use locally derived heirarchies for this
12:42justin_smithsince they are multimethods, right?
12:42gfredericksuhms
12:42justin_smithand you can make local heirarchies
12:43gfredericksI mean regardless you have to paste
12:43gfrederickseven ifcheshire does work that way which I doubt
12:43gfredericksbecause the hierarchy is fixed with the multimethod
12:44justin_smithI'd have to make derived multimethods...
12:44gfredericksif you wanna go down the rabbit hole, write a json lib that lets you pass in opts for how to convert various objects
12:44justin_smithhrphm
12:44justin_smithyeah
12:44justin_smithgood point, thanks
12:44gfrederickswhile you're at it do an edn lib
12:44gfredericksor go down another rabbit whole and try to write one lib that does both
12:44gfrederickshole*
12:45justin_smithgfredericks: I just had coffee, not crack
12:45justin_smiththanks for the ideas though :)
12:45justin_smithhaha
12:45gfredericksaaand this is why I haven't written a logging lib yet :P
12:45justin_smithgets ugly doesn't it
12:45justin_smithyeah
12:45sobellogging is on my short list for, "you'll shoot your eye out, kid"
12:45sobelit is...more than meets the eye
12:45gfredericksbut pasting cheshire is a quicker way to getting the logging lib
12:46justin_smithgfredericks: what about clojure.data.json?
12:46gfredericks...or paste that
12:46gfredericksc.d.j extends the same way
12:46gfredericksit is The Clojure Way
12:47gfredericksyou make a global thing and tell people to punch it
12:47justin_smithgfredericks: what about a tree walk between the input data and the logging, that replaces types with types proprietary to one's own lib, and letting users add to that mapping?
12:47gfredericksyeah if you want to walk every dang thing that gets logged, that is a feasible approach
12:48justin_smithyou could provide walked and unwalked, with the proper caveats
12:48justin_smithI mean, creating json out of clojure data is already a tree walk
12:49justin_smithgfredericks: now I am thinking this thing needs to be named after a cross of paul bunyon and a monkey
12:50sobeli thought all clojure libraries started with theme and inspiration as foundation
12:50sobelit's a lot harder to snark about clojure tools. this is harder than i thought.
12:51justin_smithheh
12:51sobelpython+friends were fish in a barrel, i tell ya
12:51justin_smithis obscure-reference already taken?
12:51justin_smith(may as well go meta)
12:51sobelhehe
12:53justin_smithlein new abstruse
12:53justin_smith$dict abstruce
12:53lazybotjustin_smith: Word not found.
12:53sobelso i've been thinking about a monsterous app that would basically be built around a DAO that can grab SQL as well as Clojure from a database, and build the app infrastructure around that, using that
12:53justin_smith:P
12:53justin_smith$dict abstruse
12:53lazybotjustin_smith: adjective: Difficult to understand; recondite. See Synonyms at ambiguous.
12:53sobeloh, i like recondite
12:53sobelthat should be a library
12:54justin_smith$dict recondite
12:54lazybotjustin_smith: adjective: Not easily understood; abstruse. See Synonyms at ambiguous.
12:54justin_smithhaha, they point to each other
12:54justin_smith(inc sobel)
12:54lazybot⇒ 1
12:54justin_smithrecondite is a good name for it
12:54sobelthere is already a C++ library called Recondite
12:55justin_smithsobel: technomancy worked on serializable functions if that's what you mean about clojure from a database
12:55justin_smithhttps://github.com/technomancy/serializable-fn
12:57Frozenlockhttps://github.com/Frozenlock/force-serialize
12:57Frozenlock:-p
12:57sobeljustin_smith: that is really nice. i figured, even without that, it would be viable to eval from db resultsets
12:57justin_smithFrozenlock: wow, the readmes are like the same...
12:57sobelhehe
12:58justin_smithahh, now that I look closer, I get it
12:58Frozenlock"An almost exact copy of serializable-fn."
13:00wes__I've gotten my application to compile with uberjar, but when I move it to another computer it fails to find the main class
13:00justin_smithwes__: when you uberjar, two jars get made
13:00justin_smithonly one of them is the actual uberjar
13:01sobelimho: it should not build the dep-free jar unless you explicitly flag it
13:02justin_smithsobel: it builds the dep free one as an intermediate step. The choice is whether to delete it or not.
13:02sobelah ok
13:02wes__I've tried the one in uberjar and uberjar+uberjar, but neighter work
13:02wes__neither
13:03justin_smithdid you turn on :gen-class or :aot for your main ns? because if not you need to do java -cp your-uber.jar clojure.main -m your.ns
13:04justin_smithif you turned on gen-class or aot it should be set up to just run with java -jar your-uber.jar
13:04sobelmy project was generated with :gen-class
13:05sobelwhat is the meaning of (:gen-class) ? is it calling a key?
13:05justin_smithsobel: ns turns things like (:require ...) and (:gen-class) into function calls
13:05sobelah right, because those are lists until the called context evals them
13:06sobelmental compile still in static mode
13:06sobelcompiler
13:15LicenserSo quick feedback to my problem, here is what happens. I had a filter that updated the state and then dew the table however the 'new' state was not put into the function but the old one (pre entering the filter) so it took a render loop (I guess?) that could be triggered seconds later to actually cause the update to appear in the browser
13:22timvisheris it possible to combine test.check with midje?
13:22timvisheri.e. can test.check generate facts?
13:23reiddrapertimvisher: think there are some examples here http://zotskolf.nl/2014/11/10/testcheckbasics.html
13:24timvisherreiddraper: neat! i wonder if i ever would have thought to assert against the results of quick-check :)
13:24timvisher(inc reiddraper)
13:24lazybot⇒ 6
13:25gfredericksclojurebot: reiddraper is underrated
13:25clojurebotOk.
13:25mavbozo(inc reiddraper)
13:25lazybot⇒ 7
13:59wes__So, turns out: If you build an uberjar with JRD8, it MAY not run on a system with JRE6
14:00justin_smithwes__: using java code, or pure clojure?
14:00wes__pure clojure
14:00wes__well... maybe not
14:00justin_smiththat's a bug then
14:00justin_smithmaybe not pure clojure?
14:00gfrederickswe've had a guy doing an 8->7 build and it only broke when we added java code
14:00wes__I used PDFBoxing which is a wrapper of PDFBox and Seesaw
14:01justin_smithSeesaw is just using built in classes
14:01justin_smithis PDFBox jre6 compatible?
14:01wes__yep, it works when I compiled with jre6
14:01justin_smithOK, you found a bug in clojure then
14:03wes__So, by pure clojure you mean not using PDFBox right?
14:03justin_smithno
14:03justin_smithI mean not using any java source
14:03justin_smithonly java that's been compiled in a way that is 1.6 compatible
14:03wes__Ok, thanks again
14:04justin_smithwes__: there are javac options to make sure java 8 outputs something 1.6 compatible, but if your project isn't compiling any java code, than any incompatibility in your uberjar is a clojure bug
14:04timvisherreiddraper: man. thank you for test.check and for how you return a map instead of printing something when it succeeds. _good job_ :)
14:05wes__oh, ok. I understand now
14:05timvisher(inc data)
14:05lazybot⇒ 1
14:05wes__I'll submit a ticket
14:05timvisher(inc-lots data)
14:06Bronsawes__: what's the issue?
14:07wes__I had JDK8 set in my PATH, and compiled an uberjar. It ran fine on my computer but would not run on other computers here at work. I checked all the :gen-class etc, but nothing would work. Until I changed my PATH variable for java to point to JRE6. Then the uberjar ran on the other computers (we use JRE6 at work)
14:10Bronsawes__: yes I got that, but what do you mean by "it would not work"? :)
14:10Bronsawhat error did you get?
14:11wes__My main class could not be found.
14:11wes__Could not find or load main class: pdf-merger.core
14:11Bronsahave you tried "pdf_merger.core" instead?
14:12justin_smithwes__: what happens if you try my previous suggestion of "java -cp your-uber.jar clojure.main -m pdf-merger.core"
14:12wes__I'm sorry, that's what it said. "Could not find or load main class: pdf_merger.core"
14:14wes__<justinc_smith> "Exception in thread "main" java.lang.NoSuchMethodError: java.awt.Component.revalidate()U"
14:15wes__Something to do with Seesaw?
14:15justin_smithwes__: is the 1.6 jre a headless jre?
14:15justin_smithno, because you made it work, never mind
14:16wes__I'm sorry, I'm kinda new. What do you mean by headless jre?
14:16justin_smitha jre that ships without any of the desktop related stuff (meant for servers), a common default on linux systems
14:17wes__I would say no. This is jre6 is installed on all our desktops and laptops
14:17justin_smithprobably the mac default jre yeah?
14:18wes__Besides, it worked once I compiled with JRE6 vs JDK1.8.0_25
14:18wes__No, Windoze
14:19justin_smithright, OK
14:20wes__So, it's a clojure bug? or an inconsistancy between JDK1.8 and JRE6
14:20justin_smithwes__: the jre isn't outputting the bytecode, clojure is
14:20justin_smithclojure is explicitly compatible with jre6
14:21justin_smithso it's a clojure bug if it outputs things that are not compatible
14:21wes__So, you are saying that it shouldn't matter if I was using JRE6 or JDK1.8
14:21justin_smithright, because clojure isn't using the java compiler, it has its own embedded bytecode emitter
14:21wes__got it. Thanks
14:22justin_smithand if that is doing different things with different jres, that's a problem
14:22Bronsajustin_smith: wes__ unless some of the deps are explicitely checking for jre version at compile time and using a method not available in 1.6 when available
14:22justin_smithBronsa: ahh, a poorly behaved lib might do that huh
14:23Bronsajustin_smith: wes__ this is probably what's going on actually
14:23Bronsajava.awt.Component.revalidate was added in 1.7
14:23justin_smithBronsa: so would this happen in seesaw, or in one of its java deps?
14:24justin_smithopen question, I don't really expect you to know off the top of your head :)
14:24Bronsahttps://github.com/daveray/seesaw/blob/31f7e8f6af46c1c9856d3f9d8bb427a0868fbc07/src/seesaw/layout.clj#L29-L34
14:24Bronsathis should not work with 1.6 at all
14:25justin_smithmaybe the type hint ends up working differently in 1.6? weird
14:25Bronsaok I think I know what's happening
14:25cesparewhat is the actual definition of what a test ns is in clojure? Is it anything under test/ ? We're switching some tests from midje to clojure.test and it's running helper namespaces as tests that wasn't happening with midje
14:25Bronsawhen compiling to 1.6 the method cannot be resolved
14:25Bronsaand the call ends up using reflection
14:25wes__I didn't use layout. Just seesaw.chooser, seesaw.dnd and seesaw.core
14:25Bronsait would fail at runtime
14:25justin_smithcespare: in clojure.test a test is a var with the :test metadata set
14:26justin_smithcespare: "test ns" is a convention that clojure.test is agnostic to
14:26cesparejustin_smith: ok maybe this is a question about lein test then
14:26justin_smithBronsa: that would do it
14:26Bronsawhen compiling under 1.8 that method is resolved and the call compiles to an invokevirtual, when the class is loaded under 1.6 that fails
14:27justin_smithcespare: what does "running a helper namespace" mean - you have namespaces with top level side effects that are loaded in order to invoke those side effects?
14:27cespareit's running a helper ns and finding no tests, but this is causing problems; it seems like midje was excluding them (maybe because they weren't _test.clj files, or else because they weren't *-test namespaces?)
14:27Bronsawes__: doesn't matter, maybe one of those ns requires seesaw.layout
14:27cesparejustin_smith: yeah there's some kind of problem with records being redefined
14:27justin_smithcespare: I still don't know what "running and ns" means
14:28justin_smith*running an ns, sorry
14:28Bronsawes__: the bottom line is that seesaw requires jdk 1.7 to run
14:28cesparejustin_smith: as in, i run lein test, it prints out the namespaces that it's testing; this includes a helper ns that contains no tests
14:28cespareonly test helper functions
14:29justin_smithcespare: something in that ns created a var with the :test metadata
14:29cesparejustin_smith: nope.
14:30justin_smithcespare: that's the only way that clojure.test would run tests for that ns
14:30cesparejustin_smith: at least, it does not have "deftest" nor ":test" in it.
14:30Bronsadoesn't lein test run all namespaces under :test-paths?
14:30cesparejustin_smith: it's not about running tests; there are none; it's about evaluating that file twice
14:31justin_smithahh, so a defrecord is being redefined?
14:31cespareyes
14:31cesparethe error is "foo.bar cannot be cast to foo.bar"
14:31justin_smithright, redefined record
14:32justin_smithlein should be using require, is something in one of your namespaces using load?
14:33cesparejustin_smith: no, but it does :import a class definition of the record in question
14:34justin_smithcespare: is the class required in the same ns?
14:34justin_smithsorry, the ns that creates that class
14:34cespareyes
14:34justin_smiththat shouldn't be an issue at all then
14:38cesparewell, the fix for now seems to be moving all of our test helper stuff out of test/ into src/
14:38justin_smithinteresting
14:39justin_smithI would create a separate path before putting it in src/ myself, but that's just style
14:39justin_smithcespare: oh, now I get it
14:39justin_smithcespare: here's the deal: lein will load all .clj files under test/ in order to make sure all :test vars are defined
14:40justin_smithcespare: somehow I guess the namespace didn't get properly registered, so that require reloaded the file (this is the weird part)?
14:40justin_smithI know that lein will run tests where the namespace defined in the ns form does not match the file path, without complaint
14:40justin_smith(I know this from a history of being dum)
15:06cesparejustin_smith: a trivial project with a helper namespace in test/ and a single test that requires that ns double-evals the test ns
15:07justin_smithcespare: that seems like it would be fixable...
15:10gfredericksjustin_smith: what's all this "without transposition" nonsense
15:10justin_smithgfredericks: a just intoned scale is made of pitches that have base frequencies that are all in the same harmonic series
15:10justin_smithbut they are transposed to all be in one octave
15:11justin_smithbut the notes in taps are just all in one series
15:11justin_smithunless I am mistaken...
15:11gfredericksokay so you're not talking about the order of the notes at least
15:11gfredericksjust the notes as a set
15:11justin_smithright, just presence or absence in the set of notes
15:11justin_smithright
15:11gfredericksokay yeah that makes sense
15:11justin_smithtaps is made to be playable on a valveless brass instrument
15:12gfredericksexactly I was just typing that out
15:12justin_smithwhich means it has to only have fundamentals that are in a single harmonic series (that of the tube played)
15:13justin_smithfascinating stuff. My biggest sadness about all this is that people mistake the fact that we understand linear vibrations (strings, tubes) so well for the idea that their behavior is "normal"
15:13justin_smithmost sound making things don't follow any of these rules
15:13gfrederickswhen an instrument is named for a particular key does that imply it's not tuned with equal temperment?
15:14justin_smiththere's a name for this in math - eg. we know so much about rationals, that people mistakenly expect that most numbers are rationals, etc.
15:14justin_smithgfredericks: equal temperment is about ratios
15:14TimMcclojurebot: the internet is a series of misunderstood tubes
15:14clojurebotRoger.
15:14justin_smiththe name of the key is the name of the note on the piano that it aligns with
15:14gfrederickssure I know what it is
15:15gfredericksI'm talking about e.g. a B-flat trumpet
15:15gfredericksand why it's useful to even categorize instruments that way
15:15justin_smithgfredericks: you can't have a tube or a string that is not equally tempered, it is only when you have valves, keys, frets, or multiple strings or tubes, that any temperement other than just intonation is possible
15:15justin_smitherr, first part of that was misstated, sorry
15:15justin_smiths/not equally tempered/not just intonation/
15:16gfredericksthe fretted instruments are inherently equal aren't they
15:16justin_smithno, they are not tempered at all
15:16justin_smiththey are terrible hacks
15:16justin_smithmost notes on them are out of tune, unless you do bends
15:16gfrederickswhat about a 1-string guitar
15:17justin_smithgood luck with chords...
15:17gfredericksmust be equal temperment
15:17gfrederickslook at all those perfectly spaced frets
15:17justin_smithsure, 1 string guitar, with good fret placement and very good neck design could maybe pull it off
15:17justin_smithin practice they are hacks
15:17gfrederickswhat aspect of it is not equal?
15:18justin_smiththe difference between a guitar as actually played (when doing chords at least) and either equal or just temperment, is bigger than the difference between equal and just
15:18gfredericksI'm still asking about a 1-string guitar
15:18gfrederickswhy is it not naturally equal temperment
15:19justin_smithOK, it's sensitive to finger pressure on the string, to placement of the finger between frets, to pressure in either direction on the necks, the rigidity of the string
15:19gfrederickssure there are variables, but assuming equal ratio'd frets, isn't equal temperment the default behavior?
15:20justin_smithgfredericks: what I am saying is in practice with mortal players, those noise sources are bigger than the difference between equal / just tunings
15:20gfredericksthat's fine I'm thinking of platonic guitars
15:20gfredericksassume a spherical mass rolling on a frictionless plane
15:20justin_smithgfredericks: with a perfectly skilled virtuoso, and different fret placement on each string (wiggly frets), you could pull it off
15:21gfredericksthere's only one string
15:21justin_smithI actually know people with wiggly frets on their guitars
15:21justin_smithsorry, yeah, it could be fine with one set of frets
15:21gfredericksokay so there's nothing *inherently* not-equal temperment about a 1-string guitar with normal frets
15:21justin_smithsure
15:21gfredericksphew
15:22justin_smithbut your fret spacing would need to be customized for string stiffness
15:22justin_smitha different brand / size of string would require new fret spacing
15:22justin_smithfor example
15:22gfredericksvarying ratios? or a different constant ratio?
15:22justin_smithbecause the resistence to displacement is different, and the amount of tension added by displacement is different on different frets
15:23justin_smithgfredericks: it would be about the degree to which the string is willing to stretch, and how linear its stretching behavior is - in practice metals tend not to be very linear about such things
15:24justin_smithin practice, beyond a certain degree of accuracy in intonation, a guitarist needs as much skill as eg. a violinist
15:24justin_smithanyway, none of this is clojure, sorry :)
15:24gfredericksanyhow my original question was about why you name an instrument after a particular key
15:25gfredericksis that *only* done if the instrument is not equally tempered?
15:25justin_smithbecause if you play not x as trained on that instrument, you play note y in real life
15:25gfredericksignoring the convention of naming the notes differently
15:26justin_smithit's more complicated than that - for "simplicity" sake they teach you "this fingering goes with that note", and instead of retraining for a new base frequency, they just reify the transposition from the canonical
15:26justin_smithso only the composer / arranger needs to get a headache
15:26justin_smithand not the player
15:26gfredericksassuming no player ever tries to play something intended for a different instrument :)
15:26gfrederickswhy would that ever happen
15:27justin_smithgfredericks: you use sheet music written for that instrument's transposition
15:27gfredericksI know
15:27gfredericksman I'm having a hard time getting at the root of my question
15:27gfredericksbut fingerings is an interesting aspect
15:28gfredericksso if you had a magically-equally-tempermented trumpet for which the lowest open note happened to be B-flat, would you therefore call it a B-flat trumpet just because of fingerings?
15:28justin_smithyeah
15:29gfredericksjust to mantain brass-instrument-coherency
15:29justin_smithright, it's enough to require musical virtuosity, no need to require they become mathematicians too
15:29gfredericksthat makes sense
15:30gfredericksthis makes me wonder why people think about temperments at all; it sounds too complicated to pull off anything specific once you have more than one instrument
15:31gfredericksI guess if your ear is sensitive enough you can't ignore it
15:31justin_smithgiven enough specialists, amazing things can be achieved
15:31gfredericksthose poor tortured souls
15:34justin_smithThere's cultural elements there too. Before the introduction of western music theory in the late 19th century, Chinese composers knew about the issues of temperment and intonation, but instead of maximizing for large numbers of notes but a small collection of available ratios, they maximized for a smaller number of notes, and a larger set of available ratios. I think you can make a direct comparison to food - european food looking for a few "best" fl
15:40oddcullyjustin_smith: got cut around ... few "best" fl
15:40justin_smithahh I think you can make a direct
15:40justin_smith comparison to food - european food looking for a few "best" flavors and combining
15:40justin_smith like with like, and eastern food looking for maximal variety, and combining for
15:40justin_smith contrast.
15:41justin_smithoops, sorry
15:57donkey_boyhi everyone
15:57donkey_boyburn all jews in oven
15:57donkey_boydeath to infidels
15:57donkey_boyallahu akhbar
15:57justin_smithhey amalloy you around?
15:58donkey_boyallahu akhbar
15:58donkey_boydeath to infidels
15:59timvisheris it possible to affect the error message that midje delivers?
15:59timvisherpreferably with a function that gets passed the failing value?
15:59donkey_boytimvisher you foul infidel jew
15:59donkey_boyyou should be stoned to death
15:59donkey_boyallahu akhbar
16:00amalloyjustin_smith: pong
16:00justin_smithamalloy: I think donkey_boy wants to be kicked off the channel
16:00uris77yeah, I ignored him already
16:00oddcullythere are some kickbans to share
16:01donkey_boyjustin you foul infidel you daughter should be beaten to death with a baseball bat
16:01donkey_boybecause you are an infidel
16:01donkey_boyallahu akhbar
16:01oddcullydonkey_boy: it is `your`
16:01oddcullyoh
16:01ntaylorhah
16:01oddcully(inc amalloy)
16:01lazybot⇒ 250
16:01ntaylorI expected better from the Finnish educational system :(
16:02timvisheri'm asking because i'd like to midje to spit out the the `:smallest` value in the error message.
16:02oddcullythere are bad apples everywhere
16:02justin_smiththanks
16:03timvisherlooks like it might involve implementing a plugin: https://github.com/marick/Midje/wiki/Customizing-reporting
16:16donkey_boyburn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn
16:16donkey_boyall jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven vvvv
16:16donkey_boyburn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven
16:16donkey_boyallahu akhbar
16:16donkey_boydeath to infidels
16:16donkey_boyburn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven burn all jews in oven
16:17SeyleriusBan time, I figure.
16:17hyPiRionamalloy: I think you need to do more than just kick them
16:17Seylerius(inc amalloy)
16:17lazybot⇒ 251
16:17@amalloyyeah. i was hoping i wouldn't need to remember how to do bans properly
16:19@amalloyhopefully that holds up
16:19hyPiRionI think I've seen that exact nick doing this previously, so I guess it will
16:20oddcullywho cares... some drunk kiddo
16:20oddcullyhe wont come back anyway or else his client would have reconnected him already
16:38TimMcamalloy: I've never been able to find documentation on how to ban properly.
16:38amalloyTimMc: i found some a while ago, i just don't have to do it often and forget
16:38amalloyplus it's like, you have to choose. i don't want to do IP bans if i can help it
16:39ghadishaybanbbloom: your CSP tweet really resonated.
16:40bbloom_ghadishayban: yeah, i'm writing some go right now ... it feels true :-P
16:40ghadishaybanconcurrency assembly
16:41TimMcWhat was the twert?
16:41bbloom_alt/alts/select multiplexing on queues is really all i want out of CSP
16:44justin_smithghadishayban: bbloom_: TimMc: this tweet? https://twitter.com/BrandonBloom/status/583068350034485249
16:44bbloom_yeah
16:45justin_smithgood discussion there
16:48sritchieI’d be stoked if cljx could figure out how to delete generated files for which there’s no cljx source
16:48clojurebotIt's greek to me.
16:49sritchiewhen switching branches, for example
16:51bbloom_sritchie: good news. feature expressions are coming.
16:51sritchieah, yeah, no gen
16:51sritchieso good!
17:01nicksellenI'm embedding clojure in a jvm which can run things like (go-loop [] (<! (timeout 1000)) (println "called") (recur)) which I need to programmatically shutdown from java. it seems perhaps not possible (https://github.com/boot-clj/boot/wiki/Pods points out threads will keep the pod alive)
17:06justin_smithnicksellen: you would need to shut down the core.async thread pool, because a go loop doesn't belong to a single thread
17:06nicksellenjustin_smith: can I access that thread pool?
17:06justin_smithnicksellen: if you need to shut it down from the outside, better to use some object that can act as a signal (a channel or queue a message could go on, or a delay or promise, etc.)
17:07justin_smithnicksellen: sure, the thread pool is defined in core.async, but shutting it down would mean shutting down all core.async
17:07sobelso, [robert.hooke :as bob]
17:07sobelawesome or awesomest?
17:07gfredericksit's the best
17:07nicksellenjustin_smith: thats exactly what I want to do :) the requirement is to *completely* remove a clojure environment (and then close the classloader).
17:08justin_smithnicksellen: https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj#L16 you can access it via the var
17:08justin_smithif you are accessing clojure via java, you probably know how to do that already
17:09justin_smithnicksellen: see also clojure.core/shutdown-agents if you used agents/futures at all
17:09nicksellenyes, I was calling shutdown-agents already.
17:09nicksellenjust trying out the new thing, excited!
17:10nicksellenalthough I wonder if there is other things that need shutting down too... or libraries/code could arbitary create executors etc
17:11justin_smithnicksellen: that should be it for vanilla clojure - we'd know because those pools would prevent our jvm shutdown
17:11justin_smithof course any lib that wants to can create executers or threads to do whatever
17:18nicksellenjustin_smith: success :)
17:18justin_smithawesome
17:20oddcully(inc justin_smith)
17:20lazybot⇒ 230
17:21nicksellenalthough it feels quite dirty accessing clojure.core.async.impl.exec.threadpool/the-executor directly
17:21nicksellen(clojure.core/shutdown-everything) would be nice :)
17:21justin_smithnicksellen: it didn't provide an abstraction for that though, so...
17:22nicksellenjustin_smith: what didn't?
17:23justin_smithcore.async didn't
17:23nicksellenah yeah, well, or just in core generally. could have (clojure.core/register-shutdown-hook)
17:23justin_smithjust saying, if the lib didn't abstract over something, but you can still do what you want via lower level means, I'd say it's fair enough to use those means.
17:24justin_smithnicksellen: clojure is quite absent of hooks in general (unless watches count I guess)
17:24justin_smithclojure.core at least
17:24nicksellenhmm I wonder if Runtime.addShutdownHook can be triggered on classloader closing
17:25nicksellenI'm very happy I've got this bit working though, just to make sure there are no loose references lying around, then my clojure env can be completely removed
17:39dxlr8ris there some problem using "future" inside a for? because it won't execute it's body. but it works with doseq. like... (for [x (range 3)] body) vs (dotimes [x 3] body)
17:39justin_smithdxlr8r: for is lazy
17:39justin_smithyou need to consume its output or else it won't do anything
17:40justin_smithdoall is available if you need to force early consumption, or doseq if you don't actually need the output
17:40dxlr8rhmmm, the problem is that the body returns nil...
17:40justin_smithdxlr8r: then you get a list of nils
17:40justin_smith,(for [x (range 3)] nil)
17:41clojurebot(nil nil nil)
17:41dxlr8rit is very weird.... it works from the repl, but not from inside a function
17:41dxlr8rwith for
17:41justin_smithbut use doseq if you know it's nil, clearly you don't need that result. doseq is identical syntax wise to for for your purposes
17:41ystaeldxlr8r: in the repl the result is forced to print it
17:41justin_smithdxlr8r: the repl forces evaluation because printing consumes the value
17:42justin_smiththe only difference of for and doseq is doseq allows multiple body forms
17:42justin_smith(and returns nothing and is not lazy, of course)
17:42dxlr8rahhh, ok. understood the lazy thing. was just confused when it worked from repl
17:57dxlr8runrelated... sometimes I find myself wanting to use names such as range, list, etc. for my let bindings etc. is there some kinda defacto pre og suffix for this? know of a guy that *foo*'ed everything
17:57justin_smithdxlr8r: you can use those things as let bindings, as long as it is unambiguous
17:57justin_smithbut it is an easy way to introduce future errors if you forgot you did it
17:58dxlr8ryeah, I know
17:58justin_smitheg. I used to do that with count, but got too many bugs, so I started using other names like size
17:58dxlr8rI tried finding new names, but all where taking :P
17:59justin_smithhehe
17:59justin_smiththere's always putting a _ or ' on the end
17:59dxlr8rit where a range... so I though, yeah, call it array... taken too :/
17:59dxlr8rseq?
17:59dxlr8retc :P
17:59dxlr8rnever got a good name for it
17:59justin_smithlst is a classic
17:59dxlr8rahhh
18:00noncom|2dxlr8r: if i must use such a name, i usually either just use it and then go with fully-qualified ones, or just prepend "a" to them
18:00justin_smithas is coll
18:00noncom|2for list, yeah, i often use lst and coll too
18:00dxlr8ryeah, used coll for other stuff
18:00justin_smithdepending on your coworkers accents, you may get way with cnt for count, but probably best to avoid that one
18:00dxlr8rbut there is no defacto? better to find a new name than suffix's etc?
18:01dxlr8rhaha :P
18:01justin_smithl is also good for collections
18:01dxlr8rdon't like single char bindings
18:01dxlr8rseldom use them
18:01justin_smithrst if it came off the end of something
18:01dxlr8rbut as I said. any defacto standards?
18:01justin_smithx if it really doesn't matter what kind of thing it is you are just passing it along
18:02dxlr8rwill remember rst, coll I already use, and lst :)
18:02justin_smithl and rst and x and coll are all standards
18:02justin_smithf
18:02dxlr8ruse x for testing of code, but not in prod
18:02justin_smith(if callable)
18:02Bronsaf g and h for callables
18:02justin_smithright
18:02Bronsaeven though i sometimes use f for first in destructuring
18:02dxlr8rI use this guide: https://github.com/bbatsov/clojure-style-guide#naming
18:03Bronsa(loop [[f & rs] coll] ..)
18:03dxlr8rput says nothing about pre or suffixing
18:03dxlr8rbut
18:03justin_smithpatchwork gets all creative sometimes, like using "skein" as a name for something gathered up from multiple sources
18:03justin_smithor jopotonio where the name really doesn't matter
18:03patchworkThat is a perfectly reasonable variable name
18:03justin_smith:)
18:04oddcullyi thought skein was beaten with a baseball bat?
18:05dxlr8renglish is not my native tongue, but try to have english names. so I am not as good as you to find cool names :P
18:05justin_smithpatchwork: oh wow, one of the synonyms for skein is "winning streak"
18:06patchworkRight, all of my variable names are synonyms for "winning streak"
18:06justin_smithalso, skein relations are a concept in knot polynomials
18:07justin_smithhaha
18:07justin_smithTIL there are knot polynomials
18:07dxlr8rcool, you people actuallt work with clojure. have NEVER ever seen a job ad with that in norway
18:07patchworkYeah I knew that one. Math has already claimed all the great general collective nouns
18:07dxlr8rall .NET, Java and some PHP here
18:08justin_smithdxlr8r: we only got clojure jobs at first because patchwork snuck it into his workspace, then it flourished and I got hired
18:08dxlr8rnice :)
18:08dxlr8rfrom the US?
18:08justin_smithyeah
18:08dxlr8rnice
18:08dxlr8rI learned clojure because I wanted to something hard :P
18:09dxlr8rlearn something new
18:10oddcullydxlr8r: haha, i always ridiculed lisp for the ((((((()))))))))... that is why i _try_ to learn clojure
18:10dxlr8rnow everything sucks in comparison
18:10justin_smithdxlr8r: oh, another name (from the common lisp world) is e or el for an element in a collection
18:10justin_smithand acc for the argument that gets built up in a reduce
18:10dxlr8rhehe :P better with (((((())))))) that ({({})})
18:11dxlr8rI am actually noting this down justin_smith :P
18:13dxlr8rall other languages has so much boiler code. I think I'm more productive in say regular Java for a lot of stuff, but want to master clojure :)
18:14justin_smithit's a laudible goal
18:14oddcullydxlr8r: i think with a functional mindset and and some languages on your buckle you for sure would have no problems find a job in a "cool" it environment
18:15dxlr8rin norway? I beg to differ :P
18:15dxlr8rMS is still king here
18:16oddcullyNS means somethin' else here ;P
18:16justin_smithF# is cool
18:16oddcully.*# never attracted me
18:17dxlr8rNS was the fascist party that couped the goverment. so yeah oddcully ... NS means stuff here to :P
18:17dxlr8rduring WW2 :P
18:17oddcullyhate me now: i come from a python/groovy landscape
18:17justin_smithoddcully: my fondness for .*ml overrides that for me :)
18:18dxlr8reasy to get clojure job i the US? :P
18:18dxlr8rcould move
18:18dxlr8rnot very good :P
18:18oddcullydxlr8r: we all saw dod sno
18:18dxlr8rahhh :P
18:18justin_smithdunno about easy, but it's definitely been expanding
18:18dxlr8ractually haven't seen the oddcully
18:18dxlr8rthat
18:20oddcullywell then just me
18:20oddcullygreat cinema nontheless
18:20dxlr8rwill probably watch it sometime :)
18:21dxlr8rnorwegian films aren't so bad. used to be all crap
18:21oddcullybut i hope in norway there is some culture around hiring "versatile" devs
18:21oddcullyyesterday there was some talk about "how to get hired in a startup"
18:22oddcullyi think i only know dod sno
18:22dxlr8rwell, there might be some places I don't know of. but hard to get into. not even living in the capitol
18:22oddcullyis festen from norway?
18:22dxlr8rfesten?
18:22oddcully(pleASE don't hate my now!)
18:22dxlr8rfesten who/what?
18:22oddcullyok, maybe not then
18:23dxlr8rfesten means "the party"
18:23ntaylorsome sort of demoscene thing?
18:25oddcullydenmark/sweden... sorry
18:25oddcullysince you translated it well, you norsemen seem to share quite some language
18:29dxlr8ryeah, we norwegians understand both swedish and danish
18:29bensuyeah festen means "the party" in swedish as well
18:29dxlr8rbut danes and swedes aren't so good in understanding. atleast not danes... they speak english :P
18:29dxlr8rI can understand them, but they don't want to understand us :P
18:30bensuthere is actually a small clojure community in Stockholm, I've been to a couple of meetups and they've been interesting
18:30dxlr8rmost norwegians can fake swedish speech to
18:31justin_smithdxlr8r: so can muppets
18:31dxlr8rhaha :P
18:31ntayloryeah, Stockholm seems pretty good for JVM stuff in general (maybe owing to BEA being there,I donno)
18:31oddcullyhaha
18:31oddcullySMØREBRED!
18:31oddcully(spl!)
18:31amalloyreminds me of http://www.reddit.com/r/sweden/comments/301sqr/dodetot_%C3%A4ror_fof%C3%B6ror_lolitote/ - pig latin, for swedish
18:31oddcullythat all my composekey could do
18:32justin_smithI'm sure swedish people get really tired of the swedish chef jokes
18:32oddcullyi'm so sorry!
18:32dxlr8rnorwegians doesn't get tired. but we dig all swede bashing :P
18:32oddcullyit's the liquor speaking (like with mr. lahey)
18:32dxlr8rold bad blod :P
18:33bensuyou never hear those here :) I've actually met a BEA programmer at an Erlang meetup
18:33dxlr8rwe have swede jokes
18:33dxlr8rdo you know why swedes always have an empty bottle in their fridge?
18:33bensupoor guy, everybody gave him tons of shit because, you know... java
18:34dxlr8rin case someone who isn't thirsty comes by
18:34oddcully:*)
18:35dxlr8rwe have like hundres of them :P
18:35oddcullyhere it is: austria vs bavaria
18:36bensuoddcully: are you austrian?
18:36oddcullybensu: NO!
18:37gfrederickswait hold on this is not the time of day for europeans to be about
18:37dxlr8reaster :P
18:37oddcullygfredericks: your last name suggests otherwise
18:37gfrederickseurope talk is first thing when I get up in the morning
18:37justin_smithAnd here we have the haskeller / rubyist jokes. There will always be jokes about the folks on the other side of the river.
18:37justin_smithhaha
18:37justin_smith(inc gfredericks)
18:37lazybot⇒ 131
18:38bensugfredericks: I move to Sweden so my mum wouldn't bother me with bed time!
18:38dxlr8rin scandinavia we have the easter of
18:38dxlr8rno work :P
18:38dxlr8roff
18:38oddcullybavaria^Wgermany too
18:38gfredericksoddcully: my ancestors came to staten island on the mayflower while fighting the british
18:39oddcullygfredericks: your lastname suggested that to me even by obfuscating it
18:39bensujustin_smith: ruby jokes are pretty hilarious now matter in which side of the river you are
18:39gfredericksI think fredericks is wswedish
18:39dxlr8rwhat better way to spend easter than programming clojure?
18:39bensu(even when you like ruby)
18:39dxlr8rhehe :P
18:39justin_smithbensu: and mongodb jokes
18:40bensujustin_smith: god yes. those webscale mongo db videos are hilarious
18:40justin_smithbut those are there because laughing is better than tears of rage and pain.
18:40oddcullygfredericks: i worked with a swede (fredrikson - son of fredrik -- but could as well we friedrich (german))
18:40gfredericksthere's a 1/8 probability it's danish
18:41bensujustin_smith: the guy that makes them is in the Erlang community, we better not upset him...
18:42bensujustin_smith: the one thing I envy from the Mongo/Meteor community is that server real time sync
18:43justin_smithbensu: can't you duplicate that by any db with (future (sync-eventually db)) because mongo isn't actually verifying any sync happened
18:43QueIs clojure a good choice for a first programming language? I plan to do some web development later on since I only know html and css
18:43justin_smithbensu: I could be missing a nuance here
18:44justin_smithQue: if you find it difficult, racket is somewhat more streamlined, but similar enough so that you could come back to clojure later
18:44justin_smith(with little difficulty)
18:44justin_smithQue: of course since this is a clojure lovers channel, I will tell you it's the best :)
18:44turbofailracket also comes with a relatively friendly IDE to get started with
18:44Que:))
18:45oddcullyyou can configure mongo by request now you want your data realized
18:45justin_smithyeah, racket is optimized for first time programmers when you use the IDE
18:45bensuit's not about the database being fast to respond, but about making it feel in the client that you are working directly with the db and pushing fresh data to the client constantly
18:45dxlr8rQue: clojure will be harder to learn if you first learn php, Java etc. so if your goal is the master clojure, don't make your brain think in objects
18:46dxlr8rcan be hard to unlearn
18:46justin_smithbensu: ahh, so the low latency of getting updates?
18:46dxlr8ror not unlearn, but adapt :)
18:46bensujustin_smith: and the pub/sub mechanism across all clients
18:47justin_smithbensu: aha, so it's like a db and a distributed messaging system in one
18:47QueI only followed some python/ruby/ js tutorials so since I have no programming background I was unsure to pick a language so "esoteric" as clojure
18:47bensuyeah! mongo offers the db and meteor builds the sync layer on top using websockets
18:47justin_smithbensu: have you looked at zookeeper? I've had good experiences and have heard nothing but good things about it. It does coordination of data with low latency and good throughput.
18:47bensuit works great out of the box but it's extremely complected!
18:48justin_smithbensu: but zookeeper explicitly is not a db
18:48herrwolfeQue: python is nice as well. But scheme is great to learn multi paradigm
18:49dxlr8rQue: depends on waht you want. if you have programming as a hobby I would recommend clojure. but it you plan on getting a job fast I would instead learn a more used language... JavaScript IS the most important language atm
18:49bensujustin_smith: yeah, I've looked about it and it could be a component. I'm actually trying to figure out the abstractions/protocols to offer the client and server
18:49QueAnd I can only find learning resources geared to experienced programmers so that's why I am here :-D
18:49justin_smithbensu: avout is cool as long as you don't use the watch feature - it provides a view of zookeeper that is much like atoms or refs
18:50oddcullydxlr8r: moving up norse was an option... until you mentioned JS... ;P
18:50bensubut it's very late here in Sweden to have good ideas, so I'll be going
18:50bensujustin_smith: I'll look at avout, thanks!
18:50bensuhejdå!
18:51justin_smithQue: clojure from the ground up and clojure for the brave and true are both pretty accessible to newcomers http://www.braveclojure.com/ https://aphyr.com/tags/Clojure-from-the-ground-up
18:51dxlr8rheidå
18:51dxlr8r:P
18:51Quedxlr8r: but javascript is so ugly and very things I don't understand and don't make sense to me
18:51oddcullybensu: slàinte
18:51dxlr8rQue: agree :) but still the most important language atm
18:51justin_smithQue: yeah, clojure is simpler in many ways (until you get to the dusty corners - every language has those)
18:52oddcullyguess, i got that tick on the a wrong
18:52Quejustin_smith: Thanks for the links
18:53turbofailjustin_smith: are they really accessible to programming newcomers? most of us haven't been one of those for a long time...
18:54justin_smithQue: also, this channel and #clojure-beginners are open to even the most introductory of clojure questions - as long as there is at least some evidence you are putting some effort in
18:54turbofailso i don't know how good a judge of that we are
18:54QueBut if I learn clojure would it be to learn other languages like javascript or python?
18:54justin_smithturbofail: clojure from the ground up is explicitly for an audience that has never programmed before
18:54oddcullybraveclojure is basically the first site i read about clojure... it is really funny
18:54dxlr8rQue: clojure is not a good start if you want to learn JavaScript or Python
18:55justin_smithturbofail: the main complaints I have heard about it is that it goes to slow, and it's too basic
18:55dxlr8rPython is a good start for that
18:55turbofailjustin_smith: i dunno. i tried teaching a friend basic programming stuff in a similar fashion to how clojure from the ground up approaches things, and it was a total disaster
18:55turbofailthat said that may have just been my friend being super impatient
18:56justin_smithstatistically most people that try to learn to program, just don't find a way to make it work, no matter the approach you take
18:56justin_smitheven if they want to
18:56justin_smithturbofail: the real difference I think is stubbornness / obsessiveness - this is beyond "patience" territory I think :)
18:57dxlr8rI found the immutable nature hardest. and thinking about loops in a different way was hard to. like use reduce, etc. instead of complex loops
18:57Quedxlr8r: thank you for the sincere advice
18:57justin_smithif your first language is a functional one, immutable just makes sense, it's like math
18:58dxlr8ryeah... agree
18:58oddcullyalso in pure practicality terms you will have an easier time as an sh*tty JS developer
18:58oddcullyno one will notice
18:58justin_smithhaha
18:58dxlr8rthat's why I said it's harder to learn clojure if you are into the Java/Python/JS world
18:58dxlr8roddcully: haha
18:59dxlr8rI still use loops for stuff that reduce etc. could do. and I make A LOT of let's :P
18:59oddcullyeverything will be attacked with a `for` loop then
18:59turbofailalso, "just like math" and "just makes sense" don't always go that well together
18:59justin_smithhaha
19:00justin_smithturbofail: I think the most confusing and problematic thing in the entire programming world is "i = i+1;"
19:00dxlr8rlet, a noobs best weapon against (((()))) :)
19:00Quebut if you have a virgin brain like me it would be a good choice? Am I understanding it right?
19:00justin_smithQue: I think so. But clearly there is some diversity of opinion.
19:00dxlr8rQue: yeah. but don't expect to get anywhere soon if you plan on getting a job
19:00dxlr8ror get a head start for university
19:01turbofailjustin_smith: i dunno. that never confused me as a kid, it only started seeming odd to me after i started thinking about things in more depth
19:01QueIt's more like a hobby to be honest
19:01oddcullyQue: quite honest, from my perspective -- as a clojure learner meself -- i can't tell. the basics are sound and safe and the things you take away are really for life. if you want to find a job in the biz... depends
19:02justin_smithQue: yeah, for hobby, I'd say definitely choose one of clojure, racket, haskell, ocaml
19:02dxlr8rQue: I still consider myself a noob, and I am better with other languages. but I have fallen in love with the language. it's more powerful, more consistent etc.
19:03dxlr8rI have also learned clojure as a hobby/use for my own projects
19:03ntaylormy two cents: any language you choose is, language-feature wise, the right language to learn from if it makes you motivated to keep going forward with programming
19:03justin_smith'strooth
19:03justin_smith(inc ntaylor)
19:03lazybot⇒ 1
19:04ntaylorI think a lot of people (myself included) got hung up on Is This Language The Best One rather than experimenting and learning ;)
19:04dxlr8r:)
19:04justin_smithprobably the most important language to me in my learning was csound -- because I could use it for cool stuff that I wanted to do
19:04justin_smithbtw. it is a terrible language, syntax and feature wise
19:04justin_smithbut it makes it super easy to make synthesizers :)
19:05ntaylorhah
19:05dxlr8rclojure can be more a hassle to setup than say a LAMP. my command line skills and long hours with Linux did come in handy
19:05QueImmediate satisfaction is a very strong argument.....
19:05dxlr8rand ofcourse finding an editor for humans is hard
19:05dxlr8rmost clojurans use emacs
19:05oddcullymy entry point was graphics
19:05ntaylorI think someone already mentioned Racket above, but that's a huge benefit of the PLT-Scheme stuff
19:06justin_smithyup
19:06oddcullyso getting results for your eye or ear seems crucial
19:06ntayloryou just install the thing and It Works
19:06turbofailyeah the racket IDE is pretty awesome
19:06ntayloryeah same
19:06ntaylorI TAed the How To Design Programs curriculum in grad school and it was (surprisingly nobody) so much better than the former OO curriculum
19:06Quegotta search for racket then
19:07dxlr8rif you are not gonna mess to much with lein etc. Counterclockwise is a good clojure IDE Que. would start there unless you already know emacs
19:07ntaylorif only because you had the REPL right-away and got immediate feedback
19:08n8dawgQuestion on core.async, I have a producer and consumer talking over a channel, no buffer, lets say producer looks something like this: (go (>! chan (foo)))
19:09n8dawgquestion is, is (foo) called when consumer reads from chan or when go block is called?
19:10justin_smithn8dawg: I would expect when the go block is called. But honestly I don't know.
19:11postpunkjustinif there's no buffer then I would definitely expect it to be when the go block is called
19:11justin_smithjustin tag-team action
19:11postpunkjustintwo out of n Justins agree
19:12oddjustini don't
19:12oddcullyor maybe i am
19:15Queso should I go with the racket's official tutorial or pick something else?
19:16dxlr8rhardly heard of it. sorry :/
19:16justin_smiththe official tutorial should be good
19:16ntaylorQue: remind me, is your background a new programmer?
19:17Quentaylor: Only did a couple of tutorials on ruby/python js
19:17ntaylorif so, I might recommend the intro textbook How To Design Programs, which is intended for new CS uni students but should be good for self-study too http://www.ccs.neu.edu/home/matthias/HtDP2e/
19:18ntaylorimho it is a fantastic intro to both programming and thinking in the functiona programming style
19:18ntaylorthe official racket docs are written by at least a few of the same authors, though, so you may get a good experience going through those as well
19:19Quentaylor: thank you I will explore both and see what fits me.
19:19oddcully(inc ntaylor)
19:19lazybot⇒ 2
19:20ntayloryw!
19:20Quentaylor: So am I right to assume that the link is for learning to program using racket language? or is it clojure/something else?
19:20ntaylorQue: sorry, no, the link is for a textbook that uses Racket
19:21ntaylorbut, being both Lisp-likes, they're philosophically similar to one another
19:21dxlr8rskimming the textbook, and I agree. a lot like clojure
19:23QueThank you very much. You guys were most helpful. Really appreciated :)
19:23Que(inc ntaylor)
19:23dxlr8rgood luck :)
19:23lazybot⇒ 3
19:23Quedxlr8r: thanks :)
19:24ntayloryw!
19:24dxlr8rbtw guys. you know of some clojure/java library that handles processes? I use a library named "clj-pid" for getting the pid of the running process, but would like to list all it's "children"... like "pgrep -P"
19:25dxlr8ratm I use sh with pgrep etc. and it works great, but wondered if there where a lib
19:25dxlr8rmy program will be reliant of pgrep, which I don't like
19:27oddcullymine on instaparse, which i totally like
19:28oddcullyand yet you are better off than the ps aux | grep folks!
19:30dxlr8rhttps://github.com/lewang/instaparse ? how is that gonna help med oddcully ?
19:31dxlr8rme
19:35ntaylordxlr8r: I bet you wouldn't have too much trouble rolling your own that does a `Runtime.getRuntime().exec("ps aux")` and then have you filter
19:35ntaylorthe difficulty with the JVM being cross platform is that exposing system level stuff like this is rare :(
19:36ntaylorI thought there might be a built-in mxbean for this, but not as far as I can see http://docs.oracle.com/javase/7/docs/api/java/lang/management/OperatingSystemMXBean.html
19:36dxlr8rI use "clojure.java.shell"... and pgrep is much better than ps
19:36dxlr8rfor that task
19:37ntaylorright, I meant to say pgrep rather than ps
19:37ntaylorwhatever thing you want executed on the shell :)
19:37ntaylorif you were feeling really ambitious, you could write your own linux/OSX specific MXBean and write clojure bindings for it :)
19:38dxlr8r:) I have a nice way now, it's very clean. but not portable. works on pgrep for bsd, gnu and busybox
19:38dxlr8rbut would not work in say, windows
19:38ntayloryeah, a truly portable way is gonna require some effort
19:38ntayloryeah exactly
19:38dxlr8r(sh "pgrep" "-P" (pid/current))
19:38dxlr8rreally easy
19:39dxlr8rthen just do a split of the output and have nice list
19:39ntaylori've never had cause to shell out in clojure, that is nice
19:39dxlr8rtrying to master clojure, so use it for shell scripting
19:39dxlr8rcould do it in perl/bash whatever
19:39dxlr8rbut I already know those :P
19:40ntaylornothing beats perl
19:40dxlr8ror... who really knows bash? I never get that right. I have to lookup everything... messy "language"
19:40netrobyMorning (From GMT+8)
19:40pmonksFor invoking other apps I've found conch (https://github.com/Raynes/conch) pretty nice. Doesn't solve the portability problem, mind you...
19:41dxlr8rhehe, perl is nice. I am not experienced enough to say that perl is the best :) it works
19:41ntaylorperl was actually my first FP language
19:41dxlr8ryeah, tried to use conch. but it didn't give me anything I needed
19:41ntaylor(and one of my favourite things to do is to make the Haskell crowd mad at me by saying the best book I've ever read about functional programming is Higher Order Perl)
19:41dxlr8rso went back to regular sh
19:42dxlr8rmy first language was TI-83 Basic
19:42dxlr8rthen PHP
19:43postpunkjustinthat's quite a step down
19:44SeyleriusHah.
19:44dxlr8rwould be cool to write my own clojure vbinding and post it github. would look nice on my resume
19:44dxlr8rhehe
19:44justin_smithdxlr8r: under linux, I'd use the /proc files to get what you might want
19:46dxlr8rjustin_smith: yeah, I use OS X, and the script is gonna be deployed on linux/os x/bsd machines, so pgrep looks better in that case
19:47dxlr8rhttps://github.com/facebook/osquery could work to :P
19:47dxlr8rbut wanted something easy
19:47dxlr8rbut that project is so nice :)
19:48Seyleriusdxlr8r: What in the world is a vbinding?
19:49dxlr8rSeylerius: meant binding
19:49dxlr8rtyping to fast for my own good
19:49SeyleriusAh.
19:50SeyleriusSo a clojure binding for... the abomin—*cough* I mean PHP? Or for something else?
19:50dxlr8rI thought about OperatingSystemMXBean
19:50dxlr8rI don't need it, but could be a cool project
19:51dxlr8rhaha :P PHP is like 12 years ago
19:51dxlr8rhardly touched it since
19:51SeyleriusGood.
19:51ntayloryeah, if you know how to get the process lists from the Win32 API, you can do platform-specific stuff in the bean and expose a uniform interface into managed code
19:52dxlr8ryeah, thinking about it ntaylor . as I said, would look good on a resume, and also give some cred
19:52ntaylorI guess the good news there is that you would need to maintain Windows and "everything else", so only two distinct code paths
19:52ntayloryeah
19:53dxlr8rI have heard that having a github account with good projects is a good move. I am 30 and without a "real" job
19:53dxlr8rso time is running out :P
19:53ntaylorha ha ha
19:53dxlr8ris 30 old? :P
19:53pmonksoh sweet babby child
19:54pmonksyou got no idea what's coming
19:54pmonks;-)
19:54ntaylorEVERYTHING BREAKS
19:54pmonks(inc ntaylor)
19:54ntaylorthat is my "getting old" experience so far
19:54lazybot⇒ 4
19:54pmonksThen you forget you break easily (cause your memory is broke too) and really get into trouble. :-(
19:54dxlr8rI have some idea :P I have to exercise more than I used to or else every bone hurts :P
19:55ntaylorself-preservation is for the young peopel anyway
19:56pmonksThat's why I drink - to try to preserve myself.
19:56pmonksThat and it's cheaper per ounce than anti-inflammatories.
19:56dxlr8rdon't drink or smoke. workout about 3 times each week
19:57dxlr8rsometimes more
19:58pmonksWait until you stop healing from injuries - that sucks. :-(
19:58pmonksI used to be able to take a week break, R.I.C.E. and I'd be fine. Now I have injuries that just won't heal properly.
19:59pmonksAnd old ones randomly resurfacing.
19:59pmonkssuxx
19:59dxlr8rI go regulary to acupunctur for my arms
19:59dxlr8ror else I can't use a mouse or keyboard :/
19:59dxlr8rhad it for over 10 years
20:00pmonksWhat's your sport of choice, if you don't mind me asking?
20:00dxlr8rbut actually recovering
20:00dxlr8rI used to be really good in triple jump
20:00dxlr8rnow it's just hobby
20:00pmonkswow
20:00pmonksThat looks way hard on the legs!
20:00dxlr8rnot that hard actually
20:01dxlr8rnever had any mayor injuries because if it
20:01dxlr8ryou get more injures doing nothing than doing something... atleast in the long run :)
20:01pmonks+1
20:02Seylerius(inc dxlr8r)
20:02lazybot⇒ 1
20:02Seylerius(inc pmonks)
20:02lazybot⇒ 3
20:03Seylerius(inc ntaylor)
20:03lazybot⇒ 5
20:05dxlr8rthx :)
20:20justin_smithdxlr8r: I got my first real programming job at 35
20:21justin_smithafter over a decade of hobby programming
20:24dxlr8rnice to hear. I have been really close getting a real job. I am kinda like a poteto, I do all kinds of stuff. really good with OS X and Server.app etc. also good with Linux and network in general
20:25dxlr8rthen I also do some programming, but never profesionally. only small projects
20:34justin_smithpoteto?
20:35patchworkHow large is the thread pool for futures? And where do I set it?
20:37justin_smithpatchwork: I'm on mobile, but it is thee agent thrad pool
20:38justin_smithsame one shutdown-agents shuts down
20:39justin_smithmaybe see you in 20 minites?
20:40patchworkjustin_smith: Ah yes, you heading to the clojure meetup?
20:40patchworkat puppet?
20:40patchworkI will be there
20:41justin_smithhttp://stackoverflow.com/questions/11316737/managing-agent-thread-pools-in-clojure
20:41justin_smithbuilt in pool, unlimited size
20:42patchworkReally weird, I am making 1000's of concurrent requests to http-kit, but it only ever accepts 400 at a time
20:42patchworkExactly 400
20:42patchworkevery time
20:43patchworkIt seems too convenient
20:43amalloypatchwork: perhaps you're running out of OS file handles, for example
20:43amalloythough 400 seems a bit low for that
20:45justin_smithhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Agent.java
20:45patchworkYeah I hope my OS can handle more than 400 files at a time : P
20:45amalloywell the default on most unix machines is 1024 files per process
20:46patchworkIt could be something like that then...
20:46justin_smithalso, thread limits per process
20:46dxlr8rjustin_smith: potato :)
20:47justin_smithso what does it mean to say you are a potato?
20:48patchworkjustin_smith: Any idea what the thread limits per process are?
20:48johnmendoncaversatility of a potato
20:49dxlr8rjustin_smith: thought that was an english term to. in norwegian it means you can be used for everything
20:49dxlr8rversatile :)
20:52justin_smithin english potato means mentally challengef (like downs syndrome) or very weak tech (like a cheap camera). i assumed you meant something different
20:53dxlr8rhehe :P won't use that term again in english :P