#clojure log - Jan 15 2014

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

0:03 rubber-duck: so the error goes away when I remove the recur in catch block

0:05 AJ256: Anyone: localrepo plugin, pomegranate library, creating a local maven repository, etc. I've found a lot of different answers on Google for how to add local jars as dependencies to leiningen projects. Anyone in here have any experience and an opinion on the fastest/easiest way to add a local jar as a dependency?

0:17 bendb: ,(help)

0:17 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: help in this context, compiling:(NO_SOURCE_PATH:0:0)>

0:18 ddellacosta: AJ256: I think it depends on what you are trying to do with it. For something experimental that I'm not actually hacking on, I'll simply run lein install in the lib directory and then require it from the relevant project. But I've used checkouts in the past if I've wanted to work on the library's code at the same time as the project using the lib. Pomegranate and lein-try seem to be great if you're just trying out a lib to see if

0:18 you want to use it (although, I've never used pomegranate and I may not understand its use-cases well).

0:20 AJ256: honestly, don't understand the use-case for lein-localrepo either. Seems like it's just giving you more fine-grained control over your default local maven repo?

0:20 granted, seems handy

0:21 AJ256: Thanks, ddellacosta. I'm trying to hack on a lib at the same time as the library that depends on it. And I don't want to release it to the world until I'm ready. (It's for work. It's open source, so I can put it on clojars eventually, but I need to have a certain minimum level of quality before I release it.)

0:22 *at the same time as the app that depends on it

0:22 ddellacosta: AJ256: in that case, I imagine putting the lib in the checkouts directory would work the best for you: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L273

0:23 AJ256: sorry, this is probably a better link: https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#checkout-dependencies

0:23 maybe you're already familiar with checkouts though

0:24 alew: is it possible to cider-jack-in with a particular leiningen profile?

0:24 AJ256: I'm still relatively new to clojure, and even newer to leiningen, so no. Not familiar with checkouts yet.

0:27 ddellacosta: yes the second link makes a little more sense to me than the first. :D

0:27 ddellacosta: AJ256: yep, sorry 'bout the confusion. :-)

0:29 AJ256: Ha, not at all ddellacosta! Thanks for the tips! I'll check this out tomorrow and give it a go.

0:29 Thanks!

0:29 ddellacosta: AJ256: np, good luck!

0:36 eric_normand: I like Clojure :)

0:36 grncdr: I was just thinking the same thing

0:36 I need to find a small contract where they don't care about the implementation so I can build a full webapp in Clojure

0:37 eric_normand: have you tried the "it's just a java library" approach?

0:39 ddellacosta: eric_normand: loved your post re: Hindley-Milner in Clojure, btw. Been learning Haskell lately and it nicely dovetails with what I've been learning.

0:40 Tolstoy: Hm. Any reason [clojurewerkz/cassaforte "1.3.0-beta7"] doesn't seem to pull in dependencies?

0:40 eric_normand: ddellacosta: thanks. I'm glad you liked it

0:40 Tolstoy: Exception in thread "main" java.lang.ClassNotFoundException: org.apache.cassandra.db.marshal.UTF8Type

0:41 ddellacosta: Tolstoy: is it possible an older version of cassandra is getting pulled it by something else?

0:41 Tolstoy: ddellacosta: Not sure. I created a new project (first use of cassandra ever).

0:42 ddellacosta: Tolstoy: ah, okay, then sounds like maybe not. I would do a lein deps and poke around. Sorry I don't have much more than that...

0:43 Tolstoy: Time to revisit good ole ~/.m2, eh? ;)

0:43 abaranosky: bitemyapp: sorry I dissappeared after asking you guys about a JSON library. I totally forgot I had asked, and some work stuff came up.

0:44 We haven't yet identified any performance issues with any particular JSON serialization library, but a coworker was wondering which would be fastest. I always use Cheshire because I like its flexibility.

0:45 eric_normand: Tolstoy: try lein deps :tree

0:45 Tolstoy: eric_normand: Did that right off. Maybe it should be pulling in something but isn't.

0:46 eric_normand, ddellacosta: https://github.com/clojurewerkz/cassaforte/issues/26

0:46 ddellacosta: Tolstoy: ah, there ya go. :-)

0:47 Tolstoy: ddellacosta: Wow, that pull in half the internet. ;)

0:51 beta8 did the trick. Sheesh! ;)

1:17 andyf: OK, basic question about protocols here (I haven't used them in my code yet). Why is there a warning if you create two protocols that have a method name in common?

1:18 hiredman: andyf: they aren't methods, they are functions, they live in vars as per normal

1:18 so they will overwrite each other

1:19 andyf: hiredman: OK. But there is no warning if you re-defn the same function multiple times.

1:20 hiredman: andyf: I imagine the defprotocol macro checks and issues the warning

1:20 andyf: I mean, I guess I'm not complaining that someone was considerate enough to put in the warning. Just surprised me at first.

1:22 hiredman: protocols are neat, and can do some cool stuff, but there are all kinds of fiddly bits people tend to screw up, so sadly, best to avoid them

1:22 lots of confusion around functions and methods and protocols and interfaces

1:23 logic_prog: if a document is copyrihted, how many people can I share it with for educational purposes?

1:24 hiredman: that isn't even getting in to the problems you can have with stale classes and weird classloader issues and what not

1:28 andyf: Is there some special significance or behavior to protocol methods whose name begins with a dash?

1:29 amalloy: andyf: no

1:29 hiredman: it is a convention for protocol functions that are the underlying implementation for some other function to be so named

1:29 so if conj was part of a protocol you might have conj as the function and -conj as the underlying protocol function

1:30 (convention meaning dnolen does it in clojurescript)

1:30 andyf: good to know. Sort of like the convention where foo* is a function that does most of the heavy lifting for a macro named foo

1:30 hiredman: and core.logic

1:30 amalloy: yeah, i was going to say dnolen just uses it for all protocol functions

1:30 but hiredman is probably more right

1:34 andyf: Might just be a bug in Clojure/Java, but defining a protocol where the method name begins with a dash, and only one arg, causes a reflection warning (if they are enabled), but I don't see any other combinations that do that.

1:34 hiredman: andyf: are you using the latest master?

1:35 andyf: hiredman: 1.5.1, I think. I'll try it with latest to see if anything changes

1:35 hiredman: I seem to recall a bug like that, but I thought it was patched

1:38 andyf: Sounds familiar. Probably this one http://dev.clojure.org/jira/browse/CLJ-1202

1:39 amalloy: oh good. i thought i fixed that; glad to hear it's just not in a release yet

1:50 chare: ok so the problem with clojure is that its dynamically typed which means I can't convince my friends to use it

1:51 how do I love that

1:51 solve that

1:51 andyf: find new friends

1:51 :)

1:52 chare: and haskell is just too scary to them to even contemplate

1:53 bitemyapp: abeaumont_: what-evs.

1:53 oh. wrong person.

1:53 n/m

1:53 sigh dammit baranosky.

1:55 chare: so andyf no solution for me?

1:55 andyf: chare: I gave you one, albeit not terribly seriously. Could work, though, if you wanted to go for it.

1:57 chare: isn't there something like typed clojure or something

2:00 egghead: chare: typed clojure, while cool, probably won't sell people who don't like dynamic typing on dynamic typing

2:00 chare: egghead uh explain why not

2:01 bitemyapp: typed clojure isn't that nice or fundamental to clojure

2:01 it's a way to harden up code.

2:01 egghead: chare: because compile time checks or else!

2:01 :p

2:02 i'd just explain how clojure offers everything you need for typed systems with multimethods, protocols, etc

2:02 you can program to contracts, you can dispatch off type

2:02 you can enforce inputs and outputs at the bytecode level what more do these people want

2:03 chare: egghead you're making things too complicated, they only understand the term static typing

2:03 anything more is too complicated

2:05 egghead: chare: just tell them that clojure is staticly typed with such good type inference that you don't need to declare the types

2:05 chare: but thats lying

2:05 they know i'll be lying

2:05 egghead: then when they ask about types because they pass the wrong type just teach them about multimethods and protocols

2:06 lol chare

2:06 obv

2:06 but if they don't want to learn you aren't going to convince them to by saying 'dynamic typing!'

2:07 chare: egghead damn it i'm going to be stuck with python or ruby forever

2:07 egghead: wut

2:07 if they are using ruby or py they can certainly use clj as an alternative

2:09 chare: thats not how they think

2:14 noonian: hmm, but both python and ruby have dynamic typing?

2:16 chare: they make exceptions for ruby and python...

2:19 ok this is what I'm going to do

2:19 give them clojure ultimatum

2:19 not budge

2:20 eric_normand: chare: they have authority to choose python and ruby? but you don't have same authority to choose clojure?

2:22 chare: ok so if I suggest clojure whats to stop them from countering with nodejs

2:24 andyf: chare: If you are looking for some kind of irrefutable argument for Clojure that everyone will be convinced by, you aren't going to find one.

2:24 nor for any other technology

2:25 chare: andyf so in other words you're saying my friends are stupid

2:25 noonian: just not interested in learning clojure from the way it sounds

2:25 andyf: I am saying that there are practically no statements in the world that you could get everyone to agree on. Don't bemoan the fact, just accept it and move on to more interesting questions.

2:28 Make Clojure your hobby, even if it isn't your day job. If it is really important to you that it is your day job, get better at it and look for opportunities.

2:28 * bitemyapp eats popcorn and watches, enraptured

2:29 * andyf grabs some popcorn to munch on, too

2:33 chare: so lets go back to making a game in clojure

2:33 logic_prog: let's figure out how to make money with clojure

2:34 bitemyapp: logic_prog: I like your idea.

2:34 noonian: yes!

2:34 logic_prog: bitemyapp: I feel that clojrue makes me a 10x engineer

2:34 thus, i should be able to make 1M /year

2:34 bitemyapp: logic_prog: math looks right.

2:34 logic_prog: bitemyapp: you look like a 20x engineer. Tell me about your 2M / year job.

2:35 I'm thinking baout building a search service on top of dropbox

2:35 i.e. a better way to search through your dropbox docs

2:35 bitemyapp: logic_prog: cool.

2:38 ddellacosta: man, I like source maps but they really seem to slow down my incremental compilation

2:38 logic_prog: bitemyapp: you have any good ideas?

2:39 bitemyapp: logic_prog: I'm sorry, was that supposed to be a serious question?

2:39 chare: lets use clojure in same way to thwart the nsa

2:39 bitemyapp: logic_prog: it's a little hard for me to tell at the moment who is being serious and who is not.

2:41 noonian: its a superposition

2:41 logic_prog: yes, the company is both alive and dead until one tries to raise a VC round

2:42 once the VC measures things like growht, revenue, etc ... then it's forced to either "funded" or "not-funded" stage

2:46 quizdr: the doc for both (ns) and (in-ns) both say: Sets *ns* to the namespace named by name (unevaluated), creating it

2:46 if needed. So what exactly is the difference?

2:46 hiredman: ns is a macro that contains a call to in-ns in the expansion

2:47 in-ns is a function

2:47 use ns

2:48 quizdr: why do books such as Halloway's often suggest/teach to use in-ns? there must be some reason

2:49 amalloy: halloway's book is older than the hills, but even then i expect if he's telling you to use in-ns you're probably mistaken. ns was around then, right?

2:49 he might be explaining to you how it works, just in case you ever need to know

2:49 quizdr: no, i'm reading the second edition, just released.

2:50 hiredman: in-ns is often used to change the value of *ns* while at the repl

2:50 noonian: yeah, in-ns is useful from the repl

2:50 quizdr: so again, what is the actual difference between using it or just ns, even from the repl?

2:51 noonian: use ns in your programs, thats where you do all your requires and imports. use in-ns from the repl to switch to the ns's declared in your programs and test your code

