#clojure log - Jan 28 2014

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

0:00 tutysara: deadghost: right, we have lot of things packed together, but looks interesting

0:01 egghead: i've been enjoying liberator for web stuff in clj

0:01 deadghost: egghead, it's refreshing how these libs fit together

0:02 as opposed to monolithic djagno/rails

0:02 tutysara: deadghost: *we -> they

0:02 deadghost: and not reinventing the wheel every five minutes like nodejs

0:03 * Raynes patents a device which rolls along the ground facilitating easy movement of large objects.

0:04 tutysara: egghead: are you the same person who is famous for Angularjs videos

0:04 egghead: nope

0:04 deadghost: https://egghead.io/

0:04 hah

0:05 tutysara: egghead: sorry :), are you use any tempting engine with liberator or doing a SP

0:05 *SPA

0:05 egghead: spa

0:06 om

0:08 tutysara: i am not much of a front end person, so I though I will start with server side rendering with some tempting engine and then slowly move towards exposing data through apis and building frontends

0:09 egghead: tutysara: I can recommend laser

0:09 tutysara: egghead: okie, let me take a look

0:09 egghead: it does a great job of separating the raw html for your template transformations

0:12 deadghost: Raynes, would you recommend your laser lib over enlive?

0:12 egghead: loooooool

0:12 Raynes: No.

0:14 It's hilariously slower than Enlive at the moment. Kinda feel like I need to get some time to investigate that before I tell people to use it.

0:14 deadghost: see that's why I love #clojure

0:14 lib authors are right here

0:14 and they'll tell your their code sucks and you shouldn't use it

0:14 Raynes: Well, I didn't say my code sucked.

0:14 :p

0:14 egghead: lol don't let Raynes dissuade you, use laser!

0:15 Raynes: Just some changed introduced a few versions ago made it significantly slower than it was originally.

0:15 And I haven't had time to look into/fix it.

0:15 changes*

0:20 tutysara: I will wait for the release of deadghost 's enlive framework then ;)

0:26 deadghost: Raynes, I'm reading my blog

0:26 *your

0:26 my sister is thinking about homeschooling

0:26 I haven't met any homeschooled people as far as I'm aware

0:27 tbaldridge: deadghost: boo!

0:27 deadghost: I just hear stories of fundies indoctrinating their kids

0:28 tbaldridge, you come from homeschool land?

0:28 tbaldridge: Indeed

0:28 deadghost: did you come out weird

0:28 tbaldridge: very much so :-P

0:29 deadghost: I get the impression homeschooled kids come out weird

0:30 technomancy: we had a homeschooled 15-year-old give a presentation at seajure about the different optimizations he had implemented for a puzzle solver and the performance characteristics/trade-offs of each approach

0:30 it was the most in-depth technical presentation anyone's given at the group; pretty amazing

0:30 tbaldridge: to be honest, that's where I saw the biggest benefit. I held a 8 hour/day job by the time I was 17, doing school at night and in the mornings. And still had time to learn programming.

0:31 technomancy: not really what you'd call typical I guess

0:31 tbaldridge: It's kindof amazing how much time you have when you don't have to sit on a bus or wait for people to understand what the teacher is saying.

0:32 deadghost: tbaldridge, how did your parents handle schooling

0:32 technomancy: there are lots of people in the seattle area that homeschool because they are concerned about their kids getting a good education rather than for religious reasons

0:36 deadghost: hah, now I wonder how many skilled clojurians started programming as 12 and are younger than me

0:36 *at

0:36 no one knows you're 12 online

0:36 technomancy: sitting in a classroom is actually a pretty great way to kill anyone's interest in learning

0:37 deadghost: tis true

0:37 tutysara: Raynes: do we have an example of using lib-noir access-rules used with form login

0:37 deadghost: I'm not sure how homeschooling works

0:37 do they bring in teachers or something

0:37 technomancy: you don't get a lot of kids interested in math coming out of US schools, but honestly IMO it's shocking that there are any at all given the methods

0:37 tutysara: technomancy: :) :)

0:37 tbaldridge: deadghost: nah, for the most part anyone who has learned something can teach it.

0:38 deadghost: so tbaldridge did your parents do most of the teaching or have random people show up?

0:38 tbaldridge: when it came to stuff like math my parents said "here's a book, and the answer key, study it, ask if you have questions, we'll give you a test in 2 weeks"

0:38 deadghost: hahahaha

0:38 tutysara: technomancy: soo true for many classes during my college

0:38 technomancy: deadghost: there are no classes for infants to learn how to walk or babies to learn speech--children are naturally curious and learners. this only stops when they get put in classrooms.

0:38 deadghost: life skills that translate to programming 100%

0:40 technomancy: the most effective way to have kids learn is for them to be interested in something. encouraging that doesn't require a lot of training in a parent or a degree, just mindfulness.

0:40 deadghost: man technomancy I think I was so much more focused in middleschool and below

0:40 get told to read a science book and read and remember every detail

0:42 so technomancy would you homeschool

0:42 sounds like you're going to or considering it

0:49 technomancy: deadghost: yeah, already doing it some

0:49 http://technomancy.us/167

0:54 Raynes: deadghost: I champion homeschooling mostly because of how much free time it can give you.

0:54 quizdr: isn't there a repl command that searches through the docs of all functions for the string you've entered?

0:54 Raynes: find-doc

0:55 quizdr: that's the one thanks

0:56 Raynes: deadghost: The only reason a homeschooled child would come out 'weird' is if he or she were socially inept due to lack of interaction with other children.

0:56 I picked up rollerblading. *shrug*

0:57 deadghost: so

0:57 are you still into rollerblading?

0:58 Raynes: Nope.

0:58 deadghost: what happened to your childhood dream of becoming a rollerblade champion?

1:00 Raynes: My childhood dream was to be a rockstar.

1:00 deadghost: RIP dreams

1:00 Raynes: Actually, a country artist followed by a rockstar.

1:00 Yes, there was a point in my life where I liked country music.

1:01 It's hard not to when it's literally all you hear growing up.

1:01 literally all the music you hear*

1:01 deadghost: makes me think of the times I sold stuff at fleamarkets

1:01 mexican music all day

1:01 and every song sounds the same

1:02 quizdr: Raynes i grew up in Oklahoma so I know what you are talking about. what part of the country are you referring to?

1:02 Raynes: Alabama

1:02 quizdr: ah my sis lives there

1:04 tutysara: yogthos: Is there an example project of using lib-noir access rules

1:23 sobel: My childhood dream was to not hate programming when I began to be a tool of trade

1:23 done

2:14 TEttinger: so... I'm fiddling with trying to re-implement the APL standard lib in clojure with normal english names, operating on nested seqs rather than arrays. But I'm hitting a snag where I'm not sure whether it makes sense to even support non-rectangular nesting (like [1 2 [1 2 3]]).

2:16 Mostly, I just want a bit better lib support for nested data, like an element-wise map that descends recursively.

2:29 machrider: noob here... trying to split my code across two files, the newly created file is producing: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol, compiling:(myproj/ui.clj:1:1)

2:30 it's a pretty straightforward (ns myproj.ui) declaration that it seems to be choking on

2:31 not sure where to start trying to understand this error

2:32 joshuafcole_: machrider: Can you pastebin the new file in its entirety?

2:33 quizdr: machrider you may be calling a sequence function on something that is not a sequence

2:34 machrider: joshuafcole_: http://pastie.org/private/ln0jztpcxjckeowmgaokqhttp://pastie.org/private/ln0jztpcxjckeowmgaokq

2:34 i've been commenting things out trying to narrow it down

2:34 sorry, link: http://pastie.org/private/ln0jztpcxjckeowmgaokq

2:35 (attempting to learn clojure by writing a tetris clone)

2:35 quizdr: ,(seq 5

2:35 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

2:35 quizdr: ,(seq 5)

2:35 clojurebot: #<ExceptionInfo clojure.lang.ExceptionInfo: Don't know how to create ISeq from: java.lang.Long {:instance 5}>

2:35 quizdr: you see your error is similar

2:35 joshuafcole_: And can you also put up the stack trace?

2:36 machrider: quizdr: do you see the error in my code?

2:36 quizdr: most of the code in that paste is commented-out?

2:37 machrider: trace: http://pastie.org/private/b4waclf2xzewfkadkcdr8g

2:37 joshuafcole_: I can see a couple problems

2:38 machrider: the core file pulls in UI with: (:use [tetris.ui])

2:39 noonian: i think the :name key of gen-class is supposed to be a string and thats where the error is coming from

2:39 joshuafcole_: actually scratch that, the parens looks unbalanced but the font on pastie was just a bit hard to read

2:40 noonian: hmm, maybe not

2:40 joshuafcole_: interestingly, it's working just fine in LT

2:40 noonian: then i got to the second example on clojure docs :P

2:40 joshuafcole_: when I run your code

2:40 machrider: maybe it's a problem in my core.clj?

2:40 joshuafcole_: Seems plausible enough

2:42 machrider: what's the proper way to refer to that MainScreen class from the core namespace?

2:42 whether :use or otherwise..

2:44 noonian: i think you're supposed to namespace it like tetris.ui.MainScreen, then import it like a normal java class

2:45 http://clojuredocs.org/clojure_core/clojure.core/gen-class

2:58 machrider: ok, it was the :implements line that broke it..

2:58 without it, compiles fine

3:02 because :implements expects a sequence...

3:02 fixed

3:10 TEttinger: any core.matrix users here? what type of tasks do you use it for, I wonder?

3:14 llasram: Matrix math mostly

3:14 :-D

3:16 Why do you ask?

3:26 xificurC: I was meaning to ask for a while now as I dont understand the low-level stuff, does one lose performance for AOT compiling clojure code into an uberjar? I read the jvm jit-compiles java code, does that mean it can only jit-compile java?

3:26 TEttinger: xificurC, it still JITs, it just reduces startup time

3:26 llasram: xificurC: The JVM JIT compiler compiles JVM bytecode, which is what you get when you AOT Clojure

3:26 clojurebot: 'Sea, mhuise.

3:26 llasram: Wow

3:27 clojurebot: The JVM JIT compiler compiles JVM bytecode, which?

3:27 clojurebot: Titim gan éirí ort.

3:27 llasram: whew

3:27 clojurebot: which?

3:27 clojurebot: I don't understand.

3:27 llasram: Ok, good. Although who knows what fact you just learned.

3:27 TEttinger: haha

3:27 xificurC: TEttinger, llasram, ok thanks

3:28 TEttinger: oh sorry llasram, asked and ran... I'm wondering if using the NDArray impl that comes with core.matrix would be suitable for general-purpose nested-sequence tasks.

3:29 llasram: TEttinger: Oh, I don't know. I've mostly been using the Mahout-backed implementation I've made, and need to find the time to polish and release

3:29 xificurC: there was another thing on my mind - what would be the benefits of clojure targeting llvm?

3:29 TEttinger: xificurC, easier calling of C for one

3:29 llasram: None of the existing implementations seem to have sparse matrix representations, alas

3:30 ddellacosta: xificurC: faster start up time I would imagine, in addition

3:30 TEttinger: llasram: ? there are some

3:30 noidi: &n

3:30 lazybot: java.lang.RuntimeException: Unable to resolve symbol: n in this context

3:30 llasram: TEttinger: Citation?

3:30 xificurC: and it would be os-agnostic, right?

3:30 not like the jvm isnt

3:30 but if I understand correctly llvm-compiled code would run faster than what runs on the jvm right now

3:31 TEttinger: https://github.com/mikera/core.matrix/blob/3e0028062f85789f64a8b5b7df821f54865f7e50/src/main/clojure/clojure/core/matrix/implementations.clj#L20

3:31 xificurC, unclear until someone does it. hotspot's a very good JIT

3:32 but it does startup slowly

3:32 llasram: TEttinger: Oh. Yeah, using a persistent map with reference instances for each key and value does not count :-)

3:32 xificurC: TEttinger: so hotspot's speed is comparable to, i dont know, compiled C?

3:32 TEttinger: haha fair enough

3:33 xificurC, when it's up to speed, it can be close. LLVM depends on how you manage to implement clojure on it. so does clojure on JVM

3:34 a big issue IMO with the JVM is needing to box... everything, almost, to make sense with generics

3:34 xificurC: TEttinger: interesting, i always thought java is very slow, guess its not true anymore

