#clojure logs

2014-01-28

00:00tutysaradeadghost: right, we have lot of things packed together, but looks interesting
00:01eggheadi've been enjoying liberator for web stuff in clj
00:01deadghostegghead, it's refreshing how these libs fit together
00:02deadghostas opposed to monolithic djagno/rails
00:02tutysaradeadghost: *we -> they
00:02deadghostand not reinventing the wheel every five minutes like nodejs
00:04tutysaraegghead: are you the same person who is famous for Angularjs videos
00:04eggheadnope
00:04deadghosthttps://egghead.io/
00:04deadghosthah
00:05tutysaraegghead: sorry :), are you use any tempting engine with liberator or doing a SP
00:05tutysara*SPA
00:05eggheadspa
00:06eggheadom
00:08tutysarai 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
00:09eggheadtutysara: I can recommend laser
00:09tutysaraegghead: okie, let me take a look
00:09eggheadit does a great job of separating the raw html for your template transformations
00:12deadghostRaynes, would you recommend your laser lib over enlive?
00:12eggheadloooooool
00:12RaynesNo.
00:14RaynesIt'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.
00:14deadghostsee that's why I love #clojure
00:14deadghostlib authors are right here
00:14deadghostand they'll tell your their code sucks and you shouldn't use it
00:14RaynesWell, I didn't say my code sucked.
00:14Raynes:p
00:14eggheadlol don't let Raynes dissuade you, use laser!
00:15RaynesJust some changed introduced a few versions ago made it significantly slower than it was originally.
00:15RaynesAnd I haven't had time to look into/fix it.
00:15Rayneschanges*
00:20tutysaraI will wait for the release of deadghost 's enlive framework then ;)
00:26deadghostRaynes, I'm reading my blog
00:26deadghost*your
00:26deadghostmy sister is thinking about homeschooling
00:26deadghostI haven't met any homeschooled people as far as I'm aware
00:27tbaldridgedeadghost: boo!
00:27deadghostI just hear stories of fundies indoctrinating their kids
00:28deadghosttbaldridge, you come from homeschool land?
00:28tbaldridgeIndeed
00:28deadghostdid you come out weird
00:28tbaldridgevery much so :-P
00:29deadghostI get the impression homeschooled kids come out weird
00:30technomancywe 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
00:30technomancyit was the most in-depth technical presentation anyone's given at the group; pretty amazing
00:30tbaldridgeto 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.
00:31technomancynot really what you'd call typical I guess
00:31tbaldridgeIt'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.
00:32deadghosttbaldridge, how did your parents handle schooling
00:32technomancythere 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
00:36deadghosthah, now I wonder how many skilled clojurians started programming as 12 and are younger than me
00:36deadghost*at
00:36deadghostno one knows you're 12 online
00:36technomancysitting in a classroom is actually a pretty great way to kill anyone's interest in learning
00:37deadghosttis true
00:37tutysaraRaynes: do we have an example of using lib-noir access-rules used with form login
00:37deadghostI'm not sure how homeschooling works
00:37deadghostdo they bring in teachers or something
00:37technomancyyou 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
00:37tutysaratechnomancy: :) :)
00:37tbaldridgedeadghost: nah, for the most part anyone who has learned something can teach it.
00:38deadghostso tbaldridge did your parents do most of the teaching or have random people show up?
00:38tbaldridgewhen 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"
00:38deadghosthahahaha
00:38tutysaratechnomancy: soo true for many classes during my college
00:38technomancydeadghost: 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.
00:38deadghostlife skills that translate to programming 100%
00:40technomancythe 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.
00:40deadghostman technomancy I think I was so much more focused in middleschool and below
00:40deadghostget told to read a science book and read and remember every detail
00:42deadghostso technomancy would you homeschool
00:42deadghostsounds like you're going to or considering it
00:49technomancydeadghost: yeah, already doing it some
00:49technomancyhttp://technomancy.us/167
00:54Raynesdeadghost: I champion homeschooling mostly because of how much free time it can give you.
00:54quizdrisn't there a repl command that searches through the docs of all functions for the string you've entered?
00:54Raynesfind-doc
00:55quizdrthat's the one thanks
00:56Raynesdeadghost: 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.
00:56RaynesI picked up rollerblading. *shrug*
00:57deadghostso
00:57deadghostare you still into rollerblading?
00:58RaynesNope.
00:58deadghostwhat happened to your childhood dream of becoming a rollerblade champion?
01:00RaynesMy childhood dream was to be a rockstar.
01:00deadghostRIP dreams
01:00RaynesActually, a country artist followed by a rockstar.
01:00RaynesYes, there was a point in my life where I liked country music.
01:01RaynesIt's hard not to when it's literally all you hear growing up.
01:01Raynesliterally all the music you hear*
01:01deadghostmakes me think of the times I sold stuff at fleamarkets
01:01deadghostmexican music all day
01:01deadghostand every song sounds the same
01:02quizdrRaynes i grew up in Oklahoma so I know what you are talking about. what part of the country are you referring to?
01:02RaynesAlabama
01:02quizdrah my sis lives there
01:04tutysarayogthos: Is there an example project of using lib-noir access rules
01:23sobelMy childhood dream was to not hate programming when I began to be a tool of trade
01:23sobeldone
02:14TEttingerso... 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]]).
02:16TEttingerMostly, I just want a bit better lib support for nested data, like an element-wise map that descends recursively.
02:29machridernoob 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)
02:30machriderit's a pretty straightforward (ns myproj.ui) declaration that it seems to be choking on
02:31machridernot sure where to start trying to understand this error
02:32joshuafcole_machrider: Can you pastebin the new file in its entirety?
02:33quizdrmachrider you may be calling a sequence function on something that is not a sequence
02:34machriderjoshuafcole_: http://pastie.org/private/ln0jztpcxjckeowmgaokqhttp://pastie.org/private/ln0jztpcxjckeowmgaokq
02:34machrideri've been commenting things out trying to narrow it down
02:34machridersorry, link: http://pastie.org/private/ln0jztpcxjckeowmgaokq
02:35machrider(attempting to learn clojure by writing a tetris clone)
02:35quizdr,(seq 5
02:35clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
02:35quizdr,(seq 5)
02:35clojurebot#<ExceptionInfo clojure.lang.ExceptionInfo: Don't know how to create ISeq from: java.lang.Long {:instance 5}>
02:35quizdryou see your error is similar
02:35joshuafcole_And can you also put up the stack trace?
02:36machriderquizdr: do you see the error in my code?
02:36quizdrmost of the code in that paste is commented-out?
02:37machridertrace: http://pastie.org/private/b4waclf2xzewfkadkcdr8g
02:37joshuafcole_I can see a couple problems
02:38machriderthe core file pulls in UI with: (:use [tetris.ui])
02:39nooniani think the :name key of gen-class is supposed to be a string and thats where the error is coming from
02:39joshuafcole_actually scratch that, the parens looks unbalanced but the font on pastie was just a bit hard to read
02:40noonianhmm, maybe not
02:40joshuafcole_interestingly, it's working just fine in LT
02:40noonianthen i got to the second example on clojure docs :P
02:40joshuafcole_when I run your code
02:40machridermaybe it's a problem in my core.clj?
02:40joshuafcole_Seems plausible enough
02:42machriderwhat's the proper way to refer to that MainScreen class from the core namespace?
02:42machriderwhether :use or otherwise..
02:44nooniani think you're supposed to namespace it like tetris.ui.MainScreen, then import it like a normal java class
02:45noonianhttp://clojuredocs.org/clojure_core/clojure.core/gen-class
02:58machriderok, it was the :implements line that broke it..
02:58machriderwithout it, compiles fine
03:02machriderbecause :implements expects a sequence...
03:02machriderfixed
03:10TEttingerany core.matrix users here? what type of tasks do you use it for, I wonder?
03:14llasramMatrix math mostly
03:14llasram:-D
03:16llasramWhy do you ask?
03:26xificurCI 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?
03:26TEttingerxificurC, it still JITs, it just reduces startup time
03:26llasramxificurC: The JVM JIT compiler compiles JVM bytecode, which is what you get when you AOT Clojure
03:26clojurebot'Sea, mhuise.
03:26llasramWow
03:27llasramclojurebot: The JVM JIT compiler compiles JVM bytecode, which?
03:27clojurebotTitim gan éirí ort.
03:27llasramwhew
03:27llasramclojurebot: which?
03:27clojurebotI don't understand.
03:27llasramOk, good. Although who knows what fact you just learned.
03:27TEttingerhaha
03:27xificurCTEttinger, llasram, ok thanks
03:28TEttingeroh 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.
03:29llasramTEttinger: 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
03:29xificurCthere was another thing on my mind - what would be the benefits of clojure targeting llvm?
03:29TEttingerxificurC, easier calling of C for one
03:29llasramNone of the existing implementations seem to have sparse matrix representations, alas
03:30ddellacostaxificurC: faster start up time I would imagine, in addition
03:30TEttingerllasram: ? there are some
03:30noidi&n
03:30lazybotjava.lang.RuntimeException: Unable to resolve symbol: n in this context
03:30llasramTEttinger: Citation?
03:30xificurCand it would be os-agnostic, right?
03:30xificurCnot like the jvm isnt
03:30xificurCbut if I understand correctly llvm-compiled code would run faster than what runs on the jvm right now
03:31TEttingerhttps://github.com/mikera/core.matrix/blob/3e0028062f85789f64a8b5b7df821f54865f7e50/src/main/clojure/clojure/core/matrix/implementations.clj#L20
03:31TEttingerxificurC, unclear until someone does it. hotspot's a very good JIT
03:32TEttingerbut it does startup slowly
03:32llasramTEttinger: Oh. Yeah, using a persistent map with reference instances for each key and value does not count :-)
03:32xificurCTEttinger: so hotspot's speed is comparable to, i dont know, compiled C?
03:32TEttingerhaha fair enough
03:33TEttingerxificurC, 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
03:34TEttingera big issue IMO with the JVM is needing to box... everything, almost, to make sense with generics
03:34xificurCTEttinger: interesting, i always thought java is very slow, guess its not true anymore
03:34TEttingerxificurC, it is slow to start up, less so with tiered compilation
03:35TEttingerwhat 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
03:35xificurCwell 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 :)
03:35TEttingernot exactly.
03:36TEttingerJIT can do different opts, but they are all slower to start
03:36TEttingertake a look at luajit, it has an amazing JIT and has really very little type info in the language
03:37TEttingerjava 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
03:38xificurCcant the startup be sped up or started ahead?
03:38TEttingerso in clojure, if you call "reduce" 2000 times, or other numbers on different hotspot implementations, hotspot kicks in and compiles it to machine code
03:39TEttingerabsolutely. tiered compilation in Java 7's VM has good startup and hotspot performance
03:40xificurCI understand a tiny bit more again, thanks
03:41TEttingerstill, 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
03:41TEttingersolid state drives speed up startup for everything, that's included
03:41xificurCso you're saying everything has its use-case, llvm wont die because of increasingly better jits
03:41TEttingeroh llvm is doing great. rust is targeting it now I think
03:42TEttingerit's also home to clang, and clang is beloved by apple (it's the compiler in new XCode versions IIRC)
03:42xificurCah, theres so much to learn nowadays
03:42xificurCand every day theres a new language hype
03:42TEttingerif you want, I have some JVM performance links open somewhere
03:42xificurCthis month i see julia everywhere
03:43xificurCthats why i asked about llvm too i guess, its claiming to have close to C performance
03:43xificurCwhile staying dynamic
03:44xificurCTEttinger: sure why not, maybe I'll understand something :)
03:45TEttingerhttp://www.javacodegeeks.com/2011/07/jvm-options-client-vs-server.html this covers some
03:46TEttingerhttp://www.javaworld.com/article/2078623/core-java/jvm-performance-optimization--part-1--a-jvm-technology-primer.html?page=1 may be better
03:47TEttingeryeah the second one is a good intro, but it seems to get pretty in-depth
03:48xificurCi'll check the second one for sure, once I find time, now work is calling
03:48TEttingerLLVM has close to C performance when it's C that's being run on it, for sure.
03:48TEttingerok, have a good one
03:49xificurCTEttinger: and julia is c?
03:49TEttingerI think Julia is another language?
03:51TEttingeryeah, Julia looks great for performance. seems to have a very different focus from clojure from how I see it so far
03:52bacqhi
03:52TEttingerhey bacq
03:57djcoinHi 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 ?
03:59djcoin(+ ~20 java -client processes each taking 2.3 mo ? - not such a big deal maybe but like it is normal ? Why so many processes ?!)
04:00TEttingerdjcoin, I wonder if it's not closing them
04:04fredyrjulia is llvm based jit iirc
04:05TEttingeryeah
04:06fredyrone of the biggest issues w/ targeting llvm for clojure is to get a gc thats comparable w/ the jvm for concurrency stuff
04:07fredyri would think at least
04:08xificurCTEttinger: can you explain the different focus?
04:10TEttingerxificurC, 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
04:11katoxdjcoin: I run the latest version of cljs and cljsbbuild and I see nothing like 15+ java processes
04:12logic_proghttps://github.com/clojure/core.typed <-- is there a guide somewhere here for me to learn core.typed ?
04:12arcatanlogic_prog: maybe this one --> https://github.com/clojure/core.typed/wiki/User-Guide <--
04:13logic_prog(inc arcatan)
04:13lazybot⇒ 1
04:13katoxdjcoin: actually a single java -client process (while having cljsbuild on auto)
04:13logic_progwait, isn't atan = arctan, thus arcatan = tan ?
04:13djcoinkatox: hm, what have i done then :< THanks katox
04:14katoxdjcoin: sounds like something is spawning and not closing processes, hard to say. are you uptodate with lein and cljsbuild and cljs?
04:16djcoinkatox: 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
04:17djcoinSame goes for LightTAble
04:17katoxweird
04:17katoxI can't actually run light table since 0.6 update, so I can't check
04:28elsenHas anyone read the "Web dev with clojure" from the pragmatic bookshelf?
04:29xificurCTEttinger: thanks
04:29TEttingerno prob
04:55deadghostelsen, currently reading it
05:03elsenNice, from what you already read, would you recommend it?
05:03elsenI'd like to get into clojure dev and web dev seem's like the best way to start
05:04elsen(I'd rather do data crunching with it, but nothing comes close to ipython notebook right now :(
05:05deadghostelsen, it's a pretty light read and is filling in a lot of gaps for me
05:05deadghostin fact I'd say light read makes it a plus
05:05deadghost226 pages
05:05deadghostand covers everything to get writing
05:09elsendoes it cover testing and databases orm?
05:09elsenthat's the part I'm missing most in online tutorials :x
05:10deadghostwell it covers databases
05:10deadghostas for orm I know it mentions korma but I haven't seen it used yet
05:11deadghostelsen, looking at table of contents it has tests
05:11elsenok, I'll give it a try then, thanks for the info!
05:12fredyrtheres a unit test section according to the toc as well
05:12deadghostelsen, it covers korma orm but it's only 3 pages
05:12fredyrbut doesn't seem to be a lot of focus on tho
05:12deadghostat the end of the book
05:13deadghostyeah just 4 pages on unit testing
05:13elsenyea that's.... light
05:13deadghostthen again I sorta like the lightness
05:13deadghostread it, try it
05:13deadghosthttp://www.clojurebook.com/
05:13deadghost^that thing though
05:13deadghostthat thing is a dense monster
05:14d11wtqI'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?
05:14elsenYea, been there
05:14deadghostelsen, how did that go over
05:15elsenbadly, I've read the kindle version, layout of examples, tables, etc was messed up
05:15DerGuteMoritzd11wtq: why TDD that, isn't there a spec for the protocol?
05:15d11wtqDerGuteMoritz: Well, I'm not talking raw to the protocol, I'm using Carmine.
05:16elsendeadghost: but that's a nice reference later
05:16d11wtqDerGuteMoritz: I didn't fancy re-inveting the wheel there.
05:16DerGuteMoritzd11wtq: ah, just noticed I misread that as you wanting to implement a redis client
05:16DerGuteMoritzalrighty then!
05:16d11wtqDerGuteMoritz: Nah, just using Redis as a storage backend
05:16llasramd11wtq: Stub the functions. Using clojure.test you can use `with-redefs`, or if using midje it has explicit support for that sort of thing
05:16deadghost"The perfect second Clojure book: Clojure Programming goes beyond the language basics and shows how to apply Clojure to a variety of practical tasks. "
05:16deadghostthe thing is I'm not sure what the first book is supposed to be
05:16deadghostI picked up clojure from common lisp
05:17elsendeadghost: joy of clojure?
05:17d11wtqllasram: Thanks! I didn't know about with-redefs, that sounds useful!
05:17deadghostis it
05:17deadghost?
05:17d11wtqNot using midje. Tried it months ago. Found it hacky and too magic :)
05:17llasramd11wtq: I feel similarly, but is designed to fit more of a TDD workflow
05:18fredyrseems to me all the clojure books are good second books :)
05:19d11wtqllasram: 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
05:19d11wtqIt gets a bit deeply nested though, especially with the surrounding lets.
05:20deadghostto be fair fredyr I don't know if I've ever met a solid, you should definitely start on this beginner's book
05:21deadghostcommon lisp: a gentle guide to symbolic computation is up there though
05:21fredyrdeadghost: yeah i guess you're right
05:21deadghostk&r is goodish
05:21fredyrotoh i usually like to dive in even though its a bit too much the first read
05:22deadghostsicp didn't click with me when I attempted it
05:23deadghostlearn x the hard way have been too shallow when I ran through them
05:23elsendeadghost: practical common lisp is an awesome first contact with common lisp
05:24deadghosttried it, I have gentle introduction
05:24deadghost*favor
05:24elsengood to know
05:24deadghostPCL might be fine for people a bit more experienced
05:32katoxd11wtq: https://github.com/amitrathore/conjure is not bad either, a tiny bit more fancy version of with-redefs
05:33escherizehas anyone had a job interview in clj?
05:33llasramMost of my job interviews are conducted in Engglish
05:33llasramEnglish even
05:35escherizedo you typically write english when asked programming problems?
05:35llasramSorry, bad joke :-)
05:35escherizeme too ^^;
05:35escherizei had an interview today
05:35llasramI've never interviewed for Clojure, but have conducted interviews for Clojure positions on my team
05:35escherizeoh. what kind of procedure did you use?
05:35deadghostdo you fizzbuzz them
05:36escherizefizzbuzz lol
05:36llasramHonestly 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
05:37escherizemy friend thinks one should devite incredible energy to interviewing
05:37llasramFor Clojure I usually just see how deeply they know the language, core abstractions, mapping to JVM constructs, etc
05:37escherizehe means: it literally affects the quality of the interviewer's life in a very meaningful way
05:38escherizedevote*
05:39llasramThe one conducting the interview or being interviewed?
05:39escherizethe interviewer, afaik
05:39escherizethe one asking questions, i mean.
05:40llasramOk, yeah, then I agree. It's important to make sure your org has only the people you want
05:40escherizefizzbuzz is rather awk in clojure.
05:41llasram? with core.match it's like 2 lines
05:41escherizehttps://github.com/clojure/core.match
05:41llasramOk, 3 unless your formatting is insane, but you know what I mean
05:42llasramOh, forgot it was the example in the README :-)
05:42llasramHeh
05:42deadghosthah that's cute
05:42llasramOk, so a few more than 3 :-)
05:44deadghostqtiest fizzbuzz
05:45escherizeI still think it's kind of awkward though
05:46escherizeoh i rather like this one:
05:46escherize(map vector(range 1 99)(cycle[nil nil"fizz"])(cycle[nil nil nil nil"buzz"]))
05:46escherizesource: http://clojurefun.wordpress.com/2012/09/21/code-golf-in-clojure/
05:47winkinterviewing is fun as long as you don't do 2 per day :P
05:47escherizei was asked a question that i wanted to use clojure on
05:47escherizein the context of a python interview
05:47winkwe actually don't do any coding questions
05:47escherizewhat do you do?
05:48deadghostdoesn't that result in sadness?
05:48winkmostly how they work, what they work on, what they like and don't like
05:48winkso far this was enough to tell how they will fit in
05:49winkwe're not a one-language shop, so wouldn't make sense to test their knowledge anyway
05:49deadghostwork at 1am to 8am, automated irc anime bots, maids
05:50winkI am not totally opposed to coding questions, as long as you let the interviewee do some sensible stuff
05:50winklike: not have em write on a flipboard with a broken feltpen
05:50winkor: don't shout at them for leaving out a semicolon
05:51escherize["top" "stop" "tops" "awk" "pot"] => [["top" "pot"] ["stop" "tops"] ["awk"]]
05:51escherizeI've interviewed a lot but not in clojure until today
05:52dsrxmy 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"
05:52dsrxbecause of the sheer number of people it filtered out
05:52escherizeouch
05:52dsrxI 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
05:53escherizethat reminds me of joel spolsky
05:53escherizehttp://www.joelonsoftware.com/articles/GuerrillaInterviewing3.html
05:54dsrxI never got a single person who used or even hinted at using a reduce :(
05:54deadghostmy first thought was reduce
05:54deadghostthen I had to think about how someone would normally do it
05:55dsrxsome of the answers would have worked but only on lists of numbers > 0
05:55deadghostdoes js even have reduce?
05:55deadghostI don't even know
05:56dsrxer only when the first element was > 0 I guess
05:56dsrxdeadghost: modern browsers have it natively yeah, and typical utility libraries provide it as well
05:56lynxlunai think the y have
05:57deadghostI know there's that one functional js lib
05:57escherizelodash? underscore?
05:57deadghostunderscore
05:57dsrxerrrr no wait
05:57dsrxit was to find the maximum of a list :V
05:57dsrxI should not be chatting while this tired
05:58escherize,(reduce #(if (< %1 %2) %2 %1) [1 2 3 4 5])
05:58clojurebot5
05:58dsrxyeah it was max, and people would typically provide something that didn't work on lists of negative numbers.
05:58escherizedid i do that D:
05:58escherize,(reduce #(if (< %1 %2) %2 %1) [-1 -2 -3 -4 -5])
05:58clojurebot-1
05:58dsrx,(doc reduce)
05:58clojurebot"([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...
05:59dsrxtypical answer was like this https://www.refheap.com/28708
06:00escherizethat looks pretty typical
06:02deadghostoh geez
06:02deadghostactually took my brain a while to process
06:03deadghostI don't think I've used a for loop in at least two months
06:03escherizecan we ever go back to that ?
06:04deadghostdeadghost very simple man
06:05deadghosthe doesn't like keeping track of state, assignment, counts, and all that jazz
06:06escherizei watched simple made easy tonight
06:06escherizei wanted to start learning clojure again
06:09tim_anyone use selmer templating library?
06:13d11wtqtim_: I'm planning on it, just because I don't want to write HTML using Clojure.
06:13d11wtqtim_: Or rather, I don't want to make our front-end devs write Clojure.
06:20tim_ust wondered if anyone knew how to loop n times in selmer? looping over a list is straight forward.
06:21d11wtqtim_: Does {% for i in (range 0 n) %} work?
06:22tim_let me see....
06:23d11wtqtim_: The answer with 117 upvotes here might work too: http://stackoverflow.com/questions/1107737/numeric-for-loop-in-django-templates
06:24d11wtq{% for i in "xxxxxx" %} to loop 6 times.
06:24d11wtqI prefer a range though. It's clearer.
06:25elsenfor i in "123456" ? :D
06:26d11wtqelsen: Works nicely until you go >= 10 :P
06:26elsenyou can get to 16 with hexa :D
06:27tim_Hmmm, i've tried the range and string methods but no luck.
06:27d11wtqtim_: The answer by
06:27lynxlunaerm, can u use enlive d11wtq?
06:27d11wtqGuillermo Siliceo Trueba
06:28d11wtqIs also good.
06:28d11wtqBut you need to write a filter.
06:28tim_i've checked syntax as have a for loop working on a list further down the page.
06:28tim_i started with enlive and moved away from it as there are some open bugs regarding disabling the template caching.
06:30deadghostenlive has been eh for me so far
06:30deadghosthasn't been easy for me to figure out how to use it
06:31deadghostand I find myself doing things kind of hacky/uncleanly
06:32lynxlunahmm I used it to create just a simple web apps, so I think experience varies. But definitely will look at the bugs you mentioned
06:32tim_I'll try the filter approach.....
06:33deadghostfor example, it adds head and body tags when getting an html snippet from file
06:33lynxlunaI created simple web apps for motivation to lean Clojure, my background was all fully imperative, non-web, C++.
06:33deadghostand needing to extract the body every time
06:34lynxluna*learn
06:34tim_Whats the general verdict regarding clojure for web apps? is it more popular for backend systems.
06:34lynxlunaI'd look at it
06:35lynxlunaI never code web before using language other than Clojure. I touched PHP a decade ago but never liked it.
06:35clgvtim_: with all the effort going into CLJS I guess there is also a lot of interest in running the frontend with Clojure(Script)
06:35lynxlunaMy current experience has been a little bit rocky but amazing
06:36d11wtqclgv: I'd be interested to try ClojureScript in Node.js on the server too.
06:36lynxlunad11wtq: that will be interesting
06:37katoxbumpy ride ;)
06:39clgvd11wtq: well just try. I currently only implemented a server program in clojure which worked pretty well :)
06:41d11wtqclgv: 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.
06:41clgvd11wtq: queueing/scheduling for remote task execution on multiple machines?
06:42d11wtqclgv: Yep.
06:42clgvd11wtq: that's exactly what I built ;)
06:42d11wtqclgv: Hah :)
06:42d11wtqclgv: Do you have a link?
06:42clgvd11wtq: no. there is no public release so far.
06:42d11wtqclgv: I'm just writing this as a learning experience in Cloure, using Redis as a data store.
06:43d11wtqclgv: 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).
06:45clgvd11wtq: what do you use for communication?
06:45clgvd11wtq: I built a message passing communication with clojure maps as messages on top of Java RMI
06:46d11wtqclgv: 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.
06:46d11wtqclgv: Ah the nodes don't talk directly to each other... it's centered around Redis/Redis Cluster.
06:47clgvd11wtq: ah ok
06:48clgvd11wtq: so we are talking about different use cases ^^
06:48d11wtqclgv: I think so :)
06:48clgvd11wtq: my ultimate goal was to have a remote executing `future`
06:49d11wtqclgv: 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.
06:49d11wtqclgv: Well that's pretty much the end result of mine too :P
06:50d11wtqclgv: (schedue/add s [:in "5 minutes"] #(println "bob"))
06:50d11wtqclgv: The (println ..) is captured and put into Redis, then read back out on the other side.
06:51clgvd11wtq: the difficult part is to get the code to the workers without having pre-deploy it^^
06:51d11wtqclgv: Obviously anything listening to the queues needs to know about any functions that are references.
06:51d11wtq*referenced
06:51d11wtqclgv: That's how Sidekiq/Resque work too.
06:52d11wtqclgv: Sounds like yours is gonna be better if you don't need to run the code on the remote side :)
06:53d11wtqMine's more like a weekend project to do the queueing part. The web UI will be the interesting bit for me.
06:58escherizeis there a best practice for accepting something like [f & args]
06:58d11wtqescherize: How do you mean?
06:58escherizesometimes the function i'm writing seems to want to take a list
06:59escherizeif args is a list to begin with, how should i handle that
06:59d11wtqescherize: You can use (apply f args)
06:59d11wtqescherize: If I'm understanding what you're asking correctly.
06:59escherizebut can it accept both?
07:00escherizehttps://www.refheap.com/28715
07:00d11wtqescherize: Well, not without some hacks, since how do you know that the list wasn't just the first argument?
07:01d11wtqescherize: Yeah, so in that snippet it's ambiguous which one would be correct.
07:02escherizei wish less terms were called map
07:02escherizei think i should rename that anyway
07:02escherizei think i'll use apply. thanks for the guidance :]
07:03d11wtqescherize: No worries. apply is for that purpose.
07:04escherizei could also
07:04escherizejust make the signitue [f args] rather than [f & args]
07:04escherizeif i'll always expect a list
07:05d11wtqescherize: 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.
07:05d11wtqOtherwise you may incorrectly convert a vector/list to multiple args.
07:09clgvd11wtq: well it definitely runs the code on the remote side
07:10d11wtqclgv: Nice, that's impressive :)
07:12d11wtqI 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
07:13d11wtqWell. That's not so much programming, as thinking. But you know what I mean.
07:15d11wtqAm 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.
07:16d11wtqThey're generally just logically grouped functions that all operate on the same data structures though.
07:19escherizei need to pull some 5k line file into memory. should i use defonce?
07:35sverihi, when i use (get map "key") is there a way to provide an alternative if the key does not exist?
07:36ior3ksveri: just another another argument to get
07:36ior3kjust add*
07:36d11wtqsveri: (doc get) in the repl.
07:37ior3k,(get {:one 1} :two 2)
07:37clojurebot2
07:37d11wtq,(doc get)
07:37clojurebot"([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."
07:37d11wtq:)
07:49scape_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"})
07:56clgv,({:one 1} :two 2)
07:56clojurebot2
08:02podviaznikovHey, 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
08:03edbondpodviaznikov, looks nice
08:04edbondpodviaznikov, search doesn't works, 404
08:04edbondhttp://www.jarkeeper.com/korma
08:05vijaykiranedbond: edbond: you should use the github way of repo
08:05podviaznikovyou should put full repo name actually: /korma/Korma -> http://www.jarkeeper.com/korma/Korma
08:06edbondok
08:09deadghostanyone have much experience with small businesses?
08:09deadghostthinking of just going door to door asking about their problems
08:09deadghostand see I can solve any of them with programming
08:11clgvpodviaznikov: the input field doesnt even show me what I type...
08:12edbondclgv, PR welcome :)
08:12clgvedbond: huh what?
08:13edbondclgv, it's opensource
08:13clgvedbond: 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 ;)
08:13podviaznikovclgv: thanks. I see that some problem in Firefox. Works in Chrome. Checking firefox now
08:14clgvpodviaznikov: firefox 26 it is indeed
08:14clojurebot'Sea, mhuise.
08:18podviaznikovclgv: fixed and deployed. Thanks for letting me know. That was unexpected
08:20edbondpodviaznikov, nice, padding was not needed indeed :)
08:20clgvpodviaznikov: works now
08:21podviaznikovedbond:yep. But still strange that padding took content's space. Why it worked in Chrome but not in FF
08:23fredyr_pmbauer: ping
08:40deadghosthttp://i.imgur.com/O0tOSlx.png
08:40deadghostI'm thinking just keeping it simple and one page
08:40deadghostshow note on right side with ajax and liberator
08:55maravillasnice project podviaznikov
09:00podviaznikovmaravillas thanks!
09:00katoxweb version of lein ancient, cool ;)
09:00katoxpodviaznikov: good job
09:01podviaznikovkatox, thanks! exactly, it's just fronted for lein-ancient
09:26CookedGryphondoes anybody have an idea how many running go-blocks are workable in core.async?
09:26CookedGryphonassuming 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?
09:27CookedGryphonI'm not looking for exact numbers or benchmarks here, just a general idea of the scale at which I should be creating go blocks
09:27CookedGryphonbetween say, the number of buttons on a web page, through to 10e6 body physics simutations for example
09:38clgvCookedGryphon: I guess the same rules as for ThreadPoolExecutors apply in this case as well
09:39CookedGryphonclgv: not necessarily.
09:39clgvCookedGryphon: it is implemented on top of them for Clojure JVM ;)
09:40CookedGryphonI'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
09:40clgvCookedGryphon: you really want to do a physics simulation with core.async?
09:41CookedGryphonthe 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
09:41CookedGryphonthat was just an example
09:41CookedGryphonof whmere thinking about channels and individual go loops would potentially simplify things
09:42clgvCookedGryphon: for too many very small calculations you certainly introduce a lot of overhead
09:42CookedGryphonyeah, 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
09:42CookedGryphonfrom their experience
09:43CookedGryphonfor example, I've seen a web demo with 20,000 little robots moving about, works great. Is that the upper limit, or what?
09:43tim_@CookedGrypton you would need to tune for your problem based on your hardware, task length and num tasks in parallel
09:44clgvtim_: yeah, that's what I think as weel
09:44CookedGryphontim_: 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
09:45CookedGryphonor whether I'm going to hit a roadblock sooner rather than later
09:45CookedGryphonand it's just a bad idea for problems with thousands of chans
09:49tim_There is no number i can give as a limit. I suggest a quick prototype and it should highlight some more specific potential issues.
09:50shep-werkCookedGryphon: and then write a blog post on your results so us lurkers can benefit too :-)
09:50clgvCookedGryphon: can you describe the problem you want to use that for?
09:52CookedGryphontim_: 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
09:53CookedGryphonclgv: not concisely, it's a simulation problem with lots of interacting parts though. I'm looking into actors as an alternative model
09:56clgvCookedGryphon: humm actors will have similar behaviour I guess
09:57tim_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.
09:57clgvCookedGryphon: I think the tradeoff is using actor/go-block indirection or writing a tight-loop to simulate the particles
09:58clgvas many workers as cpu cores and each has its "particle space" to update
09:59CookedGryphonHmm, 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:00CookedGryphonI'll write up in more detail in a blog post I think
10:00CookedGryphonand do some experiments to see how many go blocks I can usefully get running!
10:00clgvCookedGryphon: that'll probably help discussing it
10:08tim_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:08tim_n is always nil
10:09tim_i can replicate in the repl, but can't see what i've done wrong.
10:10korenaniwas wondering is there a canonical bitcoin client for clojure?
10:11arrdem$google clojure bitcoin client github
10:11lazybot[kenrestivo/pawnshop · GitHub] https://github.com/kenrestivo/pawnshop
10:11ToxicFrogtim_: pretty sure that you can't put constants where variable names are expected in selmer
10:12ToxicFrogtry (render "{{n|times}}" {:n 5})
10:12tim_ah
10:13tim_thanks, that works great.
10:14ToxicFrog(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:15tim_i see. was confused as can see constants used in selmer expressions.
10:15korenanithanks arrdem
10:16ToxicFrogtim_: yeah, expressions and filters/variables use different rules.
10:19sdegutisis there a dogecoin client for clojure?
10:19arrdemsdegutis: I was working on a dogecoin trading facility...
10:20sdegutissweet
10:20arrdemsdegutis: I don't think there's a real "wallet" system but I haven't looked.
10:20arrdem$google clojure dogecoin github
10:20lazybot[sinemetu1 (Sam Garrett) · GitHub] https://github.com/sinemetu1
10:20sdegutisthen it is doomed
10:20arrdemsdegutis: I meant a Clojure implementation/wrapper of one.
10:21arrdemsdegutis: obviously there's a dogecoin wallet.
10:21sdegutisyou say obviously as if its obvious :P
10:21sdegutisall i know about dogecoin is its just such wow, so currency
10:21arrdemlolz. it's a fork of litecoin, which is a 3rd generation fork of bitcoin.
10:22arrdemso all the infrastructure is the same except for the proof of work function and a few other implementation details.
10:22sdegutisah
10:30jph_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:31arrdemjph_: this, and it's SCRYPT based which makes it more resistant to ASIC hardware...
10:31jph_arrdem, correct
10:31arrdemnot that there aren't still ASICs...
10:31arcatanalso dogecoin has better branding
10:31jph_arrdem, and they're actively considering making it harder for asics by (i think) increasing the mem requirements
10:32arrdemjph_: 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:32jph_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:33arrdemI 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:34arrdemthat said, I do like being able to mine effectively with just my gaming box :P
10:34jph_arrdem, i'd suggest they're stuck in an old-world centralization mindset
10:34jph_yes it might be 'better', but is it 'good' ?
10:35jph_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:36arrdemthe 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:36jph_instead they can get 10,000+ for $20 USD
10:36jph_arrdem, asics are the 1% of the cryptocoin world
10:37arrdemjph_: 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:37jph_yeh
10:37arrdems/significant/important/g
10:37jph_but we havent seen any scrypt quite that powerful
10:38jph_im sure they're coming tho
10:39arrdemjph_: 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:39jph_i only spotted one company last time i researched working on scrypt chips
10:40jph_i don tthink the chip manufacturers see the ROI for scrypt asics
10:40jph_im sure there could be small runs tho
10:40jph_for private miners
10:40arrdembit chip makers don't, the issue is the private miners who do small runs.
10:42arrdemnow back to our regularly programmed clojure chatter...
10:42jph_heh
10:43jph_im just fiddling with caribou, getting used to it's routing engine
10:49tim_i'm playing with monger, its working well at the moment...
10:50CookedGryphontim_: until you need to interact with more than one connection iirc
10:50arrdem(inc Cookedgryphon)
10:50lazybot⇒ 2
10:50CookedGryphonthough they may have fixed that in newer versions
10:50tim_more than connection per thread?
10:50arrdemtim_: per system :/
10:50tim_lol
10:51nopromptany good ideas around testing async/stateful code in clojurescript?
10:53CookedGryphontim_: I use congomongo whenever I need to do mongo stuff
10:53CookedGryphonless side effecting, universally setting options like congomongo. I find the syntax nicer too
10:53arrdemCookedGryphon: congomongo does have a connection param everywhere, right?
10:54CookedGryphonright, or a with-connection macro which sets a dynamic var
10:54CookedGryphonfor a given context
10:54arrdemyep yep.
10:54tim_i'm just panic googling the connection limit issue....
10:55CookedGryphonbut 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:01arrdemeh dynamic vars and lazy-seqs...
11:02CookedGryphonarrdem: good point... can't remember if I hit that when I did it
11:02CookedGryphonshouldn't the lazy seq capture the dynamic var's value?
11:03CookedGryphonit's closed in by that point surely
11:03CookedGryphon(not= dynamic mutable)
11:03CookedGryphon?
11:03arrdem`cbp and bitemyapp did a good job with revise in that the connection was always an explicit value.
11:04arrdemCookedGryphon: lazy seqs don't capture anything. dynamic vars are resolved at sequence realization.
11:05CookedGryphonarrdem: fair enough. This was ages ago, i might have passed in the connections explicitly
11:06CookedGryphonthough 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:06CookedGryphongtg, back in a bit;
11:12S11001001CookedGryphon: 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:29dkinzerIs 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:30nopromptdnolen: any good ideas around testing async stuff while awaiting chas' updates to clojurescript.test?
11:38S11001001dkinzer: 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:40S11001001An example of the latter is `cond', or `let'.
11:47dnolennoprompt: I thought chas landed some async support
11:49katoxdnolen: 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:50dnolenkatox: yes, I hope to come up with something better but this will have to do for now
11:50dnolenkatox: it does have the benefit of being a bit more explicit, where React is a bit more magical
11:50katoxdnolen: yes that's true
11:52katoxdnolen: 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:52dnolenkatox: yes I'm aware, I'm kind of lukewarm about it - Om works how it works for now
12:05katoxdnolen: 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:06dnolenkatox: known issue and om.core/join is marked EXPERIMENTAL ;) this actually requires a significant change and is slated for 0.3.1
12:07dnolenkatox: you really should not use om.core/join at this time if you need synchronization or updates
12:08dnolenshould get resolved in a couple of days once I have a satisfactory implementation strategy down
12:11katoxdnolen: 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:11dnolenkatox: yes
12:12dnolenpushing things down opts works but that still suffers from synchronization issues
12:12dnolenand I think I prefer people not use opts for this (but I understand that people will as a workaround for now)
12:13katoxdnolen: yes, it's quite an artificial boundary to pass some things in a cursor and bunch of other stuff in opts
12:14dnolenkatox: working on it :)
12:14srrubyHow do I add clojure.contrib.seq to project.clj ?
12:14katoxdnolen: 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:14llasramsrruby: Anything in clojure.contrib is ancient history
12:15dnolenkatox: channels should pass to children as state in my opinion
12:15dnolen:init-state really
12:17katoxdnolen: ok, right, I have it in the main component state anyway (so I'll just pass that deeper)
12:17srrubyllasram: Thanks.
12:17arrdemsrruby: but it may be useful...
12:29dkinzerS11001001: thx for the clarification. I think that must be it.
12:34sdegutisAnyone in here using a Thinkpad that they can recommend for serious Clojure development?
12:34sdegutis(i.e. serious programming)
12:36arrdemsdegutis: most of them are pretty good... I know technomancy uses a thinkbrick as his dev laptop.
12:37arrdemsdegutis: I'm a mechanical keyboard fiend so I just lug around an ultrabook and a massive USB keyboard :P
12:37sdegutis:)
12:37technomancysdegutis: I can't recommend any thinkpads currently for sale, but if you go on ebay...
12:37arcatani keep hearing that the old ThinkPads were great, but that they've jumped the shark since
12:38technomancyarcatan: everyone says that about the lenovo acquisition, which is pure BS
12:38sdegutistechnomancy: Why can't you recommend current Thinkpads?
12:38arrdemarcatan: my perception is that IBM's thinkpads aren't so hot, but Lenovo still builds good bricks.
12:38technomancysdegutis: sorry, to be more specific I can't recommend the X series
12:38technomancyI don't know anything about the larger ones
12:39sdegutistechnomancy: Oh, I was looking into the T series.
12:39technomancythe current X series are all either low-res screens or no user-serviceable parts bullshit, which offends me deeply
12:39sdegutisI don't agree with the new "thinner/lighter is better" idea.
12:39technomancydinc
12:39technomancythinner is useless
12:39technomancyit just makes it look cool at the expense of actual functionality
12:40sdegutisYup.
12:40technomancyI can strongly recommend the X200 since that was the last one before they went to low-res screens
12:40dsrxafter 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:40sdegutisRelated: anyone interested in a mid-2013 15" rMBP with 16gb memory and 512gb SSD?
12:40dsrx(it survived with a little ding on the front lip)
12:40DerGuteMoritzFWIW, x201(s) also has a high-res screen
12:41DerGuteMoritzat least my x201s is 1440x900
12:41technomancythough 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:41technomancyDerGuteMoritz: aha cool; I guess it was the x220 where it went downhill
12:42DerGuteMoritztechnomancy: yep
12:42technomancyI can't stand the idea of buying something I can't open up to fix myself though
12:42technomancyall the super-light junk seems to be that way
12:42DerGuteMoritzindeed
12:42katoxI'm on T520 and it's quite solid - I hate two things - nvidia drivers and unstable N iwlwifi driver on debian stable
12:43technomancysdegutis: oh yeah, don't get anything that doesn't have an intel graphics chipset
12:43technomancythat's a common noob mistake =)
12:43sdegutisWhy?
12:43clojurebotWhy is why
12:43sdegutisclojurebot: disable that response
12:43clojurebotIt's greek to me.
12:43technomancythey typically either use up a lot more juice or can't suspend properly
12:43sdegutisOoh.
12:43technomancyor don't support rotation, or whatever
12:43katoxtechnomancy: this one can sleep well, but the nvidia-settings is royal PITA
12:44technomancyeven the dinkiest onboard intel chip in my 5-year-old thinkpad can drive a big old 28-inch external display
12:44technomancyclojurebot: forget Why |is| why
12:45clojurebotI forgot that Why is why
12:45sdegutistechnomancy: Thanks :)
12:46technomancyheh, np
12:46katoxtechnomancy: I'll ping you later this year or the next for a debian gear ntb advice ;)
12:47katoxso far it seems it's worse and worse every year
12:47technomancykatox: I'm holding on to my ancient thinkpad for dear life
12:47technomancythe novena design I linked to above looks badass though
12:48sdegutistechnomancy: But you haven't looked into the T series, how do you know it doesn't fit your requirements?
12:49technomancysdegutis: well... I like something I can pick up with two fingers
12:49technomancythin is useless; light is not
12:49technomancyhowever...
12:49technomancysince starting to use a mechanical keyboard I'm beginning to think that ship has sailed
12:50technomancyif 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:50sdegutis:)
12:52katoxthe Tx20 had the last keyboard with the old design, Tx30 and Tx40 have "mac"-like one (far from good imo)
12:52srrubytechnomancy: I love my model m keyboard. Circa 1987
12:53technomancykatox: yeah, after going mechanical I have a hard time caring about that
12:53technomancyespecially since the underlying switch design hasn't actually changed; if it was a flat one like the macbook I would definitely stay away
12:53katoxtechnomancy: it's not just mechanical, the key layout is horrible too
12:54sdegutiskatox: what's wrong with the new mac-like design? (I'm typing on an Apple aluminum full-size keyboard right now btw)
12:54technomancysdegutis: the response is just rubbish; the keys only move a few mm
12:54technomancyit feels like typing on glass
12:54sdegutistechnomancy: oh. But why is that not good?
12:55dsrxyou could always get an old toshiba T1000 or something for a mechanical keyboard :)
12:55arrdemsdegutis: I like more travel on each keypress.
12:55arrdemsdegutis: it's a personal thing.
12:55sdegutisOh.
12:55arrdemsdegutis: I also kinda like feeling when the key engages, and the pressure change leading up thereto.
12:55technomancyI don't like typing on glass
12:56arrdemtechnomancy: one day we will all have 20" reconfigurable touchscreens for keyboards..
12:56technomancyarrdem: hopefully after I retire
12:56dsrxbeautiful http://3.bp.blogspot.com/_YIydOBZLqFs/TRDwa_v0WkI/AAAAAAAAAB8/PPYssOLGvfM/s1600/IMG_7456.JPG
12:56technomancyoooh ctrl in the right place, nice
12:58katoxtechnomancy: that can be easily changed in bios on lenovos tough
12:58TimMctechnomancy: Ever seen one of these? https://en.wikipedia.org/wiki/IBM_ThinkPad_Butterfly_keyboard
12:58dsrxkatox: yeah, but you still have to look at the thing
12:59technomancyTimMc: I've seen that but never tried it for myself
12:59katoxdsrx: I'm looking at the screen not the keyboard anyway
12:59TimMcOne of my housemates has one. He's going to gut the laptop and put a Raspberry Pi in it.
12:59technomancyTimMc: it's a sweet idea though; I wish it had taken off
12:59technomancymaybe it could have postponed the tragedy of 16:9 aspect ratios
12:59dsrxkatox: when you're typing maybe, but when it's sitting on your desk asleep... the caps lock will still offend
13:00llasram16:9 isn't so bad -- you get a normal screen + a thin IRC client on the side
13:01gfredericksis there a derogatory name for clojure yet? Can I suggest "cluggles"?
13:01llasramClojture?
13:01arrdemgfredericks: most people just use "it isn't haskell"...
13:01llasrams,jt,tj,
13:02technomancythere's always Smug Lisp Weenie, but that's more general
13:03llasramKludjure
13:03dkinzerI like Clojture.
13:09alandipertif 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:10dsrxarrdem: lol
13:27ebaxtIs this the correct way to drain a channel in core.async? https://www.refheap.com/28804
13:32mdrogalisbbloom: Insightful tweet chain.
13:33bbloommdrogalis: if only there was some sensible way to read it as a tree or something
13:33mdrogalisbbloom: Yeah, conversation is really a graph sort of thing. Not linear.
13:33mdrogalisBut anywho. Great stuff.
13:35arrdemobligitory "emacs can do that" : https://github.com/ppareit/graphviz-dot-mode
13:35arrdemnow you just need a better twitter client :P
13:36arrdems,need,need to buind,g
13:36technomancyor like... you know, a mail client
13:36technomancytweet->imap bridge
13:36bbloomtechnomancy: get on that
13:36technomancyI'll add it to the seajure project ideas wiki
13:36arrdemI have 10Kdoge for a working implementation :P
13:38bbloomtechnomancy: seriously, if that doesn't already exist somewhere, it's totally a profitable business venture :-)
13:42technomancyyeah, when I hear the word IMAP, the first thing that comes to my mind is $$$ these days
13:43dacchaha
13:43bbloomtechnomancy: you heard the wrong words. the right words were "email" and "twitter" :-P
13:43dacci'd like to bridge both twitter and email into irc, hrm
13:44bbloomdacc: as soon as you add irc, it's negative money :-)
13:44arrdemI just want a meta-messaging client which exposes Twitter, FB and IRC as a single IRC like message stream...
13:45technomancyarrdem: bitlbee actually does twitter
13:45bbloomarrdem: 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:45arrdembbloom: haha... which is why I was thinking it'd make a perfect Emacs major mode :P
13:46bbloomarrdem: godspeed.
13:46arrdembbloom: thanks. I'll need it...
13:47S11001001what are you going to add clojure-elisp, arrdem? :)
13:47arrdemS11001001: who said I was actually going to write elisp...
13:48technomancydo it as an nrepl op; that way everyone can join in the fun
13:48arrdem(inc technomancy)
13:48lazybot⇒ 95
13:48scottjthe best thing about bitlbee+twitter is that it puts the tweets in most recent at bottom.
13:48Bronsaarrdem: I use twitter/gtalk over bitlbee
13:49imancmega 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:50Bronsaarrdem: I'm pretty sure it's possible to have the facebook chat over bitlbee too
13:50arrdemBronsa: you still use gtalk? IRC and Twitter have basically replaced it for me except for the idiots who only use FB...
13:50technomancyI used to use gtalk till they killed the federation
13:52technomancythat sounds like a weird star trek spoiler, but it's not
13:52arrdemtechnomancy: it's a pretty solid FTL spoiler...
13:52insamniacI was trying to think of a Romulan joke
13:53technomancythough... they're still making those movies, so it could still happen
13:55carkwhat are you all using for testing async stuff in clojurescript ? (callbacks or core.async)
13:56carki couldn't find anything
14:15mikerodI 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:21sdegutisOfficially listing my rMBP on craigslist, woo.
14:27dobry-denIt'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:35gfredericks,(defrecord Sparky [a])
14:35clojurebotsandbox.Sparky
14:36gfredericks,(hash (Sparky. 42))
14:36clojurebot-503760783
14:36gfredericks,(.hashCode (Sparky. 42))
14:36clojurebot1013910531
14:36AeroNotix,(what-is-love?)
14:36clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: what-is-love? in this context, compiling:(NO_SOURCE_PATH:0:0)>
14:40dkinzerlol
14:49yediholy shit lighttable is amazing, dunno why i waited this long to try it out
14:50dacci think it's written in clojurescript on top of webkit or something, too
14:50carkdacc: exactly so
14:53daccpretty impressive
15:08dnolenBronsa: ping
15:08Bronsadnolen: pong
15:09dnolenBronsa: how difficult would be it to have a comments preserving mode in tools.reader?
15:11escherizewhat's a quick way to look up a row in a longish csv file?
15:11Bronsadnolen: 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:12seangrovednolen: SF CLJS had a great turnout, and very good talks. Pretty surprised by how well the first meetup turned out
15:12Bronsadnolen: it could be possible to keep them in a separate table indexed by starting line+starting column though
15:12seangrovednolen: Next month is on React/Om
15:12dnolenseangrove: that awesome!
15:12dnolenseangrove: that the meetup went well
15:12seangroveYeah, about ~30 people showed up, two lightning talks, one main talk
15:13seangroveGood Q&A, etc.
15:13dnolenBronsa: interesting
15:14Bronsadnolen: why would you need that?
15:15arrdemBronsa: automated refactoring tools.
15:15Bronsathat's probably a better job for a parser than for a reader
15:16arrdemagreed. The parser could be augmented to store this data, but then the reader would have to be changed to ignore comment groups.
15:17AeroNotixHas anyone got an example of using gen/hash-map in simple-check?
15:19BronsaI'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:19reiddraperAeroNotix: (gen/sample (gen/hash-map :name gen/string-ascii :age gen/s-pos-int))
15:19arrdemthat's exactly what you'd want to do in order to support this..
15:19arrdemtools.parser and tools.reader
15:20Bronsayeah.
15:20arrdemI gotta start somewhere... get a jira opened and I'll start refactoring :P
15:22BronsaIf I recall correctly somebody had a modified version of tools.reader that behaved only as a parser
15:23oskarkvMy 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:24arrdemoskarkv: you can access it as (user/my-fn)
15:24arrdemoskarkv: or (#'user/my-fn)
15:25arrdemBronsa: I expect you'd want to do better than the naive instaparse grammer :P
15:26Bronsaarrdem: let me finish fixing this bug in tools.emitter.jvm and then I'll open a jira
15:26arrdemBronsa: k.
15:26mmitchellI 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:27BronsaI was probably thinking of https://github.com/kovasb/codn
15:27oskarkvarrdem ah, I had to use the original namespace, not user. Thanks.
15:28dobry-denescherize: sequential scan?
15:29aaronj1335so 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:29dobry-denQuestion: 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:38grzmanyone know examples of xhr with om/react out in the wild?
15:40escherizehttps://www.refheap.com/28863
15:40escherizehaving some trouble retrieving lines that match 'word'
15:42grzmescherize: any reason not to use https://github.com/clojure/data.csv and operate over the fields directly?
15:43dobry-denescherize: https://groups.google.com/d/msg/clojure/jGoLKevw1LI/0bmtETp6D1kJ
15:43RaynesUgh, don't use that. Use data.csv or dsantiago's lib.
15:44escherizethanks you guys
15:44dobry-denwhat's wrong with that?
15:45RaynesThere are useful, stable libraries with tests and such that do a very good job at parsing csv files.
15:46RaynesReplacing those with a single function copied from someone else's code is rarely a good choice over solid, stable libraries.
15:49dobry-densure. although i'd encourage escherize to get a line-seq idiom down for quick and dirty stuff
15:49RaynesAgreed.
15:49escherizenoted
15:50escherizethanks :]
15:50RaynesIf you're reading files, you almost certainly want to lazily iterate over lines.
15:50dobry-denclojure 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:50Raynesescherize: The difference being that with line-seq you get a lazy sequence that reads lines from the file as needed.
15:51Raynesescherize: With your version, you're reading the entire file into memory as a string and then splitting it into a collection.
15:51RaynesBoth of the CSV libraries handle the lazy parsing for you.
16:07sdegutistechnomancy: which thinkpad do you have? thinking of just going on ebay and getting a peer-approved model
16:08daccsdegutis: switching away from mac?
16:08technomancysdegutis: I have the X200s. the s signifies low-voltage, which is great IMO; I get 6-7h from a 9-cell battery
16:08sdegutisdacc: seriously considering it. just tried windows 8 and im in love.
16:08technomancysdegutis: but the main thing is just to avoid the low-res screen
16:08technomancyso nothing newer than the X201
16:09technomancyunless you are OK with non-user-serviceable parts, which are an anathema to everything that is decent
16:09technomancy(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:10sdegutistechnomancy: 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:10sdegutistechnomancy: old is good, it means cheaper
16:10technomancysdegutis: you might need to get a new battery, but those arnet' bad
16:10technomancysdegutis: also be sure to check the brightness, not just the resolution
16:10sdegutistechnomancy: on an x200s?
16:11technomancyI wouldn't go under 250 nits
16:11sdegutisoh, i didnt know that could vary by specific models
16:11technomancysdegutis: any model is offered with 3 or 4 different screen options
16:11sdegutisah
16:11technomancyyeah, it's kinda confusing
16:11sdegutisso kinda like Apple's "customize" feature.
16:12escherizethanks for the csv help, i got the lookup down to 8.5 ms!
16:12sdegutislem.
16:12technomancythinkwiki.org is your friend
16:12sdegutisthx
16:12technomancysure
16:14winkwithout reading the backlog: I love my x230s (if you can stand the new chicklet keyboard, I can)
16:14winkqueue technomancy hatin on me :D
16:15gfrederickswithout reading the backlog: what do you guys think about climate change
16:15technomancyyeah, 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:15arrdemgfredericks: the door is that way sir
16:15technomancyif you are usually working out of an office, you probably don't care as much about weight or brightness or internal resolution
16:16deadghostwhy would someone use a laptop at an office
16:16cespareslow 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:16gfredericksso you can carry it to meetings
16:16technomancydeadghost: I don't know; apparently it's a thing
16:16technomancygfredericks: not having a laptop at meetings is pretty great though
16:16llasramgfredericks: Next time you do an open mic night, let us know
16:17hiredmancespare: repeatedly
16:17technomancygfredericks: if global warming is true why is it cold lol
16:18cesparehiredman: thanks
16:19sdegutisarrdem: lol
16:19llasramtechnomancy: We are having our semi-decade-ly snow in Atlanta, and I have heard that joke made too seriously too many times today
16:20technomancyassuming you linked them to http://ifglobalwarmingisrealthenwhyisitcold.blogspot.com/
16:20gfrederickstechnomancy: haha lol scientists are bias
16:21llasramtechnomancy: I will in the future!
16:21gfrederickstechnomancy: that fourth one is from the onion
16:23TimMcI liked that recent XKCD.
16:23dkinzerit's called global climate change... and it's more complicated than that.
16:23sdegutisI miss the old style XKCDs.
16:24carkthat blog is frightening
16:24TimMcdkinzer: (To be clear, I don't think anyone so far in this conversation is a climate change denier.)
16:25arrdemto deny climate change absolutely is to be a fool, to dispute the human involvement is more tennable.
16:25technomancydkinzer: you can tell it's not serious because there's a "lol" on the end =)
16:26dkinzertechnomancy: :)
16:26llasramarrdem: Is that what you're actually working on?
16:26gfrederickstechnomancy: this sentence is serious lol
16:26TimMclol lol
16:26technomancygfredericks: nice try
16:26arrdemlel?
16:27gfredericksaw shucks
16:31cespareHow do I make the repl not print the output value? Apparently 'clojure repl don't print' isn't good enough for google
16:32stuartsierra(do … something … nil)
16:33cesparesure, that works.
16:33technomancycespare: you can start a sub-repl with clojure.main/repl that overrides the print function too
16:33technomancykind of convoluted though
16:34technomancyor just (def _ (...)) would hide it too
16:35cesparehrm (do (expensive-thing) nil) isn't running expensive thing. Nor is (doall ... nil)
16:36carkcespare: hum are you sure about that ?
16:37cesparemore concretely, (doall (take 5000000000 (repeatedly (fn [] 3))) nil) returns instantly.
16:37cesparei must be doing something dumb.
16:38carkdoall with 2 parameters : the first one is n
16:38sdegutis,3
16:38clojurebot3
16:38carkwrap your doall in (do (doall ...) nil)
16:39technomancycespare: no, it's clojure being dumb about undefined inputs
16:39technomancywell, both are at fault I guess
16:39hyPiRioncespare: I guess you'd like to do (dorun (take 5000000000 (repeatedly (fn [] 3)))) instead
16:39cespareoh yeah, doall is different.
16:39cesparedorun, that's better.
16:39cesparethanks hyPiRion
16:40hyPiRionWell, doall retains all in memory, so if you're doing memory profiling, take a note of that
16:42cesparewhat 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:43cespareI was trying to repro by profiling doing various convoluted things with lazy seqs.
17:35daGrevisI'm sorry, but why this doesn't work? http://vpaste.net/wNG9E
17:38oskarkvdaGrevis what is it supposed to do?
17:38daGrevisoskarkv, string/substring?
17:38daGrevischeck if 13 is in 2013
17:39llasramdaGrevis: 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:39oskarkvthe digits are strings, not numbers
17:39brehautdaGrevis: prefer hyphens to underscores in names (minor style point)
17:39oskarkvor, maybe characters
17:41daGrevisthanks all
17:41daGrevisbrehaut, i though hyphens were the correct way
17:41daGrevisohh, i have underscore there. sorry
17:42llasram~guards
17:42clojurebotSEIZE HIM!
17:44daGreviswhy doesn't some work on lists?
17:45hyPiRionit does...?
17:45hyPiRion,(some even? (list 1 2 3))
17:45clojurebottrue
17:45cark,(some odd? '(1 2 3))
17:45clojurebottrue
17:45daGrevisyes, my bad
17:45daGrevis1st arg is a fn
17:45daGrevisand vec somehow acts as fn
17:45brehautvectors are functions of the indexes
17:46oskarkvyes, somehow ;)
17:46ivan,([1 2] 0)
17:46clojurebot1
17:46brehautlikewise maps are functions of their keys
17:46rhg135interfaces
17:46clojurebotNo entiendo
17:46brehaut(doc ifn?)
17:46clojurebot"([x]); Returns true if x implements IFn. Note that many data structures (e.g. sets and maps) implement IFn"
17:46rhg135clojurebot, you disapoint me
17:46clojurebotNo entiendo
17:46oskarkv(map ifn? '() [] {})
17:46oskarkv,(map ifn? '() [] {})
17:46clojurebot()
17:46oskarkvops
17:47oskarkvthat's not right
17:47oskarkv,(map ifn? ['() [] {}])
17:47clojurebot(false true true)
17:47brehautyou zipped them togehter
17:47oskarkvyeah :p
17:47brehautand you missed sets ;)
17:47oskarkvyeah
17:47brehaut(functions of their contents)
17:47oskarkvim failing
17:47daGrevisthis is interesting
17:48brehautdaGrevis: and keywords are functions of maps
17:48brehaut,(:foo {:foo 1})
17:48clojurebot1
17:48brehaut,({:foo 1} :foo)
17:48clojurebot1
17:48hyPiRionand symbols, too
17:48brehautyeah
17:48hyPiRion,('foo {'foo :wat})
17:48clojurebot:wat
17:48oskarkvthat i did not know :P
17:48rhg135ooh
17:48rhg135nor i
17:49hyPiRioneven ##('foo #{'foo}) works, I think
17:49lazybot⇒ foo
17:49brehautyou can also destructure :syms and :strs as well as keys :)
17:49rhg135makes sense tho
17:49rhg135keywords being subsets of symbols
17:49hyPiRionwell, it's a bit confusing that symbols are ifns at times. Or rather, that they don't throw exceptions when used erronously
17:50hyPiRion,('foo 'baz 'bar)
17:50clojurebotbar
17:50rhg135?
17:50brehaut,(let [{:syms [foo] :keys [baz] :strs [bar]} {'foo 1 "bar" 2 :baz 3}] [foo bar baz])
17:50llasram,('+ 1 1)
17:50clojurebot[1 2 3]
17:50clojurebot1
17:50llasram^ that's my favorite :-D
17:50rhg135if you do that i'll find you :P
17:51llasramNever in anger. Just to confuse the kids
17:51rhg135that's almost evil
17:52brehautquickly, to the #swearjure!
17:52rhg135and it is if you don't see the '
17:52arrdembrehaut: .... that is evil. but nice.
17:52brehautarrdem: its mostly for writing macros i think?
17:52oskarkvwhat's the actual definition of the symbol function?
17:52brehaut,(source symbol)
17:52clojurebotSource not found\n
17:52oskarkvi mean, the one that symbols implement
17:53rhg135clojurebot, i is disapoint
17:53clojurebot'Sea, mhuise.
17:53rhg135wut
17:53llasramclojurebot: i?
17:53hyPiRionclojurebot: i?
17:53clojureboti is disapoint
17:53clojureboti is disapoint
17:53llasramniiiiice
17:53hyPiRionzing
17:53llasramclojurebot learned how to zing itself!
17:53AeroNotixnot sure why people are jizzing about brehaut's snippet
17:53ivan,(let [{:syms [foo] :keys [foo] :strs [foo]} {'foo 1 "foo" 2 :foo 3}] [foo foo foo])
17:53clojurebot[1 1 1]
17:53rhg135smart bot
17:54brehautAeroNotix: its just an obvious feature a lot of people dont seem to know about
17:54rhg135AeroNotix, no llasram's
17:54clojurebotI don't understand.
17:54AeroNotixllasram's warrants further investigation
17:54rhg135clojurebot, i?
17:54clojureboti is disapoint
17:54AeroNotix(for me at least)
17:55rhg135i mean it's simple just weird
17:55rhg135unexpected at least
17:55AeroNotixQuite
17:56AeroNotixcan someone explain that?
17:57rhg135symbols are callable
17:59AeroNotixohh ok
18:00AeroNotixbecause I tried in common lisp and obviously it didn't work
18:00rhg135hmm ##('foo 'bar)
18:00lazybot⇒ nil
18:00llasramAeroNotix: Weird -- I just tried it in ANS Forth and it didn't work either ;-)
18:00rhg135##(source symbol)
18:00lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
18:01oskarkv,('foo 'whatever :not-found)
18:01clojurebot:not-found
18:01rhg135ic
18:01rhg135oh
18:01rhg135i understand now
18:02rhg135,('+ 2 1)
18:02clojurebot1
18:06AeroNotixllasram: at least I wasn't being facetious for no reason
18:07llasramAeroNotix: That's fair
18:07llasramNo offense intended -- apologies
18:08AeroNotixllasram: no worries, internet and all that.
18:18S11001001hg log -l3
18:18S11001001hey y'all, I use mercurial
18:18AeroNotixS11001001: AND fail at irc
18:18S11001001I type that as instinctively as ls now
18:19arrdemls
18:19lazybotboot home lib lost+found mnt opt sbin swap tmp usr
18:19arrdemls boot
18:19lazybotbin dev lost+found opt sbin swap usr
18:19arrdemwut
18:19arrdemcd /boot/dev
18:19arrdemls
18:19lazybotdata etc lib lost+found media mnt opt root sbin selinux src srv tmp var
18:19arrdem(inc lazybot)
18:19lazybot⇒ 20
18:19arrdemcat /etc/fstab
18:19arrdemdang
18:20S11001001AeroNotix: 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:20S11001001:)
18:20xnilwindow close
18:21technomancy"Computer, send an IRC message to the #clojure channel on freenode."
18:21carki had to try C-x b to remember it's the command i use every 2 seconds .... that is sad
18:21arrdemoh. right. the buffer change command. yeah that's long muscle memory...
18:21AeroNotixweechat here
18:22arrdemC-x o ftw...
18:26dsrx,('* 1 7)
18:26clojurebot7
18:28brehaut,('foobarzen 1 7)
18:28clojurebot7
18:28noonianhmm?
18:28brehautit doesnt have to be a symbol that would otherwise resolve, thats just why its potentially confusing
18:28rhg135,('this 'is 'cool)
18:28clojurebotcool
18:28noonian,('why?)
18:28clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: Symbol>
18:28noonian('foo 4)
18:29noonian,('foo 4)
18:29clojurebotnil
18:29brehaut.(ifn? 'foo)
18:29mysamdog,('why 'not?)
18:29clojurebotnil
18:29noonian,(ifn? 'foo)
18:29clojurebottrue
18:29brehautthanks
18:29brehautargs are [associtive default] like get
18:29rhg135('ic 1 :nope)
18:29noonian,('foo {'foo 7})
18:29clojurebot7
18:29rhg135oh
18:30dsrx,(get 1 5)
18:30clojurebotnil
18:30noonian,('foob {'foo 7} "ahh")
18:30clojurebot"ahh"
18:30brehautget needs a key too; the symbol is its own key
18:31noonianyeah, so symbols work like keywords and it's just strings and aggregate values as keys you've got to watch out for :P
18:31nooniani want to use symbols as map keys now just because
18:31dsrx,(doc get)
18:31clojurebot"([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."
18:32brehautyoiu also cant use numbers, booleans, regexps etc as keys and expect that trick to work
18:34rhg135,(1 {1 2})
18:34clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
18:35rhg135i presume you meant another trick
18:35rhg135ohhhhhhhhhhh
18:35rhg135misread that lol
18:50mmitchellIs there a helper/extension lib for clojure.core.test, I want some of the convenience of midje but not the whole thing.
18:52mmitchellOr hmm... is anyone using core.logic/core.match in their clojure.core tests?
18:54TimMcWhat sort of trouble can I get into by using non-ASCII characters in function names?
18:55hyPiRionmmitchell: 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:55gunsTimMc: I haven't run into any trouble in my private code
18:55technomancyTimMc: as long as they're at the end and the ascii part is unambiguous on its own, fair game =D
18:55mmitchellhyPiRion: cool i'll check it out, thanks
18:55TimMctechnomancy: Nice.
18:55hyPiRionTimMc: works fine, but GH renders it as an error =/ https://github.com/hyPiRion/snigilbot/blob/master/src/snigil/players/minimax.clj#L71-L93
18:55TimMcI have a function called naïve-foo
18:56gunsIs 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:57gunsdeftype essentially does the reverse and it doesn't seem to set any metadata
18:58Bronsaguns: deftypes implement clojure.lang.IType
18:59gunsBronsa: I see. thank you, that may be good enough
18:59gunsbtw, is tools.analyzer considered stable for library use yet?
19:00`cbpOf course emacs is using 800mb of ram with only erc
19:01Bronsaguns: days close to a stable release
19:01rhg135`cbp, reminds me of the jvm
19:01gunsBronsa: awesome! looking forward to it
19:03rhg135forget the startup time, dat ram usage
19:03llasram`cbp: Eight-hundred Megabytes And Constantly Swapping? -- just keep adding `0`s and the joke never gets old!
19:04`cbp:(
19:04llasramHuh, my emacs also has 800mb virtual. I really haven't noticed much regarding RAM since switching to a 32GB workstation
19:04technomancydo you have a limit on how many lines to keep per channel?
19:04`cbpI 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:05ivandoes virtual matter?
19:05`cbpI only had clojure and it had 4k lines
19:05technomancyI cap mine at 500
19:06technomancyI do that more to keep me from wasting time than for ram reasons though
19:06rhg135lol
19:11AeroNotixtechnomancy: fwiw, I use the same instance of weechat for months. Rarely steps over a few hundred megabytes.
19:12devni had a weird issue with weechat-curses
19:13devnif i closed the window terminal it was running in, it would leak memory
19:14technomancyyeah, mine hasn't broke 200mb virtual yet
19:15TimMctechnomancy: 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:15rhg135what is this madness??? im syncing from github at 90kbps
19:16devnsimplest way to check if something is transient?
19:16devnthere's no transient? predicate, right?
19:16rhg135transient??
19:16lazybotrhg135: Definitely not.
19:16devn,transient?
19:16clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: transient? in this context, compiling:(NO_SOURCE_PATH:0:0)>
19:17rhg135,(find-doc "transient")
19:17clojurebot-------------------------\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:17hyPiRiondevn: (instance? clojure.lang.ITransientCollection my-transient)
19:17devnhyPiRion: that's what i was looking for. thanks.
19:21z_keyff
19:21z_keywhoas, my bad
19:21z_keyI have a question regarding a problem I came across on 4 clojure
19:22z_key#19: implement 'last'
19:22z_keymy solution that works in the REPL is:
19:22z_key(defn lst [coll] (if (empty? (rest coll)) coll (recur (rest coll)))))
19:22rhg135(comp first reverse)
19:23technomancyrhg135: show, don't tell =P
19:23rhg135oops
19:24z_keySo, my lst func yields (5), or ("A"), with parens. The answers are 5, A. (5) != 5. Can someone enlighten me?
19:25rhg135well call first on that
19:25rhg135also empty? isn't very idiomatic
19:26rhg135i've mostly seen seq
19:26z_keylopng-time coder, first-time clojurer.
19:26technomancyeh
19:26technomancyI support the use of empty?
19:26rhg135or in this case next would work
19:26z_keyyes...
19:27z_keywhat is the difference between 5 and (5)? List context versus "primitive"?
19:27technomancywhy use jargon when there's a perfectly fine English word
19:27rhg135technomancy, cool, but i don't see how it's better than seq
19:27`cbpz_key: the parens indicate a list
19:28rhg135ah
19:28`cbpz_key: 5 is an item inside that list
19:28z_keyshouldn't '(5) = 5, then?
19:28rhg135znope
19:28rhg135erm
19:28rhg135z_key,
19:28`cbpz_key: why would that be true?
19:29`cbpz_key: you are comparing a list to a number there
19:29z_keystill gettin' my head around the basics
19:29rhg135a list should never equal a number
19:29z_keyhow do I change the list context?
19:29z_keyremove, not change
19:29`cbpz_key: You can get the first element of the list with the function `first`
19:29rhg135first
19:30z_keySo my function, recursively destroys the list until there's one (last) element left
19:31z_keyhow do I "remove the parens" and make 5=5?
19:32gfredericksz_key: so you want the first element in the list?
19:33z_keyNo, but I just understood what `cbp and rgh135 meant. That's how I recast (5) to the "literal context"(?) 5
19:33technomancyrecast?
19:33z_key(= (first (5) 5)
19:33z_key)
19:34z_keyright?
19:34z_keywait
19:34z_key(= (first (5)) 5)
19:34`cbpz_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:34noonianyep
19:34technomancy~tias
19:34noonian,(first (list 5))
19:34clojurebottias is try it and see
19:34clojurebot5
19:34z_keyexactly
19:35noonian,(source last)
19:35clojurebotSource not found\n
19:35nooniangrumple
19:36rhg135just return (first coll) instead
19:36z_keybam. perfect
19:36rhg135you are returning the seq when you want a value
19:37rhg135weel a seq is a value just not THE value lol
19:37z_key;)
19:38z_keygotta run, i made significant progress with your all's help. thx
19:38rhg135np
19:38z_key... it's the small things. =)
19:39rhg135it truly is
20:32scape_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:33coventryCLJS 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:33scape_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:36technomancyscape_: something is messing up *out* when prn is run
20:37scape_hmm, ok I'll look around, thx
20:37dsrxscape_: check *nrepl-server xxxxx* buffer too
20:38scape_I only have a cider repl buffer, it's empty unless I manually input things to it
20:55mysamdogI have what is probably a really stupid question, but here goes.
20:56mysamdogI have a vector of an arbitrary size that contains hashmaps.
20:56mysamdogI want to be able to go through the hashmaps and pick out the values that correspond with :TITLE
20:56mysamdogWould I just use map?
20:57mysamdogOh
20:57mysamdogI think I figured it out
20:58mysamdogI would do (map (get vector :TITLE))
20:58cark(map :title my-vector)
20:59mysamdogYep, that's it
21:00mysamdogI was doing (map vector :title) before and couldn't figure out why it wasn't working
21:00cark=)
21:00dkinzer,(doc map)
21:00clojurebot"([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:01xnilso that's why :kw can be used as a function
21:01xnilneat
21:06darthdeushey 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:07darthdeusand is there a better or more up to date guide for clojure & emacs? :)
21:08technomancydarthdeus: cider is just the new name for nrepl.el
21:08darthdeusoh okay
21:17darthdeusthis 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:20dsrxdarthdeus: you can run M-x cider-restart, which will restart the nrepl process and start it again in that project
21:34llasramdarthdeus: There's also the `alembic` library which allows you to add dependencies to a running REPL JVM
21:35scape_alembic is nice
22:10frozenlockIs 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:11xnili think it's ctrl+space, then type "insta"
22:11xnilit should show up on the right side
22:19frozenlockxnil: 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:23carkfrozenlock: i think the idea is that the instarepl is the same thing, only but you have the history directly available in your "file"
22:24carkfrozenlock: maybe you shoudl try one of the tutorials from dnolen, you'll see it's quite the same thing
22:24frozenlockYup, I tried one.
22:24carkoh ok
22:24frozenlockBut 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:25frozenlockIn LT, it will truncate after 2-3 items
22:25carkmhh, you may print to the console
22:26frozenlockPerhaps I'm doing it wrong... say I have "my-variable", I usually just do ctrl-enter to check it. Is there another way?
22:27carki'm not used to lightable, more of an emacs user personally
22:27carki'll check it out though because i distincly remember there is a console
22:30carkfrozenlock: you can toggle the console from the ctrl-space menu
22:31carkthen (print (+ 1 2)) will show your output.... not sure how this interacts with clojurescript though
22:32frozenlockIt doesn't :-/
22:32frozenlockI'll browse the plugins, surely I'm not the only one in need of a repl :-p
22:33carki think you need to start a clojurescript repl then connect to a browser window, then use js/console.log
22:33carkor set *print-fn* and be done with it =)
22:35frozenlockNasty :-p
22:37carki 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:38carkand no need to fiddle with a web server, just do pure clojurescript developement
22:38carkthis also bypasses the security restrictions when navigating to a file instead of an url
22:47devnfrozenlock: try clicking the truncated output thing
22:47devnit should expand to the full output
22:47frozenlockdevn: It does, but I don't want to take the mouse :-p
22:47devnhaha, well you didn't say that!
22:48frozenlockI want my cozy emacs environment, but in LT :-)
22:48devnfrozenlock: see if you can find what sets the print-length
22:48devnthen, you know, just set it
22:48carki tried it, but really couldn't make the paredit plugin work like i want
22:48devnthat's every paredit i've used outside of emacs
22:49cark=(
22:49carkthat's the one thing that would make me really try to switch
22:49devntpope has been making the vim world a better place by fixing up paredit for vim
22:50frozenlockAnd now I need ielm in LT!
22:50carkielm ?
22:50frozenlockm-x ielm
22:50devnidk, i use light table for some development, mostly when im prototyping
22:50devnthen i write it foreal in emacs
22:51devnlike, working on a macro in light table is pretty cool
22:51devnyou 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:51devnin lighttable you just edit, and watch
22:51frozenlockOh, that's neat.
22:52carkah sounds nice
22:52devn(defmacro foo ...) (foo ...)
22:52devnthen as you change foo, you see the call to foo change
22:52carktho i on't write much macros, and when i do they're thin wrappers around functions
22:52devnspeaking of macros, i made something really stupid last night, just so i'd have dibs on the macro name
22:53devnhttps://github.com/devn/defjam
22:53devnNote that it's not functional, is completely stupid, and has no real purpose at the moment.
22:54devnBut 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:54bbloomdevn: does it define new types of jam? i like rasberry
22:54devnbbloom: that'll be the first feature i write with it
22:55devn(defjam raspberry [toasts] (apply :raspberry-jam [:wheat :white]))
22:57devn(defjam raspberry [toasts] (apply :raspberry-jam (generate/toast 5 :burn-factor 1/2)))
22:57devnthat's a bit better
22:57devn(partition-all 2 buttered-toast)
22:58devn(with butter-knife (partition-all 2 buttered-toast))
22:58devnfun times.
22:58bbloom(inc devn)
22:58lazybot⇒ 13
23:01devnbbloom: it's fun to write fake stuff like that
23:01devn(defjam raspberry [toasts] (apply :raspberry-jam (into toaster-oven (generate/bread 5 :type :wheat :burn-factor 1/2))))
23:02dsrxdevn: still waiting for defleppard macro
23:02devnomg yes!
23:02bbloomdsrx: we've already got one-arm-ifs, that's close right?
23:02dsrxhaha
23:02devndsrx: defjux is another one
23:02devnhttp://en.wikipedia.org/wiki/Definitive_Jux
23:13carkohhh the var function does not exist in clojurescript
23:15carki guess today i'll have to write macros after all...
23:17allenj12can somone explain why (reduce *' (range 1 (inc n)))) but not (reduce * (range 1 (inc n)))) no quote vs quote
23:17allenj12for finding the factorial
23:17dsrxcark: var function?
23:18cark,(var 'hello)
23:18clojurebot#<CompilerException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:0:0)>
23:18carkhum
23:19cark,(var +)
23:19clojurebot#'clojure.core/+
23:20carki guess it's a macro or special form
23:21cark,(reduce * (range 1 (inc 4)))
23:21clojurebot24
23:21carkthere is no quote
23:21allenj12it didnt work for me though with bigger numbers
23:21allenj12i got stack overflow
23:22cark,(reduce * (range 1 100))
23:22clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
23:23allenj12,(reduce *' (range 1 100))
23:23clojurebot933262154439441526816992388562667004907159682643816214685929638952175999932299156089414639761565182862536979208272237582511852109168640000000000000000000000N
23:23allenj12clark; weird isnt it
23:23carkoh i know
23:23carkthat's not stack overflow
23:24carkbut integer overflow
23:24cark*' works with bigints too
23:24carkthat's not syntax, *' is the function name
23:25allenj12clark: o yes sorry i misspoke i ment integer. interesting i couldnt find it on the clojure docs or anything
23:25carkhttp://clojuredocs.org/clojure_core/clojure.core/*'
23:26carktoo bad clojuredocs isn't maintained anymore ><
23:26carkor are there some news on that front ?
23:26allenj12clark: they arent? lol
23:26SegFaultAXReddit writes the best blog posts.
23:26SegFaultAXallenj12: No, that's why it hasn't been updated since 1.3
23:27carkthe real docs are, but not the clojuredocs web site
23:27allenj12SegFaultAX: interesting that does stink though
23:28carkhttp://clojure.github.io/clojure/clojure.core-api.html#clojure.core/*'
23:28carkthat's the official thing
23:30allenj12clark: how have i not seen this yet! thank you