#clojure log - Apr 02 2015

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

0:54 irctc_: 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

0:54 ?

1:02 justin_smith: irctc_: a small thing - (conj (conj a b) c) is the same as (conj a b c)

1:03 irctc_: on every recursion, your col1 and col2 are the same value

1:03 perhaps you meant to do first in a let inside the loop

1:03 or use destructuring

1:13 answered on SO

1:28 irctc_: I am trying not to use reference &

4:12 borkdude: ordnungswidrig 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

4:37 justin_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

4:41 ordnungswidrig: borkdude: 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.

4:42 borkdude: i.e. you can return {:location "http://whatever-s3-url/buck/pig.jpg"} from those decisions

4:42 borkdude: ordnungswidrig ah I tried returning {:location ...} in :moved-temporarily? but that didn't work somehow

4:42 ordnungswidrig with a get request

4:42 ordnungswidrig anyway I used this now (fn [ctx]

4:42 (ring-response

4:42 (redirect (str (::s3-url ctx)))))

4:42 in handle-ok

4:43 ordnungswidrig: I guess you would need to return false from :exists? and true from :existed?

4:44 borkdude: that's not very intuitive, I must admit :-)

4:44 borkdude: ordnungswidrig in exists? I return {::s3-url ...}

4:44 if the file indeed exists

4:45 ordnungswidrig: borkdude: if you want to redirect on get, then exists must return false.

4:45 borkdude: ordnungswidrig you mean by spec or by liberator?

4:46 ordnungswidrig it works now I must say

4:46 ordnungswidrig: borkdude: in liberator. Here's an example: https://gist.github.com/ordnungswidrig/d9013659e1f7a80ea584

4:46 borkdude: ordnungswidrig ah ok

4:46 * ordnungswidrig should measure decision graph edge coverage in liberator's test suite.

4:47 borkdude: ordnungswidrig 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?

4:48 ordnungswidrig: The :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.

4:50 borkdude: ordnungswidrig 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.

4:51 ordnungswidrig: borkdude: 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

4:51 borkdude: right?

4:52 borkdude: ordnungswidrig right

4:53 ordnungswidrig: borkdude: https://tools.ietf.org/html/rfc7231#section-6.4.4

4:54 borkdude: ordnungswidrig it seems the only way to get to 303 is via post in liberator?

4:55 ordnungswidrig: borkdude: 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?

4:56 borkdude: sounds good to me

5:00 ordnungswidrig: borkdude: dare to file an issue?

5:00 borkdude: ordnungswidrig yes, I'll do

5:05 ordnungswidrig https://github.com/clojure-liberator/liberator/issues/205

5:06 ordnungswidrig: borkdude: hurray!

5:06 mrchance: hi! 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

5:06 Any ideas?

5:09 also, lein deps :tree lists nrepl 0.2.6 as a top level dependency for whatever reason, it's definitely not in my project.clj

5:13 ordnungswidrig: mrchance: is it in your ~/.lein/profiles.clj?

5:15 mrchance: ordnungswidrig: no, profiles only has a single plugin in it, the cider-nrepl 0.9.0 snapshot

5:17 aha, this might be related: https://github.com/technomancy/leiningen/issues/1569

5:40 TEttinger: cfleming: 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

5:41 cfleming: TEttinger: I'm trying to figure out whether Cursive is the red pill or the blue pill

5:42 mrchance: ok, for anyone interested... :dependencies ^:replace {foo...} fixed it for me

5:42 TEttinger: I do take a lot of pills

5:42 cfleming: TEttinger: But either way, great, very interested to know how you find it!

5:44 TEttinger: Are you used to vim or Emacs? Or something else?

5:44 TEttinger: light table and nightcode

5:44 and a lot of jEdit

5:45 cfleming: Ah ok - hopefully won't be too much of a shock then

5:45 TEttinger: the 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

5:45 so I had something like 13 clojure apps open in various broken states

5:45 cfleming: What's your opinion on the light table inline eval?

5:46 TEttinger: it never worked for me

5:46 I was doing stuff that needed weird thread things

5:46 cfleming: Ok

5:46 Just curious

5:46 TEttinger: either stuff needed the opengl render context stuff that I don't claim to understand, or had to be on the swing render thread

5:46 and that apparently didn't work with inline eval

5:47 cfleming: No, it wouldn't, since the evaluation is asychronous

5:47 You'd get back the results of putting something into an executor or whatever - probably nil

5:52 egli: mrchance: what exactly did you add to your project.clj?

5:55 mrchance: egli: just a ^:replace metadata tag to my dependencies

5:57 egli: according to the issues, this might work too {:profiles {:base {:dependencies ^:replace []}}}

5:58 I 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

5:59 I couldn't ignore it either because it broke things like cider completion...

6:00 and this problem doesn't seem limited to projects involving gorilla-repl

6:03 oluap: Is clojure a good first programming language? I only know html/css and did some basic tutorials about python, ruby and javascript .

6:04 dstockton: oluap: probably, it has simple syntax

6:04 might ruin other languages for you

6:04 mrchance: oluap: I'd say yes, easy to set up and try, and simple syntax

6:04 also what dstockton said ^^

6:05 certainly made programming python a lot less fun for me :)

6:10 oluap: I 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

6:11 mrchance: oluap: true, that is a bit rare. You can try the basics here: http://www.tryclj.com/

6:13 There are also some good books, "Clojure programming" or "Clojure in Action" that should be suitable to beginners

6:13 dstockton: oluap: you made it to #clojure, i don't believe you're such a beginner

6:14 mavbozo: mrchance, 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

6:15 mrchance, lein deps :tree list [cider/cider-nrepl "0.8.2"] (my current cider-nrepl plugin) at the top level

6:15 s/project repl/project.clj/

6:16 mrchance, also it list [org.clojure/tools.nrepl "0.2.7"] which is what I currently use

6:17 mrchance: mavbozo: hm, for me emacs still says "WARNING: CIDER requires nREPL 0.2.7 to work properly"

6:18 mavbozo: my last line of deps :tree output says: [org.clojure/tools.nrepl "0.2.6" ... ]

6:19 mavbozo: mrchance, no warning from when connecting from emacs's cider

6:20 mrchance: mavbozo: weird, what could it be? my leiningen is 2.5.1

6:20 mavbozo: mrchance: ah, maybe because I had :dependencies [[org.clojure/tools.nrepl "0.2.7"]] in my :user key in ~/.lein/profiles.clj

6:20 mrchance: mavbozo: possible :)

6:20 mavbozo: s/had/have/

6:21 oluap: dstockton: What do you mean by that?

6:21 mrchance: but I would be happy if that was sufficient

6:21 lemme try

6:23 mavbozo: ok, that combination works too. Nice! Maybe I messed up somewhere else earlier

6:24 mavbozo: 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

6:25 mavbozo: oluap, these days, it's rare seeing a beginner programmer who knows IRC

6:26 mrchance: requires a later version, I mean

6:27 oluap: mavbozo: I am no computer illiterate and i am not that young :)

6:33 elvis4526: How can I see what a macro will generate ?

6:33 i'll try (macroexpand-1)