3:34 TEttinger: xificurC, it is slow to start up, less so with tiered compilation

3:35 what sucks is that oracle doesn't distribute a 32-bit windows server JVM (the fast one with more hotspot opts), only on 64-bit and/or non-windows

3:35 xificurC: well thanks for the clarification. it seems that jit is better in almost every way than aot compiling. now if I only understood how does jit work :)

3:35 TEttinger: not exactly.

3:36 JIT can do different opts, but they are all slower to start

3:36 take a look at luajit, it has an amazing JIT and has really very little type info in the language

3:37 java has to be AOT compiled to .class files (clojure has this as an option), then the .class files are JITed and the most-run paths get compiled to native code

3:38 xificurC: cant the startup be sped up or started ahead?

3:38 TEttinger: so in clojure, if you call "reduce" 2000 times, or other numbers on different hotspot implementations, hotspot kicks in and compiles it to machine code

3:39 absolutely. tiered compilation in Java 7's VM has good startup and hotspot performance

3:40 xificurC: I understand a tiny bit more again, thanks

3:41 TEttinger: still, a lot of it has to do with file reading, like how anything on the JVM needs rt.jar loaded (rt=run time), and that's a large file to be read from disk

3:41 solid state drives speed up startup for everything, that's included

3:41 xificurC: so you're saying everything has its use-case, llvm wont die because of increasingly better jits

3:41 TEttinger: oh llvm is doing great. rust is targeting it now I think

3:42 it's also home to clang, and clang is beloved by apple (it's the compiler in new XCode versions IIRC)

3:42 xificurC: ah, theres so much to learn nowadays

3:42 and every day theres a new language hype

3:42 TEttinger: if you want, I have some JVM performance links open somewhere

3:42 xificurC: this month i see julia everywhere

3:43 thats why i asked about llvm too i guess, its claiming to have close to C performance

3:43 while staying dynamic

3:44 TEttinger: sure why not, maybe I'll understand something :)

3:45 TEttinger: http://www.javacodegeeks.com/2011/07/jvm-options-client-vs-server.html this covers some

3:46 http://www.javaworld.com/article/2078623/core-java/jvm-performance-optimization--part-1--a-jvm-technology-primer.html?page=1 may be better

3:47 yeah the second one is a good intro, but it seems to get pretty in-depth

3:48 xificurC: i'll check the second one for sure, once I find time, now work is calling

3:48 TEttinger: LLVM has close to C performance when it's C that's being run on it, for sure.

3:48 ok, have a good one

3:49 xificurC: TEttinger: and julia is c?

3:49 TEttinger: I think Julia is another language?

3:51 yeah, Julia looks great for performance. seems to have a very different focus from clojure from how I see it so far

3:52 bacq: hi

3:52 TEttinger: hey bacq

3:57 djcoin: Hi there, i'm not a specialist of the java world but is it normal that when I launch something like "lein cljsbuild auto myproject", I get like 15 java processes each taking 10+Mo of memory doing most of the time... nothing ?

3:59 (+ ~20 java -client processes each taking 2.3 mo ? - not such a big deal maybe but like it is normal ? Why so many processes ?!)

4:00 TEttinger: djcoin, I wonder if it's not closing them

4:04 fredyr: julia is llvm based jit iirc

4:05 TEttinger: yeah

4:06 fredyr: one of the biggest issues w/ targeting llvm for clojure is to get a gc thats comparable w/ the jvm for concurrency stuff

4:07 i would think at least

4:08 xificurC: TEttinger: can you explain the different focus?

4:10 TEttinger: xificurC, clojure is (was originally?) aimed at compatibility with java libs, being a lisp, and having support for concurrency like no other language did at the time. concurrency has become less of a focus as people have found it's just a really productive environment to work with! julia seems laser-targeted at scientific computing, but I could be wrong

4:11 katox: djcoin: I run the latest version of cljs and cljsbbuild and I see nothing like 15+ java processes

4:12 logic_prog: https://github.com/clojure/core.typed <-- is there a guide somewhere here for me to learn core.typed ?

4:12 arcatan: logic_prog: maybe this one --> https://github.com/clojure/core.typed/wiki/User-Guide <--

4:13 logic_prog: (inc arcatan)

4:13 lazybot: ⇒ 1

4:13 katox: djcoin: actually a single java -client process (while having cljsbuild on auto)

4:13 logic_prog: wait, isn't atan = arctan, thus arcatan = tan ?

4:13 djcoin: katox: hm, what have i done then :< THanks katox

4:14 katox: djcoin: sounds like something is spawning and not closing processes, hard to say. are you uptodate with lein and cljsbuild and cljs?

4:16 djcoin: katox: Lein 2.3.2 ; BUt i'm worried that this may come from my OS or something, I got like 20+/usr/lib/chromium too despites having just a few tab

4:17 Same goes for LightTAble

4:17 katox: weird

4:17 I can't actually run light table since 0.6 update, so I can't check

4:28 elsen: Has anyone read the "Web dev with clojure" from the pragmatic bookshelf?

4:29 xificurC: TEttinger: thanks

4:29 TEttinger: no prob

4:55 deadghost: elsen, currently reading it

5:03 elsen: Nice, from what you already read, would you recommend it?

5:03 I'd like to get into clojure dev and web dev seem's like the best way to start

5:04 (I'd rather do data crunching with it, but nothing comes close to ipython notebook right now :(

5:05 deadghost: elsen, it's a pretty light read and is filling in a lot of gaps for me

5:05 in fact I'd say light read makes it a plus

5:05 226 pages

5:05 and covers everything to get writing

5:09 elsen: does it cover testing and databases orm?

5:09 that's the part I'm missing most in online tutorials :x

5:10 deadghost: well it covers databases

5:10 as for orm I know it mentions korma but I haven't seen it used yet

5:11 elsen, looking at table of contents it has tests

5:11 elsen: ok, I'll give it a try then, thanks for the info!

5:12 fredyr: theres a unit test section according to the toc as well

5:12 deadghost: elsen, it covers korma orm but it's only 3 pages

5:12 fredyr: but doesn't seem to be a lot of focus on tho

5:12 deadghost: at the end of the book

5:13 yeah just 4 pages on unit testing

5:13 elsen: yea that's.... light

5:13 deadghost: then again I sorta like the lightness

5:13 read it, try it

5:13 http://www.clojurebook.com/

5:13 ^that thing though

5:13 that thing is a dense monster

5:14 d11wtq: I'm writing code that talks to redis and would like to TDD it. In an OO language I'd stub the redis connection object. What's the best way to do this sort of thing in Clojure?

5:14 elsen: Yea, been there

5:14 deadghost: elsen, how did that go over

5:15 elsen: badly, I've read the kindle version, layout of examples, tables, etc was messed up

5:15 DerGuteMoritz: d11wtq: why TDD that, isn't there a spec for the protocol?

5:15 d11wtq: DerGuteMoritz: Well, I'm not talking raw to the protocol, I'm using Carmine.

5:16 elsen: deadghost: but that's a nice reference later

5:16 d11wtq: DerGuteMoritz: I didn't fancy re-inveting the wheel there.

5:16 DerGuteMoritz: d11wtq: ah, just noticed I misread that as you wanting to implement a redis client

5:16 alrighty then!

5:16 d11wtq: DerGuteMoritz: Nah, just using Redis as a storage backend

5:16 llasram: d11wtq: Stub the functions. Using clojure.test you can use `with-redefs`, or if using midje it has explicit support for that sort of thing

5:16 deadghost: "The perfect second Clojure book: Clojure Programming goes beyond the language basics and shows how to apply Clojure to a variety of practical tasks. "

5:16 the thing is I'm not sure what the first book is supposed to be

5:16 I picked up clojure from common lisp

5:17 elsen: deadghost: joy of clojure?

5:17 d11wtq: llasram: Thanks! I didn't know about with-redefs, that sounds useful!

5:17 deadghost: is it

5:17 ?

5:17 d11wtq: Not using midje. Tried it months ago. Found it hacky and too magic :)

5:17 llasram: d11wtq: I feel similarly, but is designed to fit more of a TDD workflow

5:18 fredyr: seems to me all the clojure books are good second books :)

5:19 d11wtq: llasram: I'm just nesting (testing "when foo is true" (testing "in this situation" (testing "this thing happens" ... ))) macros together, so I feel more like I'm in RSpec :P

5:19 It gets a bit deeply nested though, especially with the surrounding lets.

5:20 deadghost: to be fair fredyr I don't know if I've ever met a solid, you should definitely start on this beginner's book

5:21 common lisp: a gentle guide to symbolic computation is up there though

5:21 fredyr: deadghost: yeah i guess you're right

5:21 deadghost: k&r is goodish

5:21 fredyr: otoh i usually like to dive in even though its a bit too much the first read

5:22 deadghost: sicp didn't click with me when I attempted it

5:23 learn x the hard way have been too shallow when I ran through them

5:23 elsen: deadghost: practical common lisp is an awesome first contact with common lisp

5:24 deadghost: tried it, I have gentle introduction

5:24 *favor

5:24 elsen: good to know

5:24 deadghost: PCL might be fine for people a bit more experienced

5:32 katox: d11wtq: https://github.com/amitrathore/conjure is not bad either, a tiny bit more fancy version of with-redefs

5:33 escherize: has anyone had a job interview in clj?

5:33 llasram: Most of my job interviews are conducted in Engglish

5:33 English even

5:35 escherize: do you typically write english when asked programming problems?

5:35 llasram: Sorry, bad joke :-)

5:35 escherize: me too ^^;

5:35 i had an interview today

5:35 llasram: I've never interviewed for Clojure, but have conducted interviews for Clojure positions on my team

5:35 escherize: oh. what kind of procedure did you use?

5:35 deadghost: do you fizzbuzz them

5:36 escherize: fizzbuzz lol

5:36 llasram: Honestly a bit slap-dash. We have some standard questions we ask everyone. I don't think they're optimal, but at least by asking everyone the same things we get something like a baseline for comparison

5:37 escherize: my friend thinks one should devite incredible energy to interviewing

5:37 llasram: For Clojure I usually just see how deeply they know the language, core abstractions, mapping to JVM constructs, etc

5:37 escherize: he means: it literally affects the quality of the interviewer's life in a very meaningful way

5:38 devote*

5:39 llasram: The one conducting the interview or being interviewed?

5:39 escherize: the interviewer, afaik

5:39 the one asking questions, i mean.

5:40 llasram: Ok, yeah, then I agree. It's important to make sure your org has only the people you want

5:40 escherize: fizzbuzz is rather awk in clojure.

5:41 llasram: ? with core.match it's like 2 lines

5:41 escherize: https://github.com/clojure/core.match

5:41 llasram: Ok, 3 unless your formatting is insane, but you know what I mean

5:42 Oh, forgot it was the example in the README :-)

5:42 Heh

5:42 deadghost: hah that's cute

5:42 llasram: Ok, so a few more than 3 :-)

5:44 deadghost: qtiest fizzbuzz

5:45 escherize: I still think it's kind of awkward though

5:46 oh i rather like this one:

5:46 (map vector(range 1 99)(cycle[nil nil"fizz"])(cycle[nil nil nil nil"buzz"]))

5:46 source: http://clojurefun.wordpress.com/2012/09/21/code-golf-in-clojure/

5:47 wink: interviewing is fun as long as you don't do 2 per day :P

5:47 escherize: i was asked a question that i wanted to use clojure on

5:47 in the context of a python interview

5:47 wink: we actually don't do any coding questions

5:47 escherize: what do you do?

5:48 deadghost: doesn't that result in sadness?

5:48 wink: mostly how they work, what they work on, what they like and don't like

5:48 so far this was enough to tell how they will fit in

5:49 we're not a one-language shop, so wouldn't make sense to test their knowledge anyway

5:49 deadghost: work at 1am to 8am, automated irc anime bots, maids

5:50 wink: I am not totally opposed to coding questions, as long as you let the interviewee do some sensible stuff

5:50 like: not have em write on a flipboard with a broken feltpen

5:50 or: don't shout at them for leaving out a semicolon

5:51 escherize: ["top" "stop" "tops" "awk" "pot"] => [["top" "pot"] ["stop" "tops"] ["awk"]]

5:51 I've interviewed a lot but not in clojure until today

5:52 dsrx: my favorite interview question at the last job was "write a function in javascript without using Math.min that returns the smallest number in an array"

