#clojure logs

2014-02-08

00:11sdegutisIt works pretty great.
00:11sdegutisJust loaded a file from it. Yay.
00:54sm0keso guys how efficient is? ##(def fib-seq (lazy-cat [1 1] (map + (rest fib-seq) fib-seq)))
00:54lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
00:54sm0ke,(def fib-seq (lazy-cat [1 1] (map + (rest fib-seq) fib-seq)))
00:54clojurebot#'sandbox/fib-seq
00:55sm0ke,(last (take 1000000 fib-seq))
00:55clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
00:55sm0keand why doesnt clojure promote integers to Biginteger?
00:58tmciversm0ke: It does if you use +'
00:59sm0ke,(def fib-seq (lazy-cat [1 1] (map +' (rest fib-seq) fib-seq)))
00:59sm0ke,(last (take 1000000 fib-seq))
00:59clojurebot#'sandbox/fib-seq
00:59clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
00:59sm0kehaha
01:00sm0kehmm ok seems to run fine in my repl
01:00sm0keclojurebot is more restrictive is guess
01:00sm0kewhats +' ?
01:00sm0ke(doc +')
01:00sm0ke,(doc +')
01:00clojureboteval service is offline
01:00clojureboteval service is offline
01:00tmciverIt's checked addition.
01:01tmciver(+ is unchecked)
01:01tmciverthe docs say that +' supports arbitrary precision.
01:01sm0keok
01:02tmciver+' is therefore slower.
01:03sm0kethat fib-seq definition is weird, what is it doing?
01:03sm0kefor sure it doesnt look like recursion
01:03sm0keas fib-seq is not a function
01:05benkay`can someone explain the behavior of for in this context: ,(for [i "foobar"] (println i))
01:05benkay`,(fir [i "foobar"] (println i))
01:05clojureboteval service is offline
01:05benkay`,(for [i "foobar"] (println i))
01:05clojurebot(f\no\nnil o\nnil b\nnil a\nnil r\nnil ...)
01:06tmciverbenkay`: i get each letter of "foobar" in turn. the nils are returned by println.
01:06tmciver*i gets*
01:06benkay`ahh
01:06sm0kebenkay`: its list comprehension
01:06sm0keso you get a list of nils
01:06benkay`,(for [i "foobar"] (print i))
01:06clojurebot(fonil onil bnil anil rnil ...)
01:07benkay`i'm still not quite grokking where the nils are coming from in the list comprehension
01:07sm0kebut also the stdout is mixed with the list output and print statements
01:07sm0ke,(for [c "foobar"] c)
01:07clojurebot(\f \o \o \b \a ...)
01:07benkay`ah ha
01:08benkay`now i do grok. thanks.
01:08benkay`,(inc sm0ke)
01:08clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: sm0ke in this context, compiling:(NO_SOURCE_PATH:0:0)>
01:08sm0kehaha
01:09sm0ke(inc benkay`)
01:09lazybot⇒ 1
01:09benkay`(inc sm0ke)
01:09lazybot⇒ 3
01:16seangroveI may be going crazy, but I swear google closure had UUID generation already
01:23LLKCKfanIs there any natural ways to relieve pain without using herbs or weed? No drugs
01:23dsrxstart writing clojure instead of java
01:25srrubyexcercise.
01:25srrubyexercise
01:26dnolenseangrove: it does
01:27seangrovednolen: Been googling for quite a bit, searched the docs, and I can't seem to find it.
01:36muhuk(defprotocol Test) (extends? Test (reify Test)) => true
01:37muhukwhy does this throw ClassCastException?
01:37muhukdo I have to use a record or type?
02:10akaseangrove: having sex should relieve some pain
02:11akaunless the pain is on your...
02:11seangroveI feel I have been unfairly targeted.
02:16dsrxseangrove: now you've made me feel crazy, because I thought the same thing as you but also can't find it
02:21dsrx$ cd closure-library && git grep -i uuid | wc -l
02:21dsrx0
02:22dsrxahhh...
02:22dsrxseangrove: 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
02:23eggheadlife is too short for uuids
02:25dsrxfunction YoloID() { return Math.floor(Math.random() * 1024).toString(16); }
02:32eggheadseangrove: you could tweet about it
02:32LLKCKfanIs there any natural ways to relieve pain without using herbs or weed? No drugs
02:41benkay`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.
02:43benkay`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.
02:43benkay`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
03:11benkay`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
04:06piranhais it possible to start cljsbuild auto and some http server simultaneously?
04:32piranhahow do I get a function from namespace by its name?
05:40sm0ke,(keys (ns-public 'clojure.core))
05:40clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ns-public in this context, compiling:(NO_SOURCE_PATH:0:0)>
05:41sm0kei cant seem to find a take-while function in clojure, whats the alternative?
05:41sm0keoh
05:41sm0kethere is
05:45borkdudeI maybe want to start over with my emacs config to make it more lightweight than my emacs live config
05:45borkdudeany tips on a starter kit which is currently hip
05:50sm0ke 2 ; problem 3¬
05:50sm0ke 1 (defn prime-factors [n]¬
05:50sm0keoh my gawd
05:50sm0kesorry
05:51jack_rabbitindeed.
05:51sm0kefrkn touchpads
05:53jack_rabbitthe horror
05:56borkdudebtw, how I can detach a tmux in which I entered: emacs foo.txt
05:57borkdudeshell-command tmux-detach?
07:32sm0ke,(def a (delay (do (prn:ok) 1)))
07:32clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: prn:ok in this context, compiling:(NO_SOURCE_PATH:0:0)>
07:32sm0ke,(def a (delay (do (prn :ok) 1)))
07:32clojurebot#'sandbox/a
07:32sm0ke,(force a)
07:32clojurebot:ok\n1
07:32sm0keweird
07:33sm0kei had an old repl open and was getting npe, restarting repl seems to have fixed it
07:37sm0kea tree fell in the forest did someone hear the sound
08:29zaisteinvasmani: thanks! it's fixed now
08:29logic_progdoes (binding [ ...] ) work in cljs? it appears I'm just getting nil back
09:50nlminhtlHi guys, did anybody solve a problem with Leiningen for IDEA 13? https://gist.github.com/Ignotus/08412bf852e2a945a5d3
09:50ForNeVeRI also have the same problem.
09:50nlminhtlForNeVeR: >__<
09:50nlminhtlForNeVeR: you!
09:50ForNeVeRIt seems that LocatableConfigurationType interface was deprecated and now is gone.
09:50ForNeVeRnlminhtl: no you.
09:52ForNeVeRDocumentation suggests to implement RuntimeConfigurationProducer instead. Should we patch the plugin? Who is responsible for that?
09:53ForNeVeRAnd it seems that this issue is already fixed in master: https://github.com/derkork/intellij-leiningen-plugin/commit/b41a23a70463a21302ede546b3aea753ca293e8a
09:53ForNeVeRSo... WTF?
10:15bartxxhi, is there a way to save state of core.async's go state machine?
10:16bartxxto save to file
10:35ForNeVeRWell, 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:36ForNeVeRHopefully the cursiveclojure project will release something soon, so we will not need to maintain it.
10:47benmossanyone familiar with how cljs' load-file works, and if there's a way to determine if a ns exists?
10:52AimHere,(all-ns)
10:52clojurebot(#<Namespace clojure.uuid> #<Namespace user> #<Namespace clojure.core> #<Namespace sandbox> #<Namespace clojure.repl> ...)
10:53AimHere,(find-ns 'clojure.core)
10:53clojurebot#<Namespace clojure.core>
10:53AimHere,(find-ns 'clojure.wibble)
10:53clojurebotnil
10:55benmosscool, thanks ill try that out
10:57benmossno bueno in clojurescript
10:57AimHereOh well, sorry about that
11:00rovarwhat is the easiest way to convert a vector of integers into a bytearray?
11:01rovarI was thinking about DataOutputStream
11:01rovardidn't know if that has been clojurified somewhere
11:03joegallo,(into-array Byte/TYPE (map byte (range 4)))
11:03clojurebot#<byte[] [B@48bd67>
11:03joegallobehold, a byte array
11:06rovarjoegallo: thanks, I'm trying to do it to a vector of 8 byte integers
11:16hyPiRionor just ##(byte-array (map byte (range 4)))
11:16lazybot⇒ #<byte[] [B@ebb182>
11:19rovarhyPiRion: that works if the values are between -127 and 128
11:19rovarwhat if it's 3 billion?
11:20pyrtsa##(byte-array (map unchecked-byte (map (partial + 3000000000 (range 4))))
11:20pyrtsaOops.
11:20pyrtsa##(byte-array (map unchecked-byte (map (partial + 3000000000) (range 4))))
11:21lazybot⇒ #<byte[] [B@f6e1f0>
11:22rovarpyrtsa: what value do you think that's going to store?
11:22pyrtsaIncidentally, [0 1 2 3].
11:23hyPiRionwait, what do you mean by "store" in the first place?
11:23pyrtsaunchecked-byte uses the last 8 bits of the integer.
11:23pyrtsa(I.e. it is correct modulo 256.)
11:24pyrtsa(unchecked-byte 129)
11:24pyrtsa,(unchecked-byte 129)
11:24clojurebot-127
11:25joegalloare you looking for two arbitrary ints to become a single vector of bytes?
11:25joegalloif so, you might want to say that...
11:25joegallovector of EIGHT bytes
11:25joegallomissed a key word there...
11:26joegallobecause 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:26joegalloso you shouldn't be surprised when that's the answer you get.
11:27rovarmore 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:27pyrtsarovar: Okay then. What about endianness?
11:27joegalloi'm curious where you're getting these 64 bit ints from? java ints are 32 bit.
11:27joegalloare these longs? are you using BigInteger?
11:27rovarpyrtsa: don't care, this is for serialization to and from the same machine only
11:28pyrtsajoegallo: Generally, integers in Clojure are Long.
11:28rovarjoegallo: longs
11:28joegallopyrtsa: when somebody starts talking about the number of bytes in some type, i assume they're talking jvm primitives.
11:29pyrtsaFair enough.
11:29neoartifexk thanks
11:30joegallohttp://docs.guava-libraries.googlecode.com/git-history/release/javadoc/com/google/common/primitives/Longs.html#toByteArray%28long%29
11:30joegalloif you're willing to live with a new library dependency
11:30joegallomap that over your longs and turn them each into 8 bytes. concat the arrays.
11:31joegalloalternatively, the docstring for that method tells you what you can do using java.nio.ByteBuffer to do the same thing.
11:31hyPiRionIt's okay to just bytebuffer here
11:31joegalloright...
11:32rovaryea.. I've found bytebuffer in clojars which simplifies this a bit.
11:32rovari've never really coded in java before.. coming to clojure from c++/haskell so I'm still exploring the java stdlib
11:32pyrtsa,(defn long->le [x] (mapv #(unchecked-byte (bit-shift-right x (* 8 %))) (range 8)))
11:32clojurebot#'sandbox/long->le
11:33pyrtsa,(long->le 257)
11:33clojurebot[1 1 0 0 0 ...]
11:33pyrtsa,(long->le 510)
11:33clojurebot[-2 1 0 0 0 ...]
11:33hyPiRionO_o
11:33pyrtsaetc.
11:33pyrtsahyPiRion: Bytes.
11:33pyrtsa"le" for little-endian.
11:35hyPiRion,(import 'java.nio.ByteBuffer)
11:35clojurebotjava.nio.ByteBuffer
11:35hyPiRion,(let [xs (range 100) bb (ByteBuffer/allocate (* 8 (count xs)))] (doseq [x xs] (.putLong bb x)) (.array bb))
11:35clojurebot#<byte[] [B@b4bc1e>
11:35pyrtsaOkay. That's better.
11:39rovarhyPiRion: that's pretty much what I ended up with, except i put a (.toLong x) to ensure length
11:43rovarreversing that is interesting
11:46rovaris there a thrush operator that applies methods to resulting objects?
11:46rovare.g. ByteBuffer.wrap(barray).asLongBuffer.array()
11:47rovarahh ..
11:47hyPiRionthat's just ->
11:50rovarI think either (-> (ByteBuffer/wrap buff) (.asLongBuffer) (.array)) is the same as (.. (ByteBuffer/wrap buff) (asLongBuffer) (array))
11:50pyrtsa.. is different.
11:50pyrtsaIt won't use the result of the previous call in the next.
11:51pyrtsa(.. x a b c) does (do (.a x) (.b x) (.c x) x) whereas (-> x (.a) (.b) (.c)) returns (.c (.b (.a x)))
11:52hyPiRioner
11:52hyPiRion,(macroexpand '(.. (ByteBuffer/wrap buff) (asLongBuffer) (array)))
11:52clojurebot(. (. (ByteBuffer/wrap buff) (asLongBuffer)) (array))
11:52pyrtsaOuch. Okay, I should shut my mouth tonight. Sorry.
11:53pyrtsadoto was that.
11:53hyPiRionpyrtsa: yeah, I figured you mixed them up
11:54pyrtsaI think -> is more readable and tend to avoid .. altogether. So that's why the confusion.
12:12dabdI 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:04cddrDoes 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:10sdegutisWhat happened to Feb 3? http://logs.lazybot.org/irc.freenode.net/%23clojure
13:12silasdaviscddr, it expects a {:username ... :password ...} map
13:13llasramsdegutis: Wasn't that the day of the DoS attack on freenode?
13:13sdegutisOh.
13:13sm0kesdegutis: looks like an inside job to hide sensitive data
13:13sdegutisOh.
13:14sm0keyou never know when million dollars are at stake
13:14sm0keclojure is now a big name
13:15sdegutisRight.
13:15mdeboardIs 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:15mdeboardstart-server*
13:16llasramArgh, 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:17sm0kellasram: save it for next relases
13:17llasrammdeboard: Leinigen project.clj /:repl-options/:init form
13:17sm0keyou knwo what they say
13:17llasrammdeboard: Check `lein sample` for an example
13:17sm0kealways leave your code in a broken state
13:17mdeboardllasram: Thanks
13:18llasramsm0ke: Early-and-often is good, but I don't have the social energy to make a major thing out of it every time
13:19llasramWhich I'm planning to do for this release, so want it to be as awesome as possiblel
13:21sm0kellasram: have you been using parkour in production?
13:21llasramSince day 1
13:21mdeboardllasram: That is a pro tip on the repl-options, thanks
13:21llasramOnly thing still in Cascalog at Damballa is one ETL job which I haven't touched in a year
13:21llasrammdeboard: np!
13:22sm0kellasram: why moving away from cascalog?
13:22llasramsm0ke: I'm pretty sure I already linked you to my Parkour "motivation" write-up :-)
13:23llasramIn a nutshell though -- I want to write MapReduce programs in Clojure, not Datalog queries in some funky macro DSL
13:23mdeboardllasram: But I spent so much time wrapping my head around cascalog :(
13:23llasramI think MapReduce is a great fit for Clojure. You just need an API which exposes their compatibilities
13:24mdeboardBut seriously, that's great and honesly much needed
13:24sm0kemakes sense
13:24mdeboardPython has a great mapreduce module called mrjob. You just write python and do some configuration behind the scenes and it works fine
13:24sm0kellasram: is parkour closely knit on hadoop api?
13:25mdeboardyou 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:25llasrammdeboard: 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:26llasramsm0ke: 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:26sm0kellasram: can parkour run on other platform too in other words
13:26llasramOh, no
13:26llasramIt is for Hadoop and nothing but Hadoop
13:27llasramSwapable backends is an explicit non-goal
13:27sm0keoh why may i ask?
13:27llasramBecause it seems like over-engineering to me :-)
13:28sm0kewell spark seems pretty good for in memory analytics
13:28sm0kewhich is a far fetched idea for *BIG DATA* though
13:28llasramOh, yeah, spark. I still need to explore that. I've had my time cut pretty thin lately
13:28llasramSpark is potentially interesting
13:29llasramI thought you meant like the Cascalog 2.0 idea of being able to support both bulk and stream processing, via e.g. Storm
13:29sm0kellasram: it has same functional constructs map, reduce, partition , union etc
13:29sm0kellasram: oh yea that
13:29sm0keno
13:29llasramSupporting something that is still actually MapReduce might be a future plan, but not ATM
13:30sm0kewhat
13:30llasram?
13:30sm0kecascalog 2.0 will run on storm?
13:31llasramThat's the promise of the design, but I don't believe the Storm backend has been released yet
13:31sm0kei didnt read that right first time
13:31llasramhaha
13:34sm0kei kind of like cascalog, but sometimes i cant seem to get things right which looks obvious
13:34sm0kebut i feel the real power is with the joins
13:35llasramCascalog's join are great if you need joins, but joins are also hideously, hideously inefficient
13:35sm0keworst part is figuring out which job out of the dozen running is doing exactly what
13:35llasramAlso true :-)
13:36sm0kellasram: you know what, cascalog potentially can run on top of parkour
13:37sm0kecrazy idea
13:37sm0keif it can run on top of spark i dont see any reason why is cant on top of parkour
13:37llasramThat 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:38sm0kellasram: well you could potentially be free of the cascading dependency
13:38sm0kethats a huge win
13:38llasramThe biggest problem is the tuple abstraction. You'd need to either steal Cascadings or do it from scratch
13:39llasramAnd I get the impression of lot of people are actually pretty happy with what the Cascading layer gives them :-)
13:39llasramThey get to participate in a broader Cascading ecosystem of taps etc
13:40llasramDoes Cascalog support Spark now? I must have missed the announcement
13:40sm0kenot yet, but i read that in the group somewhere
13:41llasramI see
13:41sm0kesam seems to have partitioned the api into logic and platform
13:41llasramYah
13:42sm0keidea being platform can be implemented per platform, you should look into it :)
13:42llasramRight :-)
13:44sm0kei see huge benefits, cascading is impenetrable, but via parkour jobs can be annotated with meta coming from cascalog queries
13:44sm0kei am assuming you can do that with parkour
13:44sm0ke:)
13:45sm0keso you could finally put a finger on whicj job is doing query x
13:46sm0keanyways, parkour is interesting, i need to take a in-depth look at it yet
13:46sm0kethanks for the project!
13:46llasramnp! Let me know if you have any comments after you have had a chance to take a deeper look
13:47GadolGrandGadolsecrets 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:48sm0kesure thing, the live cluster repl you mentioned is nice
14:12sdegutisI 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:18gfrederickssdegutis: 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:18gfrederickss/then/them/
14:19sdegutisgfredericks: 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:21gfrederickssdegutis the deadbeat functional programmer
14:21llasramsdegutis: You do HackerNews, right? What's the norms there on submitting your own blog posts?
14:21sdegutisllasram: Dunno, I just joined a few days ago. And so far I've broken most of the unwritten rules somehow.
14:22sdegutisllasram: I'd say just do it and let the chips fall where they may.
14:22llasramOh, weird. For some reason I thought I remember seeing you being a frequent user for a long while
14:22sdegutisllasram: Maybe, if "a long while" means like 2 or 3 weeks.
14:23llasramYes. Flea years :-D
14:23gfredericksclojurebot: a flea year is the distance that a flea travels in one year
14:23clojurebotIn Ordnung
14:23llasramnice
14:24gfredericks(in a vacuum of course)
14:24sdegutisllasram: 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:24hakujinis the "joy of" book still the best source for teaching clojure idioms even though it's quite outdated?
14:25llasramhakujin: I don't know about idioms, but philosophy, yes
14:25llasramAnd haven't they released / are releasing a new edition?
14:25hakujinend of the month according to Amazon
14:26llasramWell there you go
14:26sdegutisllasram: Although I'm no marketer, that's just my simplistic analysis of how to get to the front page.
14:38rovarhakujin: you can get the 2nd edition advance copy from manning press
14:40sdegutishakujin: I recommend reading through popular Clojure projects (like weavejester's) to find good idioms.
14:41sdegutishakujin: 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:47dnolenreversible Clojure is pretty fun - http://github.com/clojure/core.logic/commit/dcc94f57a93c3c4d6085121844480dd9799f8cd5
14:50bbloomhehe nice
14:51bbloomdnolen: have you seen www.cs.indiana.edu/~sabry/papers/rational.pdf‎ and the "reversible language" described in that paper's predicesor?
14:51bbloomer predecessor
14:52bbloomdnolen: this one http://dl.acm.org/citation.cfm?id=2103667&amp;dl=ACM&amp;coll=DL&amp;CFID=385002691&amp;CFTOKEN=24885898
14:53dnolenbbloom: I've only skimmed the literature in the past.
14:53sdegutisdnolen: I can't wrap my head around that. It looks so greek to me.
14:53bbloomdnolen: the "information effects" paper is pretty cool and makes the fractional types paper make sense
14:55patrkriswhat 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:55patrkrisbut aren't there some function built into clojure that does this?
14:55dnolenbbloom: 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:56dnolensdegutis: it's just conj that can run forwards or backwards and can take partially instantiated Clojure terms
14:57sdegutisdnolen: Oh, neat.
14:57sdegutisSometimes this channel makes me feel pretty dumb, in a good way :)
14:58llasramOk, 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:01rovarvery cool
15:02rovardoes it have to run on a mapreduce node, or can it remotely connect/deploy?
15:03llasramYou 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:04llasramI 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:04llasramOh, I knew I forgot something -- example program in github
15:07sdegutisWow, millions.
15:08llasram?
15:08insamniac$$$?
15:10llasramAnd here's a fresh Hacker News thread, if you're into that sort of thing: https://news.ycombinator.com/item?id=7202425
15:14sdegutisI kinda wanna use node-webkit as my default browser...
15:15sdegutisllasram: I'd upvote it but I can't login again for 84 more minutes.
15:15llasramheh
15:15llasramLimiting your access to distractions?
15:15llasramOr like a BDSM thing?
15:16llasramYeah, ok, I'm in a punchy mood
15:16sdegutisllasram: I enabled that "noprocrast" setting this morning.
15:16rovarllasram: upgoated
15:17llasramsweet
15:17insamniacsdegutis: what was the Wow, millions for?
15:18sdegutisinsamniac: I was just looking at node-webkit's github stars.
15:19sdegutisinsamniac: It had a lot. That made me think of the pseudo-number "millions".
15:19sdegutisinsamniac: So I thought out loud in here.
15:19sdegutisinsamniac: I should probably curb that.
15:19sdegutisEspecially when it makes almost no sense and is completely irrelevant and off-topic.
15:20sdegutisIn other news, I got a basic hello world script working in ClojureCLR this weekend :D
15:20sdegutisI called it from my C# program, and it called my C# function, which actually did stuff. It was pretty awesome.
15:22insamniacMeh.. I need to get motivated and write some code.
15:22insamniacI finished the clojure koans at least.
15:22sdegutisinsamniac: You could write a Clojure compiler in Clojure.
15:22sdegutisThat's a good way to learn Clojure.
15:23sdegutisI hear that's how dnolen did it.
15:23insamniacYeah that sounds like something I could find motivation for.
15:23insamniacI was thinking something more along the lines of a shitty canvas game
15:24insamniacI'm hoping to find inspiration at devnexus.
15:25insamniacI need a coding room that has no internets.
15:27llasraminsamniac: Ah, the fair city of Atlanta
15:27sdegutisinsamniac: Try turning off your wifi.
15:27llasramKnown for its Southern hospitality and coding rooms
15:33seangroveSFDC API, you make me want to be a better person
15:37insamniacI'm in Augusta. Known for James Brown and The Masters.
15:38muhoosdegutis: actually i think tim baldridge did, via clojure-py
15:39muhoomust have been good practice for core.async, which AFAICT is a compiler in a compiler
15:40muhoothat go macro is pretty wild
16:17bartxxDoes anybody knows if it is possible to save state from core.async state machine? "save" meaning extract and for example write to file.
16:19bartxxI 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:20clojure-kiddoes anybody in here have experience with laser?
16:20clojure-kidI'm trying to use it to pull text out of web pages
16:20clojure-kidbut so far I've only found how to transform it into valid html
16:21clojure-kidI just want plain text
16:21clojure-kidis that even something it's meant to do?
16:24s_kilkIs 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:29rovars_kilk: there is Quartzite, which is close, it has the scheduling component, but not really the queing component
16:30s_kilkrovar : 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:30lazybots_kilk: Definitely not.
16:31amalloyclojure-kid: i don't think laser is intended to do anything other than produce html
16:31s_kilkDefinitely not a bad idea? :)
16:31amalloyyou can check with Raynes, of course
16:32rovars_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:32clojure-kidamalloy: is there something actually meant to do that, then?
16:32rovarso it would be a good exercise, IMO, but you might find that there is far less to do :)
16:32clojure-kidand yes, I'll send Raynes a message
16:33s_kilkrovar : aye, I see. But would there be any use in a more fully featured library that would abstract over rabbitmq like celery does?
16:33arrdemRaynes: oi
16:33hyPiRionRaynes: ping pong
16:33clojure-kidRaynes: your presence is requested
16:33rovars_kilk: other than me hoping RabbitMQ dies in a fire, no :)
16:33hyPiRion$seen Raynes
16:33lazybotRaynes was last seen talking on ##eleventhbit 2 hours and 33 minutes ago.
16:33clojure-kid:(
16:34s_kilkrovar : 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:35s_kilkwell, lets also say we could use redis or whatever as a queue broker, doesn't need to be RMQ
16:35arrdembesides #emacs and #clojure, anyone have favorite interesting channels to lurk?
16:35rovars_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:35s_kilkarrdem : i like to lurk on #ruby toon
16:36s_kilkrovar : any particular problems you've found with RabbitMQ ? or is it a general dislike for the concept? :)
16:43pdurbinarrdem: #rest and #indiewebcamp are favorites of mine
16:45clojure-kidhmm, crawlista looks more suited to my web-scraping needs
16:46clojure-kidthere's even a function called extract-text, which I think just pulls the content out of the page
16:51sverihi, 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:54mmitchelldoes anyone feel like helping me with a macro today? :)
16:55plooknmmitchell: what is it?
16:55hyPiRionAnyone knows how to use (or even better, create) records from Java?
16:55rhg135mmitchell, depends, go-ish or when-ish ;)
16:56mmitchellit's a macro i've been trying to write all day to run through forms and assert that they're true
16:57mmitchellHere's a skeleton of what I'm trying to do: https://gist.github.com/mwmitchell/8890906
16:58mmitchellSo I think loop is the right way to run through the test forms
16:59crundarFirst time clojuring. How do get and install libraries. I followed the instructions on the download page, java -cp clojure-<version>.jar clojure.main
16:59mmitchellAnd 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:59crundarit seems like there must be a better way to start up clojure generally. That can't be how you all get things going.
16:59mmitchellcrundar: definitely, Leiningen
17:00mmitchellcrundar: http://leiningen.org/
17:00rhg135even maven
17:00rhg135but dat xml
17:00clojure-kidcrundar: Leiningen is the way to go
17:01rhg135agreed
17:01mmitchellrhg135: did you see my macro gist?
17:01rhg135yes
17:01rhg135unfortunately im horrible at macros
17:01mmitchellno problem, me too :)
17:02mmitchelli can get pretty far, but there's something I'm clearly not understanding and am not able to do exactly what I want
17:03rhg135recursion seems appropriate here
17:04mmitchellrhg135: yeah i was using loop/recur to step thru each test form
17:04rhg135like `(do (blah...) (assert-all ~val ~(rest tests)))
17:16riz_hi
17:16riz_can anyone please point me to a good tutorial on macros?
17:16riz_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:18afhammadriz_: try this video: http://www.youtube.com/watch?v=dKoNnMEjcEI
17:23afhammadalso i recommend picking up a book such as Joy of Clojure, it covers macros well
17:25riz_thank you will check it out
17:25mmitchellwow, i think i actually got it: https://gist.github.com/mwmitchell/8890906
17:39loganlinnAre these ampersands reader macros? https://github.com/clojure/clojurescript/blob/d9b2b4c5b3693621e57615f6c9e147ac71f5b47a/src/clj/cljs/core.clj#L599-L600
17:40loganlinnI assume its something to do with inspecting a namespace
17:52muhoologanlinn: @ is deref. ~@ is splice
17:57hyPiRionunquote-splice, actually
17:59hyPiRionloganlinn: &env is the environment the macro was called from. So yes, it's for looking up values.
18:02ivanshould the builtin macros be in pygments' ClojureLexer.builtins? (they aren't right now)
18:05hyPiRionivan: like `or` and `and`?
18:05ivanthose two are in there
18:05hyPiRionoh, so they've only picked a snippets of them then
18:05ivanbut e.g. lazy-seq isn't
18:06ivan`try` is also mysteriously missing from the special forms, I'll have to check those too
18:06ivanI first started looking into this when I noticed (require ) was being highlighted differently from (import )
18:07hyPiRionwell, 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:36eraserhdIs there a way to boot a clojure project that doesn't take focus away from the terminal?
19:36eraserhdin OS X.
19:40tolstoyeraserhd: Try adding this to project.clj: :jvm-opts ["-Dapple.awt.UIElement=true"]
19:40tolstoy
19:41eraserhdtolstoy: Hrmm. That seems like the opposite of what I want. But lemme try.
19:42eraserhdtolstoy: That gives me an IllegalArgumentException when I try...
19:43bbloomtolstoy: oh that is awesome. just put that in my lein profile
19:43bbloomeraserhd: worked for me
19:43tolstoyeraserhd: When I don't have that, I get an icon on my dock and lose focus.
19:43tolstoyeraserhd: With that on, It Works. ;)
19:44bbloomtolstoy: so nice.
19:44eraserhdI just installed Oracle's Java 7, which replaced Apple's (for another project). I'm guessing this JVM doesn't have that.
19:45eraserhdBut the documentation talks about java.awt.headless
19:46tolstoybbloom: Not sure where I found that gem, but it's great. ;)
19:47tolstoyeraserhd: I'm using it with Oracle JDK 8 (and 7 (and 6)).
19:49eraserhdSo 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:50tolstoyeraserhd: Good to know. The UIElement=true thing does indeed seem the opposite of what we want.
20:46eraserhdFor clojure CLI programs, do we have a standard wrapper script or a favorite lein plugin that makes and installs them?
20:46arrdemclojure really isn't a cli tools language.... slow starting JVM T_T
20:47arrdemwhich really means no, there isn't good infrastructure/libraries there.
20:48eraserhdI'm hoping LLVM backends help there. Part of my current excitement about Clojure :)
20:48eraserhdBut, OK... write my own wrapper script.
20:48seancorfieldor use ClojureScript and target Node.js (to avoid the JVM startup)
20:49arrdemunless Bronsa has some seriously strong foo that I know not of, such things are a loooong way off.
20:49arrdemyeah cljs on Node or V8 was something Rich held forth as a serious faststart option.
20:49tolstoyeraserhd: I've used lein-exec when start-up time didn't really matter.
20:50tolstoyeraserhd: https://github.com/kumarshantanu/lein-exec
20:51eraserhdI'm willing to live with startup time for now.
20:52eraserhdBecause cljs is 100 times better than JavaScript, but the damn types, arghh.
20:53scottjeraserhd: check drip for improved startup times (there are several other solutions, perhaps mostly abandoned)
20:54scottjjark being one
20:55eraserhdI 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:56eraserhd`lein exec` seems to require staying in the source dir, which isn't useful for the system utility that I'm writing.
20:59eraserhdscottj: Drip is neat.
21:10gfrederickseraserhd: "the damn types"?
21:28technomancyor racket
21:29technomancyeraserhd: lein 1.x had a shell wrappers feature, but no one used it, so it was dropped for 2.x
21:38eraserhdgfredericks: I don't remember specifically, but I recall having a lot of differences from clojure relating to Javascript not differentiating types.
21:38eraserhde.g. (cond (string? x) ... (number? x) ...)
21:39eraserhdGranted, I used this to my advantage, too. :)
22:01fowlslegsIs there anyway to kill a runaway REPL process besides ending the REPL?
22:09gfrederickseraserhd: oh okay so differences from jvm-clojure in particular
22:59quizdrI 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:59arrdem,#'clojure.core/any?
22:59clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: clojure.core/any? in this context, compiling:(NO_SOURCE_PATH:0:0)>
22:59arrdem,#'clojure.core/any
23:00clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: clojure.core/any in this context, compiling:(NO_SOURCE_PATH:0:0)>
23:00shriphaniarrdem, afaik there's no any in clojure-world
23:00arrdemquizdr: one thing you could do is (reduce #(or %0 %1) my-col false)
23:00arrdemshriphani: yeah I always get that wrong.
23:01arrdem,(reduce #(or %1 %2) [false false false nil] nil)
23:01clojurebot[false false false nil]
23:01arrdemoh. order.
23:01arrdem,(reduce #(or %1 %2) nil [false false false nil])
23:01clojurebotnil
23:02arrdem,(true? (reduce #(or %1 %2) nil [false false false nil]))
23:02clojurebotfalse
23:03shriphaniis there a utility for clojure that checks if I have imports I am not using etc
23:03shriphanilike pylint
23:03loganlinn,(apply or [false false false nil])
23:03clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/or, compiling:(NO_SOURCE_PATH:0:0)>
23:03arrdemloganlinn: hence the reduce :c
23:03quizdri shall try that
23:05arrdem(true? (any ..)) will work too...
23:05quizdri guess the easiest way is to just call true? on it
23:05loganlinnyeah, makes sense
23:05quizdrah, i see we think alike someimtes arrdem
23:07shriphaniquizdr, was this to avoid some NullpointerException ?
23:08quizdrno, it was to test for true or false on a wider problem, and i wanted a definite true or false returned shriphani
23:08technomancyshriphani: slamhound does that
23:09arrdemtechnomancy: does slamhound still work.. or is it still slime bound?
23:19technomancyarrdem: slamhound is so non-slime-bound that it even works with nrepl-discover
23:19technomancyyou know, the new hotness that's so new it's not even finished or usable
23:19arrdemso new and so hot I hadn't heard about it yet :D
23:20arrdem(dec so) ;; this guy....
23:20lazybot⇒ -4
23:20technomancyarrdem: guns has been doing a great job keeping momentum going on slamhound in all seriousness
23:20arrdemtechnomancy: 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:21arrdemnow we just need that standard code formatter.....
23:21technomancyit bums me out that everyone is writing stuff that's coupled to a single editor
23:21technomancywish I had time to get nrepl-discover more polished, but that seems unlikely now that my conference proposal was turned down
23:21arrdem:c
23:30scottjwell, the predecessor to clj-refactor.el, clojure-refactoring was primarily clojure with a very small .el interface
23:30gunsthanks technomancy; I do have a little problem related to slamhound that I discovered the other day: https://i.imgur.com/KSPKuJD.png
23:30arrdemclearly what we really need is an Emacs rewrite in Clojure compiled to ASM via clojure.tools.emitter.x86_64...
23:30gunsthat's a picture of the Clojure process dying from running out of permgen
23:31gunsit happened while running slamhound in a continuous loop; apparently remove-ns does not actually trigger gc of the compiled classes
23:32gunsthe solution to this appears to be loading clojure classes with a custom classloader
23:32gunsbut it's not clear how easy that will be
23:32technomancyguns: huh, sounds like a possible bug in clojure
23:32gunsyes, basically (eval …) always increases permgen
23:33technomancyyou can construct a classloader that delegates to the current one
23:33gunsthat's what I'm hoping will succeed
23:33gunsusing the classunloading flag alleviates this, but I've managed to crash the profiler even with that flag
23:34guns:(
23:39guns(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:40arrdemlazybot stands impartial witness