2:51 andyf: Try this at a REPL, and you will see everything that (ns foo.bar) does that in-ns does not: (pprint (macroexpand '(ns foo.bar)))

2:51 SegFaultAX: quizdr: The difference is in-ns is a function, whereas ns is a helper macro.

2:53 quizdr: andyf that's useful thanks

3:15 logic_prog: in cljs, is it possible to create a _buffered_ cljs/chan that has _infinite_ size?

3:15 i.e. I want the buffer to just continuousy grow

3:15 rather than have a limit

3:17 mischov: I believe I remember something in some talk about core.async that mentioned not allowing that foot-shooting to occur, but I could be entirely wrong.

3:18 logic_prog: this is foot shooting?

3:18 to have a channel without a buffer

3:18 hmm

3:20 SegFaultAX: logic_prog: Unbounded buffering is expressly prohibited. Back pressure is a good thing, embrace it.

3:20 mischov: "What we do not provide and will not provide are unbounded buffers"

3:21 http://www.infoq.com/presentations/clojure-core-async at 23:00

3:22 SegFaultAX: Because it makes absolutely no sense.

3:23 What rationale could there be for "I want this buffer to grow until all available ram is consumed, and my application crashes unrecoverably due to OOM"

3:24 quizdr: that can be a desirable effect for anyone writing a virus, so there is some use

3:25 SegFaultAX: Java isn't the most typical platform for virus authors.

3:25 quizdr: tell that to Android users

3:25 SegFaultAX: And anyway, it would be a relatively short lived attack unless -Xmx == total available vram.

3:26 quizdr: It's not as if Android is /only/ capable of running Java.

3:26 bitemyapp: logic_prog: don't do that.

3:26 logic_prog: noted

3:26 yeah, watching Rich Hickey take it apart

3:26 quizdr: not an Anroid user or developer but I thought Java was the official language of Android

3:27 SegFaultAX: Official is not the same as only permitted language.

3:27 There is a native toolkit as well.

3:27 quizdr: but it is the most widespread language, and Android is also the most virus-prone mobile OS, so Java is indeed a target of virus authors

3:27 SegFaultAX: quizdr: http://developer.android.com/tools/sdk/ndk/index.html

3:28 I don't have any evidence to support or reject that claim. The point is authors would not be limited to java.

3:29 quizdr: http://tech.fortune.cnn.com/2013/04/14/apple-enterprise-android-malware/

3:30 SegFaultAX: quizdr: Greater freedom for the consumer comes at the cost of larger attack surfaces.

3:31 quizdr: Android is likely the reason Java is now a major target of virus authors.

3:31 mischov: Not particularly applicable, but made me think of it.. http://java-0day.com/

3:32 SegFaultAX: quizdr: It probably has more to do with the Android market share dwarfing all other platforms, globally.

3:33 There are also more viruses targeting MS platforms than OSX platforms. Does that imply that OSX is more secure? Of course not, but why go after something that has 5 - 10% of the overall market share when you can instead attack something that has > 85%

3:34 bitemyapp: safari is easier to hack these days than IE, but IE is the bigger target.

3:34 that wasn't always the case.

3:34 logic_prog: is the behabior of "put!" on a full channel defined?

3:34 SegFaultAX: IE also happens to be one of the most (if not /the/ most) standard compliant browser.

3:34 logic_prog: https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async.cljs#L87 sys very little

3:34 SegFaultAX: That sure as shit wasn't always the case.

3:35 quizdr: my point was simply that Java is a source of virus writing after all, regardless of the reasons

3:38 bitemyapp: SegFaultAX: uh, sorta. IE9 still flakes out on some stuff.

3:38 Java browser JRE is a fat source of exploits.

3:38 SegFaultAX: bitemyapp: IE9 is a piece of shit. I'm talking about 11

3:39 quizdr: IE is sure not as much of a joy to use as other browsers though. for example, IE has nothing on lynx

3:39 bitemyapp: I like this guy.

3:39 SegFaultAX: quizdr: That's not exactly an apples-to-apples comparison, though.

3:39 bitemyapp: can we keep him?

3:41 quizdr: hi

3:58 testcloj`:

3:58 (def a {:a []})

3:58 (def b {:a 2})

3:58 (def c [{:a 2} {:a 3}])

3:58 (merge-with conj a b) -->this works

3:58 (merge-with conj a c) --> this doesn't work, since c is a vector, but how to make it work?

4:01 noonian: ,(let [a {:a []}, c [{:a 2} {:a 3}]] (map (partial merge-with conj a) c))

4:01 clojurebot: ({:a [2]} {:a [3]})

4:02 quizdr: noonian nice

4:02 amalloy: (apply merge-with conj a c)

4:02 TEttinger: amalloy, that only works if a is a map, right?

4:03 amalloy: although it's rather suspect that the types of the values in a are different from those in b

4:03 well uh...it is a map?

4:03 TEttinger: well if c and a are reversed it fails right?

4:03 amalloy: like, nothing involving merge-with a will work if a is not a map

4:03 quizdr: amalloy how is your apply any different than the original example?

4:03 aren't they both just calling merge-with with the same args?

4:03 amalloy: (apply f x [y z]) => (apply f x y z)

4:03 er

4:03 (apply f x [y z]) => (f x y z)

4:04 quizdr: ah the apply splices for you, got it

4:04 noonian: ,(let [a {:a []}, c [{:a 2} {:a 3}]] (apply merge-with conj a c))

4:04 clojurebot: {:a [2 3]}

4:05 noonian: so different semantics and it depends on what he wanted heh

4:05 TEttinger: ,(let [a {:a []}, c [{:a 2} {:a 3}]] (apply merge-with conj c a))

4:05 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry>

4:05 quizdr: hanging out in this room is like going to a party except you leave with *more* brain cells

4:06 TEttinger: this one's a bit of a brain-bender yeah

4:09 magnars: Anyone know how/why/where Ring adds ;charset=ISO-8859-1 to my Content-Type header? And possibly how I can make it serve utf-8 instead?

4:10 noonian: ,(let [a {:a []}, c [{:a 2} {:a 3}]] (reduce (partial merge-with conj) (conj c a)))

4:10 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IPersistentCollection>

4:11 AeroNotix: any docs on running compojure with SSL?

4:11 noonian: ,(let [a {:a []}, c [{:a 2} {:a 3}]] (reduce (partial merge-with conj) {:a []} (conj c a)))

4:11 clojurebot: {:a [2 3 []]}

4:11 noonian: hmm

4:12 AeroNotix: or with ring w/e. I cannot use nginx to terminate SSL connections since this application is processing CC information, and thus all connections need to go through SSL for PCI compliance

4:21 noonian: i think friend can do ssl

4:22 see https://github.com/cemerick/friend and http://clojure-yap.blogspot.com/2013/07/setting-up-friend-few-preliminaries.html

4:22 clgv: AeroNotix: pretty easy. just configure jetty to use SSL. you'll need to pass it a keystore containing the certificate

4:23 AeroNotix: clgv: ok cheers

4:23 clgv: AeroNotix: (jetty/run-jetty routes {:ssl? true, :keystore "path/to/keystore.ks", :key-password "verysecret"})

4:24 better not include it in the source ;)

4:24 AeroNotix: :)

4:25 mischov: magnars: ring-middleware-format might be what you're looking for

4:27 magnars: or it might not be. either way, https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/content_type.clj

4:29 magnars: mischov: ah, yes, I've got that. The problem is that it forces iso-8859-1 on me for some reason.

4:29 TEttinger: magnars, that's the encoding of cmd.exe on windows by default I think

4:30 if things are being piped through there, it might explain it

4:31 magnars: it's probably the encoding on my terminal as well, even if it is on OSX. So I have to find a way to override the default encoding in Java somehow?

4:31 mischov: Try making a handler to set the content type as UTF-8

4:33 er.. not handler, wrapper... middleware wrapper

4:33 magnars: yeah, that works. Thanks.

4:34 testcloj`:

4:34 how to create the following

4:34 ([] [] [] [])

4:34 I tried the following, but doesn't work

4:34 (take 4 (repeatedly #([])))

4:35 noonian: ,(doc repeatedly)

4:35 clojurebot: "([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"

4:35 TEttinger: ,(repeat 4 [])

4:35 clojurebot: ([] [] [] [])

4:35 quizdr: ,'([] [] [] [])

4:35 clojurebot: ([] [] [] [])

4:35 noonian: (take 4 (cycle [[]]))

4:36 ,(take 4 (cycle [[]]))

4:36 clojurebot: ([] [] [] [])

4:37 mischov: quizdr: I see you, and raise you (identity '([] [] [] []))

4:38 bitemyapp: ,#('([] [] [] []))

4:38 clojurebot: #<sandbox$eval119$fn__120 sandbox$eval119$fn__120@1a72123>

4:38 bitemyapp: ,(#('([] [] [] [])))

4:38 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn>

4:39 bitemyapp: right. fuck me.

4:39 quizdr: mischov i call your bet (eval (eval (quote (quote (identity '([] [] [] []))))))

4:39 * bitemyapp rolls eyes, yawns, and shakes head

4:40 bitemyapp: mischov: http://words.steveklabnik.com/a-30-minute-introduction-to-rust http://steveklabnik.github.io/nobody_knows_rust

4:40 mischov: quizdr: Ah, so you did have the two evals...

4:41 quizdr: i bet you thought i had three... i'm that good. i can bluff with the best of them.

4:41 TEttinger: ,(take 4 (map vec (repeat nil)))

4:41 clojurebot: ([] [] [] [])

4:42 mischov: bitemyapp: wtf format for a slideshow is that! :D

4:43 bitemyapp: mischov: I've seen hipsters using it lately, think it's based on that one dude's JS.

4:43 I forget his name, he makes a bunch of impressive pretty JS widget thingies.

4:43 mischov: bitemyapp: oh- him!

4:44 bitemyapp: mischov: you know who I'm thinking of?

4:45 mischov: bitemyapp: absolutely not.

4:45 jonathanj: what's an efficient way to produce a new seq without the last item?

4:45 butlast?

4:46 bitemyapp: mischov: Hakim! http://lab.hakim.se/reveal-js/#/

4:46 mischov: http://lab.hakim.se/

4:46 mischov: bitemyapp: vertical slides are ux silliness.

4:47 quizdr: jonathanj drop-last? ,(doc drop-last)

4:47 jonathanj: i'm reimplementing `comp`: http://cljbin.com/paste/52d65895e4b0120cbe8ee015

4:47 mischov: bitemyapp: at least in the same presentation with horizontal slides...

4:47 bitemyapp: mischov: I know that. I don't know why people do that stuff.

4:48 mischov: because it makes them smile.

4:48 bitemyapp: mischov: anyway, the presentation is secondary to the blog post, that tells you the "what's actually different about this?" bits. The Rust tutorial is pretty short too. http://static.rust-lang.org/doc/0.9/tutorial.html

4:48 Glenjamin: i think the idea is optional slides

4:48 bitemyapp: they're not optional.

4:48 Glenjamin: so you can go left->right, but drill down if you have time

4:48 oh

4:49 well, thats the intention of the feature afaik

4:49 mischov: bitemyapp: I'll check it out after sleep. :D Thanks.

4:49 bitemyapp: mischov: cheers.

4:49 mischov: Glenjamin: in the presentation in question his topics are horizontal and the parts of each topic are vertical

4:50 Glenjamin: i suppose in theory he could stop going down after a few, and move onto the next section

4:50 although they're not structured that way, i see

4:51 yeah, basically the whole deck is down from slide 1

4:51 noonian: whats the difference between butlast and drop-last?

4:52 fredyr: noonian: laziness

4:52 andyf: drop-last is lazy, butlast is not

4:53 noonian: thanks, and it looks like the only difference from drop is it makes a new seq instead of returning the same one

4:53 mischov: drop-last can also drop more than 1

4:59 TEttinger: ,(defn comptroller [& funs] (fn [& args] (reduce #(apply %2 (if (seq? %1) %1 [%1])) args (reverse funs))))

4:59 clojurebot: #'sandbox/comptroller

5:00 TEttinger: ,((comptroller str +) 1 2 3)

5:00 clojurebot: "6"

5:00 piranha: somehow core.async works very occasionally for me. It's like magic, sometimes it works and sometimes it does not

5:01 :\

5:01 I don't even know how to describe that... quite frustrating

5:05 noncom: piranha: https://www.youtube.com/watch?v=JYAq-7sOzXQ

5:06 piranha: noncom: yes that's exactly it!

5:06 noncom: I do (put! chan :keyword) in few places and it works only for a first time, but then it worked all the time when I did it from dev tools console

5:06 but now it stopped catching messages from console... and still works once for messages from code

5:07 that's somehow really disturbing

5:07 I'm pretty sure it's my fault but it's not immediately obvious from the code what I did wrong %)

5:08 noncom: if you want someone to comment on that i think you should post a refheap. core.async is encouraged to use by this community so people will try to help i think

5:08 piranha: well here is my code: https://github.com/piranha/locations/blob/master/src/locations/core.cljs#L48-L51

5:08 it's quite simple

5:09 and I guess that calling qwe('search') at least should print :search to console...

5:09 and real put!s are in views.cljs

5:13 noncom: piranha: oh, sorry, me myself is not a big expert in core.async, especially in its cljs incarnation (although it must work the same way). maybe you could ask some time later today in this channel when someone who is very familiar with core.async can answer

5:14 piranha: noncom: sure, it's just I'm frustrated right now and there is nobody around in real life I could speak with, and I had to let this frustration out... :)

5:14 noncom: :)

5:14 piranha: anyway yes, I'll ask later for sure

5:14 noncom: it happens to me from time to time too

5:15 piranha: :)

5:15 fredyr: piranha: may i ask why you extend string to be clonable?

5:16 piranha: fredyr: so that I could use it as an Om's cursor

5:16 fredyr: hmm

5:16 piranha: Om by default extends map and vector (and maybe list)

5:16 fredyr: that might explain why i had problems yesterday then

5:16 piranha: but you can't supply a string to a component and then expect a component to update it since there is not metadata

5:16 so you extend it with -clone which returns boxed string

5:17 fredyr: but isn't that when you're having a string as the actual cursor?

5:17 piranha: haha that may be a problem :) the same thing with a number

5:17 well I have a string as a cursor, it just needs to be wrapped in a String object

5:17 (js/String. "actual string")

5:17 fredyr: i had a map as the cursor coming in to the component

5:18 but wasnt able to destructure the cursor to get strings

5:18 that i could use in the html

5:18 https://gist.github.com/fredyr/8424220

5:18 piranha: hm that's strange

5:18 fredyr: to get it to work i had to do (om/value)

5:19 piranha: fredyr: no real idea why it's behaving so, I think you might want to wait for dnolen as well :)

5:19 fredyr: right

5:19 :)

5:20 i almost always miss the us folks

5:20 being on cet time i mean

5:23 clgv: fredyr: you can catch them in the afternoon easily

5:23 * clgv is in CET zone as well

5:24 fredyr: yeah

5:24 piranha: yeah just need some patience :) I'm in EET and still able to catch them

5:24 fredyr: hah

5:25 piranha: but it's true, time makes everything hard :)

5:26 fredyr: it more like the combination of time zones, work and family thats doing it

5:26 :)

5:27 btw i can recommend tim baldrigde's break down of the core.async internals if you haven't watched

5:28 they were really cool imo

5:28 piranha: yeah it's in my queue

5:29 fredyr: is that a fifo or priority queue?

5:29 (;

5:30 clgv: fredyr: you got a link to the video, since google doesnt return anything useful

5:30 fredyr: http://www.youtube.com/watch?v=R3PZMIwXN_g

5:31 there's a part II and one called deep walking macros in the same serie

5:31 s

5:31 piranha: fredyr: ah, not this one? http://www.youtube.com/watch?v=enwIIGzhahw

5:31 my link seems to be an overview

5:31 ok, that's less interesting :)

5:31 fredyr: that one is good also

5:32 but more as an introduction

5:33 the go macro vids are more like macrology galore, state monads and headasplodes

5:38 sg2002: Hello. Can somebody help me with setting cider? I get this: error in process sentinel: Could not start nREPL server: "eval" íå ÿâëÿåòñÿ âíóòðåííåé èëè âíåøíåé

5:38 êîìàíäîé, èñïîëíÿåìîé ïðîãðàììîé èëè ïàêåòíûì ôàéëîì.


5:39 ior3k: sg2002: does "lein repl" work?

5:40 mrcheeks: sg2002: how did you install it? via package-install? Do you also have lein install?

5:40 installed*

5:41 sg2002: I have lein installed. Lein works.

5:41 mrcheeks: what about the cider installation then?

5:41 sg2002: Installed via package install.

5:43 mrcheeks: Try to 'pastebin/refheap' your setup for cider

5:43 sg2002: I'm using windows by the way. It looks like some kind of message from shell, just in the wrong codepage.

5:43 mrcheeks: ah Windows...

5:44 sg2002: mrcheeks: Don't have any. Just basic thing from the readme.

5:44 testcloj`: {1 "abc", 2 "def" 3 "qq"}

5:44 {:a [1],:b [1 2], :c [2 3]}

5:44 how to get the following ?

5:44 {:a "abc",:b "abc,def", :c "def,qq"}

5:46 sg2002: Oh, was able to read the message... Hmm.

5:47 noncom: sg2002: your message says that eval is not an executable command

5:47 sg2002: noncom: Yep.

5:47 noncom: looks like you feed it to cmd instead of clojure repl

5:48 sg2002: Yeah, seems so. Why would that happen?

5:51 AeroNotix: What other shells are available for Clojure?

5:51 (ala python=>ipython)

5:52 fredyr: AeroNotix: does light table count?

5:53 noncom: sg2002: well, idk what is your setup... what you try to start and how

5:53 AeroNotix: fredyr: no

5:53 sg2002: Hmm. Just reinstalling package helped. Guess my cider installation got broken somehow. Plus it kind of updated from nrepl, haven't used clojure in emacs in quite a while.

5:53 noncom: oh well..

5:54 sg2002: Thanks for the hlep anyway.

5:55 sm0ke: for a class generated using gen-class how do i change the state variable?

5:56 it seems to be a stupid final

5:56 and i cant use atom

5:56 can i ask the state variable of gen-class to be non final

5:58 anyone?

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

5:58 sm0ke: clojurebot: dont mess with me

5:58 clojurebot: excusez-moi

5:58 sm0ke: grrr

6:05 so i want a mutable map in clojure, how do i do it?..there i said it

6:08 AeroNotix: sm0ke: ref/atom?

6:09 ucb: sm0ke: if this is related to gen-class, I believe you can manage mutable stable there

6:09 sm0ke: AeroNotix: no i cant use atom, its not fucking serializable!!

6:09 AeroNotix: sm0ke: woah the hostility

6:09 sm0ke: god clojure makes it hard to mutate

6:09 AeroNotix: sorry

6:09 AeroNotix: sm0ke: that's kind of the point

6:09 fredyr: sm0ke: transient map doesn't do it?

6:09 AeroNotix: transients should do it

6:09 sm0ke: fredyr: yes exactly

6:10 fredyr: AeroNotix thanks i was looking into just that

6:10 so transient map with assoc! and dissoc! right?

6:12 fredyr: yes

6:12 sm0ke: i hope there was a better solution

6:12 AeroNotix: ,(def mut-map (transient {}))

6:12 clojurebot: #'sandbox/mut-map

6:12 sm0ke: its like trading clojure goodness for serialization

6:12 AeroNotix: ,(assoc! mut-map :k :v)

6:12 clojurebot: #<IllegalAccessError java.lang.IllegalAccessError: Transient used by non-owner thread>

6:12 AeroNotix: WHAT EVER

6:14 sm0ke: there should be a serializable stm solution

6:14 fredyr: user> ,(let [t (transient {})] (assoc! t :hello :world) (persistent! t))

6:15 ,(let [t (transient {})] (assoc! t :hello :world) (persistent! t))

6:15 clojurebot: {:hello :world}

6:18 sm0ke: just tell me transient doesnt imply what transient means in java

6:19 fredyr: it doesnt

6:19 sm0ke: phew!

6:20 clgv: sm0ke: it is an optimization to build up collections faster. often the pattern is (->> some-coll (reduce (fn ..) (transient [])) persistent!)

6:20 DerGuteMoritz: note that you still need to reassign the var even with transients

6:20 they do mutate in place but not reliably

6:20 clgv: using a transient in a variable is not idiomatic afaik

6:21 DerGuteMoritz: sm0ke: can't you use a box type of sorts?

6:21 clgv: yeah, I'd think so, too

6:21 its purpose is to be used in a short-lived local context

6:21 clgv: sm0ke: you definitely should go for ref or atom depending on whether you need transactions or not

6:23 pyrtsa: Often you don't want to use transient anyway, because many core functions such as `into` do use transients internally. Just use an atom or a ref and do multiple updates at once when possible.

6:23 sm0ke: wtf man! transientmap is not serializable!

6:23 wtf

6:24 fredyr: liar

6:24 pyrtsa: A transient map has many issues. For instance, you can't list its keys.

6:24 fredyr: :S

6:24 DerGuteMoritz: ,(def foo (clojure.lang.Box. 1))

6:24 clojurebot: #'sandbox/foo

6:24 DerGuteMoritz: ,(.-val foo)

6:24 clojurebot: 1

6:24 pyrtsa: It's intended for a very limited use case.

6:24 DerGuteMoritz: ,(set! (.-val foo) 2)

6:24 clojurebot: 2

6:24 DerGuteMoritz: ,(.-val foo)

6:24 clojurebot: 2

6:24 fredyr: sm0ke: sorry didn't know if it was serializeable or not

6:24 sm0ke: just gave an option for mutable maps

6:25 pyrtsa: sm0ke: What are you trying to do?

6:25 sm0ke: well

6:25 DerGuteMoritz: sm0ke: yo, no need to be hostile

6:25 fredyr: sm0ke: but if mutable map is what you want you might want to just use java.util.HashMap

6:25 sm0ke: i just want a mutable fucking variable for my gen class which i can serialize

6:25 DerGuteMoritz: sm0ke: did you see my clojure.lang.Box example above?=

6:25 sm0ke: fredyr: sorry

6:26 DerGuteMoritz: it's not serializable either AFAIK but it is trivial to make your own box type that is

6:26 sm0ke: i dont understand why a transient map isnt serializable

6:26 fredyr: ,(java.util.HashMap. {:wow :such :anger :doge})

6:26 clojurebot: {:anger :doge, :wow :such}

6:27 sm0ke: ,(instance? java.io.Serializable (transient {}))

6:27 clojurebot: false

6:28 sm0ke: ,(instance? java.io.Serializable {})

6:28 clojurebot: true

6:28 sm0ke: ,(instance? java.io.Serializable (clojure.lang.Box. 1))

6:28 clojurebot: false

6:28 sm0ke: hmm

6:28 what are the options

6:28 pyrtsa: sm0ke: Probably because no one thought it should be. Transients were built to be just quick ways to construct persistent data structures.

6:28 fredyr: ,(instance? java.io.Serializable (java.util.HashMap. {:wow :such :anger :doge}))

6:28 clojurebot: true

6:28 sm0ke: pyrtsa: so what should i do for a mutable serializable data strucutre

6:29 pyrtsa: sm0ke: Try java.util.HashMap.

6:29 sm0ke: heh

6:29 DerGuteMoritz: sm0ke: just roll your own serializable version of https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Box.java

6:29 sm0ke: DerGuteMoritz: sounds like work!

6:29 pyrtsa: sm0ke: No, seriously. Your use case doesn't sound like idiomatic Clojure, so why try to use idiomatic Clojure for it?

6:29 DerGuteMoritz: sm0ke: well or use Java's stdlib

6:30 sm0ke: if java.util.HashMap is what you want, why not use it?

6:30 right, what pyrtsa says

6:30 serializing clojure data is done via EDN usually

6:30 sm0ke: yep, makes sense

6:30 DerGuteMoritz: there i no explicit serialization

6:31 DerGuteMoritz: sm0ke: hm?

6:32 sm0ke: DerGuteMoritz: the user of my api can create objects and send over network

6:32 oh wait

6:32 does java.io.Serializable iterface has methods for onSerialization? onDeserialization?

6:33 yeah

6:33 DerGuteMoritz: sm0ke: well the wire format is your choice, you could use EDN instead of Java serialization

6:33 sm0ke: onRead onWrite should do right

6:46 sobel: my repl (1.5.1) prints 'nil' after every println. is that normal?

6:46 it also prints the parameter string, but i get a 'nil' printed on a new line too

6:46 karls: sobel: println's return value is nil.

6:46 sobel: ah ok

6:47 i just didn't see it in any of the tutorial material i'm using so i wasn't sure if mine was subtly broken or what

6:47 but that makes perfect sense

6:48 so far i'm liking http://www.braveclojure.com/do-things/ but pointers to other new-to-clojure material are welcome.

6:49 sm0ke: ugh.. overwring serializable methods left me wondering how to re initialize the final variable!

6:49 i think the best option was what pyrtsa suggested

6:52 CookedGryphon: sm0ke: have you looked at nippy?

6:52 just joining the conversation now, but if you're talking about serializing stuff to send over the wire, it's a really nice option

6:53 sm0ke: CookedGryphon: yea but the problem is i cannot control serialization explicitly

6:54 CookedGryphon: what do you mean?

6:55 sm0ke: what if the class you want to be serializable is just a instance variable in some other class user of the api created?

6:55 which is being serialized by standard java api

6:55 CookedGryphon: it's compatible with normal java serializable

6:55 and it uses protocols so you can extend it to whatevery ou want

6:56 you can even pass in a single extra option to encrypt it

6:57 sm0ke: CookedGryphon: well yea i have been using it for a while, but i dont see how it solves the problem

6:57 may be i am not thinking otb

6:58 CookedGryphon: try explaining again, I don't get what your issue is

6:59 clgv: clojurebot allows defs?

6:59 ,(defn f [x] (inc x))

6:59 clojurebot: #'sandbox/f

6:59 clgv: wow

6:59 that's new

6:59 (f 0)

6:59 ,(f 0)

6:59 clojurebot: 1

6:59 AeroNotix: ,(sandbox/f 10)

6:59 clojurebot: 11

7:00 sm0ke: CookedGryphon: make a class using gen-class which has a mutable variable and is serializable

7:00 AeroNotix: ,(prn (repeat 10))

7:00 clojurebot: (10 10 10 10 10 ...)\n

7:00 sm0ke: CookedGryphon: a map variable would be nice

7:01 CookedGryphon: atoms are welcome for sake of idiomatic clojure writing

7:01 AeroNotix: clever girl

7:03 CookedGryphon: 2 options, extend java serializable, job done, or (extend-freeze MyType 1 [x data-output-stream] (.writeUTF data-output-stream (freeze (.getMyMapVariable x))) .....

7:03 and then extend-thaw the other way

7:03 write each of the things you want to save to the output stream, then read them off the input stream in the same order

7:05 clgv: sm0ke: I wouldn't serialize clojure datastructures via serialization. you'll serialize a lot of useless internal structure of the datastructures

7:06 AeroNotix: sm0ke: https://github.com/edn-format/edn ?

7:07 sm0ke: what if the class is being used by some java guy?

7:07 he doesnt know edn or nippy

7:07 AeroNotix: screw him ;)

7:07 j/k

7:07 sm0ke: he want to do a.x=2

7:07 CookedGryphon: he can know edn

7:07 sm0ke: AeroNotix: childish

7:07 AeroNotix: sm0ke: twas a joke

7:07 CookedGryphon: or you provide a wrapper which accesses it through your clojure api

7:08 AeroNotix: a wrapper would be nice

7:08 sm0ke: ok guys i am going to use a HashMap unless someone can come up with a way to overrite onRead and onWrite

7:25 ok .. but i still think transient should extend serializable

7:26 do you guys think someone should open a ticket for it? or is there some insight on why its no like so

7:37 CookedGryphon: sm0ke: you aren't supposed to let transients escape your function, trying to do anything like assoc or conj on a transient will throw an exception

7:37 sm0ke: CookedGryphon: yea but there are assco! and dissoc!

7:37 CookedGryphon: to stop you accidentally leaking transients into a context requiring/expecting a persistent

7:38 yeah, but if you're not meant to let them out of your function, you most certainly aren't meant to keep them around long enough to serialise them

7:38 sm0ke: CookedGryphon: i dont see what anything of this has to do with it being serializable

7:38 CookedGryphon: you aren't meant to observe it outside of the function that makes it

7:38 sm0ke: CookedGryphon: i can do a (def a (transient {}))

7:39 observe it from anywhere now

7:39 CookedGryphon: yes, you can do all sorts of things you're not supposed to

7:39 doesn't mean you should, and definitely doesn't mean it was the way it was intended do be used

7:40 if you don't want your datastructure persistent and immutable, don't use a persistent immutable datastructure, it's inefficient if nothing else

7:41 sobel: having read up on lock-free data structures, i am MUCH happier with immutable data structures

7:41 lightbulb moment

7:42 it really took some theory reading to figure out the wisdom in it.

7:42 CookedGryphon: transient/persistent is meant to be used in very confined areas, where you can see everything that's happening to it and therefore easily reason about it - "If a tree falls in the woods, does it make a sound?

7:42 If a pure function mutates some local data in order to produce an immutable return value, is that ok?"

7:42 (from http://clojure.org/transients)

7:44 augustl: sobel: just chiming in and seconding that you shouldn't use transient outside of function-local values

7:44 you should always take and return immutable values. If you have a function that takes a transient as an argument, kittens will die, and so on :)

7:44 sobel: TL/DR: Concurrency is hard

7:44 :)

7:44 augustl: transients are only about performance

7:45 locks: let's go shopping

7:45 but we take to take turns

7:45 or we can go to different stores at the same time

7:45 augustl: also, a transient isn't truly mutable. (do (def a (transient {})) (assoc! a :foo "123") (println (:a foo))) => nil

7:45 locks: and then meet somewhere

7:45 unless someone is l--oh boy.

7:45 augustl: you still have to use the return value from assoc! and friends

7:45 sm0ke: well CookedGryphon if a tree would fell in the forest i should be able to take it home and burn the wood

7:45 sw1nn: anyone around who's playing with om?

7:45 sm0ke: lol

7:45 sobel: i would not be in a position to self-teach clojure if i hadn't tackled SQL already. i don't know how someone could transition from OO to FP without the same experience.

7:46 sw1nn: I've got a test project that renders some components, but I'm getting lots of 'mysterious' <span data-reactid=".r[4jfl6].[0].[0].[0].{cljs$lang$protocol_mask$partition0$}">167668511</span>

7:46 locks: sw1nn: not yet, but I bet dnolen knows a thing or too

7:47 dnolen: sw1nn: it seems like you may be accidentally providing a data structure as the key, instead of some simpler value like a string or number

7:47 CookedGryphon: sm0ke: no you shouldn't. Clojure's constraints are what give it value. The fact that you can't just do whatever the hell you like, means that other people reading your code have a much easier time of it, and so do you as your codebase grows beyond a trivial size

7:47 sw1nn: dnolen. thnks, that makes sense.

7:48 augustl: sobel: immutable values is the biggest takeway from Clojure into other environments imo :)

7:49 such benefits, wow

7:49 sm0ke: CookedGryphon: i am sorry but i still dont see what the hell anything of that has to do with serializability

7:49 CookedGryphon: just my opinion

7:49 augustl: oh I just realized I meant sm0ke not sobel :)

7:49 sobel: so tabcomplete

7:50 sm0ke: absolutely, immutable is good

7:50 edbond: sw1nn, try to apply dom/* function. like (apply dom/div nil (map .....))

7:50 augustl: actually braincomplete, saw both your names ;)

7:50 sobel: so early, much squinting

7:50 CookedGryphon: sm0ke: because if you are serializing and then instantly deserializing within the tight inner loop of a single function, you're doing something very very wrong and misunderstanding the fundamentals

7:50 sobel: sry, done dogeing

7:50 CookedGryphon: brb

7:51 sm0ke: CookedGryphon: ok

7:51 locks: sobel: much apology, such sincerity

7:51 augustl: very meme :)

7:52 sm0ke: i dont know man, the fact that no one else agrees with me must be beacuse i am wrong

7:52 augustl: sm0ke: agrees with you that passing around transients is OK?

7:52 edbond: dnolen, how to om/transact! without re-render?

7:52 dnolen: edbond: not currently possible, but what's the use case?

7:53 sm0ke: augustl: i said serializability, you CAN pass them around doesnt meant they SHOULD

7:53 augustl: i never made that statement

7:53 augustl: sm0ke: yeah I agree

7:54 sm0ke: augustl: serializability is nothing, given things you can already do with them

7:54 so i dont see the fkn point

7:55 edbond: dnolen, thanks. This is very specific, will try to find another way to block until render finish.

7:56 dnolen: edbond: re-renders are never immediate

7:57 edbond: dnolen, only on requestAnimationFrame, I know

7:57 fredyr_: dnolen: yesterday i ran into trouble when trying to destructure a cursor in om, https://gist.github.com/fredyr/8424220

7:58 dnolen: is there something obvously wrong in there, would you say?

7:59 edbond: fredyr_, did you try lein cljsbuild clean and compile again?

8:00 fredyr_: dnolen: it works fine if I do (om/value state) though

8:00 dnolen: fredyr_: did you extend-type string to ICloneable?

8:00 fredyr_: dnolen: no i haven't

8:01 dnolen: should i?

8:01 dnolen: fredyr_: hmm I don't know, in the middle of some other stuff. But that seems like a bug to me file a GitHub issue please

8:02 fredyr_: dnolen: ok sure

8:02 dnolen: is the gist info enough or would you like something more complete?

8:03 dnolen: fredyr_: gist is minimal enough, but please put the contents directly into the issue, thanks.

8:03 fredyr_: dnolen: ok will do

8:05 edbond: fredyr_, what om, cljs versions do you use? I pasted your code and see div > h2

8:05 fredyr_: edbond: 0.1.6

8:05 edbond: fredyr_, if you had previous versions may be worth to do clean, both lein deps and cljsbuild.

8:06 sometimes it helps for me

8:06 fredyr_: edbond: yeah that might be a reason

8:06 edbond: lein cljsbuild clean

8:06 edbond: and lein deps clean

8:07 fredyr_: edbond: ah that one i haven't done before

8:09 rurumate_: I have a map from strings to vectors of strings like this: {"a" ["foo" "bar"] "b" ["baz"]}. how to invert?

8:09 should become {"foo" "a" "bar" "a" "baz" "b"}

8:10 AimHere: I'd probably knock up something with reduce-kv for that kind of problem

8:11 fredyr_: edbond: no luck unfortunately with cleaning

8:12 edbond: fredyr_, hm, I can paste compiled js probably to compare

8:13 fredyr_, clojurescript 0.0-2138, lein-cljsbuild 1.0.2-SNAPSHOT

8:13 om 1.0.6

8:14 fredyr_, did you try om/examples, they works?

8:14 AimHere: ,(reduce-kv (fn [m k v] (apply assoc m (interleave v (repeat k)))) {} {:a [:foo :bar] :b [:baz]})

8:14 clojurebot: {:baz :b, :bar :a, :foo :a}

8:15 lumafi: ,(into {} (for [[k vv] {"a" ["foo" "bar"] "b" ["baz"]}, v vv] [v k]))

8:15 clojurebot: {"foo" "a", "bar" "a", "baz" "b"}

8:16 fredyr_: edbond: so i can get my code to work if i wrap the cursor with om/value before accessing author

8:17 edbond: and i do some build-all stuff and so on that works fine

8:21 testclo: how to destruct a map? for the following e.g. I want to get the key and value for each pair

8:21 (def a {1 2,3 4})

8:21 (map (fn[key val]) a )

8:23 AimHere: ,(map identity {:a 1 :b 2 :c 3})

8:23 clojurebot: ([:a 1] [:c 3] [:b 2])

8:23 AimHere: That sort of thing?

8:23 jcromartie: (seq {:x 1 :y 2})

8:23 err

8:23 AimHere: When you treat a map as a sequence, it turns into a sequence of [k v] pairs

8:23 jcromartie: ,(seq {:x 1 :y 2})

8:23 clojurebot: ([:y 2] [:x 1])

8:24 fredyr_: edbond: im on cljs 0.0-2127, that could perhaps be the reason

8:24 jcromartie: ,(map type {:x 1 :y 2})

8:24 clojurebot: (clojure.lang.MapEntry clojure.lang.MapEntry)

8:25 jcromartie: ,(map count {:x 1 :y 2})

8:25 clojurebot: (2 2)

8:27 fredyr_: edbond: OHHHZOMG

8:28 edbond: fredyr_, did that helps?

8:29 fredyr_: edbond: it did!!

8:29 edbond: now it works fine, so it seems like there was something in the cljs version

8:29 dnolen: fredyr_: oh yeah, the README says 2138

8:29 fredyr_: but perhaps I should make that more clear

8:36 fredyr_: dnolen: sorry to bother you with that

8:38 noncom: are there already some examples or tutorials on macro architecture of guis with core.async? not just one or two elements or a simple website, but full-scale uis?

8:39 i've been looking for examples on csp but did not find

8:49 fredyr_: edbond: thanks very much

8:49 edbond: fredyr_, you are welcome

8:50 quizdr: ,(println "thanks everyone, see you tomorrow")

8:50 clojurebot: thanks everyone, see you tomorrow\n

9:11 sritchie: I'm going to brave it and ask a shell question here… do you guys know why this works with &&, but fails with ||?

9:12 if [ -z $CIRCLE_CI ] && [ $CIRCLE_BRANCH != "develop" ]; then echo "WORKING"; fi

9:12 -bash: [: !=: unary operator expected

9:12 when I use ||

9:12 clojurebot: Huh?

9:13 hyPiRion: sritchie: I guess $CIRCLE_BRANCH results into nothing, and then you get the expression [ != "develop" ]

9:13 so wrap it in ""s

9:13 sritchie: ah, gotcha

9:14 hyPiRion: same with $CIRCLE_CI I guess

9:14 sritchie: strangely that one works, even if I sub in some random var

9:14 cool, makes sense

9:14 much like when I learned clojure, digging into bash is changing the way I think about programming :)

9:15 demon386: In a good way?...

9:15 sritchie: haha, not yet

9:17 hyPiRion: sritchie: I feel that with every language with some new concept I haven't yet learned, which usually is a net gain

9:18 Bash gave me the value of printing to stdout

9:18 or uh, "value"

9:31 locks: dnolen: are you planning on having a section on your cljs tutorial on how to tweak LT itself?

9:38 rurumate_: AimHere: thanks mate, sorry for late reply

9:39 it seems to work, amazing stuff

9:51 instilled: hi. i'm trying to remove maps from a list where a-key matches an item in a list, i.e something like this: (map #(if ((:a-key %1) in list) nil %1) some-list-of-maps). Is there an idiomatic clojure way of doing this?

9:53 hyPiRion: instilled: so you have one list with maps, one key, and one list with items?

9:57 instilled: hyPiRion: I have a 'list of maps' and a 'list of values' and would like to remove all maps the 'list of maps' where a certain key, let's say :x, matches a value in the 'list of values'

9:58 hyPiRion: instilled: okay, gotcha

9:58 instilled: hyPiRion: i have it working but it feels like there is a more clojure way of doing the same thing….

9:58 hyPiRion: instilled: so the "safest" way of doing it would be this: (let [list-set (set item-list)] (remove #(some->> (find % my-key) second (contains? list-set)) list-of-maps))

9:59 instilled: ihyPiRion: i use filter and a set as a predicate...

9:59 hyPiRion: this won't remove the map if the key is not existant, and key can be nil

10:00 although, ugh, this won't work if the value is nil.

10:02 (let [list-set (set item-list)] (remove #(some-> (find % my-key) (as-> tuple (contains? list-set (second tuple)))) list-of-maps)) should also preserve nil values, if that's what you're looking for

10:02 instilled: hyPiRion: ok. right. (some #{"val"} nil) does return nil. and it shouldn't in my case. I'll get my head around you solution …

10:03 AeroNotix: I'm using SSL+jetty, when I try to `lein run' it gives me a java.net.SocketException: Permission denied. Trying to run on SSL.

10:03 instilled: hyPiRion: cheers a lot!

10:03 hyPiRion: instilled: I would guess my first solution is essentially the same as yours, just a bit more convoluted. I attempted to handle nil keys and nil values with it, but failed :p

10:04 AeroNotix: I would guess you need permission to listen to those ports. Ports below a specific range usually must.

10:05 AeroNotix: hyPiRion: sure, but it's running on 8080

10:06 hyPiRion: and I need to have the clojure jar running SSL due to some legal restrictions, so I can't just have nginx proxy to it or w/e

10:07 hyPiRion: then I'm not sure. Are you sure the httpS port is running on 8080 and not the http one? https is by default 443 and won't change if just http changs.

10:08 (But yeah, it's defineatedly configurable.)

10:08 AeroNotix: :ssl-port 8080

10:08 in the jetty optoins

10:08 hyPiRion: okay, then I have no idea.

10:09 AeroNotix: :(

10:09 hyPiRion: You probably need a certificate for it, but I don't think it should give a socket exception

10:09 AeroNotix: It works when I run it as root

10:10 pcn: AeroNotix: then it is trying to bind to a low port

10:10 AeroNotix: pcn: It's running on 8080

10:10 which is not a privelidged port

10:10 hyPiRion: AeroNotix: have you changed :port to something else?

10:11 pcn: What hyPiRion said

10:11 AeroNotix: hyPiRion: :port is blank

10:11 I didn't set it

10:11 pcn: Set it to something else and try

10:11 AeroNotix: second

10:11 hyPiRion: What pcn said

10:11 :p

10:11 AeroNotix: that works :)

10:11 it probably has a default

10:11 pcn: Because it's possible that by making it empty, you're telling jetty to bind to port 80

10:12 hyPiRion: or in this case, attempt to bind to port 80

10:12 then fail horribly

10:12 AeroNotix: yeah, the default for :port must be 80

10:12 * AeroNotix checks source

10:12 AeroNotix: http://clojuredocs.org/ring/ring.adapter.jetty/run-jetty

10:13 it mentions other defaults... but not :port

10:13 hyPiRion: yeah, that should definitely be fixed

10:13 AeroNotix: indeed

10:16 hyPiRion: AeroNotix: ah, it's just not updated

10:17 https://github.com/mmcgrana/ring/blob/master/ring-jetty-adapter/src/ring/adapter/jetty.clj#L62-L77 <- actual docstring

10:18 AeroNotix: sweet!

10:37 gfredericks: is using long names for bit operations some sort of lisp tradition?

10:39 ,'(|| && << >> <<< >>>)

10:39 clojurebot: (|| && << >> <<< ...)

10:39 gfredericks: I guess the one we can't get is ^

10:39 hyPiRion: gfredericks: At least we don't have double-float-negative-epsilon and friends

10:39 CookedGryphon: it's not really a language designed for a lot of bit-twiddling

10:39 you only give short names to things you use every day, otherwise you give it a descriptive name

10:40 hyPiRion: or least-negative-normalized-double-float

10:45 gfredericks: FP units should be separate chips like GPUs

10:45 arrdem: gfredericks: nooooooo

10:45 gfredericks: dude. that would suck ass from a performance standpoint.

10:45 gfredericks: do your whole computation on that chip them

10:45 then*

10:46 arrdem: gfredericks: IEEE floating point in software? why....

10:46 gfredericks: not in software

10:46 just not all wrapped up in the main CPU

10:47 I _would_ claim that the FP unit isn't used much on most computers, but comically that's probably not true thanks to people building websites

10:47 there's a bimodal use case for FP

10:47 wink: and I thought you proposed a functional programming unit for a second...

10:48 .oO( i.e. LISP machine )

10:48 arrdem: wink: that's even sillier than saying we should throw away the floating point unit...

10:49 gfredericks: "Floating point numbers are useful for certain kinds of scientific computing and also for building a blog."

10:49 progo: :)

10:49 arrdem: the issue with having offchip components is that the IO times are so bad that unless you have an exceedingly large workload the IO time dominates

10:50 gfredericks: arrdem: I'm focusing on the world I work in where the FP unit is totally unused and so there are no consequences

10:50 hyPiRion: hah

10:50 gfredericks: other worlds are obviously irrelevant

10:50 wink: arrdem: pff :P

10:50 arrdem: gfredericks: and one of my involvements here at school is high performance scientific computing, so I can tell you that's silly :D

10:51 gfredericks: scientists are a bunch of integer-haters

10:51 * hyPiRion waves to fellow HPC student

10:51 * arrdem high fives hyPiRion for being the only other hardware nerd in chan

10:51 gfredericks: down with hardware!

10:52 nDuff: Heh.

10:52 * nDuff tries to remember around which year FPUs moved onto CPUs in consumer equipment.

10:52 gfredericks: and finally blogs became possible

10:52 arrdem: gfredericks: lolz

10:53 nDuff: i48g

10:53 *i486

10:54 gfredericks: 386 was ints only?

10:54 arrdem: gfredericks: yeah the original 386 architecture didn't have all the floating point augmentations

10:55 chronno: gfredericks: yout had to use a math coprocessor if you wanted FP

10:55 john2x: what's the standard filetype for storing app settings/metadata? e.g. yaml for Ruby/Python projects, json for js projects

10:55 chronno: gfredericks: http://en.wikipedia.org/wiki/Coprocessor#Intel_coprocessors

10:55 john2x: or is it project.clj? (can I reference keys in project.clj in a project?)

10:56 arrdem: $google clojure edn

10:56 lazybot: [edn-format/edn · GitHub] https://github.com/edn-format/edn

10:56 arrdem: $google tools reader edn

10:56 lazybot: [clojure/tools.reader · GitHub] https://github.com/clojure/tools.reader

10:56 arrdem: john2x: ^

10:57 john2x: project.clj is specific to the leiningen build system... your app won't ever be aware of what's in there.

10:57 gfredericks: bring back the coprocessor!

10:57 chronno: gfredericks: lol

10:57 john2x: arrdem: thanks. yeah, that's what I thought.

10:57 CookedGryphon: john2x: or if you want a little extra help https://github.com/TouchType/conf-er

10:57 arrdem: gfredericks: if you want to _add_ some coprocessors I'm okay with that... using such additions as an excuse to remove the FPU is silly.

10:57 that said webdev is silly

10:59 pcn: arrdem gfredericks 386 sx was no fp, dx had both right?

10:59 arrdem: huh. looks like there was an FPU standard prior to the i486.. http://en.wikipedia.org/wiki/Intel_80387#80387

10:59 john2x: CookedGryphon: even better. thanks!

11:07 CookedGryphon: john2x: no problem. Let me know if you have any problems or feature requests

11:08 john2x: CookedGryphon: will do, thanks.

11:12 AeroNotix: are multimethods the best way to dispatch on type when working with built in types and java classes?

11:12 I want to dispatch a function on a map and a java class.

11:12 `cbp: if it's just type you can use protocols

11:12 AeroNotix: boom

11:13 `cbp: headshot?

11:14 AeroNotix: HEADSHOT

11:23 katox: arrdem: it helped, I had one of those ;)

11:31 CookedGryphon: how do i "copy" a channel in core.async

11:32 I have something pulling from it, and I want something else to be able to observe the same data without affecting the first thing

11:32 rkneufeld: CookedGryphon: mult, no?

11:33 CookedGryphon: rkneufeld: do i need to do that to the top level one and change my existing loop to tap from that mult?

11:34 or does mult not consume the channel you apply mult to?

11:34 rkneufeld: I'm not sure, I've never used it–just aware of it.

11:34 I'd have to read http://clojure.github.io/core.async/#clojure.core.async/mult to say better.

11:35 CookedGryphon: yeah, I'm reading that, still not clear though

11:35 stuartsierra: I don't think you can 'copy' a channel without consuming it.

11:36 CookedGryphon: stuartsierra: that was my thinking, okay, so I'll mult the incoming channel and change the loop already consuming it to consume a tap instead and it's all good

11:36 thanks

11:36 stuartsierra: yes

11:36 you're welcome

11:36 arrdem: hum... anyone care to comment on ztellman's gloss?

11:36 mdrogalis: I was under the impression that that was what map was for.

11:36 Or this isn't a one-time-only copy?

11:37 CookedGryphon: i mean I want to observe the data that's going through a channel to something else without affecting the existing observer

11:37 mdrogalis: CookedGryphon: Ah, I understand.

11:42 jjttjj: are there any decent guidelines for when to switch from positional parameters to a single map as a parameter? Or when is it better to use destructuring to just do named args like (foo :animal "cat"), etc

11:42 the clojure-style-guide says to avoid using more than 4 positional params but what if these are db "add" functions and half of your models have only a few fields and the rest have a lot more than 4

11:43 andyf: Is there a way to set Leiningen :source-paths from the command line?

11:43 jjttjj: (I get hung up on a lot of stupid things when I should just be building stuff, just curious what other peoples' opinions are on this)

11:44 stcredzero: jjttjj: I think that's normal. If you're not doing that as a programmer, you're probably not trying.

11:45 jjttjj: stcredzero: good to know :)

11:46 gfredericks: andyf: like for a single run of `lein something`?

11:47 andyf: gfredericks: yes. If editing ~/.lein/profiles.clj is the next best thing, I can script that, instead.

11:49 gfredericks: andyf: it would surprise me if you could; integrating environ w/ leiningen sounds like an interesting idea

11:50 locks: jjttjj: I don't have an answer, but I'll validate your concerns in that I think about this sort of thing often

11:50 clgv: CookedGryphon: you can check whether you can copy the buffer of a channel - if so you can plug them together manually to get hold of the buffer

11:51 stcredzero: locks: In other words, you're telling him he should be worried, but not to be worried about the fact he is worried.

11:53 CookedGryphon: clgv: explain? Do you mean poking about in the internals? or am i misunderstanding you

11:53 stuartsierra: jjttjj: It really comes down to developer experience. If you're having trouble remembering the argument order, or creating bugs by getting it wrong, it's probably time to switch to maps or keyword args.

11:53 gfredericks: has the clojurewest.org site been down for 24 hrs now?

11:53 stuartsierra: gfredericks: works for me

11:54 jjttjj: stuartsierra, locks: thanks for the input

11:55 clgv: CookedGryphon: you can create a buffer manually and then create a channel with it. if you keep the buffer around and buffers can be copied, you can copy the content of the channel without consuming it

11:56 CookedGryphon: oh humm well, that assumes that the buffer is some mutable thingy which might not be true in case it is a persistent data structure

11:56 CookedGryphon: I think for this particular use case mult/tap is what I want, as it makes it apparent what's happening, but that sounds like a neat trick I might play with later (I want to make something to do riemann monitoring of throughput/speed etc)

11:58 clgv: ok buffers are implemented via linkedlist in a mutable fashion^^

11:59 gfredericks: huh maybe my office internet connection provides every site except clojurewest.org

11:59 presumably it is NSFW

12:01 oh it only works with www

12:01 I doughnot understand the internets

12:01 stuartsierra: gfredericks: Odd, it redirects to www. automatically for me.

12:02 gfredericks: yes I can't get any of my coworkers to reproduce this

12:03 so it's local to my machine, but happens both in the linux virtualbox vm _and_ in OSX

12:03 `curl clojurewest.org` hangs while www succeeds

12:03 I give up computers

12:03 stuartsierra: Try clearing your DNS cache (I don't remember how to do that)

12:04 deadghost: computers are overrated anyways

12:11 technomancy: andyf: the update-in task is basically for that

12:12 gfredericks: technomancy: WAT is that

12:13 * gfredericks rushes to lein help

12:13 lsdafjklsd: Anyone know how to hook a browser repl up to a clojurescript project? I've got the script tag in my <head></head> section and can see it connected, but not sure how to send commands to the browser from my cljs file

12:13 in a LightTable context

12:13 forgot to mention that, trying to get lighttable working

12:13 andyf: technomancy: cool. Looks like something like 'lein update-in :source-paths concat :test-paths ...' should append test paths to source paths for that command?

12:14 I'm just looking for something that will let me do 'lein check' on all of the source and test files, without having to edit project.clj if possible, since I want to do it on about 60 projects.

12:14 technomancy: andyf: I don't think it will look up keywords in the project map like that

12:15 you need to provide whatever you want to concat as an arg

12:15 gfredericks: it's a way to sate my endless desire for higher-order tasks is all

12:15 andyf: technomancy: OK. I think I can get it down to a few cases, perhaps. Thanks for the tip.

12:15 gfredericks: technomancy: am I crazy or does this make it difficult to override something?

12:15 i.e., there is no assoc-in

12:15 jjl`_: does anyone know if anyone has tried to update ritz-nrepl's emacs bindings to work with cider?

12:16 technomancy: gfredericks: there's a special-case for the base map

12:16 rurumate_: ,(type '2)

12:16 clojurebot: java.lang.Long

12:16 rurumate_: why is '2 not a symbol?

12:16 gfredericks: technomancy: yeah I just tried `lein update-in '' assoc :foo "bar" ...` and that worked

12:17 rurumate_: ' doesn't create symbols, it just suppresses evaluation

12:17 technomancy: note you have to double-quote strings due to shells being shells

12:17 gfredericks: ,(map type ['true 'nil 'false ':foo])

12:17 clojurebot: (java.lang.Boolean nil java.lang.Boolean clojure.lang.Keyword)

12:17 technomancy: it's easy to get a symbol when you meant to pass in a string

12:17 gfredericks: clojurebot: shells |are| shells

12:17 clojurebot: c'est bon!

12:21 gfredericks: technomancy: how to update the base map should prollably be in the docstring eh? I'll go fiddle that

12:22 technomancy: gfredericks: I think it is?

12:22 is says use a colon instead of an empty string, but it still works

12:22 gfredericks: technomancy: clearly I do not read anything

12:23 * gfredericks goes to create a github issue called "update-in docstring should say what it says"

12:23 technomancy: how can you be expected to, with today's active lifestyles

12:23 * technomancy queues up Polvo

12:35 justin_smith: man, Polvo is a nostalgia trip

12:36 matt444: Is there a version of partial that executes a function with no arguments?

12:36 CookedGryphon: matt444: uh... the function itself?

12:36 justin_smith: when I was a little kid looking for harsh noise tapes at the weirdo record store, they would always be playing the latest Polvo / Trumans Water / Sonic Youth / whatever on the sound system

12:36 technomancy: matt444: like you would with currying? not to my knowledge

12:36 justin_smith: because that was the "cool weird music" at the time

12:36 pyrtsa: ,((partial inc) 1)

12:36 clojurebot: 2

12:36 matt444: technomancy: arg, ok thanks

12:37 technomancy: matt444: partial doesn't know anything about the underlying function's arity afaik

12:37 pyrtsa: ,((partial +))

12:37 clojurebot: 0

12:37 matt444: the docs suggest they expect at least an arity of 1

12:38 Bronsa: I really wish IFn had a .arglists

12:38 technomancy: Bronsa: I'd settle for metadata

12:38 actually I'd prefer it, but whatever

12:38 pyrtsa: matt444: You're right, the docstring of partial is inexact.

12:38 Bronsa: technomancy: not reilable

12:39 technomancy: it'd be reliable if all the HOFs knew about it

12:39 not something you can necessarily retrofit though

12:40 andyf: Bronsa: So I'm liking Sean Corfield's suggestion of a linter that warns about vars with :arglists that do not match the arities of the fn that is its value. Seem like a reasonable idea to you, too?

12:40 matt444: (defn solo [fun] (fn [& args] (fun)))

12:40 Bronsa: technomancy: we already have this problem in eastwood/tools.analyzer where some functions (even in clojure.core) alter their :arglists for documentation purposes

12:40 andyf: Bronsa: But the clojure.core versions only do it for macros, I think, which does not affect the analyzer?

12:40 technomancy: oooh sketchy

12:41 andyf: Bronsa: or at least not the wrong arity warning?

12:41 technomancy: Leiningen has something like a :help-arglists so you can do that without screwing with the actual value but still provide helpful hinting

12:41 Bronsa: andyf: yeah right, but they set the bad example

12:42 andyf: btw warning about not-matching :arglists sounds reasonable

12:42 andyf: We could steer people with the warnings to use a different keyword like :help-arglists for Clojure, too.

12:42 Bronsa: I guess the problem is that clojure.core/doc uses :arglists

12:42 andyf: Especially if Leiningen had a modified version of doc that checked for :help-arglists before :arglists :-)

12:42 technomancy: maybe :human-arglists

12:43 andyf: it's just the help task

12:43 matt444: #() is what I need

12:43 except that it can't be nested

12:43 andyf: technomancy: Sure. I mean that there is apropos-better in reply, I think, and it could rebind doc, too.

12:46 ior3k: not sure if on-topic, but anyone read: http://prog21.dadgum.com/189.html ? Specifically, would anyone be able to shed some light on what is meant by "If I were writing such a simulation in a functional style, then the fixes listed above would be there from the start. It's a more natural way to work when there aren't mutable data structures."?

12:48 zerowidth: ior3k: he's referring to an earlier statement, re: "The fix is to never pollute the simulation by adding new objects mid-frame. "

12:48 basically, not mutating state until you've calculated everything you need to calculate

12:48 koalallama: any tips on how to avoid Java OOM with thise code: https://gist.github.com/ctrlrsf/12ea523e63539f166375

12:49 zerowidth: if you're doing the simulation with FP, you'd be unable (or it'd be more obviously a problem) to do that

12:49 ior3k: zerowidth: right, but given my very limited understanding about functional programming, I'd probably do exactly the same... or maybe I'm misunderstanding. If I updated an atom, wouldn't the change be immediately visible?

12:49 zerowidth: well, i can tell you what i'm doing for a very simple physics thing

12:50 which i think falls under the purview of a functional simulation ...

12:51 i have a single atom for the entire state, and instead of updating each piece of it (and replacing the atom), i do it all at once: (swap! state update-physics time-delta) where update-physics does something like (assoc state :positions (updated-positions (:positions state)))

12:52 and if that's not idiomatic, i'm all ears for code critique

12:52 ior3k: so i *think* that's what he means.

12:52 S11001001: koalallama: allnums and zerocounts can't be global defs

12:53 koalallama: make them functions instead and it's a different story

12:53 ior3k: zerowidth: don't know if you read Brian Marick's book (https://leanpub.com/fp-oo) but he mentions a style that he calls "data-flow style" which seems to be the style you mentioned

12:53 S11001001: koalallama: well, zerocounts anyway. Forget whether it matters for allnums.

12:54 koalallama: can you elaborate why/how that would affect its memory footprint?

12:54 it runs for about 60mins on my machine and then dies. I presume because the map keeps growing as range generates higher numbers

12:54 S11001001: koalallama: https://stackoverflow.com/questions/2214258/holding-onto-the-head-of-a-sequence

12:54 michaniskin: are ring middleware functions a kind of monad? if so, what is the name of this monad?

12:54 coaxmeta1: hey does anyone do clojure in vim with slimv? is that viable?

12:55 koalallama: ok, thanks

12:55 technomancy: coaxmeta1: I think everyone has migrated over to fireplace

12:55 S11001001: michaniskin: what's the type of a ring middleware function?

12:56 coaxmeta1: technomancy: oh I didn't even know about that. THanks. tpope makes a lot of good vim plugins

12:56 michaniskin: S11001001: (fn [continue] (fn [arg] ...))

12:56 technomancy: FSVO everyone

12:56 michaniskin: S11001001: the inner fn is expected to call the continuation and return the result

12:58 S11001001: so what is that (a -> z) -> b -> z? Yeah I think there's a monad there over the type of values passed to `continue', or `a'.

12:59 michaniskin: S11001001: to be more precise, there is a Handler type which is a function (Map -> Map)

13:00 S11001001: then there is the wrapper, which is what i'm interested in, which is (Handler -> Map), i think

13:01 S11001001: michaniskin: if you don't have a type variable you don't have a monad. That doesn't mean the interpreter isn't permitted to constrain it in some way, because a method of interpretation isn't required to form a monad. If you let the argument to continue vary freely you have a monad.

13:02 s,vary,varying,

13:02 er, no I was right the first time, syntactically

13:04 knyon: Is there a particular idiom for reading an EDN from the classpath?

13:04 seems I see a lot of the (-> "some.edn" clojure.java.io/resource clojure.java.io/reader java.io.PushbackReader. clojure.edn/read) pattern

13:04 seems verbose

13:04 justin_smith: knyon: (read (io/reader (io/resource "classpath/relative/file.edn")))

13:04 technomancy: you can slurp from a resource if it's small

13:05 justin_smith: technomancy: but then you need to read-string, and you could just read

13:05 michaniskin: S11001001: thanks

13:05 justin_smith: knyon: oh yeah, I forgot the PushbackReader step, my bad

13:06 knyon: justin_smith: does clojure.core/read work as clojure.edn/read?

13:06 justin_smith: knyon: yeah, it is a bit odd that there isn't a shorthand for that (read-resource modeled on read-string perhaps?)

13:06 knyon: yeah, but clojure.edn/read is actually better

13:06 usually

13:06 technomancy: knyon: depends where the data is coming from

13:07 use edn if it's unsafe, use read if it's a configgy thing

13:07 knyon: Oh, that's interesting

13:07 andyf: knyon: Read this before using clojure.core/read. There are valid use cases, but be wary

13:07 knyon: http://clojuredocs.org/clojure_core/clojure.core/read

13:07 knyon: andyf: justin_smith: much appreciated. That about covers my question

13:08 justin_smith: technomancy: well, how often would a classpath resource be unsafe? usually it is something you bundled and deployed

13:08 technomancy: heh, true

13:08 if a user can write to your classpath you've already lost

13:09 knyon: maybe for clear semantics, it's better to go with clojure.edn

13:09 even if it's safe

13:09 technomancy: it's less flexible

13:10 using the reader lets them have an escape hatch if they need to calculate something in the config file due to you not having thought of a certain case or something

13:11 knyon: Fair enough, but that should be part of the semantic decision. clojure.edn/read means 'hey, I expect an edn and I expect you not to evaluate anything in it". core/read otherwise

13:11 S11001001: michaniskin: http://lpaste.net/98542

13:12 technomancy: I'm a big fan of "declarative with escape hatches" for config

13:13 bit if it's statistical data or something then yeah, it's overkill

13:13 S11001001: michaniskin: (because fmap is free an RMF interpreter that takes the In -> Out request handler and an RMF In is not necessary)

13:14 michaniskin: S11001001: that's a little over my head at the moment. i think i need to research more before i can ask the question i really want to ask :)

13:18 rjknight: i don't suppose there are any instaparse gurus around?

13:19 i'm probably doing something extremely stupid but can't figure out exactly what it is

13:19 hiredman: I am not a guru, but I have used it and think it is great

13:19 CookedGryphon: also not a guru but have used it, put your problem in a gist and we'll see?

13:20 rjknight: will do

13:21 knyon: Is there some handy std lib function which takes a namespace and provides a path? Eg, "." and "-" to "/" and "_". Not hard rolling my own, but if it's available

13:21 matt444: Can someone give me a sanity check? Compiler is complaining about recur argument count mismatch: https://www.refheap.com/24019

13:22 CookedGryphon: matt444: what's that anonymous function doing there?

13:22 matt444: you're trying to recur into an anonymous function with one argument

13:22 giving it three arguments

13:22 Bronsa: matt444: you cannot use recur like that

13:22 matt444: i'm trying to recur back up to crawl-items

13:22 hiredman: #() is a new function, and a new recur point

13:22 koalallama: S11001001: if you're still around, can you check https://gist.github.com/ctrlrsf/12ea523e63539f166375

13:22 matt444: gotcha

13:23 so how do i do the thing i'm trying to do?

13:23 Bronsa: s/recur/crawl-items

13:23 koalallama: S11001001: I read the SO article, and I suspect reduce is holding onto the head of zerocounts. Not sure how to avoid that though.

13:23 matt444: ah, ok

13:23 thanks everyone

13:24 CookedGryphon: koalallama: you're keeping a reference to the whole list generated by map in zerocounts, and it can't throw it away because you're referencing it later on to print out the last item, so it holds on to the whole list

13:25 koalallama: CookedGryphon: right, but what would be the stragety to avoid this?

13:25 CookedGryphon: a doseq and walk the map?

13:25 s/map/sequence/g

13:25 rjknight: hiredman, CookedGryphon: https://gist.github.com/robknight/8441515

13:26 CookedGryphon: koalallama: well do you need to print the last item of zerocounts for a start?

13:26 koalallama: yup..

13:26 rjknight: what i'm expecting is that each of those numbers parse as a Word, and the spaces as Whitespace

13:27 it works with 7 numbers, but bombs out with 8 or more

13:28 hiredman: bombs out how?

13:28 rjknight: out of memory

13:28 hiredman: ah, too many possible valid parses I guess

13:29 possibly due to all the use of *

13:29 CookedGryphon: hiredman: you are saying any number of whitespace characters is whitespace, and any number of characters is a word, and then any number of any number of those is a contentLine

13:29 try taking out the + from ContentLine

13:29 rjknight: ok

13:30 CookedGryphon: or the * from whitespace?

13:30 rjknight: i'm porting this over from peg.js, where something pretty similar worked

13:30 hiredman: * is typically zero or more, + is 1 or more

13:32 rjknight: ok, that worked, at least for the out-of-memory errors :)

13:33 CookedGryphon: koalallama: you would be better off just working out that last item separately, you could even get rid of the map entirely and just use reduce with an accumulator

13:34 hiredman: I almost never use ()*, I tend to prefer recursive rules, but that seems like just a matter of taste

13:34 CookedGryphon: koalallama: but similarly you would get best performance if you make sure you don't keep a reference to allnums so it can be disposed of

13:37 S11001001: koalallama: do it backwards starting with a backwards range, then (last zerocounts) becomes (first zerocounts)

13:38 koalallama: and moving that up to before the reduce call because you don't need to hold onto zerocounts past the reduce call.

13:39 koalallama: CookedGryphon: thanks for your input. I've changed code to a doseq and memory is steady now. https://gist.github.com/ctrlrsf/12ea523e63539f166375

13:40 CookedGryphon: koalallama: that's not good, sorry

13:40 koalallama: you shouldn't be using doseq for this, doseq is for side effecting functions only, and you shouldn't be using def inside a call like that

13:40 my memory steady version looks like this: (reduce (fn [acc x] (+ acc (count (filter #(= \0 %) (str x))))) (range (inc maxnum)))

13:40 koalallama: don't be sorry :)

13:41 makes sense

13:41 CookedGryphon: koalallama: perhaps a little premature, but you could make this really fly with reducers :P

13:42 koalallama: yeah, a bit :)

13:42 zerowidth: CookedGryphon: would love to see that

13:43 przemek_: hi,

13:43 rasmusto: przemek_: ,:hi

13:43 przemek_: I'm trying to migrate from intelij to emacs and there is one issue I have been trying to solve but failed

13:43 I can't make it reformat code like idea does

13:44 what can be done is "indenting"

13:44 which doesn't format stuff like this: "(for [a (range 1 100) ) ]

13:44 CookedGryphon: zerowidth: I had a little look, but apparently reducible range hasn't made it into reducers yet which makes it trickier :(

13:45 przemek_: the thing is there are white spaces after ( or before ]

13:45 zerowidth: CookedGryphon: without knowing how reducers work, could you make a lazy-seq by hand or something that would work the same?

13:45 TimMc: przemek_: Reindenting only handles leading whitespace.

13:45 przemek_: idea can remove trailing and adjacent whitespaces + indent linens

13:45 I am sure it is doable in emacs

13:46 technomancy: M-x delete-trailing-whitespace

13:46 przemek_: but I suppose it has to do with language code style

13:46 technomancy: nothing for stuff inside the parens though; that's just weird

13:46 przemek_: I know

13:46 have tried that

13:46 CookedGryphon: zerowidth: reducers avoid lazy seq overhead, they use random access vectors and build up a "recipe" for making and combining the values

13:46 so you don't have to step through one at a time

13:46 zerowidth: oh, neat

13:46 technomancy: problem with deleting trailing whitespaces is that it zaps commas too

13:47 CookedGryphon: so the reduce can be using all your cores to do different chunks of the range at a time then combine them

13:47 przemek_: so what I can do is to use paredit mode and do my best not to introduce whitespaces inside S-exps?

13:47 kinda sad

13:47 :)

13:47 zerowidth: CookedGryphon: is it easy to convert a map on a fixed sequence to a reducer? how does that compare with pmap?

13:48 technomancy: well you already have to be careful not to introduce whitespace inside the middle of an identifier

13:48 CookedGryphon: zerowidth: trouble is, just that range as a vector uses up a lot of memory, so you need a reducers friendly one which doesn't actually generate a vector in memory but just gives you back the right range when you ask it for chunks

13:49 hyPiRion: przemek_: you could probably add a hook which does that, but I'm not sure it would be that valuable

13:49 CookedGryphon: zerowidth: pretty easy if it's already in a vector, and it makes better use of the processor than pmap which just blindly splits the work and still has all the lazy seq overhead

13:49 przemek_: well ...

13:49 hyPiRion: You generally manage to avoid those whitespaces anyway

13:49 zerowidth: CookedGryphon: so a reducer-aware range would have to be able to produce parts of the range simultaneously?

13:49 hyPiRion: At least with some clojure practise

13:49 CookedGryphon: zerowidth: exactly

13:49 przemek_: idea's plugin's code must have it

13:49 koalallama: CookedGryphon: thanks again. last paste: https://gist.github.com/ctrlrsf/12ea523e63539f166375

13:49 przemek_: so I can imagine cider gets the buffer

13:50 and processes with that code

13:50 zerowidth: i imagine pmap for this thing i'm looking at is a premature optimization... and all the more so since i'm doing it in cljs first and only thinking about pushing it server-side later >_<

13:50 hiredman: someone had a patch for reducer's friendly range

13:50 przemek_: no one has needed this so far?

13:50 koalallama: CookedGryphon: my friend trolled me into working on this when he posted his version in awk

13:50 hiredman: pmap is terrible

13:50 CookedGryphon: hiredman: Yeah, I'm looking at it, it's not made it in yet though

13:51 przemek_: I hate to have to "polish" my code manually deleting spaces

13:51 CookedGryphon: koalallama: that's more like it :)

13:52 koalallama: one discrepancy, your previous code was doing the lastzeros count on (inc maxnum), this is doing it on maxnum

13:52 and i don't get what the def lastzeros 0 and sum 0 are there for

13:52 koalallama: good catch!

13:53 jjl`_: is anyone who works on cider-mode around?

13:53 koalallama: CookedGryphon: bit-rotting.. obviously not needed either

13:54 CookedGryphon: koalallama: wait, you might have been right, range is non-inclusive, so you don't need the inc, my bad

13:55 koalallama: refresh gist if you're not board of this already. moved the inc to the maxnum def at the top.

13:55 bored*

13:56 CookedGryphon: koalallama: (last (range num)) is not num, you were right first time

13:56 koalallama: (ignore all I've just said, you were right that I was right)

13:59 CookedGryphon: lol, anyway, I'd like to see a version of that with reducers, but reducers/range isn't easily available and it's time for me to go home. Bye!

14:02 koalallama: S11001001: thanks to you as well!

14:34 mikerod: ,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))

14:34 clojurebot: ((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))

14:34 mikerod: yay, Recursion theorem in practice

14:43 AeroNotix: cider has ruined me

14:43 It's very good

14:44 I tried Clojure back in pre-1.0 days (iirc?) with SLIME and ehhh it didn't quite fit like SLIME fits with Common Lisp. But CIDER? So good.

14:45 technomancy: there's still a number of things slime can do that cider can't

14:45 AeroNotix: technomancy: probably

14:45 seangrove: Is dorun blocking?

14:45 hyPiRion: seangrove: yes

14:46 seangrove: hyPiRion: Thanks, I thought it would be, but I'm seeing some strange things locally

14:47 bufferloss: hi, I'm interested in doing some hobbyist type projects with Clojure - specifically video games and or video game related stuff. I checked http://www.clojure-toolbox.com/ but there don't seem to currently be many good options for interactive 3D graphics ala OpenGL

14:48 the one OpenGL thing that does exist explicitly states that development is slow and possibly non-existent

14:48 kristof: Sounds like territory not yet trodden upon

14:48 bufferloss: my other thought was to use Clojure in a similar way to e.g. Lua to allow users and 3rd parties to script game interactions

14:48 wondering if anyone has had experience with the latter or knows of any other good/viable options for the former

14:48 e.g. something that's not OpenGL

14:48 kristof: I imagine that there are bindings to OpenGL in Java, so it wouldn't be TREMENDOUSLY hard to wrap those in Clojure...

14:49 bufferloss: kristof, yeah I would guess the same as well

14:49 arrdem: kristof: it's jus that those bindings aren't especially good

14:49 bufferloss: what does minecraft use btw? does anyone know?

14:49 kristof: arrdem: Nobody wants to do intensive graphics calculating in java anyway

14:49 Wild_Cat: bufferloss: it uses Java3D

14:49 bufferloss: did they write e.g. their own occlusion culling algorithms?

14:49 Wild_Cat, ok thanks

14:50 how bad of an idea would it be to try to "hook in" to clojure "from" a C++ engine? ala allowing game event scripting with lua for example

14:50 Wild_Cat: bufferloss: you'd get the JVM's memory footprint combined with C++'s safety and ease of debugging.

14:51 so pretty bad, all in all, IMO

14:51 benkay: hey y'all, i'm having trouble deref'ing a future - i keep getting java.lang.ClassCastExceptions when trying to deref the return value of a Datomic transaction to get at its innards. here's the relevant paste (https://www.refheap.com/24040): any idea what i don't understand about futures in Clojure?

14:51 bufferloss: Wild_Cat, lol, ok

14:51 Wild_Cat: bufferloss: if you're gonna go with a straight C/C++ engine and main loop you might as well use Lua for scripting, that's what it's made for

14:51 `cbp: you could try clojurescript + node_webkit for 2d graphics

14:52 + webgl

14:52 bufferloss: Wild_Cat, yeah I suppose, I was actually contemplating trying to link against a common lisp runtime for example instead of lua

14:52 though I haven't done any common lisp (it's kind of defunct isn't it?)

14:54 andyf: bufferloss: No more defunct than usual :-)

14:54 mikerod: AeroNotix: I upgraded from nrepl.el to cider (after uninstalling nrepl.el) and everything became unstable and wouldnt' work

14:54 bufferloss: andyf, heh, ok

14:54 mikerod: so I reverted, I guess I'll have to do that again and tackle whatever issues I'm having. I would have expected a seemless transition though

14:54 since it was just a rename

14:54 well I guess not *just* a rename

14:55 technomancy: bufferloss: guile or chicken would be a lot easier to embed

14:55 andyf: bufferloss: The highest performance open source implementation I know of, SBCL, is still being maintained and improved by volunteers, and a guy named Zach Beane (sp?) actively maintains QuickLisp, which helps in distributing a set of up to date CL libraries.

14:56 stuartsierra: Clojure isn't great as a user scripting language because it compiles to JVM classes; there's no interpreter.

14:57 tim_: that being said, I'd be tempted to just use OpenGL from clojure

14:57 tbaldridge: or even from Java, and wrap the Java core with Clojure.

14:57 bufferloss: yeah actually I will likely try playing with Java3D just from within Clojure and see how that goes

14:57 tbaldridge: Clojure + eval on the JVM should make a fairly fast scripting language.

15:03 bufferloss: andyf, ok I'll give that a look as well, thanks

15:08 AeroNotix: What do people recommend for a YAML parser/writer library?

15:11 dobry-den: (clojure.string/replace text #"(?i)(:usa)" "<img src='/smilies/$1.gif'>") <-- Is it possible to (lower-case $1) somehow?

15:11 i.e. :UsA -> <img src='/smilies/usa.gif'>

15:14 AeroNotix: dobry-den: regex

15:14 polak?

15:15 dobry-den: no, just lived in praha.

15:16 TimMc: &(clojure.string/replace "FOO" #"O+" clojure.string/lower-case)

15:16 lazybot: ⇒ "Foo"

15:17 AeroNotix: ,:foo

15:17 clojurebot: :foo

15:17 AeroNotix: ,:choo

15:17 clojurebot: :choo

15:17 AeroNotix: train!

15:18 TimMc: that works only if they know beforehand what they are replacing

15:19 dobry-den: AeroNotix: I see that \L will lowercase the match.

15:20 "\L$1" doesn't seem to work though

15:23 zerowidth: ,(clojure.string/replace "foo:UsA:bar" #"(?i)(:usa)" (fn [[_ s]] (str "<img src=\"/images/" (clojure.string/lower-case s) ".gif\">") ))

15:23 clojurebot: "foo<img src=\"/images/:usa.gif\">:bar"

15:26 dobry-den: zerowidth: thanks for spelling it out. that function signature makes sense to me now

15:27 zerowidth: i'm not clear on the function parameters to the string/replace function, but that seemed to work

15:34 dobry-den: what's actually happening when running a website via "lein ring server" compared to lein running it?

15:43 jcromartie: grrrr… don't do this: (if this (throw …) (do something))

15:43 dobry-den: lein ring server starts jetty with the handler var as indicated in your project.clj

15:44 dobry-den: "lein run" just runs the :main specified in your project.clj, where it would be up to you to start jetty

15:45 dobry-den: and it should be a namespace with a -main fn specified by :main, vs. a var bound to a handler specified by :handler (I think?)

15:45 Wild_Cat: jcromartie: why is that if block bad practice?

15:45 jcromartie: Wild_Cat: if you're just checking something, use when and throw

15:45 it's particularly obnoxious when it's a long chain

15:46 (if a (throw …) (if b (throw …) (if c (throw …) (do-stuff)))

15:46 Wild_Cat: jcromartie: oh wait, didn't see the do thing was in the else block.

15:46 OK, I get it

16:01 jcromartie: I feel like I've made a design mistake, where I have all these functions taking a map containing a ref and dereferencing it to pass to the pure business domain functions

16:02 so, all over the place, it's like (fn [{:keys [read-model]} id] (get-user @read-model id))

16:03 maybe I'll just deref and assoc in that map in a higher level place

16:07 anybody want to take a look at this CQRS/event type deal for me https://gist.github.com/jcromartie/094b36e20132c970fbc0

16:17 matt444: is there a primer article on core.async that anyone can recommend?

16:20 stuartsierra: matt444: maybe tbaldridge's talk video http://www.youtube.com/watch?v=enwIIGzhahw

16:23 matt444: stuartsierra: thanks!

16:23 stuartsierra: you're welcmoe

16:26 mrhanky: should i avoid slurp when reading three txt files with a total size of 50kb ?

16:26 i read slurp should be avoided on larger files

16:27 jcromartie: mrhanky: so long as the strings that are created are not too large

16:27 matt444: Also this: http://swannodette.github.io/2013/11/07/clojurescript-101/

16:27 technomancy: mrhanky: "large" means "might not fit in memory"

16:28 mrhanky: oh okay :)

16:28 technomancy: presumably you are not running clojure on an arduino =)

16:28 jcromartie: Raspberry Pi maybe :P

16:41 TimMc: OK, who decided that maps and records should not be =, but lists and vectors could be?

16:41 I would like to have a chat with them, perhaps involving some swearing.

16:41 technomancy: we warned you

16:41 we warned you about records bro

16:42 they're just like stairs

16:42 TEttinger: heh

16:42 jcromartie: huh

16:42 * seangrove waits for the punchline

16:42 TEttinger: it's a joke from a comic

16:42 tcrayford: anybody ever see a ClassNotFoundException when using tooooools.namespace.repl/refresh, but upon normal import at the repl everything works fine?

16:43 locks: TEttinger: isn’t everything

16:43 technomancy: seangrove: http://www.mspaintadventures.com/sweetbroandhellajeff/comoc.php?cid=001.jpg

16:43 TEttinger: ha

16:43 tcrayford: or alternatively an error like "AVLTransientMap could not be cast to AVLTransientMap" ?

16:43 TEttinger: it's number 1 eh?

16:43 * tcrayford suspects his JVM is haunted

16:44 technomancy: obligatory http://p.hagelb.org/mystery.gif

16:44 TEttinger: technomancy, it will make no sense out of context as an intentionally bad comic

16:44 then again, it doesn't in context either

16:44 technomancy: TEttinger: I was gonna say...

16:46 TEttinger: https://twitter.com/BarackObana I do find the joke twitter account even funnier, especially when the student who clearly spoke little English mistook Obana for Obama

16:47 seangrove: technomancy is obviously operating at a highe rlevel than I am

16:48 TimMc: seangrove: It's a terrible webcomic that a character from another webcomic writes.

16:49 seangrove: TimMc: Ah, ok. That helps a bit.

16:49 technomancy: TEttinger: or https://twitter.com/Bill_Nye__Tho

16:50 tcrayford: it's fine. am just working around by rm -rf ing everything out of ~/.m2 before any lein invocation

16:50 jcromartie: Does anybody else read "[f & args]" as "f'n args!"

16:50 TimMc: Intentionally bad art is not to everyone's taste.

16:51 TEttinger: that's grea technomancy

16:52 stuartsierra: tcrayford: is anything AOT-compiled?

16:53 tcrayford: I assume not, given that I've been running `lein clean` before starting up my repl

16:53 stuartsierra: actually, I fixed it by doing a require of the clojure namespace that defines the deftype before importing it

16:54 stuartsierra: tcrayford: Ah yes, that is simply a load-order issue.

16:55 tcrayford: weirdly, I was seeing the ns that defined that type before the thing that imported it in the list that refresh spews out, so kinda unsure why that fixed it

16:56 the TransientMap error is quite probably an AOT compilation issue (it's not related to tools.ns), but currently it doesn't go away with lein clean, only rm -rf ing ~/.m2/repository/avl (which is somewhat frustrating)

17:00 stuartsierra: Yes any time you have something that looks like "class Foo is not a Foo" it's probably caused by stale copies of the same class somewhere.

17:00 * talios smells class loader hell

17:00 talios: mmm, starting the day with S.M.A.R.T. controller failures - fun fun fun

17:01 tcrayford: yeah, pretty much what I figured. Strange that `lein clean` isn't killing it though ;)

17:02 chrisbpos: hey. i remember a few months ago coming across a cool clojure learning site, it was a bit like the ruby/clojure koans, but it evaluated your answers right on the website, anyone know where this is?

17:03 it was kind of zen-themed

17:04 BobSchack: chrisbpos: http://clojurescriptkoans.com/

17:04 ?

17:05 chrisbpos: yep!!

17:05 thanks very much BobSchack

17:05 BobSchack: np

17:23 seangrove: sritchie: Hey, you're using storm right?

17:23 sritchie: not anymore, but I worked on it for quite a while

17:23 with, rather

17:23 seangrove: sritchie: If you used it on a clojure 1.5.1 project, would love to know how you got it setup

17:23 sritchie: oh, I was using it from Scala

17:24 seangrove: Did you set it up initially?

17:24 It's been pretty painful to get running :P

17:25 Especially running into problems knowing if jzmq is working properly

17:25 quizdr: ,(rest [1 2 3)

17:25 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

17:26 quizdr: ,(rest [1 2 3])

17:26 clojurebot: (2 3)

17:26 quizdr: So I rest a vector, and get a seq, right?

17:26 so then why would anyone need to do (seq (rest [1 2 3])) if rest already returns a seq?

17:27 seangrove: sritchie: And where did you get help from whenever you ran into trouble? #storm-user is silent

17:27 sritchie: yeah, it was rough - mostly I just read code

17:27 or talked to the storm team at twitter,

17:27 but those guys didn't really know clojure, strangely enough

17:28 there's one guy who works on storm who's the man

17:28 jason jackson

17:28 seangrove: nathan seems to have fully checked out too

17:31 bitemyapp: sritchie: hello puppy monster.

17:31 sritchie: :)

17:31 bitemyapp: sritchie: you are killing me.

17:31 sritchie: haha, I should set up a drop cam

17:31 it's too much, dude

17:31 bitemyapp: I like this idea.

17:31 sritchie: put up a web page.

17:31 seangrove: sritchie: Ah, bummer. Did it feel like a solid project to use, or was it stagnating?

17:31 bitemyapp: puppy-cam.

17:32 sritchie: bitemyapp: in haskell

17:32 bitemyapp: sritchie: you know me, sir.

17:32 sritchie: you couldn't stay away from that page

17:32 bitemyapp: heroin.

17:32 sritchie: all puppies, no runtime exceptions

17:32 seangrove: you know, lots of people are building on it, and the apache thing may give it a boost -

17:32 bitemyapp: funny you say that, Google's AI competition Haskell example has a partial function that throws :(

17:33 sritchie: haha, oh no!

17:33 bitemyapp: ond default input! the buggers.

17:33 seangrove: sritchie: That's what I thought, but it's been pretty iffy to setup

17:33 sritchie: seangrove: but, I dunno, it was a pretty annoying proj to build on (for Summingbird)

17:33 bitemyapp: oh well, at least it's the typical mistake. Calling head on an empty list. Woo.

17:33 sritchie: haha, yup

17:33 headOption all the way

17:33 tcrayford: sritchie: annnd now I'm super glad I didn't decide to use storm 10 months ago

17:34 bitemyapp: sritchie: you can do that in Haskell, but the culture prefers pattern matching that *ONE* thing. Everything else is Maybe.

17:34 sritchie: if you can handle a few dropped items, I'd go with Akka… BUT, I haven't been using it personally

17:34 the dynamic topology scaling is killer

17:34 * bitemyapp /lastlog's seangrove to find out what he needs

17:34 sritchie: I think they added a nice layer on top to give the at-least-once semantics with akka...

17:34 forget what it's called

17:34 bitemyapp: sritchie: perhaps Kafka?

17:35 sritchie: kafka's awesome

17:35 bitemyapp: seangrove: do you just need a more reliable queue or what?

17:35 sritchie: if you're using storm you need a stream processor

17:35 bitemyapp: at-least-once + origin-generated UUID + logs = happy times with sanity intact.

17:36 seangrove: what were you originally looking into Storm for?

17:36 jjl`_: question for emacs users: what are you actually using to have a sane environment for developing clojure? i'm really not happy with what i'm doing

17:36 seangrove: bitemyapp: Reliable, distributed workers, etc.

17:37 bitemyapp: seangrove: just use a multi-stage queue. Keep it simple.

17:38 seangrove: failed/timed out tasks go to a secondary queue

17:38 technomancy: yeah, I could not figure out why Storm is so much more complicated than just sending sexps over rabbitmq for the vast majority of applications

17:38 bitemyapp: seangrove: our data warehouse at work is RabbitMQ feeding into Datomic. Running on Clojure.

17:39 seangrove: bitemyapp: That might be a better option ultimately

17:39 bitemyapp: technomancy: the topologies in Storm are actually easier to understand than RabbitMQ routing and a bit more powerful.

17:39 quizdr: jjl` i find emacs Live by sam aaron to be a simple one-stop shop to getting everything setup.

17:39 bitemyapp: technomancy: rabbitmq routing was designed by a sadistic telecom employee.

17:39 tcrayford: technomancy: at least storm doesn't claim to beat the cap theorem ;)

17:39 bitemyapp: bindings. whatever the fuck.

17:39 quizdr: jjl` https://github.com/overtone/emacs-live

17:39 technomancy: bitemyapp: sure, but you only have like three routing patterns you actually need in practice

17:40 bitemyapp: seangrove: take UUID generation from origin seriously though, it enables at-least-once idempotent push!

17:40 technomancy: for a pure MQ sure. technomancy: the problems Storm gets used for, typically, are a bit different.

17:40 technomancy: Storm is closer to distributed dataflow than an MQ.

17:41 quizdr: jjl`_ i guess i was writing your nick wrong

17:41 bitemyapp: technomancy: one of the current challenges of distributed computing is that if an existing tool is even a bit removed from the ideal solution for your problem, it more often than not just won't work at all.

17:42 thus the seeming NIH going on. We don't have very good building blocks for these problems.

17:42 technomancy: bitemyapp: the only take-away I could find about what it could do that a queue couldn't from the strangeloop talk was that the sharding algorithm he was using with the queue at the time couldn't handle changing the size of the worker queue or something

17:42 jjl`_: quizdr: does that just use cider-mode?

17:42 technomancy: I'm sure there's more to it, but he just did a really bad job of explaining why in that talk

17:42 quizdr: it has nrepl and i think they just added cider to it but it's in the dev packs not the default packs if I recall

17:43 zerowidth: wouldn't you want to be able to handle queue size changes?

17:43 quizdr: it instantly works. just install lein and emacs live and you have clojure working out of the box

17:43 technomancy: zerowidth: sure; he was just using a crappy queue

17:43 something based on cassandra I think?

17:44 zerowidth: ahh

17:44 jjl`_: quizdr: ah they've just upgraded to cider. nrepl was renamed to cider.

17:44 quizdr: i've just finished hacking on nrepl-ritz to enable single step debugging with cider-mode. but i'm generally unhappy with it so far

17:45 quizdr: in emacs?

17:45 technomancy: jjl`_: maybe you could be more specific?

17:45 jjl`_: i'd probably use lighttable, but it doesn't have a decade of training my fingers

17:45 technomancy: breakpoints appear to be entirely broken, debug on exception seems to be entirely broken, to start with two

17:46 technomancy: oh, about ritz specifically;

17:46 I thought you meant about emacs in general

17:46 jjl`_: yes. there are some other annoyances too, but they're comparatively general

17:46 quizdr: i found emacs quite easy to adapt to actually *using* I haven't fully understand the criticism against it for workflow. but I *do* find emacs hellish to understand for setup and config purposes, which is why I like Emacs Live since it sets everything up automatically up front so I can just focus on the work. I hear Rich Hickey himself ain't much of an emacs guy

17:46 sritchie: bitemyapp: I want to get a datomic instance set up for the social graph stuff I'm starting to push

17:46 the "follows" and "watches", etc relationships

17:47 jjl`_: there are some bizarre situations where i find the indentation to be horribly wrong as well, but i guess i just have to go figure out the switches for that

17:47 sritchie: excited to try out some of the stuff you've pushed

17:47 quizdr: hmm that doesn't sound right. the indentation is a major aspect of clojure/lisp work, and emacs live seems to get that right. maybe you didn't have a good setup inside emacs

17:48 bitemyapp: sritchie: it would be nice if Brambling had a user that wasn't me or my coworker.

17:48 technomancy: indentation? wrong? it's unpossible.

17:48 jjl`_: right now i'm using cider largely uncustomised (i'm turning on eldoc)

17:50 quizdr: take a look at all the packs emacs live installs. it's a lot more than just cider. is cider alone supposed to be a complete clojure IDE?

17:50 technomancy: emacs live jumbles together a lot of unrelated junk

17:50 jjl`_: i gather that was the intention for cider, yes

17:50 technomancy: I wouldn't recommend it unless you're actually into the whole live-coding scene

17:50 bitemyapp: I'm not really keen on Emacs Live.

17:51 it destroys the whole "building your lightsaber" experience.

17:51 jjl`_: this.

17:51 also, i don't really want to take my huge config and borg it into someone else's

17:51 bitemyapp: That too.

17:51 quizdr: bitemyapp that is correct, but if you are new to emacs and don't have 2 months to waste learning how it works under the hood, emacs live is the best way to get going with clojure and emacs with zero setup on your part

17:51 bitemyapp: "waste learning"

17:52 technomancy: if you don't have the time to spend to do it right, you should wait and switch to emacs when you do have the time

17:52 it'll still be there

17:52 quizdr: i disagree

17:52 rasmusto: ~emacs.d

17:52 clojurebot: No entiendo

17:52 quizdr: emacs live is really great to use

17:52 jjl`_: erm... i guarantee you'll spend more time in your editor as a programmer than anything else. worth learning.

17:52 quizdr: when you are ready to customize, that can wait until the future moment

17:52 bitemyapp: If you don't have time to learn, you don't have time to be a programmer.

17:52 quizdr: that's a ridiculous comment

17:52 time is not infinite

17:53 you can learn how to setup emacs and spend a lot of time on that, or you can jump in and start actually coding. you can customize the IDE at a later time

17:53 bitemyapp: I don't know what your experience, but I find that most of my job is learning. Application flows from the learning that happened.

17:53 quizdr: yes, but you surely realize that you can't learn everything at once. so you prioritize.

17:53 bitemyapp: Being able to edit text sounds pretty important to me.

17:53 quizdr: learning how to code in a new language is more important to me than learning how to setup an IDE

17:54 technomancy: if you're learning clojure still, you shouldn't be learning a new editor; emacs live or not

17:54 bitemyapp: I'd agree with that.

17:54 Half-assing is a waste of time.

17:54 jjl`_: i think emacs is much easier to learn than an IDE anyway

17:54 you only need a handful of chords to get going and then you add the bits you want as you decide you want them

17:54 quizdr: emacs seems really easy to use for actually creating code, so i'm not sure what the deal is with its criticisms. but understanding its customizations can be a test of patience

17:54 jjl`_: e.g. i added multiple cursors a few weeks ago. i never would have learned how to use them from someone else's config

17:55 kristof: I don't think that applies to just chords.

17:55 technomancy: nothing to get you motivated to learn elisp like having spent the last few months trying to learn clojure using textmate

17:55 kristof: You just work with bare emacs functionality until you think "I hate _____, how do I fix this?" Google/ask, profit

17:56 Are people really complaining about emacs? The tutorial takes 20 minutes and then you're good to go, forever.

17:56 quizdr: i'm sure everyone in here had joy when first using a computer for the very first time, even if you had zero idea how it actually worked behind the scenes. understanding the backend of emacs or any other IDE is orthogonal to actually using it effectively as a learner.

17:56 bitemyapp: technomancy: the kiddles use Sublime Text now.

17:56 technomancy: get with the times man.

17:57 ieure: bitemyapp, Lightroom

17:57 technomancy: bitemyapp: oh right; textmate isn't even proprietary anymore

17:58 kristof: mumble mumble lighttable

17:58 * technomancy updates his "who do we hate today" cheat sheet

17:59 * nDuff just keeps it simple, and hates everything that isn't emacs or vim. Except maybe Light Table, but it's more getting a deferral until it's finished. :)

17:59 zerowidth: wait, there's a spreadsheet?

17:59 technomancy: zerowidth: it's just a CSV

18:00 sritchie: bitemyapp: how are you guys deploying datomic?

18:00 quizdr: for example, there is a reason why "list in a box" was so successful and used in so many books as the recommended IDE. great to learn Common Lisp without the learner having to spend a very long time learning to configure it on his/her own

18:00 sritchie: EC2?

18:00 quizdr: "lisp in a box"

18:00 bitemyapp: sritchie: yap.

18:00 sritchie: provisioned IOPS for production instances. PostgreSQL storage layer.

18:00 * jjl`_ really needs to stop asking emacs questions. it seems to start editor wars

18:01 sritchie: bitemyapp: n00b Q - if peers suck down a bunch of data to do computations,

18:01 bitemyapp: could that overload a heroku instance, say?

18:01 bitemyapp: I should probably do at least ANY reading on datomic configs before asking such questions.

18:01 bitemyapp: sritchie: you really do not want a peer on a Heroku instance.

18:01 sritchie: like, really really.

18:01 sritchie: you need fat RAM to make good use of datomic.

18:01 sritchie: okay

18:02 so if I go this route, gotta migrate out of heroku to elastic beanstalk, or some other deploy environment

18:02 or rathole and set up a whole docker thing

18:02 :)

18:02 bitemyapp: sritchie: probably, unless you want to hide the peers behind an API the heroku instances can call.

18:02 xuser: bitemyapp: why pgsql?

18:02 bitemyapp: sritchie: https://github.com/bitemyapp/berossus/

18:02 sritchie: nice

18:02 bitemyapp: xuser: because I'm not a card-carrying communist that uses things like DynamoDB.

18:03 xuser: more seriously, I know PostgreSQL and how it behaves and it's something we can redeploy internally or leased machines if needs be.

18:03 xuser: I can't "re-deploy" DynamoDB if we get tired of getting robbed by them.

18:04 technomancy: single-vendor lock-in: only a problem when it's amazon now?

18:04 bitemyapp: technomancy: I offered a way to make Heroku instances work :)

18:04 quizdr: has anyone found a really good tutorial on setting up a Clojure environment on elastic beanstalk or google app engine or basically any paas that is not Heroku? the Heroku folks are smart in realizing that they can spoil a lot of devs by taking care of all the sys admin for you

18:04 technomancy: this CSV is getting longer

18:05 bitemyapp: sritchie: unless you somehow have surplus labor to go around, I would avoid dev-ops rabbit holes as much as possible.

18:05 xuser: bitemyapp: is the transactor local storage bad?

18:06 sritchie: yeah, I already went through a fun ansible / pallet period

18:06 the zen of devops, like sharpening 1000 pencils in a sitting

18:06 bitemyapp: xuser: are you asking about ephemeral disk backed Datomic storages?

18:06 sritchie: and then writing nothing.

18:06 sritchie: :)

18:08 xuser: bitemyapp: I guess, why ephemeral?

18:08 gaverhae: Hey! Anyone here familiar with clojure.java.jdbc?

18:08 bitemyapp: xuser: have you used EC2 before?

18:08 sritchie: technomancy: here's an odd one: [do cljx, cljsbuild once dev, repl] and standalone-repl have a type mismatch merging profiles.

18:08 bitemyapp: xuser: I'm having a hard time understanding what question you were trying to ask.

18:08 sritchie: technomancy: what's standalone-repl refer to?

18:09 xuser: bitemyapp: the bult-in storage capabiltiy of datomic

18:09 is it not meant for production?

18:10 bitemyapp: xuser: you're talking about the frickin' dev storage?

18:11 xuser: bitemyapp: yes

18:11 bitemyapp: xuser: if you use something named "dev" in production you deserve what'll come to you.

18:11 xuser: it's H2.

18:11 you do not...want to use H2 in production-anything.

18:11 jjl`_: to be fair, it refers to it as 'transactor local', as opposed to 'dev'

18:11 bitemyapp: jjl`_: the config file says "dev"

18:12 when people ask questions, I check my code, not their godforsaken website.

18:12 their documentation has not historically helped us much.

18:12 jjl`_: :)

18:12 bitemyapp: working code and pestering them via support went much further.

18:13 technomancy: sritchie: I think it might have been a workaround for a bug in older lein versions; is it still around?

18:13 sritchie: just showed up on heroku

18:13 technomancy: sritchie: on a recently-deployed app?

18:13 sritchie: yeah, just a minute ago

18:13 technomancy: I had to do some really funky build stuff to get around these issues with Austin destroying my AOT compilation...

18:13 technomancy: ok, means I forgot to do some cleanup is all

18:13 sritchie: so, liberal use of ^:replace

18:13 technomancy: should be able to safely ignore it

18:14 sritchie: okay, cool

18:15 matt444: If you right a function that uses chans internally, does a function that uses it need to know that chans are being used, need to use any special syntax?

18:16 They have to use take!, right?

18:19 or no, you use <!

18:22 shaungilchrist: like function that returns a chan you mean?

18:23 xuser: bitemyapp: you are worried about aws lock-in but not datomic lock-in?

18:24 scape: :)

18:25 * technomancy hands xuser a copy of who_we_hate_today.csv

18:25 technomancy: see, no datomic

18:25 scape: lol

18:25 technomancy: carry on; nothing to see here =)

18:26 justin_smith: regarding aws lockin, who good an option is openstack, and how hard is it to target openstack as an aws replacement?

18:27 alew: I heard openstack isn't doing so well

18:28 scape: I was rather happy with Linode, AWS pricing fluxuates too easily

18:28 nDuff: justin_smith: *shrug*. Depends on how much AWS infrastructure you're using.

18:28 justin_smith: ...Amazon is certainly adding new APIs faster than they're being implemented elsewhere.

18:32 luxbock: I'm trying to solve Project Euler problem 3 without looking at other peoples solutions and I'm stuck

18:32 https://gist.github.com/8446851

18:33 the number presented in the problem is so large that it jams my repl

18:33 bitemyapp: xuser: I'm pretty grumpy about the fact that it's not open source.

18:34 xuser: but I don't have a great alternative at the moment for a historical database.

18:34 arrdem: luxbock: you can write a better primality test than that...

18:34 luxbock: also memoization would be nice here

18:34 hyPiRion: luxbock: remember that factors are not the same as prime factors

18:34 luxbock: ah, what algorithm should I be using? I got this one from SO

18:35 arrdem: luxbock: this is good, you can just tune it some

18:35 luxbock: also hyPiRion hit this nail on the head

18:35 luxbock: oh yeah the factors function isn't really used for anything

18:36 arrdem: luxbock: really what you want to do is build a cache of {a | (prime? a) && (zero? (n % a))}

18:36 luxbock: I had it there from an earlier attempt that was doomed to fail

18:36 arrdem: luxbock: which is trivial if you just compute all prime factors up to (sqrt n)

18:36 sorry. just primes. no factor requirement.

18:36 then the largest n \in that set is your largest prime factor

18:37 luxbock: alright, I'll check out memoize as well

18:37 arrdem: luxbock: memoize is really gonna help if you do this counting up thing.

18:38 luxbock: but shouldn't the way I was doing it be even faster? although I now realize that starting at half of n is far too high

18:38 * arrdem wishes he could just hack on Project Euler rather than do coursework

18:38 luxbock: do I really have to calculate all the primes between 2 to n, when I only need the highest?

18:38 arrdem: luxbock: not [8,n), [8,(sqrt n)]

18:39 well... I guess it's really [4,sqrt(n)]

18:39 hyPiRion: luxbock: it's sufficient to calculate up to sqrt(n), if you divide the number with the primes you've found so far

18:39 arrdem: the point is that if you count _up_ you have this O(1) primality table lookup from memoize on your side.

18:41 luxbock: ah, so I should be counting up and not down

18:41 arrdem: luxbock: yes, and the table of known primes is crucial to doing this really fast.

18:41 luxbock: retaining a table known primes will be much more efficient than memoizing the entire prime? function.

18:43 hyPiRion: It's not that critical for this one, actually.

18:44 luxbock: so what would be a better test for primality?

18:44 http://en.literateprograms.org/Miller-Rabin_primality_test_%28Clojure%29

18:44 I found this but it seems like an overkill

18:44 hyPiRion: luxbock: the primality test you already got is sufficient for this problem

18:44 luxbock: ok

18:46 hyPiRion: (Shameless self-plug: If you need a more performant one later, https://github.com/hyPiRion/primes is pretty fast and is thread-safe)

18:46 luxbock: cool

18:50 koreth_: For what it's worth, I found 4clojure and exercism.io to be better Clojure learning tools than Project Euler. PE is great for testing your computational mathematics skills but its problems are mostly pretty far removed from anything you'd actually do in real life (well, unless you are a mathematician!)

18:51 luxbock: yeah I know, I'm kind of learning how to use simple-check at the same time

18:52 hyPiRion: luxbock: In this case, it's sufficient to find the prime numbers below sqrt(n) dividing n. That can be done through `(filter (fn [num] (and (prime? num) (divides? n num))) (range (Math/sqrt n)))`

18:53 luxbock: oh duh, and here I was writing a loop

18:55 hyPiRion: it's one of the things which comes with training in functional languages

18:56 luxbock: I think that's how I would usually write it, but I had this idea in my head that loops are more efficient

18:56 bitemyapp: luxbock: why?

18:57 luxbock: from reading Mikera's posts on core.matrix, but that level of optimization is far above my skill level

18:57 bitemyapp: luxbock: some of that might have more to do with the limitations of Clojure than anything involving FP.

18:57 luxbock: there are languages that do things like loop and stream fusion of higher order functions like fold.

18:57 luxbock: actually the other purpose for playing with project Euler problems for me was to do micro benchmarks with criterium for different approaches

18:58 yeah I don't doubt that at all

18:58 for me compilers are pure black box magic though

18:59 so I go by bits and pieces of what I read here and there

18:59 zbyte64: Anyone know how to write an om component (reactjs) that returns a string as html? (the string is generated by a 3rd party js library)

19:00 luxbock: but this is actually exactly what I wanted to do.. I'll write the loop version next and then compare them

19:00 zbyte64: returning a function or a string creates an invariant exception

19:25 alew: are there any good instrumentation solutions for clojure ala new relic?

19:26 technomancy: new relic works with clojure

19:27 alew: not automatically

19:27 you have to provide annotations

19:27 technomancy: it does a bunch of stuff without annotations

19:28 maybe with annotations it does more though

19:28 alew: Throwing it up on heroku with just the default setup only shows me memory usage, nothing else

19:29 technomancy: hm; I have seen it do a pretty thorough profiling without changing any source

19:29 this was 2 years ago though

19:29 alew: apparently one of the versions they released had accidently support for ring instrumentation

19:30 quizdr: is there a practical limit to the number of args you can send to apply? in common lisp, this limit can be very low dependent on the implementation

19:32 rasmusto: quizdr: there's a limit to the number of arguments that a fn can take, but you can do [blah & more] to get the rest

19:32 nDuff: quizdr: in general, Clojure falls back to being inefficient if you're using a really large number, as opposed to just not working.

19:32 (err, number of args)

19:32 cgag: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L612

19:32 if you're curious

19:33 nDuff: quizdr: ...though there _are_ some fairly low limits on how many args a function can take if you're using primitive data types.

19:34 quizdr: ok, i was reading about how some functions use apply in their implementation, such as join.

19:35 nDuff: quizdr: *nod*. In general, that'll fall back to an implementation that passes an Object[] as the last argument (which is how Java's varargs work in general), and can thus handle an arbitrary length.

19:45 lsdafjklsd: Anyone using lightable to develop clojurescript apps and know how to hook up a browser repl?

19:45 john2x: anybody using revise? I was wondering on what's the standard way of creating the database and tables.. would an arbitrary "script" (that's not part of the main project's namespace?) that creates it suffice?

19:50 technomancy: clojurebot: clojars migrations?

19:50 clojurebot: Cool story bro.

19:50 technomancy: aw come on

19:50 I know I've taught you that before

19:51 matt444: What is the difference between a chan and port?

19:51 Seem to the same

19:51 technomancy: clojurebot: clojars migrations |are| just a namespace with functions: https://github.com/ato/clojars-web/blob/master/src/clojars/db/migrate.clj

19:51 clojurebot: Ack. Ack.

19:51 technomancy: john2x: ^ check that out

19:59 lsdafjklsd: clojurebot: clojars migrations?

19:59 clojurebot: clojars migrations are just a namespace with functions: https://github.com/ato/clojars-web/blob/master/src/clojars/db/migrate.clj

20:15 arrdem: technomancy: does clojurebot not provide inference engine responses to arbitrary channel text?

20:16 I'm looking at the inference engine and it doesn't look like arbitrary patterns can be matched...

20:16 technomancy: arrdem: I feel like if I dove into the source it would take away the mystery

20:18 arrdem: that said I think for every line there's a 1% chance he'll interpret it as being addressed to him

20:18 arohner: when parsing some XML w/ clojure.data.xml, I'm hitting https://gist.github.com/arohner/8448042 I think it has something to do w/ XML namespaces?

20:18 technomancy: "Namespaces? But XML doesn't have namespaces." --every XML library author, at first

20:19 arohner: :-)

20:19 arrdem: technomancy: ok. I was kinda looking for a way to make clojurebot match "*.pastebin*."

20:27 squidz: is there a good way to profile clojurescript performance?

20:28 bbloom: squidz: w/ source maps, standard js profilign tools apply

20:29 squidz: bbloom: okay thanks

20:36 davorb: hey. i'm new to clojure, but i've used common lisp before. can i use slime with clojure or something similar?

20:36 jack_rabbit: nrepl

20:36 davorb, it's about the same.

20:36 davorb: thanks jack_rabbit

20:36 jack_rabbit: np :)

20:38 AimHere: davorb, there IS clojure slime. But everyone stopped using it when they discovered nrepl

20:39 davorb: and can someone explain to me what leiningen is? is it like ruby gems or is it like javascript's yeoman?

20:40 or is it sort of like grunt?

20:40 i've looked at it, and it feels like you've got a bunch of grunt tasks and then you run them

20:40 bja: davorb, sorta like grunt. it's a nicer interface to maven

20:40 davorb: ah, okay. so it's basically a build manager?

20:41 bja: yes, but it has a lot of development-related functionality too

20:41 AimHere: Something like that. Basically if you're doing anything in clojure, you want it, and you want it bad

20:41 bja: AimHere, if you do stuff in other languages you want it and want it bad too.

20:41 want to kill myself when I use pip/virtualenv

20:41 AimHere: It's clojure's swiss-army build tool

20:42 bitemyapp: davorb: Clojure is just a library.

20:42 davorb: Leiningen and nrepl are your interfaces to the language-that-is-a-library

20:43 davorb: bitemyapp: okay, i think i get it. thanks.

20:52 chare: ok bad news

20:52 I had discussion with friends

20:52 they want ruby on rails

20:52 tell me that clojure has something I can counter with

20:52 cgag: that's a hard battle to win

20:53 locks: there’s pedestal…

20:54 cgag: immutability by default, much better performance, actual concurrency support

20:54 bitemyapp: guys

20:54 don't waste your time on this person.

20:54 locks: that’s harsh

20:54 bitemyapp: He's a troll or at minimum not quite psychotypical.

20:54 locks: he's been trolling this channel since last year.

20:54 AimHere: Nothing wrong with a little light trolling

20:55 bitemyapp: locks: he's the whole reason we had to bring active ops back.

20:55 single-handedly.

20:55 AimHere: Especially since all it'll get him is a salespitch for clojure!

20:55 locks: maybe he just needs love

20:55 bitemyapp: I'm not exaggerating.

20:55 locks: we uh, tried that. He never stops language trolling. Ever.

20:55 locks: months and months on end.

20:55 Please stop polluting the channel with this.

20:55 If you really want to help him, have him query you.

20:55 chare: bitemyapp why dho you hate me

20:56 bitemyapp: chare: you don't code.

20:56 chare: you waste the time of people that do.

20:56 chare: you are overexaggerating

20:56 and what is pedestal

20:56 bitemyapp: you don't need to prefix 'exaggerating' with 'over'.

20:57 Exaggeration is exaggeration. Overexaggeration is redundant.

20:57 And I'm not exaggerating.

20:57 locks: chare: pedestal is a web framework for clojure, it is very similar to ruby on rails

20:57 AimHere: overexaggerating is a pretty good self-referential term.

20:57 chare: how similar is similiar

20:58 rkneufeld: locks: wut

20:58 bja: chare, they are both web frameworks

20:58 * bitemyapp snorts and laughs

20:58 locks: chare: they both show HTML in your browser

20:58 bitemyapp: rkneufeld: but the real question is, do you *really* want to dive in?

21:00 locks: I don't think you've used Pedestal mate. It's quite nice, but I don't think I'd call it similar, let alone 'very', to Rails at all. It's the closest thing Clojure has to a fully integrated web stack though, which is possibly desirable if you don't like more componentized approaches like Ring/Compojure/et al.

21:00 quizdr: i'm a little confused by the arguments list that starts out this function, is it a destructing form? (fn primes-from [n [f & r]] .....

21:00 bitemyapp: locks: there's a big emphasis in Pedestal on things that Rails, frankly, can't even do at all.

21:01 bja: bitemyapp, caribou looks framework-ish

21:01 locks: bitemyapp: I was suppose to counter-troll him, not troll you

21:01 bja: I haven't seen any other frameworks that are being maintained

21:01 arrdem: why isn't /ignore working on chare...

21:01 bja: unless you count immutant

21:01 locks: I was about to say datomic is a clojure library for mysql but, well

21:01 bitemyapp: locks: this isn't trolling and you're propagating inaccurate information in a public channel and adding to the pollution. Just stop.

21:02 AimHere: quizdr, yes, that's what it seems to do

21:02 bitemyapp: bja: Luminus is what I usually recommend to people that want a shake-n-bake way to get started.

21:02 luxbock: there's also http://hoplon.io/

21:02 bitemyapp: bja: Caribou is half-way point between the template-y Luminus and the framework approach.

21:03 this is information that could go on the wiki....hmmm.

21:03 chare: what are these supposed things that pedestal can do but rails can't

21:04 bitemyapp: chare: learn to google, wastrel.

21:05 chare: bitemyapp: you're the expert so I defer to your expertise

21:06 bitemyapp: chare: I want some evidence that you're going to stop wasting peoples' time and start writing code before I lift a finger on your behalf. You've wasted countless hours already.

21:07 kristof: "If you don't like componentized appraoches like Ring/Compojure/et al"

21:07 bitemyapp: kristof: what?

21:07 kristof: You know, once I read somewhere that component mix and match web development was "the Clojure Way". I think that was someone justifying the lack of a full web stack floating around.

21:08 seubert: it used to be a fuller web stack, this is intentional

21:08 quizdr: if I want a function to accept a vector as an argument, I must use & to access all the elements in the vector, right? Because just binding the whole vector to a single argument variable doesn't seem to do this: (defn gsg [j [r]] [ j r]) returns (gsg 1 [2 4 5 6]) --> [1 2]

21:08 kristof: Probably.

21:08 bitemyapp: seubert: not fuller, just more integrated.

21:08 arrdem: bitemyapp: if one was so inclined you could probably compute the average response time per word of #clojure, count the number of words ever sent to chare/chord and then compute the USD price of wasted developer time...

21:08 kristof: What's the equivalent of Rack for Clojure?

21:08 seubert: right, sorry bitemyapp

21:08 bitemyapp: kristof: we atomized Noir on purpose.

21:08 cgag: quizdr: yeah, looks like that takes a number and a seq, and binds the first element of that seq to f and the rest of it to r

21:08 ddellacosta: kristof: ring

21:08 cgag: oh wow

21:08 woops

21:08 kristof: Oh, that's right

21:08 bitemyapp: kristof: in Haskell that'd be WAI.

21:08 arrdem: tempting.

21:08 kristof: Yes, I remember reading about WAI

21:08 bitemyapp: arrdem: I should invoice the motherfucker.

21:09 arrdem: and put up a trust fund for learning Clojure developers that disburses money for books.

21:09 books*

21:09 you only get reimbursed if you actually read the book.

21:09 chare: bitemyapp: if we want clojure to beat ruby then we need you to be working on the nextgen framework for clojure

21:09 kristof: bitemyapp: the funds would go directly to No Starch Press

21:10 arrdem: kristof: I find this outcome acceptable

21:10 bitemyapp: kristof: LYAH?

21:10 kristof: chare: I believe he just said not 3 minutes "start writing code before I lift a finger on your behalf"

21:11 bitemyapp: I wasn't aware that NSP was the one that published the LYAH book

21:11 locks: my LYAH book arrived with the spine unglued :(

21:11 hazards of mail

21:11 kristof: locks: less starch that way

21:11 bitemyapp: locks: yeowch.

21:11 bja: chare, I don't know that anyone is looking to beat ruby

21:11 bitemyapp: kristof: LYSE too.

21:12 chare: I don't write that much Clojure outside of work anymore.

21:12 kristof: Learn You Some Erlang?

21:12 bitemyapp: kristof: yis.

21:12 locks: I re-started reading joy of clojure 2ed today

21:12 bitemyapp: locks: still MEAP?

21:12 locks: bitemyapp: yup

21:12 think so

21:13 kristof: Did they push the release date on that one?

21:13 quizdr: ah i figured out my brain fry on the destructing thanks cgag and AimHere

21:13 bitemyapp: I think I'm already on that. Saw an email update about it.

21:13 locks: last update was somewhere last week

21:14 chare: why is there no learn you a clojure book

21:14 locks: kristof: "Expected publication Winter 2014"

21:14 kristof: locks: Guess I was thinking about something else.

21:14 ddellacosta: chare: Clojure Programming works for that (http://www.clojurebook.com/)

21:14 bitemyapp: ddellacosta: and then some.

21:15 chare: ddellacosta: not paying

21:15 quizdr: chard a new book on Web development in Clojure was just released today

21:15 i meant chare not chard

21:15 bitemyapp: whatever, that's been one of his names too.

21:15 quizdr: ha ha

21:16 ddellacosta: chare: if you need free resources to learn Clojure, you can start the way I did, with 4clojure and the Clojure core API reference. That combined with stack overflow and asking meaningful questions on IRC is a great way to learn.

21:16 locks: http://en.wikibooks.org/wiki/Clojure_Programming

21:17 clojurescriptkoans.com

21:17 etc

21:17 ddellacosta: locks: yeah, great links

21:17 forgot about clojurescriptkoans

21:17 locks: the koans aren’t for everyone

21:19 quizdr: wait did chare say there is no clojure book out there? by last count there are at least 8 or 9 solid Clojure books in publication

21:19 chare: FREE BOK

21:19 quizdr: chard did you ever go to the cinema?

21:20 chare

21:20 do you go to the cinema ever, or sometimes stop for a meal at a restaurant?

21:20 arrdem: bitemyapp: so this dropbox thing worked out pretty well...

21:20 bitemyapp: now I have ~/doc/org/* sync magically across mobile, laptop and desktop :D

21:20 xuser: chare: http://www.braveclojure.com/

21:21 ddellacosta: chare, are you finding any of these links useful to you?

21:21 bitemyapp: arrdem: eggscellent :)

21:21 chare: ddellacosta: I haven't started yet still reading erlang book

21:21 ddellacosta: chare: your point?

21:22 luxbock: arrdem: are you using MobileOrg?

21:23 `cbp: clojure cookbook is free

21:26 quizdr: there are some great links here, interesting books i've never heard of and that are free, sweet, thanks guys. chare hope you are paying attention.

21:27 jcromartie: http://www.youtube.com/watch?v=XluovrUA6Bk

21:27 ddellacosta: quizdr: glad someone is getting something out of it. :-)

21:28 chare: so clojure needs to kill ruby and python thats all I care about eventually

21:28 ddellacosta: jcromartie: I think he's holding a copy of "The Internet Gazette" at the top, excellent

21:28 chare: alright, I tried to give you the benefit of the doubt. I wish you adieu and good luck.

21:29 quizdr: my first clojure book was the OReilly book. it was a bit intimidating for someone totally new to this kind of programming, let alone the language. after 150 pages, i switched to Halloway's book, much more accessible to a newcomer

21:29 i look forward to the OReilly book after I have a few thousand lines of Clojure under my belt

21:29 chare: ddellacosta admit it you want python and ruby to die too

21:32 kristof: chare: Such a hard stance. You fighter! Why do you feel this way?

21:32 chare: kristof I'm just saying what I think not hiding the politically incorrect view that you're afraid to say

21:32 quizdr: no kidding. his thinking is very black and white. in his defense, this is a typical perception for many with a programmer's mind. but those who appreciate the grey areas will get more out of programming, and of life. i think clojure was created with such perception

21:33 kristof: chare: You remind me of Napoleon "liberating" Europe.

21:33 Anyway, I am too busy enjoying my life to embark on a crusade.

21:33 chare: quizdr why do you fight the urges to say you hate python and ruby

21:34 quizdr: chard no one here is "afraid" to say "python must die." why do you think that? who wants them to "die"? who has the energy to waste on such nonsense? you are a troll man.

21:35 ddellacosta: now that we've established that, let us let the troll starve and encourage it to move on to seek more bountiful pastures

21:35 quizdr: ddellacosta agreed my brother

21:36 ddellacosta: quizdr: :-)

21:36 quizdr: i'm going to go get some biryani now and satisfy my taste buds with some spicy curry

21:36 kristof: Oh! You lucky duck.

21:37 quizdr: i'd say you should join me but i suspect that's not practical or likely.

21:37 kristof: I will travel the world over for spicy foods.

21:37 quizdr: as do i

21:37 kristof: Oh, that's actually a good idea. I wonder if my girlfriend would go for that...

21:37 matt444: Any hint at what I'm doing wrong here? https://www.refheap.com/24088

21:38 quizdr: anyone else in here from Singapore?

21:38 arrdem: luxbock: yep :D

21:38 luxbock: haven't used it for anything yet but I just got the import/export crud set up.

21:38 quizdr: there's a big Haskell group here in Singapore but I'd love to get some Clojure meet ups going too. Heck I've never even used Haskell.

21:39 ddellacosta: quizdr: you are in Singapore? Are you doing Clojure there? I worked there for a short period when I was at my last company (based in Tokyo).

21:39 quizdr: i'm in Singapore for about 2 years now. but my work is in C++ (unfortunately). Clojure is strictly a hobby for now

21:40 see yalls later

21:40 chare: don't fight the anger I let out all the rage

21:41 luxbock: arrdem: hmm it's never worked for me for some reason, but my org-setup is fairly customized so might be because of that

21:41 ddellacosta: quizdr: gotcha, enjoy

21:41 arrdem: luxbock: it turns out that mobile-org has some import-export work that needs to be done

21:42 luxbock: it initially wasn't working for me either but after some bludgeoning it submitted

21:42 ddellacosta: matt444: what happens if you get rid of the close! ?

21:42 luxbock: maybe I'll give it another go later today

21:43 matt444: @ddellacosta: same result

21:43 arrdem: luxbock: http://stackoverflow.com/questions/8432108/how-to-automatically-do-org-mobile-push-org-mobile-pull-in-emacs

21:44 luxbock: http://orgmode.org/manual/MobileOrg.html#MobileOrg

21:44 ddellacosta: matt444: what result do you get by the way?

21:44 * arrdem takes off his emacs pusher hat

21:44 matt444: ddellacosta: 3

21:45 luxbock: are you storing your org-files in Dropbox only or are you using symlinks?

21:45 arrdem: luxbock: I have everything treed out in ~/doc and symlinked from ~/Dropbox to whatever I wanted DB to sync for me

21:45 worked a treat

21:46 once I set up matching symlinks on all my boxes

21:46 luxbock: alright, I'll give it another go later today, thanks for the links

21:47 ddellacosta: matt444: not positive but I suspect you'll have to call <! multiple times to get all the values out of the merged channel. You may try to put that last line in a (while true ...) loop.

21:48 matt444: ddellacosta: yes, i think you're right

21:50 ddellacosta: matt444: ah, except by just looping through it, you'll just call map over and over, so that won't work. You probably will need to merge the channels outside of a while loop, then try pulling from the merged channel inside the loop.

21:51 again, not positive; haven't used merge much and not confident I grasp the semantics of it fully

21:51 not much = not at all

22:07 squidz: i'm trying to make a function faster in clojurescript. The funciton uses assoc which seems to slowing it down. Does anybody know a faster way to implement this? Here is the funciton https://www.refheap.com/24094

22:10 it takes a map and one of the maps keys(group key), then returns a new map where every key is combined with the selected 'group key'

22:11 AimHere: squidz, I don't know if it'll be faster, but you tried zipmap?

22:11 Something like (zipmap (map #(str k group-name) (keys m)) (vals m))

22:12 dnolen: squidz: also might be faster to use (into {} ...) as that will use transients

22:12 AimHere: You might need to change the name of the 'map' argument

22:13 squidz: i'll try it with into and zipmap to see if that helps

22:13 dnolen: squidz: how big is the map?

22:13 squidz: around 15-20 key values, but that is being called around 700 times

22:15 AimHere: Oh, note that there's a 'reduce-kv' function for the sort of job you're doing

22:16 (reduce-kv (fn [m k v] ... ) instead of the syntax you were using

22:17 Hang on, calling a function 700 times on 20 sets of keys?

22:17 So each time this is happening, you're morphing a key and then associng it back in place, taking whatever performance penalties for deleting and inserting a key?

22:18 For each key, can you fix it that you're doing all the mutations at once? You'd be saving 680 hash lookups

22:20 dnolen: squidz: how long is that taking (and under what circumstances?)

22:22 egghead: dnolen: you should link to kioo in the om readme :)

22:22 dnolen: egghead: thx for the reminder will do

22:27 squidz: dnolen: right now it is taking around 3 seconds. What I am actually trying to do is given an array of maps, I want to transform so that the array shortens and the maps gain extra keys. I basicallly group by a key then for each of those gorups I output a map with combinations of that key with the remaining keys in the map. Here is all the code for an example https://www.refheap.com/24096

22:27 dnolen: squidz: 3 seconds? on what browser?

22:28 squidz: I just made a map of 20 keys and I could run your function 700 times in ~45ms

22:31 squidz: on chrome. Let me give you a cljsfiddle http://cljsfiddle.net/fiddle/beandipper.datameld

22:31 it may be the other funcitons that call it

22:32 dnolen: squidz: even using your last refheap it takes < 30ms for 700 runs of meld-data

22:34 squidz: dnolen: here is chromes flame chart http://imgur.com/GLnb580

22:37 for me the input for meld-data has 672 maps, each map having the length 13

22:38 dnolen: squidz: that's not a particularly informative flame chart w/o more information

22:38 squidz: dnolen: do you want the input data?

22:38 dnolen: squidz: that would help considerably

22:38 squidz: what optimization settings here? advanced?

22:43 squidz: dnolen: simple optimization here is the data http://pastebin.com/5TTxj2rm

22:44 jcromartie: dear god, I've been trying to make this huge refactor all day and I'm just now finally getting the REPL to start…? maybe?

22:44 I suck

22:45 dnolen: squidz: that's not EDN, are you calling clj->js inside the loop?

22:45 squidz: er js->clj

22:45 warz: hi all. new to clojure here. when writing a lib, like clj-http, is everything in `client.clj` visible to my app, or is there a way to export only certain functions, etc?

22:45 looks like everything is public, if you will

22:45 squidz: I am feeding the data like data -> js->clj -> meld-data

22:46 so only once before the call of meld-data

22:46 dnolen: squidz: k trying it out here

22:48 jcromartie: phew, it compiles finally

22:48 I know I should have done it in bite-size pieces

22:49 but, records...

22:50 if I could just listen to technomancy...

22:50 * technomancy warns jcromartie about stairs

22:51 technomancy: clojurebot: stairs is <reply>we warned you about stairs! http://www.mspaintadventures.com/sweetbroandhellajeff/archive/001.jpg

22:51 clojurebot: c'est bon!

22:52 jcromartie: tomorrow will be time for serious pair up and code review, to get this thing in shape

22:52 technomancy: clojurebot: records is stairs

22:52 clojurebot: c'est bon!

22:53 dnolen: squidz: which group are you using?

22:53 squidz: like that's the argument to meld-data here?

22:53 squidz: the group is "scenario"

22:54 so (meld-data "scenario" data)

22:54 dnolen: squidz: cannot repro under advanced

22:54 squidz: ~279ms

22:54 squidz: under Node.js which is usually slower than Chrome

22:55 squidz: for EDN conversion and call to meld

22:56 after JIT kicks in, ~110ms on my machine

22:56 squidz: hmmmm. I'm calling it in a go block. That shouldn't effect it so much right?

22:58 dnolen: squidz: seems unlike but your flamegraph is bizarrely noisy leading up to the call

22:58 squidz: pulling the data from a chan

22:58 dnolen: squidz: you're pulling data out of the chan in one big piece?

22:58 squidz: yes I think so

22:58 dnolen: squidz: under simple I see ~200ms

22:59 still nothing close to what you're seeing

23:00 squidz: probably going to need a minimal reproducible case that removes all the surrounding context for me to dig in further.

23:01 squidz: but from what I can tell, nothing slow about your data transform

23:01 well, not 3secs slow way

23:01 squidz: hm okay. Maybe trying to get a reproducable case will lead me to the problem if it is elsewhere in the project

23:02 i'll try to get a simple reproducable case and if I am still getting the same results i'll give you the simple case, but I sense that isolatiing it out will let me figure it out

23:09 dnolen: squidz: a simple perf test would be to set a global and then call your meld-data on a timeout to get it out of the go block stuff

23:12 ddellacosta: very confused with setting up cljx: I can load my cljx namespace in the (non cljs-) console, and cljx seems to be picking up changes based on my configuration, but I see no files produced and clojurescript is obviously not finding my cljx namespaces when I load it up in the browser. What is going on?

23:15 akurilin: Does everybody else also implement logging as a one-time string dump in their Ring apps? As in, if you're printlning away one piece of information at a time, as opposed to building the entire log string first, you end up with a garbled mess during concurrent requests.

23:16 I'm even bubbling up exceptions in the response map to the logger to prevent that from being a mess as well.

23:17 `cbp: use an agen? :pt

23:17 agent*

23:17 akurilin: Taking over exception propagation feels a bit strange.

23:17 `cbp: this would effectively serialize it for me?

23:19 `cbp: a logging agent would fix the many things writing at once to a file

23:19 it would queue the writes

23:21 akurilin: got it

23:29 ddellacosta: alright, so apparently you can't specify a specific filename in cljx source-paths...

23:34 sritchie: do you guys know if anyone's written the inverse of ring's nested-params?

23:34 to generate a map of params like {"card[zip]" "22302"} from input like {:card {:zip 22302}}

23:48 ddellacosta: sritchie: I don't know of anything specifically, but where are you trying to use this? Is it within the context of an HTTP request, client or server-side?

23:48 sritchie: this is for constructing requests to the stripe API

23:48 API calls

23:49 ddellacosta: sritchie: I don't know if it does all of what you need, but ring.util.codec has *some* functionality that will let you do stuff like {"foo" ["a" "b"]} => "foo=a&foo=b"

23:49 sritchie: ah, okay

23:49 I'll take a look

23:49 ddellacosta: sorry, probably a bad example

23:49 sritchie: no, good pointer for a place to look

23:50 ddellacosta: but maybe that can help...will think of what else is out there.

Logging service provided by n01se.net