5:52 because of the sheer number of people it filtered out

5:52 escherize: ouch

5:52 dsrx: I eventually removed the math.min restriction when i figured out "knows how to use apply" was a high bar as well among our candidate pool :D

5:53 escherize: that reminds me of joel spolsky

5:53 http://www.joelonsoftware.com/articles/GuerrillaInterviewing3.html

5:54 dsrx: I never got a single person who used or even hinted at using a reduce :(

5:54 deadghost: my first thought was reduce

5:54 then I had to think about how someone would normally do it

5:55 dsrx: some of the answers would have worked but only on lists of numbers > 0

5:55 deadghost: does js even have reduce?

5:55 I don't even know

5:56 dsrx: er only when the first element was > 0 I guess

5:56 deadghost: modern browsers have it natively yeah, and typical utility libraries provide it as well

5:56 lynxluna: i think the y have

5:57 deadghost: I know there's that one functional js lib

5:57 escherize: lodash? underscore?

5:57 deadghost: underscore

5:57 dsrx: errrr no wait

5:57 it was to find the maximum of a list :V

5:57 I should not be chatting while this tired

5:58 escherize: ,(reduce #(if (< %1 %2) %2 %1) [1 2 3 4 5])

5:58 clojurebot: 5

5:58 dsrx: yeah it was max, and people would typically provide something that didn't work on lists of negative numbers.

5:58 escherize: did i do that D:

5:58 ,(reduce #(if (< %1 %2) %2 %1) [-1 -2 -3 -4 -5])

5:58 clojurebot: -1

5:58 dsrx: ,(doc reduce)

5:58 clojurebot: "([f coll] [f val coll]); f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is returned and f is not called. If val i...

5:59 dsrx: typical answer was like this https://www.refheap.com/28708

6:00 escherize: that looks pretty typical

6:02 deadghost: oh geez

6:02 actually took my brain a while to process

6:03 I don't think I've used a for loop in at least two months

6:03 escherize: can we ever go back to that ?

6:04 deadghost: deadghost very simple man

6:05 he doesn't like keeping track of state, assignment, counts, and all that jazz

6:06 escherize: i watched simple made easy tonight

6:06 i wanted to start learning clojure again

6:09 tim_: anyone use selmer templating library?

6:13 d11wtq: tim_: I'm planning on it, just because I don't want to write HTML using Clojure.

6:13 tim_: Or rather, I don't want to make our front-end devs write Clojure.

6:20 tim_: ust wondered if anyone knew how to loop n times in selmer? looping over a list is straight forward.

6:21 d11wtq: tim_: Does {% for i in (range 0 n) %} work?

6:22 tim_: let me see....

6:23 d11wtq: tim_: The answer with 117 upvotes here might work too: http://stackoverflow.com/questions/1107737/numeric-for-loop-in-django-templates

6:24 {% for i in "xxxxxx" %} to loop 6 times.

6:24 I prefer a range though. It's clearer.

6:25 elsen: for i in "123456" ? :D

6:26 d11wtq: elsen: Works nicely until you go >= 10 :P

6:26 elsen: you can get to 16 with hexa :D

6:27 tim_: Hmmm, i've tried the range and string methods but no luck.

6:27 d11wtq: tim_: The answer by

6:27 lynxluna: erm, can u use enlive d11wtq?

6:27 d11wtq: Guillermo Siliceo Trueba

6:28 Is also good.

6:28 But you need to write a filter.

6:28 tim_: i've checked syntax as have a for loop working on a list further down the page.

6:28 i started with enlive and moved away from it as there are some open bugs regarding disabling the template caching.

6:30 deadghost: enlive has been eh for me so far

6:30 hasn't been easy for me to figure out how to use it

6:31 and I find myself doing things kind of hacky/uncleanly

6:32 lynxluna: hmm I used it to create just a simple web apps, so I think experience varies. But definitely will look at the bugs you mentioned

6:32 tim_: I'll try the filter approach.....

6:33 deadghost: for example, it adds head and body tags when getting an html snippet from file

6:33 lynxluna: I created simple web apps for motivation to lean Clojure, my background was all fully imperative, non-web, C++.

6:33 deadghost: and needing to extract the body every time

6:34 lynxluna: *learn

6:34 tim_: Whats the general verdict regarding clojure for web apps? is it more popular for backend systems.

6:34 lynxluna: I'd look at it

6:35 I never code web before using language other than Clojure. I touched PHP a decade ago but never liked it.

6:35 clgv: tim_: with all the effort going into CLJS I guess there is also a lot of interest in running the frontend with Clojure(Script)

6:35 lynxluna: My current experience has been a little bit rocky but amazing

6:36 d11wtq: clgv: I'd be interested to try ClojureScript in Node.js on the server too.

6:36 lynxluna: d11wtq: that will be interesting

6:37 katox: bumpy ride ;)

6:39 clgv: d11wtq: well just try. I currently only implemented a server program in clojure which worked pretty well :)

6:41 d11wtq: clgv: Yeah, I'm doing web stuff in Clojure too. Haven't finished anything yet, but started a websockets-based app (using httpkit) in my last job before I quit and building a distributed queueing/scheduling system with a web frontend now, for fun.

6:41 clgv: d11wtq: queueing/scheduling for remote task execution on multiple machines?

6:42 d11wtq: clgv: Yep.

6:42 clgv: d11wtq: that's exactly what I built ;)

6:42 d11wtq: clgv: Hah :)

6:42 clgv: Do you have a link?

6:42 clgv: d11wtq: no. there is no public release so far.

6:42 d11wtq: clgv: I'm just writing this as a learning experience in Cloure, using Redis as a data store.

6:43 clgv: Pretty much a Sorted Set and a Hash, with some MULTI..EXEC to take jobs out of the sorted set and that's it (in Redis).

6:45 clgv: d11wtq: what do you use for communication?

6:45 d11wtq: I built a message passing communication with clojure maps as messages on top of Java RMI

6:46 d11wtq: clgv: Carmine, for talking to Redis. Haven't started the Web UI yet (less important) but will use httpkit so I can do websockets and then I'm gonna try PolymerJS on the front-end.

6:46 clgv: Ah the nodes don't talk directly to each other... it's centered around Redis/Redis Cluster.

6:47 clgv: d11wtq: ah ok

6:48 d11wtq: so we are talking about different use cases ^^

6:48 d11wtq: clgv: I think so :)

6:48 clgv: d11wtq: my ultimate goal was to have a remote executing `future`

6:49 d11wtq: clgv: I'm basically implementing Sidekiq (from Ruby) in Clojure, except more flexible and with the ability to repeat-schedule things, from any of the machines running the code, without worrying about dupes.

6:49 clgv: Well that's pretty much the end result of mine too :P

6:50 clgv: (schedue/add s [:in "5 minutes"] #(println "bob"))

6:50 clgv: The (println ..) is captured and put into Redis, then read back out on the other side.

6:51 clgv: d11wtq: the difficult part is to get the code to the workers without having pre-deploy it^^

6:51 d11wtq: clgv: Obviously anything listening to the queues needs to know about any functions that are references.

6:51 *referenced

6:51 clgv: That's how Sidekiq/Resque work too.

6:52 clgv: Sounds like yours is gonna be better if you don't need to run the code on the remote side :)

6:53 Mine's more like a weekend project to do the queueing part. The web UI will be the interesting bit for me.

6:58 escherize: is there a best practice for accepting something like [f & args]

6:58 d11wtq: escherize: How do you mean?

6:58 escherize: sometimes the function i'm writing seems to want to take a list

6:59 if args is a list to begin with, how should i handle that

6:59 d11wtq: escherize: You can use (apply f args)

6:59 escherize: If I'm understanding what you're asking correctly.

6:59 escherize: but can it accept both?

7:00 https://www.refheap.com/28715

7:00 d11wtq: escherize: Well, not without some hacks, since how do you know that the list wasn't just the first argument?

7:01 escherize: Yeah, so in that snippet it's ambiguous which one would be correct.

7:02 escherize: i wish less terms were called map

7:02 i think i should rename that anyway

7:02 i think i'll use apply. thanks for the guidance :]

7:03 d11wtq: escherize: No worries. apply is for that purpose.

7:04 escherize: i could also

7:04 just make the signitue [f args] rather than [f & args]

7:04 if i'll always expect a list

7:05 d11wtq: escherize: Yep, or [f arg1 & rest], then do a type-check on arg1... but you need to be sure of the potential ways it will be called.

7:05 Otherwise you may incorrectly convert a vector/list to multiple args.

7:09 clgv: d11wtq: well it definitely runs the code on the remote side

7:10 d11wtq: clgv: Nice, that's impressive :)

7:12 I love how you can think about something complex for days and bit by bit you think up simpler/cleaner ways to do the same thing until eventually you have a picture of something simple and beautiful in your head. Isn't programming just wonderful? :P

7:13 Well. That's not so much programming, as thinking. But you know what I mean.

7:15 Am I mis-using namespaces? I find I create a namespace in Clojure in much the same way I'd create a class in an OO language.

7:16 They're generally just logically grouped functions that all operate on the same data structures though.

7:19 escherize: i need to pull some 5k line file into memory. should i use defonce?

7:35 sveri: hi, when i use (get map "key") is there a way to provide an alternative if the key does not exist?

7:36 ior3k: sveri: just another another argument to get

7:36 just add*

7:36 d11wtq: sveri: (doc get) in the repl.

7:37 ior3k: ,(get {:one 1} :two 2)

7:37 clojurebot: 2

7:37 d11wtq: ,(doc get)

7:37 clojurebot: "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

7:37 d11wtq: :)

7:49 scape_: devn: thanks for the help last night, I'll give those a try; I do notice that this results in user1, when I expect user2; (clojure.set/difference (into #{} (map (comp :uuid val) {:thing1 {:uuid "user1"} :thing2 {:uuid "user2"}})) #{"user1"})

7:56 clgv: ,({:one 1} :two 2)

7:56 clojurebot: 2

8:02 podviaznikov: Hey, I want to mention here my project jarkeeper.com. It makes badges for Clojure projects. It checks status of dependencies. Example is here: http://www.jarkeeper.com/xsc/lein-ancient and on GitHub page - https://github.com/xsc/lein-ancient

8:03 edbond: podviaznikov, looks nice

8:04 podviaznikov, search doesn't works, 404

8:04 http://www.jarkeeper.com/korma

8:05 vijaykiran: edbond: edbond: you should use the github way of repo

8:05 podviaznikov: you should put full repo name actually: /korma/Korma -> http://www.jarkeeper.com/korma/Korma

8:06 edbond: ok

8:09 deadghost: anyone have much experience with small businesses?

8:09 thinking of just going door to door asking about their problems

8:09 and see I can solve any of them with programming

8:11 clgv: podviaznikov: the input field doesnt even show me what I type...

8:12 edbond: clgv, PR welcome :)

8:12 clgv: edbond: huh what?

8:13 edbond: clgv, it's opensource

8:13 clgv: edbond: that was critcism. not that I need that project. I just wanted to try it and the UI failed me as soon as it could ;)

8:13 podviaznikov: clgv: thanks. I see that some problem in Firefox. Works in Chrome. Checking firefox now

8:14 clgv: podviaznikov: firefox 26 it is indeed

8:14 clojurebot: 'Sea, mhuise.

8:18 podviaznikov: clgv: fixed and deployed. Thanks for letting me know. That was unexpected

8:20 edbond: podviaznikov, nice, padding was not needed indeed :)

8:20 clgv: podviaznikov: works now

8:21 podviaznikov: edbond:yep. But still strange that padding took content's space. Why it worked in Chrome but not in FF

8:23 fredyr_: pmbauer: ping

8:40 deadghost: http://i.imgur.com/O0tOSlx.png

8:40 I'm thinking just keeping it simple and one page

8:40 show note on right side with ajax and liberator

8:55 maravillas: nice project podviaznikov

9:00 podviaznikov: maravillas thanks!

9:00 katox: web version of lein ancient, cool ;)

9:00 podviaznikov: good job

9:01 podviaznikov: katox, thanks! exactly, it's just fronted for lein-ancient

9:26 CookedGryphon: does anybody have an idea how many running go-blocks are workable in core.async?

9:26 assuming they're all doing little bits of arithmetic work, what sort of order of magnitude should I be thinking of before a modern computer will start to struggle?