6:34 ordnungswidrig: elvis4526: ,(macroexpand-1 '(defn foo []))

6:34 ,(macroexpand-1 '(defn foo []))

6:34 clojurebot: (def foo (clojure.core/fn ([])))

6:37 elvis4526: Okay. Then I don't get why this http://pastie.org/10069423 only return map.

6:38 where is the rest of the body ?

6:38 ordnungswidrig: elvis4526: what do you want to achieve?

6:38 elvis4526: I'm trying to understand macros

6:38 I had a map that had function as value

6:39 and I wanted to "inject" something redundant to each function as the first arg.

7:44 egli: mrchance: I used to have my work environment change from under me when doing cider upgradesI just stick to stable cider

7:44 now I just stick to stable cider

7:45 i.e. set package-archives to melpa-stable

7:45 mrchance: and thanks for the ^:replace stuff. I'll try it out

7:55 gfredericks: elvis4526: you passed the symbol map to postwalk

7:55 because of the quote on line 9

7:56 ,(clojure.walk/postwalk #(if (list? %) "" %) 'map)

7:57 clojurebot: #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 "...

7:57 gfredericks: ,(require 'clojure.walk)

7:57 clojurebot: nil

7:57 gfredericks: ,(clojure.walk/postwalk #(if (list? %) "" %) 'map)

7:57 clojurebot: map

8:27 borkdude: I am adding type hints to this call: (PutObjectRequest. ^String bucket key ^String file)

8:27 but I'm still getting "call to constructor cannot be resolved"

8:28 argh, File

8:28 hmm, still not working when changed to file

8:29 whoops

8:29 I forgot one I see. fixed

9:09 timvisher: lein is consistently attempting to retrieve `-SNAPSHOT` deps from all repos (including `releases`) and non `-SNAPSHOT` deps from all repos (including `snapshots`).

9:09 specifically for our private repo

9:10 i 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`.

9:10 is that not the case?

9:10 specifically, i want to avoid trying to retrieve released deps from `snapshots` and snapshot deps from `releases` (because obviously they're not there)

9:11 noncom: people who have used Neo4j with clojure, tell me please, what should i use, neocons or borneo for the db driver lib?

9:17 timvisher: !rng neocons|borneo

9:17 heh. this isn't #nethack...

9:17 ,(doc rand-nth)

9:17 clojurebot: "([coll]); Return a random element of the (sequential) collection. Will have the same performance characteristics as nth for the given collection."

9:17 timvisher: ,(rand-nth ["neocons" "borneo"])

9:17 clojurebot: "borneo"

9:18 timvisher: borneo it is :)

9:23 bah

9:23 i do not understand classpaths

9:23 this much is clear

9:24 where can i go to read about this?

9:25 mrchance: timvisher: 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

9:26 John-kkk: 3b FREE STEAM GAMES http://tinyurl.com/ptv3gfv

9:27 mrchance: timvisher: 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

9:27 TEttinger: doesn't sound like spam at all!

9:27 mrchance: TEttinger: I know, right? Let's totally click that!

9:27 kaiyin: https://gist.github.com/kindlychung/d8fe3270366dbda4703c why do i keep getting this error?

9:28 timvisher: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L94-L95

9:29 mrchance: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L94-L95

9:29 setting those keys manually as well doesn't seem to change anything

9:30 but that's where i'm getting my info from

9:33 noncom: kaiyin: coz your filter predicate on line 85 accepts 0 args

9:33 kaiyin: but filter tries to pass 1 arg to it

9:34 kaiyin: oh. i see.

9:35 noncom: also, 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

9:35 kaiyin: noncom: cool, thanks

9:38 mrchance: timvisher: hm, ok, in that case I don't know ^^

9:40 noncom: timvisher: uh, and i went with neocons as of now.. based on same random choice :)

9:40 kaiyin: hey, what's the wumpus game btw?

9:41 justin_smith: borkdude: 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"

9:41 noncom: will it be playable anytime?

9:42 borkdude: justin_smith I figured it out via native Java for now

9:42 justin_smith: OK

9:42 borkdude: justin_smith is it true that you have to set the content-type manually when uploading files to s3?

9:42 kaiyin: noncom: it's a dummy game from the land of lisp book. :)

9:43 justin_smith: borkdude: I always have

9:43 borkdude: ok

9:44 noncom: kaiyin: 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..

9:45 justin_smith: noncom: hunt the wumpus is an old school unix classic text UI game

9:47 noncom: oh.. i totally missed all that stuff..

10:51 jaspp: Can 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:52 What's the functional thought process when looking at this..?

10:54 mgaare: jaspp: try to think about the end result and define it in terms of the input, first

10:54 hyPiRion: jaspp: 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:54 And converting :col1 to "col1" is independent of converting :up to "up"

10:55 also, a good tip

10:55 ,(require '[clojure.string :as s])

10:55 clojurebot: nil

10:55 hyPiRion: ,(s/join ", " ["foo" "bar" "baz"])

10:55 clojurebot: "foo, bar, baz"

10:56 timvisher: hyPiRion: can you describe how i would go about removing side-effecty tests from my classpath in lein?

10:56 if you've got a moment?

10:56 my 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:57 but when i do that, the whole classpath seems to go bananas and the tests can't find anything

10:57 hyPiRion: timvisher: that sounds like a bug

10:57 jaspp: mgaare: not quite sure what you mean.

10:58 hyPiRion: timvisher: so if you have {:profiles {:foo {:test-paths ["another-test-path"]}}} and you do `lein with-profile +foo test` it just borks up?

10:59 mgaare: jaspp: 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:59 timvisher: hyPiRion: 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:00 i.e. path-roots assoc their contents at the classpath root? (← is my mental model of classpaths...)

11:00 mgaare: jaspp: it starts to naturally bring out the breakdown of operations involved, describing it like that

11:01 hyPiRion: timvisher: yes

11:01 Licenser: Good 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:01 timvisher: hyPiRion: _excellent_. i will see if i can produce a minimal example project then that exhibits this behavior.

11:01 and submit it as an issue if i can :)

11:01 mgaare: Licenser: perhaps a gist?

11:02 jaspp: mgaare: thanks.

11:02 hyPiRion: timvisher: thanks!

11:02 Licenser: mgaare 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:02 jaspp: hyPiRion: thanks

11:03 Licenser: the sort-and-paginate (which handles sorting, filtering and pagiation) seems to take ~10ms

11:03 hyPiRion: np

11:04 sobel: Licenser: for what data size?

11:06 Licenser: the list is 15 elements bytes long but the underlying data are ~20kb of json

11:07 but the whole 20kb ar't rndered

11:07 Glenjamin: Licenser: it's tricky to tell, as i'm more used to react than om

11:08 but i think you need a key prop on the list of elements

11:08 so react knows to re-order, instead of rebuild

11:08 Licenser: Glenjamin that's an itneresting pointer let me try that

11:08 sobel: 20k is how many elements?

11:08 Licenser: 15

11:08 Glenjamin: i 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:10 Licenser: there seems to be a :react-key call

11:10 s/call/keyword/

11:14 Glenjamin: sounds like the one

11:14 Licenser: thanks mate I'll investigate that!

11:15 jaspp: mgaare: hyPiRion: (s/join ", " (map #(->> % (map name) (s/join " ")) [[:a :b] [:c :d] [:e]]))

11:15 mgaare: hyPiRion: => "a b, c d, e"

11:16 justin_smith: jaspp: I think I would replace your nested map with a mapcat before doing the string/join

11:17 err, (mapcat #(map name ...) ...)

11:19 jaspp: justin_smith: thanks for the tip, will try that.

11:34 noncom: did anyone use neocons for neo4j? i have a simple question on querying relations

12:07 geirby: hello

12:07 mavbozo: hello

12:08 justin_smith: ~hello

12:08 clojurebot: BUENOS DING DONG DIDDLY DIOS, fRaUline justin_smith

12:08 * Bronsa chuckles

12:09 justin_smith: http://thebarking.com/wp-content/uploads/2014/09/lionel-poster.jpg

12:10 geirby: is there a way to fix a staircased code? I ended up having "(reduce ...(assoc ..(reduce ... (assoc (reduce ..." when transforming a map

12:10 justin_smith: geirby: -> / ->> help a lot

12:10 as do let blocks

12:10 let in clojure is like let* in other lisps, you can refer back to prior definitions

12:11 geirby: cheers, I'll give it a try

12:12 sobel: so, recommendations on logging approaches/tools?

12:12 justin_smith: sobel: timbre is good

12:13 sobel: what's idiomatic for logging? when i wrote OO i just littered my member fcns with log stmts

12:13 is there some clever trick that's clojury i might not think of as a noob?

12:14 justin_smith: why would it requier a trick? logging is by definition imperative

12:15 I mean there are things like doto that act on a thing and then return the thing, I guess

12:15 ,(doto 42 println)

12:15 clojurebot: 42\n42

12:16 sobel: hafta ask

12:16 gfredericks: sobel: I sometimes use aspect-oriented tactics to logging

12:16 like you can do a lot via alter-var-root

12:16 or the robert.hooke lib

12:17 sobel: gfredericks: 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:17 justin_smith: (doc alter-var-root)

12:17 clojurebot: "([v f & args]); Atomically alters the root binding of var v by applying f to its current value plus any args"

12:18 justin_smith: sobel: so you repleace foo with a function that logs, then calls foo with the args, then logs again. maybe

12:18 sobel: ah ok

12:18 gfredericks: sobel: I think it's probably worth jumping straight to robert.hooke though

12:18 sobel: i'm starting to agree with that

12:18 gfredericks: alter-var-root has too many pitfalls to bother with

12:18 mainly figuring out how to not accidentally wrap your function twice

12:19 sobel: i don't need more language risk at this point

12:19 :)

12:19 justin_smith: gfredericks: does it provide a way to undo the wrapping? that's another gotcha with alter-var-root

12:19 gfredericks: justin_smith: totes

12:19 permanently or temporarily

12:20 justin_smith: gfredericks: 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:21 I mean naturally you would use apply if you are using alter-var-root

12:21 gfredericks: so natural

12:22 sobel: alrighty, i remember reading about robert.hooke and thinking it was a lot more than i needed but it's very attractive now

12:23 gfredericks: I wish there was a good structured logging library that also had a set of helpers hooks or something for that kind of use

12:23 justin_smith: sobel: it's actually a pretty small lib, LOC wise

12:23 gfredericks: I've thought about it some though and am not sure what a good API for that would be

12:23 justin_smith: gfredericks: doesn't timbre have some of that?

12:24 arohner: I'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:24 justin_smith: gfredericks: no, there's something else I was thinking of...

12:24 gfredericks: justin_smith: is timbre even structured?

12:25 justin_smith: I don't think so

12:25 gfredericks: then I don't even

12:25 justin_smith: gfredericks: so you're thinking of maybe timbre + structured + tools.trace ?

12:25 gfredericks: well you'd want a lot of options around how you attach logging to a function

12:26 in terms of before/after, how you decide which args+return to log, what about exceptions

12:26 sobel: the naming puns in clojure-land are pretty much consant amusement for me.

12:27 wes_: Hello

12:27 justin_smith: ~hello wes_

12:27 clojurebot: It's greek to me.

12:29 wes__: So, when I do lein run, my -main function fails to find my other functions (in the same file). Why is this?

12:29 gfredericks: justin_smith: and I feel like any decent such lib would have to like copypaste its serializer too, whether json or edn

12:29 wes__: what's the error message?

12:29 justin_smith: wes__: something else is wrong

12:30 wes__: Attempting to call unbound fn: #'myapp.core/make-new-frame

12:30 justin_smith: wes__: how and where do you define make-new-frame?

12:31 wes__: just below (defn -main ...)

12:31 justin_smith: wes__: that doesn't work

12:31 wes__: oh, it compiles from the top down?

12:31 justin_smith: yes

12:32 wes__: so that the repl and files will work the same way

12:32 it actually simplifies things in that way

12:35 sobel: justin_smith: do you know/see any reason why i couldn't use timbre and robert.hooke together?

12:35 wes__: ok. What do you do if you have two mutually recursive functions? They call each other. Won't you get errors?

12:36 justin_smith: wes__: for mutual recursion we have letfn or declare

12:36 sobel: seems like you could combine them, sure

12:36 sobel: imperative logging, integrated as aspects

12:36 justin_smith: sobel: and throw in cheshire to make the nifty thing gfredericks wants maybe :)

12:37 sobel: great. 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:37 justin_smith: gfredericks: actually, yeah, I bet we could combine timbre, cheshire, and robert.hooke to make a really easy aspect oriented structured logger

12:37 it would be straightforward I think

12:38 sobel: glad we could help

12:38 sobel: ah, i have no need for JSON output right now. this needs to be human readable.

12:38 wes__: Thanks for the help, Justin

12:38 justin_smith: then surely you'll want XML then

12:38 * justin_smith supresses a giggle.

12:38 justin_smith: wes__: np

12:38 sobel: now that's just inhumane

12:38 justin_smith: you're the one who brought up "human readable"

12:38 haha

12:39 sobel: =)

12:40 gfredericks: log in json, get human readability w/ jq

12:40 justin_smith: gfredericks: fuck it, I'm gonna try making that logging lib.

12:40 gfredericks: justin_smith: yeah, fuck it.

12:41 justin_smith: make sure to paste in the cheshire code so you can provide default seralizations

12:41 justin_smith: huh?

12:41 why would that require pasting?

12:42 gfredericks: so you don't stomp on the user's ability to use cheshire for something else

12:42 justin_smith: is this some terrible thing about cheshire I am about to learn?

12:42 ahh

12:42 gfredericks: nothing you didn't already know

12:42 just that its extension points are global modifications yay

12:42 same as clj's printer

12:42 justin_smith: gfredericks: I wonder if I can use locally derived heirarchies for this

12:42 since they are multimethods, right?

12:42 gfredericks: uhms

12:42 justin_smith: and you can make local heirarchies

12:43 gfredericks: I mean regardless you have to paste

12:43 even ifcheshire does work that way which I doubt

12:43 because the hierarchy is fixed with the multimethod

12:44 justin_smith: I'd have to make derived multimethods...

12:44 gfredericks: if you wanna go down the rabbit hole, write a json lib that lets you pass in opts for how to convert various objects

12:44 justin_smith: hrphm

12:44 yeah

12:44 good point, thanks

12:44 gfredericks: while you're at it do an edn lib

12:44 or go down another rabbit whole and try to write one lib that does both

12:44 hole*

12:45 justin_smith: gfredericks: I just had coffee, not crack

12:45 thanks for the ideas though :)

12:45 haha

12:45 gfredericks: aaand this is why I haven't written a logging lib yet :P

12:45 justin_smith: gets ugly doesn't it

12:45 yeah

12:45 sobel: logging is on my short list for, "you'll shoot your eye out, kid"

12:45 it is...more than meets the eye

12:45 gfredericks: but pasting cheshire is a quicker way to getting the logging lib

12:46 justin_smith: gfredericks: what about clojure.data.json?

12:46 gfredericks: ...or paste that

12:46 c.d.j extends the same way

12:46 it is The Clojure Way

12:47 you make a global thing and tell people to punch it

12:47 justin_smith: gfredericks: 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:47 gfredericks: yeah if you want to walk every dang thing that gets logged, that is a feasible approach

12:48 justin_smith: you could provide walked and unwalked, with the proper caveats

12:48 I mean, creating json out of clojure data is already a tree walk

12:48 * sobel backs away slowly

12:49 justin_smith: gfredericks: now I am thinking this thing needs to be named after a cross of paul bunyon and a monkey

12:50 sobel: i thought all clojure libraries started with theme and inspiration as foundation

12:50 it's a lot harder to snark about clojure tools. this is harder than i thought.

12:51 justin_smith: heh

12:51 sobel: python+friends were fish in a barrel, i tell ya

12:51 justin_smith: is obscure-reference already taken?

12:51 (may as well go meta)

12:51 sobel: hehe

12:53 justin_smith: lein new abstruse

12:53 $dict abstruce

12:53 lazybot: justin_smith: Word not found.

12:53 sobel: so 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:53 justin_smith: :P

12:53 $dict abstruse

12:53 lazybot: justin_smith: adjective: Difficult to understand; recondite. See Synonyms at ambiguous.

12:53 sobel: oh, i like recondite

12:53 that should be a library

12:54 justin_smith: $dict recondite

12:54 lazybot: justin_smith: adjective: Not easily understood; abstruse. See Synonyms at ambiguous.

12:54 justin_smith: haha, they point to each other

12:54 (inc sobel)

12:54 lazybot: ⇒ 1

12:54 justin_smith: recondite is a good name for it

12:54 sobel: there is already a C++ library called Recondite

12:55 justin_smith: sobel: technomancy worked on serializable functions if that's what you mean about clojure from a database

12:55 https://github.com/technomancy/serializable-fn

12:57 Frozenlock: https://github.com/Frozenlock/force-serialize

12:57 :-p

12:57 sobel: justin_smith: that is really nice. i figured, even without that, it would be viable to eval from db resultsets

12:57 justin_smith: Frozenlock: wow, the readmes are like the same...

12:57 sobel: hehe

12:58 justin_smith: ahh, now that I look closer, I get it

12:58 Frozenlock: "An almost exact copy of serializable-fn."

13:00 wes__: 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:00 justin_smith: wes__: when you uberjar, two jars get made

13:00 only one of them is the actual uberjar

13:01 sobel: imho: it should not build the dep-free jar unless you explicitly flag it

13:02 justin_smith: sobel: it builds the dep free one as an intermediate step. The choice is whether to delete it or not.

13:02 sobel: ah ok

13:02 wes__: I've tried the one in uberjar and uberjar+uberjar, but neighter work

13:02 neither

13:03 justin_smith: did 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:04 if you turned on gen-class or aot it should be set up to just run with java -jar your-uber.jar

13:04 sobel: my project was generated with :gen-class

13:05 what is the meaning of (:gen-class) ? is it calling a key?

13:05 justin_smith: sobel: ns turns things like (:require ...) and (:gen-class) into function calls

13:05 sobel: ah right, because those are lists until the called context evals them

13:06 mental compile still in static mode

13:06 compiler

13:15 Licenser: So 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:22 timvisher: is it possible to combine test.check with midje?

13:22 i.e. can test.check generate facts?

13:23 reiddraper: timvisher: think there are some examples here http://zotskolf.nl/2014/11/10/testcheckbasics.html

13:24 timvisher: reiddraper: neat! i wonder if i ever would have thought to assert against the results of quick-check :)

13:24 (inc reiddraper)

13:24 lazybot: ⇒ 6

13:25 gfredericks: clojurebot: reiddraper is underrated

13:25 clojurebot: Ok.

13:25 mavbozo: (inc reiddraper)

13:25 lazybot: ⇒ 7

13:26 * reiddraper blushes

13:59 wes__: So, turns out: If you build an uberjar with JRD8, it MAY not run on a system with JRE6

14:00 justin_smith: wes__: using java code, or pure clojure?

14:00 wes__: pure clojure

14:00 well... maybe not

14:00 justin_smith: that's a bug then

14:00 maybe not pure clojure?

14:00 gfredericks: we've had a guy doing an 8->7 build and it only broke when we added java code

14:00 wes__: I used PDFBoxing which is a wrapper of PDFBox and Seesaw

14:01 justin_smith: Seesaw is just using built in classes

14:01 is PDFBox jre6 compatible?

14:01 wes__: yep, it works when I compiled with jre6

14:01 justin_smith: OK, you found a bug in clojure then

14:03 wes__: So, by pure clojure you mean not using PDFBox right?

14:03 justin_smith: no

14:03 I mean not using any java source

14:03 only java that's been compiled in a way that is 1.6 compatible

14:03 wes__: Ok, thanks again

14:04 justin_smith: wes__: 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:04 timvisher: reiddraper: man. thank you for test.check and for how you return a map instead of printing something when it succeeds. _good job_ :)

14:05 wes__: oh, ok. I understand now

14:05 timvisher: (inc data)

14:05 lazybot: ⇒ 1

14:05 wes__: I'll submit a ticket

14:05 timvisher: (inc-lots data)

14:06 Bronsa: wes__: what's the issue?

14:07 wes__: 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:10 Bronsa: wes__: yes I got that, but what do you mean by "it would not work"? :)

14:10 what error did you get?

14:11 wes__: My main class could not be found.

14:11 Could not find or load main class: pdf-merger.core

14:11 Bronsa: have you tried "pdf_merger.core" instead?

14:12 justin_smith: wes__: what happens if you try my previous suggestion of "java -cp your-uber.jar clojure.main -m pdf-merger.core"

14:12 wes__: I'm sorry, that's what it said. "Could not find or load main class: pdf_merger.core"

14:14 <justinc_smith> "Exception in thread "main" java.lang.NoSuchMethodError: java.awt.Component.revalidate()U"

14:15 Something to do with Seesaw?

14:15 justin_smith: wes__: is the 1.6 jre a headless jre?

14:15 no, because you made it work, never mind

14:16 wes__: I'm sorry, I'm kinda new. What do you mean by headless jre?

14:16 justin_smith: a jre that ships without any of the desktop related stuff (meant for servers), a common default on linux systems

14:17 wes__: I would say no. This is jre6 is installed on all our desktops and laptops

14:17 justin_smith: probably the mac default jre yeah?

14:18 wes__: Besides, it worked once I compiled with JRE6 vs JDK1.8.0_25

14:18 No, Windoze

14:19 justin_smith: right, OK

14:20 wes__: So, it's a clojure bug? or an inconsistancy between JDK1.8 and JRE6

14:20 justin_smith: wes__: the jre isn't outputting the bytecode, clojure is

14:20 clojure is explicitly compatible with jre6

14:21 so it's a clojure bug if it outputs things that are not compatible

14:21 wes__: So, you are saying that it shouldn't matter if I was using JRE6 or JDK1.8

14:21 justin_smith: right, because clojure isn't using the java compiler, it has its own embedded bytecode emitter

14:21 wes__: got it. Thanks

14:22 justin_smith: and if that is doing different things with different jres, that's a problem

14:22 Bronsa: justin_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:22 justin_smith: Bronsa: ahh, a poorly behaved lib might do that huh

14:23 Bronsa: justin_smith: wes__ this is probably what's going on actually

14:23 java.awt.Component.revalidate was added in 1.7

14:23 justin_smith: Bronsa: so would this happen in seesaw, or in one of its java deps?

14:24 open question, I don't really expect you to know off the top of your head :)

14:24 Bronsa: https://github.com/daveray/seesaw/blob/31f7e8f6af46c1c9856d3f9d8bb427a0868fbc07/src/seesaw/layout.clj#L29-L34

14:24 this should not work with 1.6 at all

14:25 justin_smith: maybe the type hint ends up working differently in 1.6? weird

14:25 Bronsa: ok I think I know what's happening

14:25 cespare: what 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:25 Bronsa: when compiling to 1.6 the method cannot be resolved

14:25 and the call ends up using reflection

14:25 wes__: I didn't use layout. Just seesaw.chooser, seesaw.dnd and seesaw.core

14:25 Bronsa: it would fail at runtime

14:25 justin_smith: cespare: in clojure.test a test is a var with the :test metadata set

14:26 cespare: "test ns" is a convention that clojure.test is agnostic to

14:26 cespare: justin_smith: ok maybe this is a question about lein test then

14:26 justin_smith: Bronsa: that would do it

14:26 Bronsa: when 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:27 justin_smith: cespare: 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:27 cespare: it'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:27 Bronsa: wes__: doesn't matter, maybe one of those ns requires seesaw.layout

14:27 cespare: justin_smith: yeah there's some kind of problem with records being redefined

14:27 justin_smith: cespare: I still don't know what "running and ns" means

14:28 *running an ns, sorry

14:28 Bronsa: wes__: the bottom line is that seesaw requires jdk 1.7 to run

14:28 cespare: justin_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:28 only test helper functions

14:29 justin_smith: cespare: something in that ns created a var with the :test metadata

14:29 cespare: justin_smith: nope.

14:30 justin_smith: cespare: that's the only way that clojure.test would run tests for that ns

14:30 cespare: justin_smith: at least, it does not have "deftest" nor ":test" in it.

14:30 Bronsa: doesn't lein test run all namespaces under :test-paths?

14:30 cespare: justin_smith: it's not about running tests; there are none; it's about evaluating that file twice

14:31 justin_smith: ahh, so a defrecord is being redefined?

14:31 cespare: yes

14:31 the error is "foo.bar cannot be cast to foo.bar"

14:31 justin_smith: right, redefined record

14:32 lein should be using require, is something in one of your namespaces using load?

14:33 cespare: justin_smith: no, but it does :import a class definition of the record in question

14:34 justin_smith: cespare: is the class required in the same ns?

14:34 sorry, the ns that creates that class

14:34 cespare: yes

14:34 justin_smith: that shouldn't be an issue at all then

14:38 cespare: well, the fix for now seems to be moving all of our test helper stuff out of test/ into src/

14:38 justin_smith: interesting

14:39 I would create a separate path before putting it in src/ myself, but that's just style

14:39 cespare: oh, now I get it

14:39 cespare: here's the deal: lein will load all .clj files under test/ in order to make sure all :test vars are defined

14:40 cespare: somehow I guess the namespace didn't get properly registered, so that require reloaded the file (this is the weird part)?

14:40 I know that lein will run tests where the namespace defined in the ns form does not match the file path, without complaint

14:40 (I know this from a history of being dum)

15:06 cespare: justin_smith: a trivial project with a helper namespace in test/ and a single test that requires that ns double-evals the test ns

15:07 justin_smith: cespare: that seems like it would be fixable...

15:10 gfredericks: justin_smith: what's all this "without transposition" nonsense

15:10 justin_smith: gfredericks: a just intoned scale is made of pitches that have base frequencies that are all in the same harmonic series

15:10 but they are transposed to all be in one octave

15:11 but the notes in taps are just all in one series

15:11 unless I am mistaken...

15:11 gfredericks: okay so you're not talking about the order of the notes at least

15:11 just the notes as a set

15:11 justin_smith: right, just presence or absence in the set of notes

15:11 right

15:11 gfredericks: okay yeah that makes sense

15:11 justin_smith: taps is made to be playable on a valveless brass instrument

15:12 gfredericks: exactly I was just typing that out

15:12 justin_smith: which means it has to only have fundamentals that are in a single harmonic series (that of the tube played)

15:13 fascinating 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:13 most sound making things don't follow any of these rules

15:13 gfredericks: when an instrument is named for a particular key does that imply it's not tuned with equal temperment?

15:14 justin_smith: there'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:14 gfredericks: equal temperment is about ratios

15:14 TimMc: clojurebot: the internet is a series of misunderstood tubes

15:14 clojurebot: Roger.

15:14 justin_smith: the name of the key is the name of the note on the piano that it aligns with

15:14 gfredericks: sure I know what it is

15:15 I'm talking about e.g. a B-flat trumpet

15:15 and why it's useful to even categorize instruments that way

15:15 justin_smith: gfredericks: 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:15 err, first part of that was misstated, sorry

15:15 s/not equally tempered/not just intonation/

15:16 gfredericks: the fretted instruments are inherently equal aren't they

15:16 justin_smith: no, they are not tempered at all

15:16 they are terrible hacks

15:16 most notes on them are out of tune, unless you do bends

15:16 gfredericks: what about a 1-string guitar

15:17 justin_smith: good luck with chords...

15:17 gfredericks: must be equal temperment

15:17 look at all those perfectly spaced frets

15:17 justin_smith: sure, 1 string guitar, with good fret placement and very good neck design could maybe pull it off

15:17 in practice they are hacks

15:17 gfredericks: what aspect of it is not equal?

15:18 justin_smith: the 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:18 gfredericks: I'm still asking about a 1-string guitar

15:18 why is it not naturally equal temperment

15:19 justin_smith: OK, 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:19 gfredericks: sure there are variables, but assuming equal ratio'd frets, isn't equal temperment the default behavior?

15:20 justin_smith: gfredericks: what I am saying is in practice with mortal players, those noise sources are bigger than the difference between equal / just tunings

15:20 gfredericks: that's fine I'm thinking of platonic guitars

15:20 assume a spherical mass rolling on a frictionless plane

15:20 justin_smith: gfredericks: with a perfectly skilled virtuoso, and different fret placement on each string (wiggly frets), you could pull it off

15:21 gfredericks: there's only one string

15:21 justin_smith: I actually know people with wiggly frets on their guitars

15:21 sorry, yeah, it could be fine with one set of frets

15:21 gfredericks: okay so there's nothing *inherently* not-equal temperment about a 1-string guitar with normal frets

15:21 justin_smith: sure

15:21 gfredericks: phew

15:22 justin_smith: but your fret spacing would need to be customized for string stiffness

15:22 a different brand / size of string would require new fret spacing

15:22 for example

15:22 gfredericks: varying ratios? or a different constant ratio?

15:22 justin_smith: because the resistence to displacement is different, and the amount of tension added by displacement is different on different frets

15:23 gfredericks: 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:24 in practice, beyond a certain degree of accuracy in intonation, a guitarist needs as much skill as eg. a violinist

15:24 anyway, none of this is clojure, sorry :)

15:24 gfredericks: anyhow my original question was about why you name an instrument after a particular key

15:25 is that *only* done if the instrument is not equally tempered?

15:25 justin_smith: because if you play not x as trained on that instrument, you play note y in real life

15:25 gfredericks: ignoring the convention of naming the notes differently

15:26 justin_smith: it'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:26 so only the composer / arranger needs to get a headache

15:26 and not the player

15:26 gfredericks: assuming no player ever tries to play something intended for a different instrument :)

15:26 why would that ever happen

15:27 justin_smith: gfredericks: you use sheet music written for that instrument's transposition

15:27 gfredericks: I know

15:27 man I'm having a hard time getting at the root of my question

15:27 but fingerings is an interesting aspect

15:28 so 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:28 justin_smith: yeah

15:29 gfredericks: just to mantain brass-instrument-coherency

15:29 justin_smith: right, it's enough to require musical virtuosity, no need to require they become mathematicians too

15:29 gfredericks: that makes sense

15:30 this 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:31 I guess if your ear is sensitive enough you can't ignore it

15:31 justin_smith: given enough specialists, amazing things can be achieved

15:31 gfredericks: those poor tortured souls

15:34 justin_smith: There'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:40 oddcully: justin_smith: got cut around ... few "best" fl

15:40 justin_smith: ahh I think you can make a direct

15:40 comparison to food - european food looking for a few "best" flavors and combining

15:40 like with like, and eastern food looking for maximal variety, and combining for

15:40 contrast.

15:41 oops, sorry

15:57 donkey_boy: hi everyone

15:57 burn all jews in oven

15:57 death to infidels

15:57 allahu akhbar

15:57 justin_smith: hey amalloy you around?

15:58 donkey_boy: allahu akhbar

15:58 death to infidels

15:59 timvisher: is it possible to affect the error message that midje delivers?

15:59 preferably with a function that gets passed the failing value?

15:59 donkey_boy: timvisher you foul infidel jew

15:59 you should be stoned to death

15:59 allahu akhbar

16:00 amalloy: justin_smith: pong

16:00 justin_smith: amalloy: I think donkey_boy wants to be kicked off the channel

16:00 uris77: yeah, I ignored him already

16:00 oddcully: there are some kickbans to share

16:01 donkey_boy: justin you foul infidel you daughter should be beaten to death with a baseball bat

16:01 because you are an infidel

16:01 allahu akhbar

16:01 oddcully: donkey_boy: it is `your`

16:01 oh

16:01 ntaylor: hah

16:01 oddcully: (inc amalloy)

16:01 lazybot: ⇒ 250

16:01 ntaylor: I expected better from the Finnish educational system :(

16:02 timvisher: i'm asking because i'd like to midje to spit out the the `:smallest` value in the error message.

16:02 oddcully: there are bad apples everywhere

16:02 justin_smith: thanks

16:03 timvisher: looks like it might involve implementing a plugin: https://github.com/marick/Midje/wiki/Customizing-reporting

16:16 donkey_boy: 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 all jews in oven burn

16:16 all 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:16 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 all jews in oven

16:16 allahu akhbar

16:16 death to infidels

16:16 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:17 Seylerius: Ban time, I figure.

16:17 hyPiRion: amalloy: I think you need to do more than just kick them

16:17 Seylerius: (inc amalloy)

16:17 lazybot: ⇒ 251

16:17 amalloy: yeah. i was hoping i wouldn't need to remember how to do bans properly

16:19 hopefully that holds up

16:19 hyPiRion: I think I've seen that exact nick doing this previously, so I guess it will

16:20 oddcully: who cares... some drunk kiddo

16:20 he wont come back anyway or else his client would have reconnected him already

16:38 TimMc: amalloy: I've never been able to find documentation on how to ban properly.

16:38 amalloy: TimMc: i found some a while ago, i just don't have to do it often and forget

16:38 plus it's like, you have to choose. i don't want to do IP bans if i can help it

16:39 ghadishayban: bbloom: your CSP tweet really resonated.

16:40 bbloom_: ghadishayban: yeah, i'm writing some go right now ... it feels true :-P

16:40 ghadishayban: concurrency assembly

16:41 TimMc: What was the twert?

16:41 bbloom_: alt/alts/select multiplexing on queues is really all i want out of CSP

16:44 justin_smith: ghadishayban: bbloom_: TimMc: this tweet? https://twitter.com/BrandonBloom/status/583068350034485249

16:44 bbloom_: yeah

16:45 justin_smith: good discussion there

16:48 sritchie: I’d be stoked if cljx could figure out how to delete generated files for which there’s no cljx source

16:48 clojurebot: It's greek to me.

16:49 sritchie: when switching branches, for example

16:51 bbloom_: sritchie: good news. feature expressions are coming.

16:51 sritchie: ah, yeah, no gen

16:51 so good!

17:01 nicksellen: I'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:06 justin_smith: nicksellen: you would need to shut down the core.async thread pool, because a go loop doesn't belong to a single thread

17:06 nicksellen: justin_smith: can I access that thread pool?

17:06 justin_smith: nicksellen: 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:07 nicksellen: sure, the thread pool is defined in core.async, but shutting it down would mean shutting down all core.async

17:07 sobel: so, [robert.hooke :as bob]

17:07 awesome or awesomest?

17:07 gfredericks: it's the best

17:07 nicksellen: justin_smith: thats exactly what I want to do :) the requirement is to *completely* remove a clojure environment (and then close the classloader).

17:08 justin_smith: nicksellen: 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:08 if you are accessing clojure via java, you probably know how to do that already

17:09 nicksellen: see also clojure.core/shutdown-agents if you used agents/futures at all

17:09 nicksellen: yes, I was calling shutdown-agents already.

17:09 just trying out the new thing, excited!

17:10 although I wonder if there is other things that need shutting down too... or libraries/code could arbitary create executors etc

17:11 justin_smith: nicksellen: that should be it for vanilla clojure - we'd know because those pools would prevent our jvm shutdown

17:11 of course any lib that wants to can create executers or threads to do whatever

17:18 nicksellen: justin_smith: success :)

17:18 justin_smith: awesome

17:20 oddcully: (inc justin_smith)

17:20 lazybot: ⇒ 230

17:21 nicksellen: although it feels quite dirty accessing clojure.core.async.impl.exec.threadpool/the-executor directly

17:21 (clojure.core/shutdown-everything) would be nice :)

17:21 justin_smith: nicksellen: it didn't provide an abstraction for that though, so...

17:22 nicksellen: justin_smith: what didn't?

17:23 justin_smith: core.async didn't

17:23 nicksellen: ah yeah, well, or just in core generally. could have (clojure.core/register-shutdown-hook)

17:23 justin_smith: just 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:24 nicksellen: clojure is quite absent of hooks in general (unless watches count I guess)

17:24 clojure.core at least

17:24 nicksellen: hmm I wonder if Runtime.addShutdownHook can be triggered on classloader closing

17:25 I'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:39 dxlr8r: is 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:39 justin_smith: dxlr8r: for is lazy

17:39 you need to consume its output or else it won't do anything

17:40 doall is available if you need to force early consumption, or doseq if you don't actually need the output

17:40 dxlr8r: hmmm, the problem is that the body returns nil...

17:40 justin_smith: dxlr8r: then you get a list of nils

17:40 ,(for [x (range 3)] nil)

17:41 clojurebot: (nil nil nil)

17:41 dxlr8r: it is very weird.... it works from the repl, but not from inside a function

17:41 with for

17:41 justin_smith: but 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:41 ystael: dxlr8r: in the repl the result is forced to print it

17:41 justin_smith: dxlr8r: the repl forces evaluation because printing consumes the value

17:42 the only difference of for and doseq is doseq allows multiple body forms

17:42 (and returns nothing and is not lazy, of course)

17:42 dxlr8r: ahhh, ok. understood the lazy thing. was just confused when it worked from repl

17:57 unrelated... 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:57 justin_smith: dxlr8r: you can use those things as let bindings, as long as it is unambiguous

17:57 but it is an easy way to introduce future errors if you forgot you did it

17:58 dxlr8r: yeah, I know

17:58 justin_smith: eg. I used to do that with count, but got too many bugs, so I started using other names like size

17:58 dxlr8r: I tried finding new names, but all where taking :P

17:59 justin_smith: hehe

17:59 there's always putting a _ or ' on the end

17:59 dxlr8r: it where a range... so I though, yeah, call it array... taken too :/

17:59 seq?

17:59 etc :P

17:59 never got a good name for it

17:59 justin_smith: lst is a classic

17:59 dxlr8r: ahhh

18:00 noncom|2: dxlr8r: 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:00 justin_smith: as is coll

18:00 noncom|2: for list, yeah, i often use lst and coll too

18:00 dxlr8r: yeah, used coll for other stuff

18:00 justin_smith: depending on your coworkers accents, you may get way with cnt for count, but probably best to avoid that one

18:00 dxlr8r: but there is no defacto? better to find a new name than suffix's etc?

18:01 haha :P

18:01 justin_smith: l is also good for collections

18:01 dxlr8r: don't like single char bindings

18:01 seldom use them

18:01 justin_smith: rst if it came off the end of something

18:01 dxlr8r: but as I said. any defacto standards?

18:01 justin_smith: x if it really doesn't matter what kind of thing it is you are just passing it along

18:02 dxlr8r: will remember rst, coll I already use, and lst :)

18:02 justin_smith: l and rst and x and coll are all standards

18:02 f

18:02 dxlr8r: use x for testing of code, but not in prod

18:02 justin_smith: (if callable)

18:02 Bronsa: f g and h for callables

18:02 justin_smith: right

18:02 Bronsa: even though i sometimes use f for first in destructuring

18:02 dxlr8r: I use this guide: https://github.com/bbatsov/clojure-style-guide#naming

18:03 Bronsa: (loop [[f & rs] coll] ..)

18:03 dxlr8r: put says nothing about pre or suffixing

18:03 but

18:03 justin_smith: patchwork gets all creative sometimes, like using "skein" as a name for something gathered up from multiple sources

18:03 or jopotonio where the name really doesn't matter

18:03 patchwork: That is a perfectly reasonable variable name

18:03 justin_smith: :)

18:04 oddcully: i thought skein was beaten with a baseball bat?

18:05 dxlr8r: english 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:05 justin_smith: patchwork: oh wow, one of the synonyms for skein is "winning streak"

18:06 patchwork: Right, all of my variable names are synonyms for "winning streak"

18:06 justin_smith: also, skein relations are a concept in knot polynomials

18:07 haha

18:07 TIL there are knot polynomials

18:07 dxlr8r: cool, you people actuallt work with clojure. have NEVER ever seen a job ad with that in norway

18:07 patchwork: Yeah I knew that one. Math has already claimed all the great general collective nouns

18:07 dxlr8r: all .NET, Java and some PHP here

18:08 justin_smith: dxlr8r: we only got clojure jobs at first because patchwork snuck it into his workspace, then it flourished and I got hired

18:08 dxlr8r: nice :)

18:08 from the US?

18:08 justin_smith: yeah

18:08 dxlr8r: nice

18:08 I learned clojure because I wanted to something hard :P

18:09 learn something new

18:10 oddcully: dxlr8r: haha, i always ridiculed lisp for the ((((((()))))))))... that is why i _try_ to learn clojure

18:10 dxlr8r: now everything sucks in comparison

18:10 justin_smith: dxlr8r: oh, another name (from the common lisp world) is e or el for an element in a collection

18:10 and acc for the argument that gets built up in a reduce

18:10 dxlr8r: hehe :P better with (((((())))))) that ({({})})

18:11 I am actually noting this down justin_smith :P

18:13 all 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:14 justin_smith: it's a laudible goal

18:14 oddcully: dxlr8r: 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:15 dxlr8r: in norway? I beg to differ :P

18:15 MS is still king here

18:16 oddcully: NS means somethin' else here ;P

18:16 justin_smith: F# is cool

18:16 oddcully: .*# never attracted me

18:17 dxlr8r: NS was the fascist party that couped the goverment. so yeah oddcully ... NS means stuff here to :P

18:17 during WW2 :P

18:17 oddcully: hate me now: i come from a python/groovy landscape

18:17 justin_smith: oddcully: my fondness for .*ml overrides that for me :)

18:18 dxlr8r: easy to get clojure job i the US? :P

18:18 could move

18:18 not very good :P

18:18 oddcully: dxlr8r: we all saw dod sno

18:18 dxlr8r: ahhh :P

18:18 justin_smith: dunno about easy, but it's definitely been expanding

18:18 dxlr8r: actually haven't seen the oddcully

18:18 that

18:20 oddcully: well then just me

18:20 great cinema nontheless

18:20 dxlr8r: will probably watch it sometime :)

18:21 norwegian films aren't so bad. used to be all crap

18:21 oddcully: but i hope in norway there is some culture around hiring "versatile" devs

18:21 yesterday there was some talk about "how to get hired in a startup"

18:22 i think i only know dod sno

18:22 dxlr8r: well, there might be some places I don't know of. but hard to get into. not even living in the capitol

18:22 oddcully: is festen from norway?

18:22 dxlr8r: festen?

18:22 oddcully: (pleASE don't hate my now!)

18:22 dxlr8r: festen who/what?

18:22 oddcully: ok, maybe not then

18:23 dxlr8r: festen means "the party"

18:23 ntaylor: some sort of demoscene thing?

18:25 oddcully: denmark/sweden... sorry

18:25 since you translated it well, you norsemen seem to share quite some language

18:29 dxlr8r: yeah, we norwegians understand both swedish and danish

18:29 bensu: yeah festen means "the party" in swedish as well

18:29 dxlr8r: but danes and swedes aren't so good in understanding. atleast not danes... they speak english :P

18:29 I can understand them, but they don't want to understand us :P

18:30 bensu: there is actually a small clojure community in Stockholm, I've been to a couple of meetups and they've been interesting

18:30 dxlr8r: most norwegians can fake swedish speech to

18:31 justin_smith: dxlr8r: so can muppets

18:31 dxlr8r: haha :P

18:31 ntaylor: yeah, Stockholm seems pretty good for JVM stuff in general (maybe owing to BEA being there,I donno)

18:31 oddcully: haha


18:31 (spl!)

18:31 amalloy: reminds me of http://www.reddit.com/r/sweden/comments/301sqr/dodetot_%C3%A4ror_fof%C3%B6ror_lolitote/ - pig latin, for swedish

18:31 oddcully: that all my composekey could do

18:32 justin_smith: I'm sure swedish people get really tired of the swedish chef jokes

18:32 oddcully: i'm so sorry!

18:32 dxlr8r: norwegians doesn't get tired. but we dig all swede bashing :P

18:32 oddcully: it's the liquor speaking (like with mr. lahey)

18:32 dxlr8r: old bad blod :P

18:33 bensu: you never hear those here :) I've actually met a BEA programmer at an Erlang meetup

18:33 dxlr8r: we have swede jokes

18:33 do you know why swedes always have an empty bottle in their fridge?

18:33 bensu: poor guy, everybody gave him tons of shit because, you know... java

18:34 dxlr8r: in case someone who isn't thirsty comes by

18:34 oddcully: :*)

18:35 dxlr8r: we have like hundres of them :P

18:35 oddcully: here it is: austria vs bavaria

18:36 bensu: oddcully: are you austrian?

18:36 oddcully: bensu: NO!

18:37 gfredericks: wait hold on this is not the time of day for europeans to be about

18:37 dxlr8r: easter :P

18:37 oddcully: gfredericks: your last name suggests otherwise

18:37 gfredericks: europe talk is first thing when I get up in the morning

18:37 justin_smith: And here we have the haskeller / rubyist jokes. There will always be jokes about the folks on the other side of the river.

18:37 haha

18:37 (inc gfredericks)

18:37 lazybot: ⇒ 131

18:38 bensu: gfredericks: I move to Sweden so my mum wouldn't bother me with bed time!

18:38 dxlr8r: in scandinavia we have the easter of

18:38 no work :P

18:38 off

18:38 oddcully: bavaria^Wgermany too

18:38 gfredericks: oddcully: my ancestors came to staten island on the mayflower while fighting the british

18:39 oddcully: gfredericks: your lastname suggested that to me even by obfuscating it

18:39 bensu: justin_smith: ruby jokes are pretty hilarious now matter in which side of the river you are

18:39 gfredericks: I think fredericks is wswedish

18:39 dxlr8r: what better way to spend easter than programming clojure?

18:39 bensu: (even when you like ruby)

18:39 dxlr8r: hehe :P

18:39 justin_smith: bensu: and mongodb jokes

18:40 bensu: justin_smith: god yes. those webscale mongo db videos are hilarious

18:40 justin_smith: but those are there because laughing is better than tears of rage and pain.

18:40 oddcully: gfredericks: i worked with a swede (fredrikson - son of fredrik -- but could as well we friedrich (german))

18:40 gfredericks: there's a 1/8 probability it's danish

18:41 bensu: justin_smith: the guy that makes them is in the Erlang community, we better not upset him...

18:42 justin_smith: the one thing I envy from the Mongo/Meteor community is that server real time sync

18:43 justin_smith: bensu: can't you duplicate that by any db with (future (sync-eventually db)) because mongo isn't actually verifying any sync happened

18:43 Que: Is 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:43 justin_smith: bensu: I could be missing a nuance here

18:44 Que: if you find it difficult, racket is somewhat more streamlined, but similar enough so that you could come back to clojure later

18:44 (with little difficulty)

18:44 Que: of course since this is a clojure lovers channel, I will tell you it's the best :)

18:44 turbofail: racket also comes with a relatively friendly IDE to get started with

18:44 Que: :))

18:45 oddcully: you can configure mongo by request now you want your data realized

18:45 justin_smith: yeah, racket is optimized for first time programmers when you use the IDE

18:45 bensu: it'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:45 dxlr8r: Que: 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:46 can be hard to unlearn

18:46 justin_smith: bensu: ahh, so the low latency of getting updates?

18:46 dxlr8r: or not unlearn, but adapt :)

18:46 bensu: justin_smith: and the pub/sub mechanism across all clients

18:47 justin_smith: bensu: aha, so it's like a db and a distributed messaging system in one

18:47 Que: I 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:47 bensu: yeah! mongo offers the db and meteor builds the sync layer on top using websockets

18:47 justin_smith: bensu: 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:47 bensu: it works great out of the box but it's extremely complected!

18:48 justin_smith: bensu: but zookeeper explicitly is not a db

18:48 herrwolfe: Que: python is nice as well. But scheme is great to learn multi paradigm

18:49 dxlr8r: Que: 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:49 bensu: justin_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:49 Que: And I can only find learning resources geared to experienced programmers so that's why I am here :-D

18:49 justin_smith: bensu: 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:50 oddcully: dxlr8r: moving up norse was an option... until you mentioned JS... ;P

18:50 bensu: but it's very late here in Sweden to have good ideas, so I'll be going

18:50 justin_smith: I'll look at avout, thanks!

18:50 hejdå!

18:51 justin_smith: Que: 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:51 dxlr8r: heidå

18:51 :P

18:51 Que: dxlr8r: but javascript is so ugly and very things I don't understand and don't make sense to me

18:51 oddcully: bensu: slàinte

18:51 dxlr8r: Que: agree :) but still the most important language atm

18:51 justin_smith: Que: yeah, clojure is simpler in many ways (until you get to the dusty corners - every language has those)

18:52 oddcully: guess, i got that tick on the a wrong

18:52 Que: justin_smith: Thanks for the links

18:53 turbofail: justin_smith: are they really accessible to programming newcomers? most of us haven't been one of those for a long time...

18:54 justin_smith: Que: 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:54 turbofail: so i don't know how good a judge of that we are

18:54 Que: But if I learn clojure would it be to learn other languages like javascript or python?

18:54 justin_smith: turbofail: clojure from the ground up is explicitly for an audience that has never programmed before

18:54 oddcully: braveclojure is basically the first site i read about clojure... it is really funny

18:54 dxlr8r: Que: clojure is not a good start if you want to learn JavaScript or Python

18:55 justin_smith: turbofail: the main complaints I have heard about it is that it goes to slow, and it's too basic

18:55 dxlr8r: Python is a good start for that

18:55 turbofail: justin_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:55 that said that may have just been my friend being super impatient

18:56 justin_smith: statistically 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:56 even if they want to

18:56 turbofail: the real difference I think is stubbornness / obsessiveness - this is beyond "patience" territory I think :)

18:57 dxlr8r: I 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:57 Que: dxlr8r: thank you for the sincere advice

18:57 justin_smith: if your first language is a functional one, immutable just makes sense, it's like math

18:58 dxlr8r: yeah... agree

18:58 oddcully: also in pure practicality terms you will have an easier time as an sh*tty JS developer

18:58 no one will notice

18:58 justin_smith: haha

18:58 dxlr8r: that's why I said it's harder to learn clojure if you are into the Java/Python/JS world

18:58 oddcully: haha

18:59 I still use loops for stuff that reduce etc. could do. and I make A LOT of let's :P

18:59 oddcully: everything will be attacked with a `for` loop then

18:59 turbofail: also, "just like math" and "just makes sense" don't always go that well together

18:59 justin_smith: haha

19:00 turbofail: I think the most confusing and problematic thing in the entire programming world is "i = i+1;"

19:00 dxlr8r: let, a noobs best weapon against (((()))) :)

19:00 Que: but if you have a virgin brain like me it would be a good choice? Am I understanding it right?

19:00 justin_smith: Que: I think so. But clearly there is some diversity of opinion.

19:00 dxlr8r: Que: yeah. but don't expect to get anywhere soon if you plan on getting a job

19:00 or get a head start for university

19:01 turbofail: justin_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:01 Que: It's more like a hobby to be honest

19:01 oddcully: Que: 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:02 justin_smith: Que: yeah, for hobby, I'd say definitely choose one of clojure, racket, haskell, ocaml

19:02 dxlr8r: Que: 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:03 I have also learned clojure as a hobby/use for my own projects

19:03 ntaylor: my 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:03 justin_smith: 'strooth

19:03 (inc ntaylor)

19:03 lazybot: ⇒ 1

19:04 ntaylor: I think a lot of people (myself included) got hung up on Is This Language The Best One rather than experimenting and learning ;)

19:04 dxlr8r: :)

19:04 justin_smith: probably 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:04 btw. it is a terrible language, syntax and feature wise

19:04 but it makes it super easy to make synthesizers :)

19:05 ntaylor: hah

19:05 dxlr8r: clojure 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:05 Que: Immediate satisfaction is a very strong argument.....

19:05 dxlr8r: and ofcourse finding an editor for humans is hard

19:05 most clojurans use emacs

19:05 oddcully: my entry point was graphics

19:05 ntaylor: I think someone already mentioned Racket above, but that's a huge benefit of the PLT-Scheme stuff

19:06 justin_smith: yup

19:06 oddcully: so getting results for your eye or ear seems crucial

19:06 ntaylor: you just install the thing and It Works

19:06 turbofail: yeah the racket IDE is pretty awesome

19:06 * justin_smith is racket fan numero uno as a learner's language.

19:06 ntaylor: yeah same

19:06 I TAed the How To Design Programs curriculum in grad school and it was (surprisingly nobody) so much better than the former OO curriculum

19:06 Que: gotta search for racket then

19:07 dxlr8r: if 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:07 ntaylor: if only because you had the REPL right-away and got immediate feedback

19:08 n8dawg: Question 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:09 question is, is (foo) called when consumer reads from chan or when go block is called?

19:10 justin_smith: n8dawg: I would expect when the go block is called. But honestly I don't know.

19:11 postpunkjustin: if there's no buffer then I would definitely expect it to be when the go block is called

19:11 justin_smith: justin tag-team action

19:11 postpunkjustin: two out of n Justins agree

19:12 oddjustin: i don't

19:12 oddcully: or maybe i am

19:15 Que: so should I go with the racket's official tutorial or pick something else?

19:16 dxlr8r: hardly heard of it. sorry :/

19:16 justin_smith: the official tutorial should be good

19:16 ntaylor: Que: remind me, is your background a new programmer?

19:17 Que: ntaylor: Only did a couple of tutorials on ruby/python js

19:17 ntaylor: if 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:18 imho it is a fantastic intro to both programming and thinking in the functiona programming style

19:18 the 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:19 Que: ntaylor: thank you I will explore both and see what fits me.

19:19 oddcully: (inc ntaylor)

19:19 lazybot: ⇒ 2

19:20 ntaylor: yw!

19:20 Que: ntaylor: So am I right to assume that the link is for learning to program using racket language? or is it clojure/something else?

19:20 ntaylor: Que: sorry, no, the link is for a textbook that uses Racket

19:21 but, being both Lisp-likes, they're philosophically similar to one another

19:21 dxlr8r: skimming the textbook, and I agree. a lot like clojure

19:23 Que: Thank you very much. You guys were most helpful. Really appreciated :)

19:23 (inc ntaylor)

19:23 dxlr8r: good luck :)

19:23 lazybot: ⇒ 3

19:23 Que: dxlr8r: thanks :)

19:24 ntaylor: yw!

19:24 dxlr8r: btw 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:25 atm I use sh with pgrep etc. and it works great, but wondered if there where a lib

19:25 my program will be reliant of pgrep, which I don't like

19:27 oddcully: mine on instaparse, which i totally like

19:28 and yet you are better off than the ps aux | grep folks!

19:30 dxlr8r: https://github.com/lewang/instaparse ? how is that gonna help med oddcully ?

19:31 me

19:35 ntaylor: dxlr8r: 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:35 the difficulty with the JVM being cross platform is that exposing system level stuff like this is rare :(

19:36 I 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:36 dxlr8r: I use "clojure.java.shell"... and pgrep is much better than ps

19:36 for that task

19:37 ntaylor: right, I meant to say pgrep rather than ps

19:37 whatever thing you want executed on the shell :)

19:37 if you were feeling really ambitious, you could write your own linux/OSX specific MXBean and write clojure bindings for it :)

19:38 dxlr8r: :) I have a nice way now, it's very clean. but not portable. works on pgrep for bsd, gnu and busybox

19:38 but would not work in say, windows

19:38 ntaylor: yeah, a truly portable way is gonna require some effort

19:38 yeah exactly

19:38 dxlr8r: (sh "pgrep" "-P" (pid/current))

19:38 really easy

19:39 then just do a split of the output and have nice list

19:39 ntaylor: i've never had cause to shell out in clojure, that is nice

19:39 dxlr8r: trying to master clojure, so use it for shell scripting

19:39 could do it in perl/bash whatever

19:39 but I already know those :P

19:40 ntaylor: nothing beats perl

19:40 dxlr8r: or... who really knows bash? I never get that right. I have to lookup everything... messy "language"

19:40 netroby: Morning (From GMT+8)

19:40 pmonks: For invoking other apps I've found conch (https://github.com/Raynes/conch) pretty nice. Doesn't solve the portability problem, mind you...

19:41 dxlr8r: hehe, perl is nice. I am not experienced enough to say that perl is the best :) it works

19:41 ntaylor: perl was actually my first FP language

19:41 dxlr8r: yeah, tried to use conch. but it didn't give me anything I needed

19:41 ntaylor: (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:41 dxlr8r: so went back to regular sh

19:42 my first language was TI-83 Basic

19:42 then PHP

19:43 postpunkjustin: that's quite a step down

19:44 Seylerius: Hah.

19:44 dxlr8r: would be cool to write my own clojure vbinding and post it github. would look nice on my resume

19:44 hehe

19:44 justin_smith: dxlr8r: under linux, I'd use the /proc files to get what you might want

19:46 dxlr8r: justin_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:47 https://github.com/facebook/osquery could work to :P

19:47 but wanted something easy

19:47 but that project is so nice :)

19:48 Seylerius: dxlr8r: What in the world is a vbinding?

19:49 dxlr8r: Seylerius: meant binding

19:49 typing to fast for my own good

19:49 Seylerius: Ah.

19:50 So a clojure binding for... the abomin—*cough* I mean PHP? Or for something else?

19:50 dxlr8r: I thought about OperatingSystemMXBean

19:50 I don't need it, but could be a cool project

19:51 haha :P PHP is like 12 years ago

19:51 hardly touched it since

19:51 Seylerius: Good.

19:51 ntaylor: yeah, 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:52 dxlr8r: yeah, thinking about it ntaylor . as I said, would look good on a resume, and also give some cred

19:52 ntaylor: I guess the good news there is that you would need to maintain Windows and "everything else", so only two distinct code paths

19:52 yeah

19:53 dxlr8r: I have heard that having a github account with good projects is a good move. I am 30 and without a "real" job

19:53 so time is running out :P

19:53 ntaylor: ha ha ha

19:53 dxlr8r: is 30 old? :P

19:53 pmonks: oh sweet babby child

19:54 you got no idea what's coming

19:54 ;-)

19:54 ntaylor: EVERYTHING BREAKS

19:54 pmonks: (inc ntaylor)

19:54 ntaylor: that is my "getting old" experience so far

19:54 lazybot: ⇒ 4

19:54 pmonks: Then you forget you break easily (cause your memory is broke too) and really get into trouble. :-(

19:54 dxlr8r: I have some idea :P I have to exercise more than I used to or else every bone hurts :P

19:55 ntaylor: self-preservation is for the young peopel anyway

19:56 pmonks: That's why I drink - to try to preserve myself.

19:56 That and it's cheaper per ounce than anti-inflammatories.

19:56 dxlr8r: don't drink or smoke. workout about 3 times each week

19:57 sometimes more

19:58 pmonks: Wait until you stop healing from injuries - that sucks. :-(

19:58 I 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:59 And old ones randomly resurfacing.

19:59 suxx

19:59 dxlr8r: I go regulary to acupunctur for my arms

19:59 or else I can't use a mouse or keyboard :/

19:59 had it for over 10 years

20:00 pmonks: What's your sport of choice, if you don't mind me asking?

20:00 dxlr8r: but actually recovering

20:00 I used to be really good in triple jump

20:00 now it's just hobby

20:00 pmonks: wow

20:00 That looks way hard on the legs!

20:00 dxlr8r: not that hard actually

20:01 never had any mayor injuries because if it

20:01 you get more injures doing nothing than doing something... atleast in the long run :)

20:01 pmonks: +1

20:02 Seylerius: (inc dxlr8r)

20:02 lazybot: ⇒ 1

20:02 Seylerius: (inc pmonks)

20:02 lazybot: ⇒ 3

20:03 Seylerius: (inc ntaylor)

20:03 lazybot: ⇒ 5

20:05 dxlr8r: thx :)

20:20 justin_smith: dxlr8r: I got my first real programming job at 35

20:21 after over a decade of hobby programming

20:24 dxlr8r: nice 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:25 then I also do some programming, but never profesionally. only small projects

20:34 justin_smith: poteto?

20:35 patchwork: How large is the thread pool for futures? And where do I set it?

20:37 justin_smith: patchwork: I'm on mobile, but it is thee agent thrad pool

20:38 same one shutdown-agents shuts down

20:39 maybe see you in 20 minites?

20:40 patchwork: justin_smith: Ah yes, you heading to the clojure meetup?

20:40 at puppet?

20:40 I will be there

20:41 justin_smith: http://stackoverflow.com/questions/11316737/managing-agent-thread-pools-in-clojure

20:41 built in pool, unlimited size

20:42 patchwork: Really weird, I am making 1000's of concurrent requests to http-kit, but it only ever accepts 400 at a time

20:42 Exactly 400

20:42 every time

20:43 It seems too convenient

20:43 amalloy: patchwork: perhaps you're running out of OS file handles, for example

20:43 though 400 seems a bit low for that

20:45 justin_smith: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Agent.java

20:45 patchwork: Yeah I hope my OS can handle more than 400 files at a time : P

20:45 amalloy: well the default on most unix machines is 1024 files per process

20:46 patchwork: It could be something like that then...

20:46 justin_smith: also, thread limits per process

20:46 dxlr8r: justin_smith: potato :)

20:47 justin_smith: so what does it mean to say you are a potato?

20:48 patchwork: justin_smith: Any idea what the thread limits per process are?

20:48 johnmendonca: versatility of a potato

20:49 dxlr8r: justin_smith: thought that was an english term to. in norwegian it means you can be used for everything

20:49 versatile :)

20:52 justin_smith: in english potato means mentally challengef (like downs syndrome) or very weak tech (like a cheap camera). i assumed you meant something different

20:53 dxlr8r: hehe :P won't use that term again in english :P

Logging service provided by n01se.net