#clojure log - Feb 08 2014

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

0:11 sdegutis: It works pretty great.

0:11 Just loaded a file from it. Yay.

0:54 sm0ke: so guys how efficient is? ##(def fib-seq (lazy-cat [1 1] (map + (rest fib-seq) fib-seq)))

0:54 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

0:54 sm0ke: ,(def fib-seq (lazy-cat [1 1] (map + (rest fib-seq) fib-seq)))

0:54 clojurebot: #'sandbox/fib-seq

0:55 sm0ke: ,(last (take 1000000 fib-seq))

0:55 clojurebot: #<ArithmeticException java.lang.ArithmeticException: integer overflow>

0:55 sm0ke: and why doesnt clojure promote integers to Biginteger?

0:58 tmciver: sm0ke: It does if you use +'

0:59 sm0ke: ,(def fib-seq (lazy-cat [1 1] (map +' (rest fib-seq) fib-seq)))

0:59 ,(last (take 1000000 fib-seq))

0:59 clojurebot: #'sandbox/fib-seq

0:59 #<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>

0:59 sm0ke: haha

1:00 hmm ok seems to run fine in my repl

1:00 clojurebot is more restrictive is guess

1:00 whats +' ?

1:00 (doc +')

1:00 ,(doc +')

1:00 clojurebot: eval service is offline

1:00 eval service is offline

1:00 tmciver: It's checked addition.

1:01 (+ is unchecked)

1:01 the docs say that +' supports arbitrary precision.

1:01 sm0ke: ok

1:02 tmciver: +' is therefore slower.

1:03 sm0ke: that fib-seq definition is weird, what is it doing?

1:03 for sure it doesnt look like recursion

1:03 as fib-seq is not a function

1:05 benkay`: can someone explain the behavior of for in this context: ,(for [i "foobar"] (println i))

1:05 ,(fir [i "foobar"] (println i))

1:05 clojurebot: eval service is offline

1:05 benkay`: ,(for [i "foobar"] (println i))

1:05 clojurebot: (f\no\nnil o\nnil b\nnil a\nnil r\nnil ...)

1:06 tmciver: benkay`: i get each letter of "foobar" in turn. the nils are returned by println.

1:06 *i gets*

1:06 benkay`: ahh

1:06 sm0ke: benkay`: its list comprehension

1:06 so you get a list of nils

1:06 benkay`: ,(for [i "foobar"] (print i))

1:06 clojurebot: (fonil onil bnil anil rnil ...)

1:07 benkay`: i'm still not quite grokking where the nils are coming from in the list comprehension

1:07 sm0ke: but also the stdout is mixed with the list output and print statements

1:07 ,(for [c "foobar"] c)

1:07 clojurebot: (\f \o \o \b \a ...)

1:07 benkay`: ah ha

1:08 now i do grok. thanks.

1:08 ,(inc sm0ke)

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

1:08 sm0ke: haha

1:09 (inc benkay`)

1:09 lazybot: ⇒ 1

1:09 benkay`: (inc sm0ke)

1:09 lazybot: ⇒ 3

1:16 seangrove: I may be going crazy, but I swear google closure had UUID generation already

1:23 LLKCKfan: Is there any natural ways to relieve pain without using herbs or weed? No drugs

1:23 dsrx: start writing clojure instead of java

1:25 srruby: excercise.

1:25 exercise

1:26 dnolen: seangrove: it does

1:27 seangrove: dnolen: Been googling for quite a bit, searched the docs, and I can't seem to find it.

1:36 muhuk: (defprotocol Test) (extends? Test (reify Test)) => true

1:37 why does this throw ClassCastException?

1:37 do I have to use a record or type?

2:10 aka: seangrove: having sex should relieve some pain

2:11 unless the pain is on your...

2:11 seangrove: I feel I have been unfairly targeted.

2:16 dsrx: seangrove: now you've made me feel crazy, because I thought the same thing as you but also can't find it

2:21 $ cd closure-library && git grep -i uuid | wc -l

2:21 0

2:22 ahhh...

2:22 seangrove: this is what I was thinking of I think. not a universally UID, but locally http://docs.closure-library.googlecode.com/git/closure_goog_base.js.html#goog.getUid

2:23 egghead: life is too short for uuids

2:25 dsrx: function YoloID() { return Math.floor(Math.random() * 1024).toString(16); }

2:28 * seangrove thinks of a way to immortalize dsrx's shame

2:32 egghead: seangrove: you could tweet about it

2:32 LLKCKfan: Is there any natural ways to relieve pain without using herbs or weed? No drugs

2:41 benkay`: hey all - how would you recommend that I go about testing a little tcp client that i'm working on? i'm most interested in the actual bytes going across the wire as opposed to deserializing them myself.

2:43 i'm looking at aphyr's reimann clojure client's tests (https://github.com/aphyr/riemann-clojure-client/blob/master/test/riemann/client_test.clj) and not seeing too much that's terribly helpful.

2:43 i'm on the fence about firing up wireshark and diddling with filters till i turn blue in the face but i figure there has to be a better solution

3:11 well in any event if any of y'all wake in the morning and want to help a kid out, i've SO'd the question in question: http://stackoverflow.com/questions/21643561/test-harness-for-a-clojure-tcp-client

4:06 piranha: is it possible to start cljsbuild auto and some http server simultaneously?

4:32 how do I get a function from namespace by its name?

5:40 sm0ke: ,(keys (ns-public 'clojure.core))

5:40 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ns-public in this context, compiling:(NO_SOURCE_PATH:0:0)>

5:41 sm0ke: i cant seem to find a take-while function in clojure, whats the alternative?

5:41 oh

5:41 there is

5:45 borkdude: I maybe want to start over with my emacs config to make it more lightweight than my emacs live config

5:45 any tips on a starter kit which is currently hip

5:50 sm0ke: 2 ; problem 3¬

5:50 1 (defn prime-factors [n]¬

5:50 oh my gawd

5:50 sorry

5:51 jack_rabbit: indeed.

5:51 * sm0ke feels embarassed

5:51 sm0ke: frkn touchpads

5:53 jack_rabbit: the horror

5:56 borkdude: btw, how I can detach a tmux in which I entered: emacs foo.txt

5:57 shell-command tmux-detach?

7:32 sm0ke: ,(def a (delay (do (prn:ok) 1)))

7:32 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: prn:ok in this context, compiling:(NO_SOURCE_PATH:0:0)>

7:32 sm0ke: ,(def a (delay (do (prn :ok) 1)))

7:32 clojurebot: #'sandbox/a

7:32 sm0ke: ,(force a)

7:32 clojurebot: :ok\n1

7:32 sm0ke: weird

7:33 i had an old repl open and was getting npe, restarting repl seems to have fixed it

7:37 a tree fell in the forest did someone hear the sound

8:29 zaiste: invasmani: thanks! it's fixed now

8:29 logic_prog: does (binding [ ...] ) work in cljs? it appears I'm just getting nil back

9:50 nlminhtl: Hi guys, did anybody solve a problem with Leiningen for IDEA 13? https://gist.github.com/Ignotus/08412bf852e2a945a5d3

9:50 ForNeVeR: I also have the same problem.

9:50 nlminhtl: ForNeVeR: >__<

9:50 ForNeVeR: you!

9:50 ForNeVeR: It seems that LocatableConfigurationType interface was deprecated and now is gone.

9:50 nlminhtl: no you.

9:52 Documentation suggests to implement RuntimeConfigurationProducer instead. Should we patch the plugin? Who is responsible for that?

9:53 And it seems that this issue is already fixed in master: https://github.com/derkork/intellij-leiningen-plugin/commit/b41a23a70463a21302ede546b3aea753ca293e8a

9:53 So... WTF?

10:15 bartxx: hi, is there a way to save state of core.async's go state machine?

10:16 to save to file

10:35 ForNeVeR: Well, if anyone interested, I've forked the IDEA Leiningen plugin and I'll try to maintain it. Latest release 0.3.5 is compatible with IDEA 13 and published on github: https://github.com/codingteam/intellij-leiningen-plugin/releases

10:36 Hopefully the cursiveclojure project will release something soon, so we will not need to maintain it.

10:47 benmoss: anyone familiar with how cljs' load-file works, and if there's a way to determine if a ns exists?

10:52 AimHere: ,(all-ns)

10:52 clojurebot: (#<Namespace clojure.uuid> #<Namespace user> #<Namespace clojure.core> #<Namespace sandbox> #<Namespace clojure.repl> ...)

10:53 AimHere: ,(find-ns 'clojure.core)

10:53 clojurebot: #<Namespace clojure.core>

10:53 AimHere: ,(find-ns 'clojure.wibble)

10:53 clojurebot: nil

10:55 benmoss: cool, thanks ill try that out

10:57 no bueno in clojurescript

10:57 AimHere: Oh well, sorry about that

11:00 rovar: what is the easiest way to convert a vector of integers into a bytearray?

11:01 I was thinking about DataOutputStream

11:01 didn't know if that has been clojurified somewhere

11:03 joegallo: ,(into-array Byte/TYPE (map byte (range 4)))

11:03 clojurebot: #<byte[] [B@48bd67>

11:03 joegallo: behold, a byte array

11:06 rovar: joegallo: thanks, I'm trying to do it to a vector of 8 byte integers

11:16 hyPiRion: or just ##(byte-array (map byte (range 4)))

11:16 lazybot: ⇒ #<byte[] [B@ebb182>

11:19 rovar: hyPiRion: that works if the values are between -127 and 128

11:19 what if it's 3 billion?

11:20 pyrtsa: ##(byte-array (map unchecked-byte (map (partial + 3000000000 (range 4))))

11:20 Oops.

11:20 ##(byte-array (map unchecked-byte (map (partial + 3000000000) (range 4))))

11:21 lazybot: ⇒ #<byte[] [B@f6e1f0>

11:22 rovar: pyrtsa: what value do you think that's going to store?

11:22 pyrtsa: Incidentally, [0 1 2 3].

11:23 hyPiRion: wait, what do you mean by "store" in the first place?

11:23 pyrtsa: unchecked-byte uses the last 8 bits of the integer.

11:23 (I.e. it is correct modulo 256.)

11:24 (unchecked-byte 129)

11:24 ,(unchecked-byte 129)

11:24 clojurebot: -127

11:25 joegallo: are you looking for two arbitrary ints to become a single vector of bytes?

11:25 if so, you might want to say that...

11:25 vector of EIGHT bytes

11:25 missed a key word there...

11:26 because when you say blah blah blah vector of bytes blah blah blah from ints, everybody is going to think you want to cast to byte.

11:26 so you shouldn't be surprised when that's the answer you get.

11:27 rovar: more like I have a vector of an arbitrary number of 64 bit ints, X, and I want to turn that into an array of bytes of size ((count x) * 8)

11:27 pyrtsa: rovar: Okay then. What about endianness?

11:27 joegallo: i'm curious where you're getting these 64 bit ints from? java ints are 32 bit.

11:27 are these longs? are you using BigInteger?

11:27 rovar: pyrtsa: don't care, this is for serialization to and from the same machine only

11:28 pyrtsa: joegallo: Generally, integers in Clojure are Long.

11:28 rovar: joegallo: longs

11:28 joegallo: pyrtsa: when somebody starts talking about the number of bytes in some type, i assume they're talking jvm primitives.

11:29 pyrtsa: Fair enough.

11:29 neoartifex: k thanks

11:30 joegallo: http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/com/google/common/primitives/Longs.html#toByteArray%28long%29

11:30 if you're willing to live with a new library dependency

11:30 map that over your longs and turn them each into 8 bytes. concat the arrays.

11:31 alternatively, the docstring for that method tells you what you can do using java.nio.ByteBuffer to do the same thing.

11:31 hyPiRion: It's okay to just bytebuffer here

11:31 joegallo: right...

11:32 rovar: yea.. I've found bytebuffer in clojars which simplifies this a bit.

11:32 i've never really coded in java before.. coming to clojure from c++/haskell so I'm still exploring the java stdlib

11:32 pyrtsa: ,(defn long->le [x] (mapv #(unchecked-byte (bit-shift-right x (* 8 %))) (range 8)))

11:32 clojurebot: #'sandbox/long->le

11:33 pyrtsa: ,(long->le 257)

11:33 clojurebot: [1 1 0 0 0 ...]

11:33 pyrtsa: ,(long->le 510)

11:33 clojurebot: [-2 1 0 0 0 ...]

11:33 hyPiRion: O_o

11:33 pyrtsa: etc.

11:33 hyPiRion: Bytes.

11:33 "le" for little-endian.

11:35 hyPiRion: ,(import 'java.nio.ByteBuffer)

11:35 clojurebot: java.nio.ByteBuffer

11:35 hyPiRion: ,(let [xs (range 100) bb (ByteBuffer/allocate (* 8 (count xs)))] (doseq [x xs] (.putLong bb x)) (.array bb))

11:35 clojurebot: #<byte[] [B@b4bc1e>

11:35 pyrtsa: Okay. That's better.

11:39 rovar: hyPiRion: that's pretty much what I ended up with, except i put a (.toLong x) to ensure length

11:43 reversing that is interesting

11:46 is there a thrush operator that applies methods to resulting objects?

11:46 e.g. ByteBuffer.wrap(barray).asLongBuffer.array()

11:47 ahh ..

11:47 hyPiRion: that's just ->

11:50 rovar: I think either (-> (ByteBuffer/wrap buff) (.asLongBuffer) (.array)) is the same as (.. (ByteBuffer/wrap buff) (asLongBuffer) (array))

11:50 pyrtsa: .. is different.

11:50 It won't use the result of the previous call in the next.

11:51 (.. x a b c) does (do (.a x) (.b x) (.c x) x) whereas (-> x (.a) (.b) (.c)) returns (.c (.b (.a x)))

11:52 hyPiRion: er

11:52 ,(macroexpand '(.. (ByteBuffer/wrap buff) (asLongBuffer) (array)))

11:52 clojurebot: (. (. (ByteBuffer/wrap buff) (asLongBuffer)) (array))

11:52 pyrtsa: Ouch. Okay, I should shut my mouth tonight. Sorry.

11:53 doto was that.

11:53 hyPiRion: pyrtsa: yeah, I figured you mixed them up

11:54 pyrtsa: I think -> is more readable and tend to avoid .. altogether. So that's why the confusion.

12:12 dabd: I am using spit with the :append option and sometimes my program will leave the file open and the OS (win 7) won't let me delete the file. I checked the implementation of spit and it is obviously using a finally to close the stream. What could be wrong here? Thanks.

13:04 cddr: Does anyone know why the bcrypt-credential-fn in friend expects a function of only one arg rather than two? Why not pass the password along as well as the username/id?

13:10 sdegutis: What happened to Feb 3? http://logs.lazybot.org/irc.freenode.net/%23clojure

13:12 silasdavis: cddr, it expects a {:username ... :password ...} map

13:13 llasram: sdegutis: Wasn't that the day of the DoS attack on freenode?

13:13 sdegutis: Oh.

13:13 sm0ke: sdegutis: looks like an inside job to hide sensitive data

13:13 sdegutis: Oh.

13:14 sm0ke: you never know when million dollars are at stake

13:14 clojure is now a big name

13:15 sdegutis: Right.

13:15 mdeboard: Is there a way to set a "start up" function with CIDER for a particular project? When I M-x cider-jack-in in a compojure project, I want to run (do (use 'my-compojure-thing.repl) (start-service)) automatically ... is there a way to do this?

13:15 start-server*

13:16 llasram: Argh, I've been trying to make another relase of Parkour all week, but I keep realizing just oooone more thing I can add to make the release even more awesome

13:17 sm0ke: llasram: save it for next relases

13:17 llasram: mdeboard: Leinigen project.clj /:repl-options/:init form

13:17 sm0ke: you knwo what they say

13:17 llasram: mdeboard: Check `lein sample` for an example

13:17 sm0ke: always leave your code in a broken state

13:17 mdeboard: llasram: Thanks

13:18 llasram: sm0ke: Early-and-often is good, but I don't have the social energy to make a major thing out of it every time

13:19 Which I'm planning to do for this release, so want it to be as awesome as possiblel

13:21 sm0ke: llasram: have you been using parkour in production?

13:21 llasram: Since day 1

13:21 mdeboard: llasram: That is a pro tip on the repl-options, thanks

13:21 llasram: Only thing still in Cascalog at Damballa is one ETL job which I haven't touched in a year

13:21 mdeboard: np!

13:22 sm0ke: llasram: why moving away from cascalog?

13:22 llasram: sm0ke: I'm pretty sure I already linked you to my Parkour "motivation" write-up :-)

13:23 In a nutshell though -- I want to write MapReduce programs in Clojure, not Datalog queries in some funky macro DSL

13:23 mdeboard: llasram: But I spent so much time wrapping my head around cascalog :(

13:23 llasram: I think MapReduce is a great fit for Clojure. You just need an API which exposes their compatibilities

13:24 mdeboard: But seriously, that's great and honesly much needed

13:24 sm0ke: makes sense

13:24 mdeboard: Python has a great mapreduce module called mrjob. You just write python and do some configuration behind the scenes and it works fine

13:24 sm0ke: llasram: is parkour closely knit on hadoop api?

13:25 mdeboard: you can either run it on local fs or on hdfs (local or remote), something that is a huge pain in the ass with cascading/cascalog. Or it was anyway a year ago whenI used it last

13:25 llasram: mdeboard: Hopefully I'll have a new release out in 1-2 hours which adds support for live-cluster REPLs. Data exploration, "mixed mode" execution, and launching real jobs

13:26 sm0ke: It's built directly on top of the Hadoop APIs, and doesn't try to hide them, if that's what you're asking?

13:26 sm0ke: llasram: can parkour run on other platform too in other words

13:26 llasram: Oh, no

13:26 It is for Hadoop and nothing but Hadoop

13:27 Swapable backends is an explicit non-goal

13:27 sm0ke: oh why may i ask?

13:27 llasram: Because it seems like over-engineering to me :-)

13:28 sm0ke: well spark seems pretty good for in memory analytics

13:28 which is a far fetched idea for *BIG DATA* though

13:28 llasram: Oh, yeah, spark. I still need to explore that. I've had my time cut pretty thin lately

13:28 Spark is potentially interesting

13:29 I thought you meant like the Cascalog 2.0 idea of being able to support both bulk and stream processing, via e.g. Storm

13:29 sm0ke: llasram: it has same functional constructs map, reduce, partition , union etc

13:29 llasram: oh yea that

13:29 no

13:29 llasram: Supporting something that is still actually MapReduce might be a future plan, but not ATM

13:30 sm0ke: what

13:30 llasram: ?

13:30 sm0ke: cascalog 2.0 will run on storm?

13:31 llasram: That's the promise of the design, but I don't believe the Storm backend has been released yet

13:31 sm0ke: i didnt read that right first time

13:31 llasram: haha

13:34 sm0ke: i kind of like cascalog, but sometimes i cant seem to get things right which looks obvious

13:34 but i feel the real power is with the joins

13:35 llasram: Cascalog's join are great if you need joins, but joins are also hideously, hideously inefficient

13:35 sm0ke: worst part is figuring out which job out of the dozen running is doing exactly what

13:35 llasram: Also true :-)

13:36 sm0ke: llasram: you know what, cascalog potentially can run on top of parkour

13:37 crazy idea

13:37 if it can run on top of spark i dont see any reason why is cant on top of parkour

13:37 llasram: That is an idea. I thought about it some, it could be made to work, and would probably be cleaner than making Cascalog run directly on the Java Hadoop APIs

13:38 sm0ke: llasram: well you could potentially be free of the cascading dependency

13:38 thats a huge win

13:38 llasram: The biggest problem is the tuple abstraction. You'd need to either steal Cascadings or do it from scratch

13:39 And I get the impression of lot of people are actually pretty happy with what the Cascading layer gives them :-)

13:39 They get to participate in a broader Cascading ecosystem of taps etc

13:40 Does Cascalog support Spark now? I must have missed the announcement

13:40 sm0ke: not yet, but i read that in the group somewhere

13:41 llasram: I see

13:41 sm0ke: sam seems to have partitioned the api into logic and platform

13:41 llasram: Yah

13:42 sm0ke: idea being platform can be implemented per platform, you should look into it :)

13:42 llasram: Right :-)

13:44 sm0ke: i see huge benefits, cascading is impenetrable, but via parkour jobs can be annotated with meta coming from cascalog queries

13:44 i am assuming you can do that with parkour

13:44 :)

13:45 so you could finally put a finger on whicj job is doing query x

13:46 anyways, parkour is interesting, i need to take a in-depth look at it yet

13:46 thanks for the project!

13:46 llasram: np! Let me know if you have any comments after you have had a chance to take a deeper look

13:47 GadolGrandGadol: secrets d'état & co ( révélations, etc ), faites tourner .. http://morganroulleau.wordpress.com ( on s'en branle que vous compreniez pas, au pire ça viendra plus tard ( .. )) ( La NSA approuve ce message. ) ( méway, sans doute, ils m'aiment. )

13:48 sm0ke: sure thing, the live cluster repl you mentioned is nice

14:12 sdegutis: I feel like I haven't yet done all the mutable-imperative that I want to do in life. It feels too soon to go totally immutable-functional.

14:18 gfredericks: sdegutis: but you wrote those functional programs and you can't take that back. you have a responsibility to then and to society to maintain them. not doing so would almost surely cause serious emotional & psychological harm

14:18 s/then/them/

14:19 sdegutis: gfredericks: Yes but if I don't take this chance, I'll always be asking myself "what if"... and I just can't live with that hanging over me for the rest of my life.

14:21 gfredericks: sdegutis the deadbeat functional programmer

14:21 llasram: sdegutis: You do HackerNews, right? What's the norms there on submitting your own blog posts?

14:21 sdegutis: llasram: Dunno, I just joined a few days ago. And so far I've broken most of the unwritten rules somehow.

14:22 llasram: I'd say just do it and let the chips fall where they may.

14:22 llasram: Oh, weird. For some reason I thought I remember seeing you being a frequent user for a long while

14:22 sdegutis: llasram: Maybe, if "a long while" means like 2 or 3 weeks.

14:23 llasram: Yes. Flea years :-D

14:23 gfredericks: clojurebot: a flea year is the distance that a flea travels in one year

14:23 clojurebot: In Ordnung

14:23 llasram: nice

14:24 gfredericks: (in a vacuum of course)

14:24 sdegutis: llasram: Just make sure to target males age 18-25 in your blog post. Don't forget to favor appealing to pathos over ethos or logos.

14:24 hakujin: is the "joy of" book still the best source for teaching clojure idioms even though it's quite outdated?

14:25 llasram: hakujin: I don't know about idioms, but philosophy, yes

14:25 And haven't they released / are releasing a new edition?

14:25 hakujin: end of the month according to Amazon

14:26 llasram: Well there you go

14:26 sdegutis: llasram: Although I'm no marketer, that's just my simplistic analysis of how to get to the front page.

14:38 rovar: hakujin: you can get the 2nd edition advance copy from manning press

14:40 sdegutis: hakujin: I recommend reading through popular Clojure projects (like weavejester's) to find good idioms.

14:41 hakujin: But the general rule of thumb that I've found to be helpful to finding good idioms on your own is: try to think in (lazy) sequences and use them whenever possible.

14:47 dnolen: reversible Clojure is pretty fun - http://github.com/clojure/core.logic/commit/dcc94f57a93c3c4d6085121844480dd9799f8cd5

14:50 bbloom: hehe nice

14:51 dnolen: have you seen www.cs.indiana.edu/~sabry/papers/rational.pdf‎ and the "reversible language" described in that paper's predicesor?

14:51 er predecessor

14:52 dnolen: this one http://dl.acm.org/citation.cfm?id=2103667&dl=ACM&coll=DL&CFID=385002691&CFTOKEN=24885898

14:53 dnolen: bbloom: I've only skimmed the literature in the past.

14:53 sdegutis: dnolen: I can't wrap my head around that. It looks so greek to me.

14:53 bbloom: dnolen: the "information effects" paper is pretty cool and makes the fractional types paper make sense

14:55 patrkris: what is a quick way of getting a seq of lines from a string? this link suggests using a BufferedReader and a StringReader: http://clojuredocs.org/clojure_core/1.2.0/clojure.core/line-seq

14:55 but aren't there some function built into clojure that does this?

14:55 dnolen: bbloom: what I've pasted above is actually not quite right but it's something to play around with, doesn't quite work for reversible conj on associative data structures - will fix that in a bit.

14:56 sdegutis: it's just conj that can run forwards or backwards and can take partially instantiated Clojure terms

14:57 sdegutis: dnolen: Oh, neat.

14:57 Sometimes this channel makes me feel pretty dumb, in a good way :)

14:58 llasram: Ok, new Parkour release: https://github.com/damballa/parkour/releases/tag/0.5.4, and blog post: http://blog.platypope.org/2014/2/8/interactive-hadoop-with-parkour/

15:01 rovar: very cool

15:02 does it have to run on a mapreduce node, or can it remotely connect/deploy?

15:03 llasram: You can remotely connect, and usually would. I just wanted to make sure it could be replicated on EMR, and it's waaaay easier to just do everything on the master there

15:04 I actually got the SOCKS stuff set up first, but then decided it was too orthogonal to the post to bother with, but also too fiddly to expect someone to do w/o significant Hadoop experience

15:04 Oh, I knew I forgot something -- example program in github

15:07 sdegutis: Wow, millions.

15:08 llasram: ?

15:08 insamniac: $$$?

15:10 llasram: And here's a fresh Hacker News thread, if you're into that sort of thing: https://news.ycombinator.com/item?id=7202425

15:14 sdegutis: I kinda wanna use node-webkit as my default browser...

15:15 llasram: I'd upvote it but I can't login again for 84 more minutes.

15:15 llasram: heh

15:15 Limiting your access to distractions?

15:15 Or like a BDSM thing?

15:16 Yeah, ok, I'm in a punchy mood

15:16 sdegutis: llasram: I enabled that "noprocrast" setting this morning.

15:16 rovar: llasram: upgoated

15:17 llasram: sweet

15:17 insamniac: sdegutis: what was the Wow, millions for?

15:18 sdegutis: insamniac: I was just looking at node-webkit's github stars.

15:19 insamniac: It had a lot. That made me think of the pseudo-number "millions".

15:19 insamniac: So I thought out loud in here.

15:19 insamniac: I should probably curb that.

15:19 Especially when it makes almost no sense and is completely irrelevant and off-topic.

15:20 In other news, I got a basic hello world script working in ClojureCLR this weekend :D

15:20 I called it from my C# program, and it called my C# function, which actually did stuff. It was pretty awesome.

15:22 insamniac: Meh.. I need to get motivated and write some code.

15:22 I finished the clojure koans at least.

15:22 sdegutis: insamniac: You could write a Clojure compiler in Clojure.

15:22 That's a good way to learn Clojure.

15:23 I hear that's how dnolen did it.

15:23 insamniac: Yeah that sounds like something I could find motivation for.

15:23 I was thinking something more along the lines of a shitty canvas game

15:24 I'm hoping to find inspiration at devnexus.

15:25 I need a coding room that has no internets.

15:27 llasram: insamniac: Ah, the fair city of Atlanta

15:27 sdegutis: insamniac: Try turning off your wifi.

15:27 llasram: Known for its Southern hospitality and coding rooms

15:33 seangrove: SFDC API, you make me want to be a better person

15:37 insamniac: I'm in Augusta. Known for James Brown and The Masters.

15:38 muhoo: sdegutis: actually i think tim baldridge did, via clojure-py

15:39 must have been good practice for core.async, which AFAICT is a compiler in a compiler

15:40 that go macro is pretty wild

16:17 bartxx: Does anybody knows if it is possible to save state from core.async state machine? "save" meaning extract and for example write to file.

16:19 I have an app with GUI build on core.async, and it would be handy to freeze GUI state, and restore later (especially for IOS apps).

16:20 clojure-kid: does anybody in here have experience with laser?

16:20 I'm trying to use it to pull text out of web pages

16:20 but so far I've only found how to transform it into valid html

16:21 I just want plain text

16:21 is that even something it's meant to do?

16:24 s_kilk: Is anyone aware of a clojure equivalent to the Celery library from python? http://www.celeryproject.org/ , it's something I would be interested in starting up, if no equivalent exists for clojure at the moment

16:29 rovar: s_kilk: there is Quartzite, which is close, it has the scheduling component, but not really the queing component

16:30 s_kilk: rovar : thanks, I'm already familiar with Quartzite, it's awesome. I'm thinking of doing a small in-process queuing module for clojure, and then expanding it to a full clustered celery-alike library. I'll give it some more thought. Or, is it possible that i'm missing something obvious that would make this idea less useful in Clojure??

16:30 lazybot: s_kilk: Definitely not.

16:31 amalloy: clojure-kid: i don't think laser is intended to do anything other than produce html

16:31 s_kilk: Definitely not a bad idea? :)

16:31 amalloy: you can check with Raynes, of course

16:32 rovar: s_kilk: yea, basically concurrency is not really that easy in python, whereas it's very easy in clojure.. setting up a list of tasks to be run asynchronously is trivial in clojure..

16:32 clojure-kid: amalloy: is there something actually meant to do that, then?

16:32 rovar: so it would be a good exercise, IMO, but you might find that there is far less to do :)

16:32 clojure-kid: and yes, I'll send Raynes a message

16:33 s_kilk: rovar : aye, I see. But would there be any use in a more fully featured library that would abstract over rabbitmq like celery does?

16:33 arrdem: Raynes: oi

16:33 hyPiRion: Raynes: ping pong

16:33 clojure-kid: Raynes: your presence is requested

16:33 rovar: s_kilk: other than me hoping RabbitMQ dies in a fire, no :)

16:33 hyPiRion: $seen Raynes

16:33 lazybot: Raynes was last seen talking on ##eleventhbit 2 hours and 33 minutes ago.

16:33 clojure-kid: :(

16:34 s_kilk: rovar : ha, i take it your not a fan then? :) I've been using celery a lot at work and have become very fond of the idea of coordinating many worker machines with a distributed queuing system. would love to hear your thoughts on that

16:35 well, lets also say we could use redis or whatever as a queue broker, doesn't need to be RMQ

16:35 arrdem: besides #emacs and #clojure, anyone have favorite interesting channels to lurk?

16:35 rovar: s_kilk: yea, it depends on your use case.. somehow I've managed to avoid having to have a distributed job queue, but certainly it would be needed somewhere.

16:35 s_kilk: arrdem : i like to lurk on #ruby toon

16:36 rovar : any particular problems you've found with RabbitMQ ? or is it a general dislike for the concept? :)

16:43 pdurbin: arrdem: #rest and #indiewebcamp are favorites of mine

16:45 clojure-kid: hmm, crawlista looks more suited to my web-scraping needs

16:46 there's even a function called extract-text, which I think just pulls the content out of the page

16:51 sveri: hi, i have a weird problem, i setup a luminus project some time ago and worked on it and now my lein run -dev hangs from time to time or takes ages to compile, i tried to remove deps i dont need, but that didnt help, any ideas how to debug that or what might cause this?

16:54 mmitchell: does anyone feel like helping me with a macro today? :)

16:55 plookn: mmitchell: what is it?

16:55 hyPiRion: Anyone knows how to use (or even better, create) records from Java?

16:55 rhg135: mmitchell, depends, go-ish or when-ish ;)

16:56 mmitchell: it's a macro i've been trying to write all day to run through forms and assert that they're true

16:57 Here's a skeleton of what I'm trying to do: https://gist.github.com/mwmitchell/8890906

16:58 So I think loop is the right way to run through the test forms

16:59 crundar: First time clojuring. How do get and install libraries. I followed the instructions on the download page, java -cp clojure-<version>.jar clojure.main

16:59 mmitchell: And I'd be happy with using plain (assert (-> val test-form)) - but i really want to be able to see the form in the exception - does this make sense?

16:59 crundar: it seems like there must be a better way to start up clojure generally. That can't be how you all get things going.

16:59 mmitchell: crundar: definitely, Leiningen

17:00 crundar: http://leiningen.org/

17:00 rhg135: even maven

17:00 but dat xml

17:00 clojure-kid: crundar: Leiningen is the way to go

17:01 rhg135: agreed

17:01 mmitchell: rhg135: did you see my macro gist?

17:01 rhg135: yes

17:01 unfortunately im horrible at macros

17:01 mmitchell: no problem, me too :)

17:02 i can get pretty far, but there's something I'm clearly not understanding and am not able to do exactly what I want

17:03 rhg135: recursion seems appropriate here

17:04 mmitchell: rhg135: yeah i was using loop/recur to step thru each test form

17:04 rhg135: like `(do (blah...) (assert-all ~val ~(rest tests)))

17:16 riz_: hi

17:16 can anyone please point me to a good tutorial on macros?

17:16 i've been looking at this for 2 weeks and haven't been able to make any progress because it's way too confusing: http://www.braveclojure.com/writing-macros/

17:18 afhammad: riz_: try this video: http://www.youtube.com/watch?v=dKoNnMEjcEI

17:23 also i recommend picking up a book such as Joy of Clojure, it covers macros well

17:25 riz_: thank you will check it out

17:25 mmitchell: wow, i think i actually got it: https://gist.github.com/mwmitchell/8890906

17:39 loganlinn: Are these ampersands reader macros? https://github.com/clojure/clojurescript/blob/d9b2b4c5b3693621e57615f6c9e147ac71f5b47a/src/clj/cljs/core.clj#L599-L600

17:40 I assume its something to do with inspecting a namespace

17:52 muhoo: loganlinn: @ is deref. ~@ is splice

17:57 hyPiRion: unquote-splice, actually

17:59 loganlinn: &env is the environment the macro was called from. So yes, it's for looking up values.

18:02 ivan: should the builtin macros be in pygments' ClojureLexer.builtins? (they aren't right now)

18:05 hyPiRion: ivan: like `or` and `and`?

18:05 ivan: those two are in there

18:05 hyPiRion: oh, so they've only picked a snippets of them then

18:05 ivan: but e.g. lazy-seq isn't

18:06 `try` is also mysteriously missing from the special forms, I'll have to check those too

18:06 I first started looking into this when I noticed (require ) was being highlighted differently from (import )

18:07 hyPiRion: well, I guess it depends on their use. Some of the macros are for control-flow which may be highlighted differently? Although it makes sense to support all of them, with some sort of highlightning.

19:36 eraserhd: Is there a way to boot a clojure project that doesn't take focus away from the terminal?

19:36 in OS X.

19:40 tolstoy: eraserhd: Try adding this to project.clj: :jvm-opts ["-Dapple.awt.UIElement=true"]

19:40

19:41 eraserhd: tolstoy: Hrmm. That seems like the opposite of what I want. But lemme try.

19:42 tolstoy: That gives me an IllegalArgumentException when I try...

19:43 bbloom: tolstoy: oh that is awesome. just put that in my lein profile

19:43 eraserhd: worked for me

19:43 tolstoy: eraserhd: When I don't have that, I get an icon on my dock and lose focus.

19:43 eraserhd: With that on, It Works. ;)

19:44 bbloom: tolstoy: so nice.

19:44 eraserhd: I just installed Oracle's Java 7, which replaced Apple's (for another project). I'm guessing this JVM doesn't have that.

19:45 But the documentation talks about java.awt.headless

19:46 tolstoy: bbloom: Not sure where I found that gem, but it's great. ;)

19:47 eraserhd: I'm using it with Oracle JDK 8 (and 7 (and 6)).

19:49 eraserhd: So the problem was that I forgot to put the jvm opts in brackets. Both java.awt.headless=true and apple.awt.UIElement=true work.

19:50 tolstoy: eraserhd: Good to know. The UIElement=true thing does indeed seem the opposite of what we want.

20:46 eraserhd: For clojure CLI programs, do we have a standard wrapper script or a favorite lein plugin that makes and installs them?

20:46 arrdem: clojure really isn't a cli tools language.... slow starting JVM T_T

20:47 which really means no, there isn't good infrastructure/libraries there.

20:48 eraserhd: I'm hoping LLVM backends help there. Part of my current excitement about Clojure :)

20:48 But, OK... write my own wrapper script.

20:48 seancorfield: or use ClojureScript and target Node.js (to avoid the JVM startup)

20:49 arrdem: unless Bronsa has some seriously strong foo that I know not of, such things are a loooong way off.

20:49 yeah cljs on Node or V8 was something Rich held forth as a serious faststart option.

20:49 tolstoy: eraserhd: I've used lein-exec when start-up time didn't really matter.

20:50 eraserhd: https://github.com/kumarshantanu/lein-exec

20:51 eraserhd: I'm willing to live with startup time for now.

20:52 Because cljs is 100 times better than JavaScript, but the damn types, arghh.

20:53 scottj: eraserhd: check drip for improved startup times (there are several other solutions, perhaps mostly abandoned)

20:54 jark being one

20:55 eraserhd: I was imagining a lein plugin which would make a fat jar and write a little shell script to execute it upon `lein install`. Except that `lein install` already means something, so it would be a different command.

20:56 `lein exec` seems to require staying in the source dir, which isn't useful for the system utility that I'm writing.

20:59 scottj: Drip is neat.

21:10 gfredericks: eraserhd: "the damn types"?

21:28 * technomancy would just use ocaml or haskell for serious CLI stuff

21:28 technomancy: or racket

21:29 eraserhd: lein 1.x had a shell wrappers feature, but no one used it, so it was dropped for 2.x

21:38 eraserhd: gfredericks: I don't remember specifically, but I recall having a lot of differences from clojure relating to Javascript not differentiating types.

21:38 e.g. (cond (string? x) ... (number? x) ...)

21:39 Granted, I used this to my advantage, too. :)

22:01 fowlslegs: Is there anyway to kill a runaway REPL process besides ending the REPL?

22:09 gfredericks: eraserhd: oh okay so differences from jvm-clojure in particular

22:59 quizdr: I want to check if some of the elements in a collection are true -- but I want to return false if none of them are. "some" only returns nil if none of them are. what's most elegant way to do this?

22:59 arrdem: ,#'clojure.core/any?

22:59 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve var: clojure.core/any? in this context, compiling:(NO_SOURCE_PATH:0:0)>

22:59 arrdem: ,#'clojure.core/any

23:00 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve var: clojure.core/any in this context, compiling:(NO_SOURCE_PATH:0:0)>

23:00 shriphani: arrdem, afaik there's no any in clojure-world

23:00 arrdem: quizdr: one thing you could do is (reduce #(or %0 %1) my-col false)

23:00 shriphani: yeah I always get that wrong.

23:01 ,(reduce #(or %1 %2) [false false false nil] nil)

23:01 clojurebot: [false false false nil]

23:01 arrdem: oh. order.

23:01 ,(reduce #(or %1 %2) nil [false false false nil])

23:01 clojurebot: nil

23:02 arrdem: ,(true? (reduce #(or %1 %2) nil [false false false nil]))

23:02 clojurebot: false

23:02 * arrdem calls it good enough

23:03 shriphani: is there a utility for clojure that checks if I have imports I am not using etc

23:03 like pylint

23:03 loganlinn: ,(apply or [false false false nil])

23:03 clojurebot: #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/or, compiling:(NO_SOURCE_PATH:0:0)>

23:03 arrdem: loganlinn: hence the reduce :c

23:03 quizdr: i shall try that

23:05 arrdem: (true? (any ..)) will work too...

23:05 quizdr: i guess the easiest way is to just call true? on it

23:05 loganlinn: yeah, makes sense

23:05 quizdr: ah, i see we think alike someimtes arrdem

23:07 shriphani: quizdr, was this to avoid some NullpointerException ?

23:08 quizdr: no, it was to test for true or false on a wider problem, and i wanted a definite true or false returned shriphani

23:08 technomancy: shriphani: slamhound does that

23:09 arrdem: technomancy: does slamhound still work.. or is it still slime bound?

23:19 technomancy: arrdem: slamhound is so non-slime-bound that it even works with nrepl-discover

23:19 you know, the new hotness that's so new it's not even finished or usable

23:19 arrdem: so new and so hot I hadn't heard about it yet :D

23:20 (dec so) ;; this guy....

23:20 lazybot: ⇒ -4

23:20 technomancy: arrdem: guns has been doing a great job keeping momentum going on slamhound in all seriousness

23:20 arrdem: technomancy: sweet! I saw clj-refactor.el floating around in the last two days and look forwards to taking a more serious look at the growing tools ecosystem

23:21 now we just need that standard code formatter.....

23:21 technomancy: it bums me out that everyone is writing stuff that's coupled to a single editor

23:21 wish I had time to get nrepl-discover more polished, but that seems unlikely now that my conference proposal was turned down

23:21 arrdem: :c

23:30 scottj: well, the predecessor to clj-refactor.el, clojure-refactoring was primarily clojure with a very small .el interface

23:30 guns: thanks technomancy; I do have a little problem related to slamhound that I discovered the other day: https://i.imgur.com/KSPKuJD.png

23:30 arrdem: clearly what we really need is an Emacs rewrite in Clojure compiled to ASM via clojure.tools.emitter.x86_64...

23:30 guns: that's a picture of the Clojure process dying from running out of permgen

23:31 it happened while running slamhound in a continuous loop; apparently remove-ns does not actually trigger gc of the compiled classes

23:32 the solution to this appears to be loading clojure classes with a custom classloader

23:32 but it's not clear how easy that will be

23:32 technomancy: guns: huh, sounds like a possible bug in clojure

23:32 guns: yes, basically (eval …) always increases permgen

23:33 technomancy: you can construct a classloader that delegates to the current one

23:33 guns: that's what I'm hoping will succeed

23:33 using the classunloading flag alleviates this, but I've managed to crash the profiler even with that flag

23:34 :(

23:39 (for the irc record, crashing the jvm like this takes many hundreds of invocations of slamhound, so it's not really a huge hindrance)

23:40 arrdem: lazybot stands impartial witness

Logging service provided by n01se.net