9:27 I'm not looking for exact numbers or benchmarks here, just a general idea of the scale at which I should be creating go blocks

9:27 between say, the number of buttons on a web page, through to 10e6 body physics simutations for example

9:38 clgv: CookedGryphon: I guess the same rules as for ThreadPoolExecutors apply in this case as well

9:39 CookedGryphon: clgv: not necessarily.

9:39 clgv: CookedGryphon: it is implemented on top of them for Clojure JVM ;)

9:40 CookedGryphon: I'm not worried about keeping everything running in real time or anything like that, more that it will keep going and complete the task/simulation without reaching a limit where it locks up and dies

9:40 clgv: CookedGryphon: you really want to do a physics simulation with core.async?

9:41 CookedGryphon: the problems I'm thinking of are inherently complex and long running, my question is, do the simplicity gains of core.async get outweighed by the fact that there's too much admin overhead past a certain point

9:41 that was just an example

9:41 of whmere thinking about channels and individual go loops would potentially simplify things

9:42 clgv: CookedGryphon: for too many very small calculations you certainly introduce a lot of overhead

9:42 CookedGryphon: yeah, I know that, I'm asking if anybody knowledgeable about the internals who might have done their own load tests or whatever, can give me an idea of the order of magnitude at which the returns significantly diminish

9:42 from their experience

9:43 for example, I've seen a web demo with 20,000 little robots moving about, works great. Is that the upper limit, or what?

9:43 tim_: @CookedGrypton you would need to tune for your problem based on your hardware, task length and num tasks in parallel

9:44 clgv: tim_: yeah, that's what I think as weel

9:44 CookedGryphon: tim_: yeah, obviously in the end to get it running faster. What I want to know is whether it's even worth starting down this road

9:45 or whether I'm going to hit a roadblock sooner rather than later

9:45 and it's just a bad idea for problems with thousands of chans

9:49 tim_: There is no number i can give as a limit. I suggest a quick prototype and it should highlight some more specific potential issues.

9:50 shep-werk: CookedGryphon: and then write a blog post on your results so us lurkers can benefit too :-)

9:50 clgv: CookedGryphon: can you describe the problem you want to use that for?

9:52 CookedGryphon: tim_: okay, I'll knock something up, and shep-werk I've been meaning to start blogging about stuff, perhaps this will spur me into doing so

9:53 clgv: not concisely, it's a simulation problem with lots of interacting parts though. I'm looking into actors as an alternative model

9:56 clgv: CookedGryphon: humm actors will have similar behaviour I guess

9:57 tim_: A vague idea If you have a very large number of small units of work to process, i would batch them up and send to a few workers to process concurrently.

9:57 clgv: CookedGryphon: I think the tradeoff is using actor/go-block indirection or writing a tight-loop to simulate the particles

9:58 as many workers as cpu cores and each has its "particle space" to update

9:59 CookedGryphon: Hmm, It's not quite that simple. Part of the simulation is going to be in which actors finish first, race conditions are almost a part of the simulation!

10:00 I'll write up in more detail in a blog post I think

10:00 and do some experiments to see how many go blocks I can usefully get running!

10:00 clgv: CookedGryphon: that'll probably help discussing it

10:08 tim_: i'm trying to get a filter to work in selmer, but i keep getting a Null pointer. (render "{{5|times}}" {}) times is my filter (defn times [n] (info "times" n)(range 0 n))

10:08 n is always nil

10:09 i can replicate in the repl, but can't see what i've done wrong.

10:10 korenani: was wondering is there a canonical bitcoin client for clojure?

10:11 arrdem: $google clojure bitcoin client github

10:11 lazybot: [kenrestivo/pawnshop · GitHub] https://github.com/kenrestivo/pawnshop

10:11 ToxicFrog: tim_: pretty sure that you can't put constants where variable names are expected in selmer

10:12 try (render "{{n|times}}" {:n 5})

10:12 tim_: ah

10:13 thanks, that works great.

10:14 ToxicFrog: (it allows numeric constants for things like passing in lists as the environment, so {{5|times}} looks up the key 5 in {}, gets no value, and passes nil to times)

10:15 tim_: i see. was confused as can see constants used in selmer expressions.

10:15 korenani: thanks arrdem

10:16 ToxicFrog: tim_: yeah, expressions and filters/variables use different rules.

10:19 sdegutis: is there a dogecoin client for clojure?

10:19 arrdem: sdegutis: I was working on a dogecoin trading facility...

10:20 sdegutis: sweet

10:20 arrdem: sdegutis: I don't think there's a real "wallet" system but I haven't looked.

10:20 $google clojure dogecoin github

10:20 lazybot: [sinemetu1 (Sam Garrett) · GitHub] https://github.com/sinemetu1

10:20 sdegutis: then it is doomed

10:20 arrdem: sdegutis: I meant a Clojure implementation/wrapper of one.

10:21 sdegutis: obviously there's a dogecoin wallet.

10:21 sdegutis: you say obviously as if its obvious :P

10:21 all i know about dogecoin is its just such wow, so currency

10:21 arrdem: lolz. it's a fork of litecoin, which is a 3rd generation fork of bitcoin.

10:22 so all the infrastructure is the same except for the proof of work function and a few other implementation details.

10:22 sdegutis: ah

10:22 * arrdem is a rich shibe

10:30 jph_: dogecoin is a bit more widely distributed since more people knew how to mine when it launched, and it has faster blocks, and higher max coins than lite or bitcoin

10:31 arrdem: jph_: this, and it's SCRYPT based which makes it more resistant to ASIC hardware...

10:31 jph_: arrdem, correct

10:31 arrdem: not that there aren't still ASICs...

10:31 arcatan: also dogecoin has better branding

10:31 jph_: arrdem, and they're actively considering making it harder for asics by (i think) increasing the mem requirements

10:32 arrdem: jph_: I know people who were in BTC early with ASIC hardware. Changing the mem requirements is just gonna screw them a little bit, it won't stop anything.

10:32 jph_: arrdem, and i think that's all they want to do, the longer they can delay asics, the greater distribution for average people with GPUs

10:33 arrdem: I had an interesting conversation with some finance guys here at UT who argued that ASICs are a _good_ thing because they constitute a mimimization of the network transaction costs.

10:34 that said, I do like being able to mine effectively with just my gaming box :P

10:34 jph_: arrdem, i'd suggest they're stuck in an old-world centralization mindset

10:34 yes it might be 'better', but is it 'good' ?

10:35 anyhow, i think dogecoin is good for cryptocurrency, in the sense that the average person doesn't ahve to fork out between$20-$750 USD for 1

10:36 arrdem: the only issue I take with ASICs is that the hardware is so expensive that the people who build and buy that class of hardware are coin hoarders, which reduces circulation.

10:36 jph_: instead they can get 10,000+ for $20 USD

10:36 * arrdem checks his wallet valuation

10:36 jph_: arrdem, asics are the 1% of the cryptocoin world

10:37 arrdem: jph_: indeed they are, but their mining power is so huge that it is very significant. My "average gaming rig" pulls about 350KH/s. A first round ASIC is easily gonna pull 1GH/s at the same power draw.

10:37 jph_: yeh

10:37 arrdem: s/significant/important/g

10:37 jph_: but we havent seen any scrypt quite that powerful

10:38 im sure they're coming tho

10:39 arrdem: jph_: none have been *announced*. Given the character and general secrecy of the BTC ASIC crowd I know I'd bet my life that hardware of that calibre is already online.

10:39 jph_: i only spotted one company last time i researched working on scrypt chips

10:40 i don tthink the chip manufacturers see the ROI for scrypt asics

10:40 im sure there could be small runs tho

10:40 for private miners

10:40 arrdem: bit chip makers don't, the issue is the private miners who do small runs.

10:42 now back to our regularly programmed clojure chatter...

10:42 jph_: heh

10:43 im just fiddling with caribou, getting used to it's routing engine

10:49 tim_: i'm playing with monger, its working well at the moment...

10:50 CookedGryphon: tim_: until you need to interact with more than one connection iirc

10:50 arrdem: (inc Cookedgryphon)

10:50 lazybot: ⇒ 2

10:50 CookedGryphon: though they may have fixed that in newer versions

10:50 tim_: more than connection per thread?

10:50 arrdem: tim_: per system :/

10:50 tim_: lol

10:51 noprompt: any good ideas around testing async/stateful code in clojurescript?

10:53 CookedGryphon: tim_: I use congomongo whenever I need to do mongo stuff

10:53 less side effecting, universally setting options like congomongo. I find the syntax nicer too

10:53 arrdem: CookedGryphon: congomongo does have a connection param everywhere, right?

10:54 CookedGryphon: right, or a with-connection macro which sets a dynamic var

10:54 for a given context

10:54 arrdem: yep yep.

10:54 tim_: i'm just panic googling the connection limit issue....

10:55 CookedGryphon: but even that works nicely if you want to nest for example (with-connection conn1 (let [data-from-conn1 ...] (with-connection conn2 (insert! data-from-conn1)))...

11:01 arrdem: eh dynamic vars and lazy-seqs...

11:02 CookedGryphon: arrdem: good point... can't remember if I hit that when I did it

11:02 shouldn't the lazy seq capture the dynamic var's value?

11:03 it's closed in by that point surely

11:03 (not= dynamic mutable)

11:03 ?

11:03 arrdem: `cbp and bitemyapp did a good job with revise in that the connection was always an explicit value.

11:04 CookedGryphon: lazy seqs don't capture anything. dynamic vars are resolved at sequence realization.

11:05 CookedGryphon: arrdem: fair enough. This was ages ago, i might have passed in the connections explicitly

11:06 though i remember being annoyed that I *couldn't* do that, so all my little helper functions had with-connection wrappers for trivial single calls which was annoying

11:06 gtg, back in a bit;

11:12 S11001001: CookedGryphon: dynamic & mutable *are* the same in that references to them are not referentially transparent. Which makes them quite similar indeed, though not exactly equivalent, as you say. So there are useful analogies to be made.

11:29 dkinzer: Is referential transparency thrown out the window when one is dealing with macros? Recently I was forced to create a global variable for a value and use it in a macro instead of just being able to pass the value to the macro as an argument.

11:30 noprompt: dnolen: any good ideas around testing async stuff while awaiting chas' updates to clojurescript.test?

11:38 S11001001: dkinzer: iff the behavior of the macro's expansion does not have the RT property, that usage of the macro is not RT. So it sounds like your *particular* macro never yields RT expressions, but there are plenty of macros that yield RT expressions for RT arguments.

11:40 An example of the latter is `cond', or `let'.

11:47 dnolen: noprompt: I thought chas landed some async support

11:49 katox: dnolen: thanks for the mention of set-state to handle the case of throwing the update away in the tutorial. spent some time wondering what am I doing wrong few days ago

11:50 dnolen: katox: yes, I hope to come up with something better but this will have to do for now

11:50 katox: it does have the benefit of being a bit more explicit, where React is a bit more magical

11:50 katox: dnolen: yes that's true

11:52 dnolen: there is one "magical" thing in om though - when you specify value as a constant from app state, then an implicit handler sets the state for inputs anyway - so the component behaves like uncontrolled while one would expect the input value to never change

11:52 dnolen: katox: yes I'm aware, I'm kind of lukewarm about it - Om works how it works for now

12:05 katox: dnolen: one more thing that's a bit unclear to me - the om/join part of the app state passed to a component is meant to be updatable (via transact!), right?

12:06 dnolen: katox: known issue and om.core/join is marked EXPERIMENTAL ;) this actually requires a significant change and is slated for 0.3.1

12:07 katox: you really should not use om.core/join at this time if you need synchronization or updates

12:08 should get resolved in a couple of days once I have a satisfactory implementation strategy down

12:11 katox: dnolen: I didn't really use it so far - I used opts for passing down additional parts of app-state, it just seemed it's meant for a usecase like this

12:11 dnolen: katox: yes

12:12 pushing things down opts works but that still suffers from synchronization issues

12:12 and I think I prefer people not use opts for this (but I understand that people will as a workaround for now)

12:13 katox: dnolen: yes, it's quite an artificial boundary to pass some things in a cursor and bunch of other stuff in opts

12:14 dnolen: katox: working on it :)

12:14 srruby: How do I add clojure.contrib.seq to project.clj ?

12:14 katox: dnolen: I can move some of those into the state (like a comm channel) but I'm unusure if propagating that state into children is a good thing

12:14 llasram: srruby: Anything in clojure.contrib is ancient history

12:15 dnolen: katox: channels should pass to children as state in my opinion

12:15 :init-state really

12:17 katox: dnolen: ok, right, I have it in the main component state anyway (so I'll just pass that deeper)

12:17 srruby: llasram: Thanks.

12:17 arrdem: srruby: but it may be useful...

12:29 dkinzer: S11001001: thx for the clarification. I think that must be it.

12:34 sdegutis: Anyone in here using a Thinkpad that they can recommend for serious Clojure development?

12:34 (i.e. serious programming)

12:36 arrdem: sdegutis: most of them are pretty good... I know technomancy uses a thinkbrick as his dev laptop.

12:37 sdegutis: I'm a mechanical keyboard fiend so I just lug around an ultrabook and a massive USB keyboard :P

12:37 sdegutis: :)

12:37 technomancy: sdegutis: I can't recommend any thinkpads currently for sale, but if you go on ebay...

12:37 arcatan: i keep hearing that the old ThinkPads were great, but that they've jumped the shark since

12:38 technomancy: arcatan: everyone says that about the lenovo acquisition, which is pure BS

12:38 sdegutis: technomancy: Why can't you recommend current Thinkpads?

12:38 arrdem: arcatan: my perception is that IBM's thinkpads aren't so hot, but Lenovo still builds good bricks.

12:38 technomancy: sdegutis: sorry, to be more specific I can't recommend the X series

12:38 I don't know anything about the larger ones

12:39 sdegutis: technomancy: Oh, I was looking into the T series.

12:39 technomancy: the current X series are all either low-res screens or no user-serviceable parts bullshit, which offends me deeply

12:39 sdegutis: I don't agree with the new "thinner/lighter is better" idea.

12:39 technomancy: dinc

12:39 thinner is useless

12:39 it just makes it look cool at the expense of actual functionality

12:40 sdegutis: Yup.

12:40 technomancy: I can strongly recommend the X200 since that was the last one before they went to low-res screens

12:40 dsrx: after using a first revision macbook for 5 years, I literally threw my macbook air across the room the first time i picked it up off my desk while moving

12:40 sdegutis: Related: anyone interested in a mid-2013 15" rMBP with 16gb memory and 512gb SSD?

12:40 dsrx: (it survived with a little ding on the front lip)

12:40 DerGuteMoritz: FWIW, x201(s) also has a high-res screen

12:41 at least my x201s is 1440x900

12:41 technomancy: though if I were buying a new kit today and not waiting around for bunnie's hacker laptop (http://makezine.com/magazine/building-an-open-source-laptop/) I would just get something with a nice screen and a rubbish keyboard and haul around my ergodox everywhere I go

12:41 DerGuteMoritz: aha cool; I guess it was the x220 where it went downhill

12:42 DerGuteMoritz: technomancy: yep

12:42 technomancy: I can't stand the idea of buying something I can't open up to fix myself though

12:42 all the super-light junk seems to be that way

12:42 DerGuteMoritz: indeed

12:42 katox: I'm on T520 and it's quite solid - I hate two things - nvidia drivers and unstable N iwlwifi driver on debian stable

12:43 technomancy: sdegutis: oh yeah, don't get anything that doesn't have an intel graphics chipset

12:43 that's a common noob mistake =)

12:43 sdegutis: Why?

12:43 clojurebot: Why is why

12:43 sdegutis: clojurebot: disable that response

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

12:43 technomancy: they typically either use up a lot more juice or can't suspend properly

12:43 sdegutis: Ooh.

12:43 technomancy: or don't support rotation, or whatever

12:43 katox: technomancy: this one can sleep well, but the nvidia-settings is royal PITA

12:44 technomancy: even the dinkiest onboard intel chip in my 5-year-old thinkpad can drive a big old 28-inch external display

12:44 clojurebot: forget Why |is| why

12:45 clojurebot: I forgot that Why is why

12:45 sdegutis: technomancy: Thanks :)

12:46 technomancy: heh, np

12:46 katox: technomancy: I'll ping you later this year or the next for a debian gear ntb advice ;)

12:47 so far it seems it's worse and worse every year

12:47 technomancy: katox: I'm holding on to my ancient thinkpad for dear life

12:47 the novena design I linked to above looks badass though

12:48 sdegutis: technomancy: But you haven't looked into the T series, how do you know it doesn't fit your requirements?

12:49 technomancy: sdegutis: well... I like something I can pick up with two fingers

12:49 thin is useless; light is not

12:49 however...

12:49 since starting to use a mechanical keyboard I'm beginning to think that ship has sailed

12:50 if my keyboard is already adding 0.9kg to my bag every time I head out it seems a bit silly to care about the additional weight of the X->T jump

12:50 sdegutis: :)

12:52 katox: the Tx20 had the last keyboard with the old design, Tx30 and Tx40 have "mac"-like one (far from good imo)

12:52 srruby: technomancy: I love my model m keyboard. Circa 1987

12:53 technomancy: katox: yeah, after going mechanical I have a hard time caring about that

12:53 especially since the underlying switch design hasn't actually changed; if it was a flat one like the macbook I would definitely stay away

12:53 katox: technomancy: it's not just mechanical, the key layout is horrible too

12:54 sdegutis: katox: what's wrong with the new mac-like design? (I'm typing on an Apple aluminum full-size keyboard right now btw)

12:54 technomancy: sdegutis: the response is just rubbish; the keys only move a few mm

12:54 it feels like typing on glass

12:54 sdegutis: technomancy: oh. But why is that not good?

12:55 dsrx: you could always get an old toshiba T1000 or something for a mechanical keyboard :)

12:55 arrdem: sdegutis: I like more travel on each keypress.

12:55 sdegutis: it's a personal thing.

12:55 sdegutis: Oh.

12:55 arrdem: sdegutis: I also kinda like feeling when the key engages, and the pressure change leading up thereto.

12:55 technomancy: I don't like typing on glass

12:56 arrdem: technomancy: one day we will all have 20" reconfigurable touchscreens for keyboards..

12:56 technomancy: arrdem: hopefully after I retire

12:56 dsrx: beautiful http://3.bp.blogspot.com/_YIydOBZLqFs/TRDwa_v0WkI/AAAAAAAAAB8/PPYssOLGvfM/s1600/IMG_7456.JPG

12:56 technomancy: oooh ctrl in the right place, nice

12:58 katox: technomancy: that can be easily changed in bios on lenovos tough

12:58 TimMc: technomancy: Ever seen one of these? https://en.wikipedia.org/wiki/IBM_ThinkPad_Butterfly_keyboard

12:58 dsrx: katox: yeah, but you still have to look at the thing

12:59 technomancy: TimMc: I've seen that but never tried it for myself

12:59 katox: dsrx: I'm looking at the screen not the keyboard anyway

12:59 TimMc: One of my housemates has one. He's going to gut the laptop and put a Raspberry Pi in it.

12:59 technomancy: TimMc: it's a sweet idea though; I wish it had taken off

12:59 maybe it could have postponed the tragedy of 16:9 aspect ratios

12:59 dsrx: katox: when you're typing maybe, but when it's sitting on your desk asleep... the caps lock will still offend

13:00 llasram: 16:9 isn't so bad -- you get a normal screen + a thin IRC client on the side

13:01 gfredericks: is there a derogatory name for clojure yet? Can I suggest "cluggles"?

13:01 llasram: Clojture?

13:01 arrdem: gfredericks: most people just use "it isn't haskell"...

13:01 llasram: s,jt,tj,

13:02 technomancy: there's always Smug Lisp Weenie, but that's more general

13:03 llasram: Kludjure

13:03 dkinzer: I like Clojture.

13:07 * arrdem votes for Kludjure

13:09 alandipert: if anyone's interested, me and michaniskin talking hoplon at https://plus.google.com/u/0/b/114209127252642497527/events/cp92seg6o5bu0dh1ms0n07u6v58 (Q & A and discussion in #hoplon)

13:10 dsrx: arrdem: lol

13:27 ebaxt: Is this the correct way to drain a channel in core.async? https://www.refheap.com/28804

13:32 mdrogalis: bbloom: Insightful tweet chain.

13:33 bbloom: mdrogalis: if only there was some sensible way to read it as a tree or something

13:33 mdrogalis: bbloom: Yeah, conversation is really a graph sort of thing. Not linear.

13:33 But anywho. Great stuff.

13:35 arrdem: obligitory "emacs can do that" : https://github.com/ppareit/graphviz-dot-mode

13:35 now you just need a better twitter client :P

13:36 s,need,need to buind,g

13:36 technomancy: or like... you know, a mail client

13:36 tweet->imap bridge

13:36 bbloom: technomancy: get on that

13:36 technomancy: I'll add it to the seajure project ideas wiki

13:36 arrdem: I have 10Kdoge for a working implementation :P

13:38 bbloom: technomancy: seriously, if that doesn't already exist somewhere, it's totally a profitable business venture :-)

13:42 technomancy: yeah, when I hear the word IMAP, the first thing that comes to my mind is $$$ these days

13:43 dacc: haha

13:43 bbloom: technomancy: you heard the wrong words. the right words were "email" and "twitter" :-P

13:43 dacc: i'd like to bridge both twitter and email into irc, hrm

13:44 bbloom: dacc: as soon as you add irc, it's negative money :-)

13:44 arrdem: I just want a meta-messaging client which exposes Twitter, FB and IRC as a single IRC like message stream...

13:45 technomancy: arrdem: bitlbee actually does twitter

13:45 bbloom: arrdem: i think every sociable geek on the planet has had that idea, but it's basically impossible to make a general purpose enough tool that wouldn't have vim/emacs level learning curve or worse

13:45 arrdem: bbloom: haha... which is why I was thinking it'd make a perfect Emacs major mode :P

13:46 bbloom: arrdem: godspeed.

13:46 arrdem: bbloom: thanks. I'll need it...

13:47 S11001001: what are you going to add clojure-elisp, arrdem? :)

13:47 arrdem: S11001001: who said I was actually going to write elisp...

13:48 technomancy: do it as an nrepl op; that way everyone can join in the fun

13:48 arrdem: (inc technomancy)

13:48 lazybot: ⇒ 95

13:48 scottj: the best thing about bitlbee+twitter is that it puts the tweets in most recent at bottom.

13:48 Bronsa: arrdem: I use twitter/gtalk over bitlbee

13:49 imanc: mega newb here - I've created a compojure project via lein, added http-kit and compojure dependencies, and I have some code in my app's core.clj. But I'm trying to figure out how to run/start the webserver. Articles suggest lein ring server, but ring is not an available command. Any ideas what I need to do?

13:50 Bronsa: arrdem: I'm pretty sure it's possible to have the facebook chat over bitlbee too

13:50 arrdem: Bronsa: you still use gtalk? IRC and Twitter have basically replaced it for me except for the idiots who only use FB...

13:50 technomancy: I used to use gtalk till they killed the federation

13:52 that sounds like a weird star trek spoiler, but it's not

13:52 arrdem: technomancy: it's a pretty solid FTL spoiler...

13:52 insamniac: I was trying to think of a Romulan joke

13:53 technomancy: though... they're still making those movies, so it could still happen

13:55 cark: what are you all using for testing async stuff in clojurescript ? (callbacks or core.async)

13:56 i couldn't find anything

14:15 mikerod: I just got burned by the fact that clojure.core/hash and clojure.core/= do *not* behave the same as .hashCode and .equals for a Clojure record type... tricky

14:21 sdegutis: Officially listing my rMBP on craigslist, woo.

14:27 dobry-den: It's taking me longer than I'd like to make ring's default multi-part upload fail if user tries uploading more than X bytes. Is there already a way to do this?

14:35 gfredericks: ,(defrecord Sparky [a])

14:35 clojurebot: sandbox.Sparky

14:36 gfredericks: ,(hash (Sparky. 42))

14:36 clojurebot: -503760783

14:36 gfredericks: ,(.hashCode (Sparky. 42))

14:36 clojurebot: 1013910531

14:36 AeroNotix: ,(what-is-love?)

14:36 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: what-is-love? in this context, compiling:(NO_SOURCE_PATH:0:0)>

14:40 dkinzer: lol

14:49 yedi: holy shit lighttable is amazing, dunno why i waited this long to try it out

14:50 dacc: i think it's written in clojurescript on top of webkit or something, too

14:50 cark: dacc: exactly so

14:53 dacc: pretty impressive

15:08 dnolen: Bronsa: ping

15:08 Bronsa: dnolen: pong

15:09 dnolen: Bronsa: how difficult would be it to have a comments preserving mode in tools.reader?

15:11 escherize: what's a quick way to look up a row in a longish csv file?

15:11 Bronsa: dnolen: probably impossible I'm afraid. we would need to have after/before every comment an IObj to store them as metadata, that is not the case

15:12 seangrove: dnolen: SF CLJS had a great turnout, and very good talks. Pretty surprised by how well the first meetup turned out

15:12 Bronsa: dnolen: it could be possible to keep them in a separate table indexed by starting line+starting column though

15:12 seangrove: dnolen: Next month is on React/Om

15:12 dnolen: seangrove: that awesome!

15:12 seangrove: that the meetup went well

15:12 seangrove: Yeah, about ~30 people showed up, two lightning talks, one main talk

15:13 Good Q&A, etc.

15:13 dnolen: Bronsa: interesting

15:14 Bronsa: dnolen: why would you need that?

15:15 arrdem: Bronsa: automated refactoring tools.

15:15 Bronsa: that's probably a better job for a parser than for a reader

15:16 arrdem: agreed. The parser could be augmented to store this data, but then the reader would have to be changed to ignore comment groups.

15:17 AeroNotix: Has anyone got an example of using gen/hash-map in simple-check?

15:17 * arrdem digs out the c.t.r source

15:19 Bronsa: I've thought about refactoring tools.reader to be two-phases, first the parser that emits an AST (which could keep comments) and a pass over that to emit the runtime values

15:19 reiddraper: AeroNotix: (gen/sample (gen/hash-map :name gen/string-ascii :age gen/s-pos-int))

15:19 arrdem: that's exactly what you'd want to do in order to support this..

15:19 tools.parser and tools.reader

15:20 Bronsa: yeah.

15:20 arrdem: I gotta start somewhere... get a jira opened and I'll start refactoring :P

15:22 Bronsa: If I recall correctly somebody had a modified version of tools.reader that behaved only as a parser

15:23 oskarkv: My user namespace has required a function I want to have access to in other namespaces, just for the sake of convenient editing. Can I get at the function without requiring user from other namespaces?

15:24 arrdem: oskarkv: you can access it as (user/my-fn)

15:24 oskarkv: or (#'user/my-fn)

15:25 Bronsa: I expect you'd want to do better than the naive instaparse grammer :P

15:26 Bronsa: arrdem: let me finish fixing this bug in tools.emitter.jvm and then I'll open a jira

15:26 arrdem: Bronsa: k.

15:26 mmitchell: I wish :require would act like :import so that you could easily alias namespaces like: (ns foo (:require [db.adapters mysql sqlite redis])) etc., instead I have to use :as like [db.adapters [mysql :as mysql] [sqlite :as sqlite] ...]

15:27 Bronsa: I was probably thinking of https://github.com/kovasb/codn

15:27 oskarkv: arrdem ah, I had to use the original namespace, not user. Thanks.

15:28 dobry-den: escherize: sequential scan?

15:29 aaronj1335: so i've defined a :test key in one of my functions' metadata. is there a test runner for these? clojure.test/run-{all-}tests doesn't seem to notice it

15:29 dobry-den: Question: I throw an exception in middleware (Compojure app) when a user's file upload is too large. What should I do with the exception so that the route endpoint can handle it?

15:38 grzm: anyone know examples of xhr with om/react out in the wild?

15:40 escherize: https://www.refheap.com/28863

15:40 having some trouble retrieving lines that match 'word'

15:42 grzm: escherize: any reason not to use https://github.com/clojure/data.csv and operate over the fields directly?

15:43 dobry-den: escherize: https://groups.google.com/d/msg/clojure/jGoLKevw1LI/0bmtETp6D1kJ

15:43 Raynes: Ugh, don't use that. Use data.csv or dsantiago's lib.

15:44 escherize: thanks you guys

15:44 dobry-den: what's wrong with that?

15:45 Raynes: There are useful, stable libraries with tests and such that do a very good job at parsing csv files.

15:46 Replacing those with a single function copied from someone else's code is rarely a good choice over solid, stable libraries.

15:49 dobry-den: sure. although i'd encourage escherize to get a line-seq idiom down for quick and dirty stuff

15:49 Raynes: Agreed.

15:49 escherize: noted

15:50 thanks :]

15:50 Raynes: If you're reading files, you almost certainly want to lazily iterate over lines.

15:50 dobry-den: clojure makes it incredibly brainless to parse large files. as long as you can consume some sort of lazy sequence. most of its core lib returns lazy seqs so they compose.

15:50 Raynes: escherize: The difference being that with line-seq you get a lazy sequence that reads lines from the file as needed.

15:51 escherize: With your version, you're reading the entire file into memory as a string and then splitting it into a collection.

15:51 Both of the CSV libraries handle the lazy parsing for you.

16:07 sdegutis: technomancy: which thinkpad do you have? thinking of just going on ebay and getting a peer-approved model

16:08 dacc: sdegutis: switching away from mac?

16:08 technomancy: sdegutis: I have the X200s. the s signifies low-voltage, which is great IMO; I get 6-7h from a 9-cell battery

16:08 sdegutis: dacc: seriously considering it. just tried windows 8 and im in love.

16:08 technomancy: sdegutis: but the main thing is just to avoid the low-res screen

16:08 so nothing newer than the X201

16:09 unless you are OK with non-user-serviceable parts, which are an anathema to everything that is decent

16:09 (If you want a T series then I have no idea; you could probably get a good screen without getting something so old maybe?)

16:10 sdegutis: technomancy: heh, thats one of the reasons i want to get rid of my rMBP... once the battery life is dead, theres no replacing it

16:10 technomancy: old is good, it means cheaper

16:10 technomancy: sdegutis: you might need to get a new battery, but those arnet' bad

16:10 sdegutis: also be sure to check the brightness, not just the resolution

16:10 sdegutis: technomancy: on an x200s?

16:11 technomancy: I wouldn't go under 250 nits

16:11 sdegutis: oh, i didnt know that could vary by specific models

16:11 technomancy: sdegutis: any model is offered with 3 or 4 different screen options

16:11 sdegutis: ah

16:11 technomancy: yeah, it's kinda confusing

16:11 sdegutis: so kinda like Apple's "customize" feature.

16:12 escherize: thanks for the csv help, i got the lookup down to 8.5 ms!

16:12 sdegutis: lem.

16:12 technomancy: thinkwiki.org is your friend

16:12 sdegutis: thx

16:12 technomancy: sure

16:14 wink: without reading the backlog: I love my x230s (if you can stand the new chicklet keyboard, I can)

16:14 queue technomancy hatin on me :D

16:15 gfredericks: without reading the backlog: what do you guys think about climate change

16:15 technomancy: yeah, my advice is optimized for what I do: being out at coffee shops every other day and only being plugged into a screen less than half the time

16:15 arrdem: gfredericks: the door is that way sir

16:15 technomancy: if you are usually working out of an office, you probably don't care as much about weight or brightness or internal resolution

16:16 deadghost: why would someone use a laptop at an office

16:16 cespare: slow is a fn that takes a long time and produces the value 3. How can I make something like this work: (def inf (cons (slow) (lazy-seq (inf)))) except I want slow to be re-evaluated each time a new seq item is realized

16:16 gfredericks: so you can carry it to meetings

16:16 technomancy: deadghost: I don't know; apparently it's a thing

16:16 gfredericks: not having a laptop at meetings is pretty great though

16:16 llasram: gfredericks: Next time you do an open mic night, let us know

16:17 hiredman: cespare: repeatedly

16:17 technomancy: gfredericks: if global warming is true why is it cold lol

16:18 cespare: hiredman: thanks

16:19 sdegutis: arrdem: lol

16:19 llasram: technomancy: We are having our semi-decade-ly snow in Atlanta, and I have heard that joke made too seriously too many times today

16:20 technomancy: assuming you linked them to http://ifglobalwarmingisrealthenwhyisitcold.blogspot.com/

16:20 gfredericks: technomancy: haha lol scientists are bias

16:21 llasram: technomancy: I will in the future!

16:21 gfredericks: technomancy: that fourth one is from the onion

16:23 TimMc: I liked that recent XKCD.

16:23 dkinzer: it's called global climate change... and it's more complicated than that.

16:23 sdegutis: I miss the old style XKCDs.

16:24 cark: that blog is frightening

16:24 TimMc: dkinzer: (To be clear, I don't think anyone so far in this conversation is a climate change denier.)

16:25 * TimMc hands out the /sarcasm tags

16:25 * llasram wears his proudly!

16:25 arrdem: to deny climate change absolutely is to be a fool, to dispute the human involvement is more tennable.

16:25 technomancy: dkinzer: you can tell it's not serious because there's a "lol" on the end =)

16:26 * arrdem goes back to compiling weather models

16:26 dkinzer: technomancy: :)

16:26 llasram: arrdem: Is that what you're actually working on?

16:26 gfredericks: technomancy: this sentence is serious lol

16:26 TimMc: lol lol

16:26 technomancy: gfredericks: nice try

16:26 arrdem: lel?

16:27 gfredericks: aw shucks

16:27 * sdegutis enjoyed http://xkcd.com/429/ and http://xkcd.com/502/

16:31 cespare: How do I make the repl not print the output value? Apparently 'clojure repl don't print' isn't good enough for google

16:32 stuartsierra: (do … something … nil)

16:33 cespare: sure, that works.

16:33 technomancy: cespare: you can start a sub-repl with clojure.main/repl that overrides the print function too

16:33 kind of convoluted though

16:34 or just (def _ (...)) would hide it too

16:35 cespare: hrm (do (expensive-thing) nil) isn't running expensive thing. Nor is (doall ... nil)

16:36 cark: cespare: hum are you sure about that ?

16:37 cespare: more concretely, (doall (take 5000000000 (repeatedly (fn [] 3))) nil) returns instantly.

16:37 i must be doing something dumb.

16:38 cark: doall with 2 parameters : the first one is n

16:38 sdegutis: ,3

16:38 clojurebot: 3

16:38 cark: wrap your doall in (do (doall ...) nil)

16:39 technomancy: cespare: no, it's clojure being dumb about undefined inputs

16:39 well, both are at fault I guess

16:39 hyPiRion: cespare: I guess you'd like to do (dorun (take 5000000000 (repeatedly (fn [] 3)))) instead

16:39 cespare: oh yeah, doall is different.

16:39 dorun, that's better.

16:39 thanks hyPiRion

16:40 hyPiRion: Well, doall retains all in memory, so if you're doing memory profiling, take a note of that

16:42 cespare: what I'm really trying to do is figure out why a sample of a large clojure codebase indicates it's spending a lot of cpu time in lazyseq.sval.

16:43 I was trying to repro by profiling doing various convoluted things with lazy seqs.

17:35 daGrevis: I'm sorry, but why this doesn't work? http://vpaste.net/wNG9E

17:38 oskarkv: daGrevis what is it supposed to do?

17:38 daGrevis: oskarkv, string/substring?

17:38 check if 13 is in 2013

17:39 llasram: daGrevis: number->digits returns a vector, which can be treated as a function of index->value. `some` expects its first argument to be a function, and calls that function on each member of the second-argument collection

17:39 oskarkv: the digits are strings, not numbers

17:39 brehaut: daGrevis: prefer hyphens to underscores in names (minor style point)

17:39 oskarkv: or, maybe characters

17:41 daGrevis: thanks all

17:41 brehaut, i though hyphens were the correct way

17:41 ohh, i have underscore there. sorry

17:42 llasram: ~guards

17:42 clojurebot: SEIZE HIM!

17:44 daGrevis: why doesn't some work on lists?

17:45 hyPiRion: it does...?

17:45 ,(some even? (list 1 2 3))

17:45 clojurebot: true

17:45 cark: ,(some odd? '(1 2 3))

17:45 clojurebot: true

17:45 daGrevis: yes, my bad

17:45 1st arg is a fn

17:45 and vec somehow acts as fn

17:45 brehaut: vectors are functions of the indexes

17:46 oskarkv: yes, somehow ;)

17:46 ivan: ,([1 2] 0)

17:46 clojurebot: 1

17:46 brehaut: likewise maps are functions of their keys

17:46 rhg135: interfaces

17:46 clojurebot: No entiendo

17:46 brehaut: (doc ifn?)

17:46 clojurebot: "([x]); Returns true if x implements IFn. Note that many data structures (e.g. sets and maps) implement IFn"

17:46 rhg135: clojurebot, you disapoint me

17:46 clojurebot: No entiendo

17:46 oskarkv: (map ifn? '() [] {})

17:46 ,(map ifn? '() [] {})

17:46 clojurebot: ()

17:46 oskarkv: ops

17:47 that's not right

17:47 ,(map ifn? ['() [] {}])

17:47 clojurebot: (false true true)

17:47 brehaut: you zipped them togehter

17:47 oskarkv: yeah :p

17:47 brehaut: and you missed sets ;)

17:47 oskarkv: yeah

17:47 brehaut: (functions of their contents)

17:47 oskarkv: im failing

17:47 daGrevis: this is interesting

17:48 brehaut: daGrevis: and keywords are functions of maps

17:48 ,(:foo {:foo 1})

17:48 clojurebot: 1

17:48 brehaut: ,({:foo 1} :foo)

17:48 clojurebot: 1

17:48 hyPiRion: and symbols, too

17:48 brehaut: yeah

17:48 hyPiRion: ,('foo {'foo :wat})

17:48 clojurebot: :wat

17:48 oskarkv: that i did not know :P

17:48 rhg135: ooh

17:48 nor i

17:49 hyPiRion: even ##('foo #{'foo}) works, I think

17:49 lazybot: ⇒ foo

17:49 brehaut: you can also destructure :syms and :strs as well as keys :)

17:49 rhg135: makes sense tho

17:49 keywords being subsets of symbols

17:49 hyPiRion: well, it's a bit confusing that symbols are ifns at times. Or rather, that they don't throw exceptions when used erronously

17:50 ,('foo 'baz 'bar)

17:50 clojurebot: bar

17:50 rhg135: ?

17:50 brehaut: ,(let [{:syms [foo] :keys [baz] :strs [bar]} {'foo 1 "bar" 2 :baz 3}] [foo bar baz])

17:50 llasram: ,('+ 1 1)

17:50 clojurebot: [1 2 3]

17:50 1

17:50 llasram: ^ that's my favorite :-D

17:50 rhg135: if you do that i'll find you :P

17:51 llasram: Never in anger. Just to confuse the kids

17:51 rhg135: that's almost evil

17:52 brehaut: quickly, to the #swearjure!

17:52 rhg135: and it is if you don't see the '

17:52 arrdem: brehaut: .... that is evil. but nice.

17:52 brehaut: arrdem: its mostly for writing macros i think?

17:52 oskarkv: what's the actual definition of the symbol function?

17:52 brehaut: ,(source symbol)

17:52 clojurebot: Source not found\n

17:52 oskarkv: i mean, the one that symbols implement

17:53 rhg135: clojurebot, i is disapoint

17:53 clojurebot: 'Sea, mhuise.

17:53 rhg135: wut

17:53 llasram: clojurebot: i?

17:53 hyPiRion: clojurebot: i?

17:53 clojurebot: i is disapoint

17:53 i is disapoint

17:53 llasram: niiiiice

17:53 hyPiRion: zing

17:53 llasram: clojurebot learned how to zing itself!

17:53 AeroNotix: not sure why people are jizzing about brehaut's snippet

17:53 ivan: ,(let [{:syms [foo] :keys [foo] :strs [foo]} {'foo 1 "foo" 2 :foo 3}] [foo foo foo])

17:53 clojurebot: [1 1 1]

17:53 rhg135: smart bot

17:54 brehaut: AeroNotix: its just an obvious feature a lot of people dont seem to know about

17:54 rhg135: AeroNotix, no llasram's

17:54 clojurebot: I don't understand.

17:54 AeroNotix: llasram's warrants further investigation

17:54 rhg135: clojurebot, i?

17:54 clojurebot: i is disapoint

17:54 AeroNotix: (for me at least)

17:55 rhg135: i mean it's simple just weird

17:55 unexpected at least

17:55 AeroNotix: Quite

17:56 can someone explain that?

17:57 rhg135: symbols are callable

17:59 AeroNotix: ohh ok

18:00 because I tried in common lisp and obviously it didn't work

18:00 rhg135: hmm ##('foo 'bar)

18:00 lazybot: ⇒ nil

18:00 llasram: AeroNotix: Weird -- I just tried it in ANS Forth and it didn't work either ;-)

18:00 rhg135: ##(source symbol)

18:00 lazybot: java.lang.RuntimeException: Unable to resolve symbol: source in this context

18:01 oskarkv: ,('foo 'whatever :not-found)

18:01 clojurebot: :not-found

18:01 rhg135: ic

18:01 oh

18:01 i understand now

18:02 ,('+ 2 1)

18:02 clojurebot: 1

18:06 AeroNotix: llasram: at least I wasn't being facetious for no reason

18:07 llasram: AeroNotix: That's fair

18:07 No offense intended -- apologies

18:08 AeroNotix: llasram: no worries, internet and all that.

18:18 S11001001: hg log -l3

18:18 hey y'all, I use mercurial

18:18 AeroNotix: S11001001: AND fail at irc

18:18 * AeroNotix is jokes

18:18 S11001001: I type that as instinctively as ls now

18:19 arrdem: ls

18:19 lazybot: boot home lib lost+found mnt opt sbin swap tmp usr

18:19 arrdem: ls boot

18:19 lazybot: bin dev lost+found opt sbin swap usr

18:19 arrdem: wut

18:19 cd /boot/dev

18:19 ls

18:19 lazybot: data etc lib lost+found media mnt opt root sbin selinux src srv tmp var

18:19 arrdem: (inc lazybot)

18:19 lazybot: ⇒ 20

18:19 arrdem: cat /etc/fstab

18:19 dang

18:20 S11001001: AeroNotix: wrong-terminal input is the traditional way to tell what IRC client someone uses. Like you can tell an ERC user because they'll say "xb" at least once

18:20 :)

18:20 xnil: window close

18:21 technomancy: "Computer, send an IRC message to the #clojure channel on freenode."

18:21 cark: i had to try C-x b to remember it's the command i use every 2 seconds .... that is sad

18:21 arrdem: oh. right. the buffer change command. yeah that's long muscle memory...

18:21 AeroNotix: weechat here

18:22 arrdem: C-x o ftw...

18:26 dsrx: ,('* 1 7)

18:26 clojurebot: 7

18:28 brehaut: ,('foobarzen 1 7)

18:28 clojurebot: 7

18:28 noonian: hmm?

18:28 brehaut: it doesnt have to be a symbol that would otherwise resolve, thats just why its potentially confusing

18:28 rhg135: ,('this 'is 'cool)

18:28 clojurebot: cool

18:28 noonian: ,('why?)

18:28 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: Symbol>

18:28 noonian: ('foo 4)

18:29 ,('foo 4)

18:29 clojurebot: nil

18:29 brehaut: .(ifn? 'foo)

18:29 mysamdog: ,('why 'not?)

18:29 clojurebot: nil

18:29 noonian: ,(ifn? 'foo)

18:29 clojurebot: true

18:29 brehaut: thanks

18:29 args are [associtive default] like get

18:29 rhg135: ('ic 1 :nope)

18:29 noonian: ,('foo {'foo 7})

18:29 clojurebot: 7

18:29 rhg135: oh

18:30 dsrx: ,(get 1 5)

18:30 clojurebot: nil

18:30 noonian: ,('foob {'foo 7} "ahh")

18:30 clojurebot: "ahh"

18:30 brehaut: get needs a key too; the symbol is its own key

18:31 noonian: yeah, so symbols work like keywords and it's just strings and aggregate values as keys you've got to watch out for :P

18:31 i want to use symbols as map keys now just because

18:31 dsrx: ,(doc get)

18:31 clojurebot: "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

18:32 brehaut: yoiu also cant use numbers, booleans, regexps etc as keys and expect that trick to work

18:34 rhg135: ,(1 {1 2})

18:34 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

18:35 rhg135: i presume you meant another trick

18:35 ohhhhhhhhhhh

18:35 misread that lol

18:50 mmitchell: Is there a helper/extension lib for clojure.core.test, I want some of the convenience of midje but not the whole thing.

18:52 Or hmm... is anyone using core.logic/core.match in their clojure.core tests?

18:54 TimMc: What sort of trouble can I get into by using non-ASCII characters in function names?

18:55 hyPiRion: mmitchell: I am generally using simple-check these days. Not sure if it fits your use case, but it has been very pleasant for the work I've done

18:55 guns: TimMc: I haven't run into any trouble in my private code

18:55 technomancy: TimMc: as long as they're at the end and the ascii part is unambiguous on its own, fair game =D

18:55 mmitchell: hyPiRion: cool i'll check it out, thanks

18:55 TimMc: technomancy: Nice.

18:55 hyPiRion: TimMc: works fine, but GH renders it as an error =/ https://github.com/hyPiRion/snigilbot/blob/master/src/snigil/players/minimax.clj#L71-L93

18:55 TimMc: I have a function called naïve-foo

18:56 guns: Is there a good way to determine if a class was created by deftype? All I can see is to munge the package name and search for a matching namespace

18:57 deftype essentially does the reverse and it doesn't seem to set any metadata

18:58 Bronsa: guns: deftypes implement clojure.lang.IType

18:59 guns: Bronsa: I see. thank you, that may be good enough

18:59 btw, is tools.analyzer considered stable for library use yet?

19:00 `cbp: Of course emacs is using 800mb of ram with only erc

19:01 Bronsa: guns: days close to a stable release

19:01 rhg135: `cbp, reminds me of the jvm

19:01 guns: Bronsa: awesome! looking forward to it

19:03 rhg135: forget the startup time, dat ram usage

19:03 llasram: `cbp: Eight-hundred Megabytes And Constantly Swapping? -- just keep adding `0`s and the joke never gets old!

19:04 `cbp: :(

19:04 llasram: Huh, my emacs also has 800mb virtual. I really haven't noticed much regarding RAM since switching to a 32GB workstation

19:04 technomancy: do you have a limit on how many lines to keep per channel?

19:04 `cbp: I wish I knew how to upgrade this mbp to 8 gb then silly distnoted and emacs can go up to 2 gb for all i care

19:05 ivan: does virtual matter?

19:05 `cbp: I only had clojure and it had 4k lines

19:05 technomancy: I cap mine at 500

19:06 * rhg135 hugs his 8gb box

19:06 technomancy: I do that more to keep me from wasting time than for ram reasons though

19:06 rhg135: lol

19:11 AeroNotix: technomancy: fwiw, I use the same instance of weechat for months. Rarely steps over a few hundred megabytes.

19:12 devn: i had a weird issue with weechat-curses

19:13 if i closed the window terminal it was running in, it would leak memory

19:14 technomancy: yeah, mine hasn't broke 200mb virtual yet

19:15 TimMc: technomancy: Oh, I guess the JVM is cool with it: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.2.1

19:15 rhg135: what is this madness??? im syncing from github at 90kbps

19:16 * rhg135 feels he's back on dsl

19:16 devn: simplest way to check if something is transient?

19:16 there's no transient? predicate, right?

19:16 rhg135: transient??

19:16 lazybot: rhg135: Definitely not.

19:16 devn: ,transient?

19:16 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: transient? in this context, compiling:(NO_SOURCE_PATH:0:0)>

19:17 rhg135: ,(find-doc "transient")

19:17 clojurebot: -------------------------\nclojure.core/assoc!\n([coll key val] [coll key val & kvs])\n When applied to a transient map, adds mapping of key(s) to\n val(s). When applied to a transient vector, sets the val at index.\n Note - index must be <= (count vector). Returns coll.\n-------------------------\nclojure.core/conj!\n([coll x])\n Adds x to the transient collection, and return coll. The 'addit...

19:17 hyPiRion: devn: (instance? clojure.lang.ITransientCollection my-transient)

19:17 devn: hyPiRion: that's what i was looking for. thanks.

19:21 z_key: ff

19:21 whoas, my bad

19:21 I have a question regarding a problem I came across on 4 clojure

19:22 #19: implement 'last'

19:22 my solution that works in the REPL is:

19:22 (defn lst [coll] (if (empty? (rest coll)) coll (recur (rest coll)))))

19:22 rhg135: (comp first reverse)

19:23 technomancy: rhg135: show, don't tell =P

19:23 rhg135: oops

19:24 z_key: So, my lst func yields (5), or ("A"), with parens. The answers are 5, A. (5) != 5. Can someone enlighten me?

19:25 rhg135: well call first on that

19:25 also empty? isn't very idiomatic

19:26 i've mostly seen seq

19:26 z_key: lopng-time coder, first-time clojurer.

19:26 technomancy: eh

19:26 I support the use of empty?

19:26 rhg135: or in this case next would work

19:26 z_key: yes...

19:27 what is the difference between 5 and (5)? List context versus "primitive"?

19:27 technomancy: why use jargon when there's a perfectly fine English word

19:27 rhg135: technomancy, cool, but i don't see how it's better than seq

19:27 `cbp: z_key: the parens indicate a list

19:28 rhg135: ah

19:28 `cbp: z_key: 5 is an item inside that list

19:28 z_key: shouldn't '(5) = 5, then?

19:28 rhg135: znope

19:28 erm

19:28 z_key,

19:28 `cbp: z_key: why would that be true?

19:29 z_key: you are comparing a list to a number there

19:29 z_key: still gettin' my head around the basics

19:29 rhg135: a list should never equal a number

19:29 z_key: how do I change the list context?

19:29 remove, not change

19:29 `cbp: z_key: You can get the first element of the list with the function `first`

19:29 rhg135: first

19:30 z_key: So my function, recursively destroys the list until there's one (last) element left

19:31 how do I "remove the parens" and make 5=5?

19:32 gfredericks: z_key: so you want the first element in the list?

19:33 z_key: No, but I just understood what `cbp and rgh135 meant. That's how I recast (5) to the "literal context"(?) 5

19:33 technomancy: recast?

19:33 z_key: (= (first (5) 5)

19:33 )

19:34 right?

19:34 wait

19:34 (= (first (5)) 5)

19:34 `cbp: z_key: you are recursing through a linked list until there's only one element left. When there's only one element left you want to pull it out of the list

19:34 noonian: yep

19:34 technomancy: ~tias

19:34 noonian: ,(first (list 5))

19:34 clojurebot: tias is try it and see

19:34 5

19:34 z_key: exactly

19:35 noonian: ,(source last)

19:35 clojurebot: Source not found\n

19:35 noonian: grumple

19:36 rhg135: just return (first coll) instead

19:36 z_key: bam. perfect

19:36 rhg135: you are returning the seq when you want a value

19:37 weel a seq is a value just not THE value lol

19:37 z_key: ;)

19:38 gotta run, i made significant progress with your all's help. thx

19:38 rhg135: np

19:38 z_key: ... it's the small things. =)

19:39 rhg135: it truly is

20:32 scape_: when I run prn from cider-jack-in in emacs, I don't know what buffer if any is getting it. when run from cider connected to an instance of lein repl, I see the result in lein. what can I do to fix this

20:33 coventry: CLJS question: Are there any circumstances in which swap!ing into an om state atom would not trigger a refresh? This is with om 0.1.4.

20:33 scape_: let me rephrase that, if I run cider-jack-in on a file in emacs, if there is a call for prn I never see the result

20:36 technomancy: scape_: something is messing up *out* when prn is run

20:37 scape_: hmm, ok I'll look around, thx

20:37 dsrx: scape_: check *nrepl-server xxxxx* buffer too

20:38 scape_: I only have a cider repl buffer, it's empty unless I manually input things to it

20:55 mysamdog: I have what is probably a really stupid question, but here goes.

20:56 I have a vector of an arbitrary size that contains hashmaps.

20:56 I want to be able to go through the hashmaps and pick out the values that correspond with :TITLE

20:56 Would I just use map?

20:57 Oh

20:57 I think I figured it out

20:58 I would do (map (get vector :TITLE))

20:58 cark: (map :title my-vector)

20:59 * mysamdog facepalms

20:59 mysamdog: Yep, that's it

21:00 I was doing (map vector :title) before and couldn't figure out why it wasn't working

21:00 cark: =)

21:00 dkinzer: ,(doc map)

21:00 clojurebot: "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & ...]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."

21:01 xnil: so that's why :kw can be used as a function

21:01 neat

21:06 darthdeus: hey guys, i have a question about clojure and emacs ... i stumbled upon this tutorial ... http://clojure.jr0cket.co.uk/perfect-environment/3---leiningen-build-tool and it seems to mention swank-clojure, but swank itself recommends using nrepl ... and i also found cider, which seems to be much easier to get working ... what do you guys recommend?

21:07 and is there a better or more up to date guide for clojure & emacs? :)

21:08 technomancy: darthdeus: cider is just the new name for nrepl.el

21:08 darthdeus: oh okay

21:17 this is probably a noob question, but if i'm already "jacked in" and i added something to the dependencies, do i have to kill the buffer running the cider connection, or is there a way to reload it? i cant seem to find it in the readme

21:20 dsrx: darthdeus: you can run M-x cider-restart, which will restart the nrepl process and start it again in that project

21:34 llasram: darthdeus: There's also the `alembic` library which allows you to add dependencies to a running REPL JVM

21:35 scape_: alembic is nice

22:10 frozenlock: Is there a repl in Lighttable? I know I can evaluate code from a file, but I'd like something like a command line environment.

22:11 xnil: i think it's ctrl+space, then type "insta"

22:11 it should show up on the right side

22:19 frozenlock: xnil: the instalrepl thing? I don't think that's what I need. I want to connect to my browser like I would with nrepl.el or inferior-lisp :-/

22:23 cark: frozenlock: i think the idea is that the instarepl is the same thing, only but you have the history directly available in your "file"

22:24 frozenlock: maybe you shoudl try one of the tutorials from dnolen, you'll see it's quite the same thing

22:24 frozenlock: Yup, I tried one.

22:24 cark: oh ok

22:24 frozenlock: But there's some difference. For example, if I have a list of 10 things, in a repl I'm able to print them all.

22:25 In LT, it will truncate after 2-3 items

22:25 cark: mhh, you may print to the console

22:26 frozenlock: Perhaps I'm doing it wrong... say I have "my-variable", I usually just do ctrl-enter to check it. Is there another way?

22:27 cark: i'm not used to lightable, more of an emacs user personally

22:27 i'll check it out though because i distincly remember there is a console

22:30 frozenlock: you can toggle the console from the ctrl-space menu

22:31 then (print (+ 1 2)) will show your output.... not sure how this interacts with clojurescript though

22:32 frozenlock: It doesn't :-/

22:32 I'll browse the plugins, surely I'm not the only one in need of a repl :-p

22:33 cark: i think you need to start a clojurescript repl then connect to a browser window, then use js/console.log

22:33 or set *print-fn* and be done with it =)

22:35 frozenlock: Nasty :-p

22:37 cark: i have a crazy setup where i save my file -> it compiles -> my node-webkit reloads automatically the page -> it prints whatever i tell it to print in the console... that introduces a delay of maybe half a second, but i have my poor man's instarepl in emacs that way

22:38 and no need to fiddle with a web server, just do pure clojurescript developement

22:38 this also bypasses the security restrictions when navigating to a file instead of an url

22:47 devn: frozenlock: try clicking the truncated output thing

22:47 it should expand to the full output

22:47 frozenlock: devn: It does, but I don't want to take the mouse :-p

22:47 devn: haha, well you didn't say that!

22:48 frozenlock: I want my cozy emacs environment, but in LT :-)

22:48 devn: frozenlock: see if you can find what sets the print-length

22:48 then, you know, just set it

22:48 cark: i tried it, but really couldn't make the paredit plugin work like i want

22:48 devn: that's every paredit i've used outside of emacs

22:49 cark: =(

22:49 that's the one thing that would make me really try to switch

22:49 devn: tpope has been making the vim world a better place by fixing up paredit for vim

22:50 frozenlock: And now I need ielm in LT!

22:50 cark: ielm ?

22:50 frozenlock: m-x ielm

22:50 devn: idk, i use light table for some development, mostly when im prototyping

22:50 then i write it foreal in emacs

22:51 like, working on a macro in light table is pretty cool

22:51 you can see it as it takes shape without the extra eval! eval! eval! macroexpand-1! macroexpand macroexpand-all eval! write! eval! and so on

22:51 in lighttable you just edit, and watch

22:51 frozenlock: Oh, that's neat.

22:52 cark: ah sounds nice

22:52 devn: (defmacro foo ...) (foo ...)

22:52 * xuser is still to lazy to switch to emacs/evil

22:52 devn: then as you change foo, you see the call to foo change

22:52 cark: tho i on't write much macros, and when i do they're thin wrappers around functions

22:52 devn: speaking of macros, i made something really stupid last night, just so i'd have dibs on the macro name

22:53 https://github.com/devn/defjam

22:53 Note that it's not functional, is completely stupid, and has no real purpose at the moment.

22:54 But I was thinking that it'd be fun to play madlibs with code, and kind of play with different names, to see how it all reads

22:54 bbloom: devn: does it define new types of jam? i like rasberry

22:54 devn: bbloom: that'll be the first feature i write with it

22:55 (defjam raspberry [toasts] (apply :raspberry-jam [:wheat :white]))

22:57 (defjam raspberry [toasts] (apply :raspberry-jam (generate/toast 5 :burn-factor 1/2)))

22:57 that's a bit better

22:57 (partition-all 2 buttered-toast)

22:58 (with butter-knife (partition-all 2 buttered-toast))

22:58 fun times.

22:58 bbloom: (inc devn)

22:58 lazybot: ⇒ 13

23:01 devn: bbloom: it's fun to write fake stuff like that

23:01 (defjam raspberry [toasts] (apply :raspberry-jam (into toaster-oven (generate/bread 5 :type :wheat :burn-factor 1/2))))

23:02 dsrx: devn: still waiting for defleppard macro

23:02 devn: omg yes!

23:02 bbloom: dsrx: we've already got one-arm-ifs, that's close right?

23:02 dsrx: haha

23:02 devn: dsrx: defjux is another one

23:02 http://en.wikipedia.org/wiki/Definitive_Jux

23:13 cark: ohhh the var function does not exist in clojurescript

23:15 i guess today i'll have to write macros after all...

23:17 allenj12: can somone explain why (reduce *' (range 1 (inc n)))) but not (reduce * (range 1 (inc n)))) no quote vs quote

23:17 for finding the factorial

23:17 dsrx: cark: var function?

23:18 cark: ,(var 'hello)

23:18 clojurebot: #<CompilerException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:0:0)>

23:18 cark: hum

23:19 ,(var +)

23:19 clojurebot: #'clojure.core/+

23:20 cark: i guess it's a macro or special form

23:21 ,(reduce * (range 1 (inc 4)))

23:21 clojurebot: 24

23:21 cark: there is no quote

23:21 allenj12: it didnt work for me though with bigger numbers

23:21 i got stack overflow

23:22 cark: ,(reduce * (range 1 100))

23:22 clojurebot: #<ArithmeticException java.lang.ArithmeticException: integer overflow>

23:23 allenj12: ,(reduce *' (range 1 100))

23:23 clojurebot: 933262154439441526816992388562667004907159682643816214685929638952175999932299156089414639761565182862536979208272237582511852109168640000000000000000000000N

23:23 allenj12: clark; weird isnt it

23:23 cark: oh i know

23:23 that's not stack overflow

23:24 but integer overflow

23:24 *' works with bigints too

23:24 that's not syntax, *' is the function name

23:25 allenj12: clark: o yes sorry i misspoke i ment integer. interesting i couldnt find it on the clojure docs or anything

23:25 cark: http://clojuredocs.org/clojure_core/clojure.core/*'

23:26 too bad clojuredocs isn't maintained anymore ><

23:26 or are there some news on that front ?

23:26 allenj12: clark: they arent? lol

23:26 SegFaultAX: Reddit writes the best blog posts.

23:26 allenj12: No, that's why it hasn't been updated since 1.3

23:27 cark: the real docs are, but not the clojuredocs web site

23:27 allenj12: SegFaultAX: interesting that does stink though

23:28 cark: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/*'

23:28 that's the official thing

23:30 allenj12: clark: how have i not seen this yet! thank you

Logging service provided by n01se.net