#clojure log - Dec 23 2015

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

2:19 qsys: :gen-class and subclassing a class with overloaded methods on arity: if I want to override only 1 method of the (arity-)overloaded methods, is it supposed to work, or not?

2:21 The case is this: an abstract class has an arity-overloaded method (arity 0 and arity 1). When I do :gen-class :extends some.Class and override only the zero-arity method and the 1-arity method is called, I get an arityexception

2:38 owlbird: ,(let [args ["alice" "bob"] func (fn [args] (map (fn [x] (prn "func1" x)) args) (map (fn [x] (prn "func2" x)) args))] (func args))

2:38 clojurebot: ("func2" "alice"\n"func2" "bob"\nnil nil)

2:39 owlbird: the first (map xxx) won't execute ?

3:16 Kneiva: ,(let [args ["alice" "bob"] func (fn [args] (doall (map (fn [x] (prn "func1" x)) args)) (doall (map (fn [x] (prn "func2" x)) args)))] (func args))

3:16 clojurebot: "func1" "alice"\n"func1" "bob"\n"func2" "alice"\n"func2" "bob"\n(nil nil)

3:55 keep_learning: Hello everyone

3:56 I am currently working on trip advisor scrapper

3:56 and written a simple code

3:56 https://www.refheap.com/113021

3:56 So far I have learned that scrapping ajax pages are hard

3:57 Currently I am using firefox to execute the javascript calls (ajax)

3:57 and it's working fine.

3:58 Now I wanted to switch headless browser and using Phantomjs

3:58 but it's throwing NoSuchElementException

3:59 and after some modification

3:59 TimeoutException

4:00 After digging some web I got to know that

4:00 http://docs.behat.org/en/v2.5/cookbook/behat_and_mink.html

4:00 Also, you can’t do AJAX with a headless browser.

4:01 So in nutshell

4:01 Ajax is making the life bit hard.

4:02 I am trying to find a way to solve this and came with one solution

4:02 Simulating browser communication via some library

4:03 but I don't have clear idea

4:03 I am looking for some feedback on scrapping trip advisor

4:04 AeroNotix: keep_learning: ajax is just another kind of http call.

4:04 keep_learning: why "can't" you do ajax with a "headless browser"

4:04 aurelian: afaik -- phantomjs and ajax: basically you'll have to wait some seconds after making the call

4:05 as in "I make ajax call to /news.php and I wait for 5 seconds"

4:05 "then I should see rainbows"

4:05 keep_learning: AeroNotix, http://docs.behat.org/en/v2.5/cookbook/behat_and_mink.html

4:05 AeroNotix, It's written there

4:06 aurelian, I waiting there till the time

4:06 AeroNotix: keep_learning: bollocks.

4:06 keep_learning: page is loaded

4:06 (t/get-url "https://www.tripadvisor.in")

4:06 (t/wait-until #(= (t/title) "TripAdvisor: Read Reviews, Compare Prices & Book"))

4:06 aurelian: I see

4:07 keep_learning: aurelian, My code is not working with Phantomjs

4:07 AeroNotix: keep_learning: I think it means "this implementation of a headless browser can't do ajax"

4:07 aurelian: oh, ok, have fun!

4:08 keep_learning: AeroNotix, Ok,

4:08 AeroNotix: keep_learning: doesn't TripAdvisor have an API you can use?

4:08 keep_learning: Any idea on how to solve my problem

4:08 AeroNotix: keep_learning: yes it does https://developer-tripadvisor.com/content-api/

4:09 use the API, scraping is for noobs

4:09 or should be used as an extreme last resort

4:11 keep_learning: AeroNotix, In my case it's kind of last resort

4:11 AeroNotix: keep_learning: why can't you use this API?

4:11 what data do you need from tripadvisor?

4:11 keep_learning: AeroNotix, Right now we are small startup

4:12 and trying to build some analytics over trip advisor data

4:12 so it's kind of commercial use.

4:12 and our funding is also very small

4:12 AeroNotix: and you don't want to pay

4:12 yeah I'm not helping scrubs

4:12 keep_learning: for the moment

4:12 AeroNotix: good luck

4:12 keep_learning: AeroNotix, Thank you

4:13 AeroNotix: disrupt the market by implementing crappy scrapers

4:13 lol

4:13 keep_learning: AeroNotix, Thank you for you suggestion but at one point every startup goes like this

4:13 by writing crappy software

4:13 and keep improving

4:13 AeroNotix: whatever. Enjoy!

4:14 keep_learning: AeroNotix, I am really enjoying this problem :)

6:42 reizuki: how do I refer to MAX_INT in clojurescript?

6:43 The way I'm doing it in .clj, Integer/MAX_VALUE, gets highlighted as cannot be resolved by IDE

6:44 while working perfectly well in .clj files and not being highlighted by IDE

6:51 ridcully_: Number/MAX_VALUE then?

6:52 JS only has Number for everything (or at least that is my impression)

7:05 reizuki: yeah, I found 3 actually

7:06 Number.MAX_VALUE Number.POSITIVE_INFINITY and in a new ECMA standard Number.MAX_SAFE_INTEGER

7:06 I just wonder how I could nicely render an infinity sign to the user when displaying Number.POSITIVE_INFINITY, which matches my use case

7:08 shanks_: hello can somebody help me with something

7:10 hello

7:13 ?

7:15 qsys_: :)

7:15 something is a little vague :p

7:15 bhajana: ^^

7:16 qsys_: I'm pretty sure someone can help with something

7:23 reizuki: how do I skip the string sanitation in cljs?

7:24 when I try to print infinity sign via "∞" it gets translated to "∞"

7:25 shanks_: oh this is my doubt:

7:26 does a function like (<= (*big list*)) evaluate all elements to return a result

7:27 or does it return false as soon as it sees one element > the next

7:28 qsys_: shanks_ : https://clojuredocs.org/clojure.core/%3C=

7:28 ,(<= 2 3 4 5 6)

7:28 clojurebot: true

7:28 qsys_: ,(<= 2 3 4 6 5 7)

7:28 clojurebot: false

7:29 qsys_: there you have it :)

7:29 shanks_: yes, but it does not say hw the function is evaluated

7:29 does it keep computing after it encounters one element > next

7:30 or does it return with flase right away

7:30 qsys_: first of all, does it matter 'how'? But yeah, I suppose it is implemented smart enough to stop when the result is known... maybe checking the source might help? :p

7:31 shanks_: (defn isSorted?

7:31 qsys_: it stops whenever false is found: https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L1020

7:32 shanks_: wow. this was exactly what i was looking for. thanks qsys

7:34 qsys_: seizuki : not sure, but if I try that, it prints the string as expected (http://clojurescript.net/ web repl)...

7:35 noncom: shanks_: i'd just mention that the idiomatic code style would be (defn sorted? ...)

7:35 without "is" since there's the ?, and no camelcaes

7:37 qsys_: seizuki : so maybe, well, some code might help (maybe, dunno)?

7:38 shanks_: :) will keep that in mind. im a total clojure noob coming from java. so, mixed both styles :D

7:40 noncom: qsys_: reizuki: it is actually a google closure thing: http://stackoverflow.com/questions/14408377/clojurescript-and-html-entities

7:40 shanks_: yeah, instead of camelCase you'd use hyphen-case

7:41 just a note :) so you don't waste time on the wrong styling

7:44 ridcully_: shanks_: you can also do (source <) in your repl

7:50 noncom: i have that idea of creating some nodey thing of clojure, like i want to have clojure daemon running on some computers, like on my home and a few work computers, so i could instantaneously control some node with clojure and have a seamless integration, kinda like erlang or something, is there any downside to this apart from security and jvm hunger?

7:56 xemdetia: noncom, I don't think there should be. I mean that is the principle of most distributed systems

7:58 I mean with that problem description you may as well just describe an ssh session to any random unix box.

7:58 noncom: yeah

7:58 looks like so

7:59 the idea is to have a clojure OS shell instead of bash though

7:59 or even instead of windows cmd

8:00 xemdetia: well that's fine too, but the principle is sound. How you do it is up to you

8:41 shanks_: hey guys,

8:41 can somebody check this code http://pastebin.com/u7apZ4Su

8:42 why is function much slower than the original '<= ' function?

8:44 ghost_: Idiomatic way of creating a deck of cards?

9:08 noncom: how do i kill a cider repl buffer with the repl in it properly? just like a regular buffer?

9:10 vijaykiran: M-x cider-quit

9:26 keep_learning: ,(get {:a 1, :b 2, :c 3} :a)

9:26 clojurebot: 1

9:27 keep_learning: ,(:a {:a 1, :b 2, :c 3})

9:27 clojurebot: 1

9:27 keep_learning: (:content {:tag :a, :attrs {:href "/Hotels-g304554-oa390-Mumbai_Bombay_Maharashtra-Hotels.html#ACCOM_OVERVIEW", :data-page-number "14", :data-offset "390", :class "pageNum last taLnk", :onclick "ta.hac.filters.paging(this, event); ta.trackEventOnPage('STANDARD_PAGINATION', 'last', '14', 0);"}, :content ("14")})

9:28 ,(:content {:tag :a, :attrs {:href "/Hotels-g304554-oa390-Mumbai_Bombay_Maharashtra-Hotels.html#ACCOM_OVERVIEW", :data-page-number "14", :data-offset "390", :class "pageNum last taLnk", :onclick "ta.hac.filters.paging(this, event); ta.trackEventOnPage('STANDARD_PAGINATION', 'last', '14', 0);"}, :content ("14")})

9:28 clojurebot: #error {\n :cause "java.lang.String cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.String cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval73 invokeStatic "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval73 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$eval73 invoke "NO_SOURCE_FILE" -1]\n [clojure.lang.Compiler eval "Compiler.java" 6...

9:29 keep_learning: Could some one please tell what is wrong with this code

9:29 I am trying to extract the :content

9:31 ridcully_: keep_learning: ("14")

9:32 ,("14")

9:32 clojurebot: #error {\n :cause "java.lang.String cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.String cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval97 invokeStatic "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval97 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$eval97 invoke "NO_SOURCE_FILE" -1]\n [clojure.lang.Compiler eval "Compiler.java" 6...

9:32 ridcully_: ,'("42")

9:32 clojurebot: ("42")

9:34 keep_learning: ridcully_, Thank you

9:55 lokien_: How to manage state here? I'm doing a card game and I need some kind of state

9:57 ridcully_: isn't some "game" value enough?

9:58 e.g. a game has players with cards in hands, the pile, ...

9:59 lokien_: Isn't that.. Too many values?

10:00 ridcully_: its a map

10:00 lokien_: Isn't that too many maps?

10:01 And maps of maps

10:02 ridcully_: well i don't know, what card game you are dealing with. but i'd start out with a map that represents the whole game. and then use functions to describe the legal actions to transform the game into it's next step

10:03 geirby: that's the way. An atom pointing to a map of maps (tree). Think of it as a single database

10:03 lokien_: Mau Mau. I think it isn't very popular in US/UK

10:04 I need to represent state of a "stack" where card's "superpowers" are waiting to evaluate

10:04 ridcully_: ah that's neunerln here

10:04 lokien_: Hard to describe to someone who hasn't play the game

10:05 ridcully_: yeah, that's exactly it

10:06 Wouldn't having state simplify things a lot?

10:08 ridcully_: wouldnt it just separate things?

10:08 each step in that game has some clear outcome

10:09 lokien_: So, just game and functions to transform it?

10:11 ridcully_: if you need an example get going, on this years conj(?) one presentation was about modelling a card game

10:12 lokien_: Oh, thanks, I'll watch it

10:13 (do you remember the title? ridcully_ )

10:13 ridcully_: https://www.youtube.com/watch?v=Tb823aqgX_0

10:14 lokien_: You're wonderful

11:04 somnasper_: What's the state of Clojure with respect to WebGL, right now? I've seen GitHub experiments, but nothing much substantial

11:05 Is that because Clojure + Threejs is such a nonissue, or because the mutable state causes issues?

11:05 justin_smith: somnasper_: in our project we used js code to do webgl, then left some externs to start it up. We don't use cljs with webgl directly.

11:05 somnasper_: that stuff's just clumsy from cljs imho

11:05 somnasper_: Thanks, justin. I figured that was probably the usual course of action

11:09 dnolen: somnasper_: justin_smith: hrm?

11:09 Clojure + Three.js isn't a thing

11:09 ClojureScript + Three.js is a thing

11:09 justin_smith: dnolen: yes, I did clarify cljs

11:10 dnolen: toxi has a zillion libs around this stuff so clearly it can be done quite well

11:11 http://thi.ng

11:17 troydm: I seem to have a very strange issue with core.logic and really very nested vector data structure (like 12 vectors down the tree structure)

11:18 it seems like even when I do (run* [q] (== q data)) it stucks executing some function which I'm not familiar with

11:18 the data itself is already computed

11:18 now my guess is that it stucks when trying to printout the actual structure

11:19 dnolen: troydm: doubtful, if you have enough recursion you'll likely get stuck

11:19 in that the search space has become too large

11:19 troydm: dnolen: (run* [q] (== q data)) this is the actual code that get's stuck

11:20 data is already computed nested vector

11:20 I'm only trying to bind it to q variable

11:20 dnolen: @troydm need a minimal case, otherwise sounds unlikely

11:20 troydm: dnolen: yeah I'll try to reproduce that issue on a minimal case

11:23 luxbock: bb

11:23 ops

12:04 noncom: in emacs prelude clojure more how do i disable the "over 80 chars in the line" special illumination?

12:37 nys-: hello

12:46 justin_smith: noncom: that's going to be part of whitespace-mode

12:46 noncom: check out M-x customize-group whitespace-mode<return>

12:46 err, no, customize-group whitespace

12:46 not whitespace-mode

12:48 noncom: justin_smith: found that: http://joxi.ru/GrqM17YFNkXW8r is this correct or should i set something else there?

12:48 justin_smith: noncom: you can customize the face used for going over 80 chars, or change that number 80 to a different one

12:48 noncom: if i set nil it says it will use fill-column.. :/.

12:49 looks like the 99999 have no effect

12:49 justin_smith: yeah, a large number works if you never want that warning (as would default-face for the long line face)

12:49 noncom: you probably have to turn global-whitespace-minor-mode off and then on again

12:50 noncom: ah! M-x global-whitespace-toggle-options

12:50 that's your ticket

12:50 noncom: yeah, just killed-reopened the buffer it worked. so i switch it off-on globally

12:51 justin_smith: OK, - but global-whitespace-toggle-options is still worth checking out

12:52 noncom: i did - thre're some options that could be toggled for me globally, i toggled the face option

14:04 devth: defonce, y u no accept a docstring?

14:06 nys-: let requires an even number of forms in binding vector <-- can somebody explain this?

14:07 devth: (let [x 1])

14:07 ridcully_: (let [a 1 b 2])

14:07 nys-: (let [[first-name last-name & aliases] (list "Rich" "Hickey" "The Clojurer" "Go Time" "Lambda Guru")] (str first-name last-name (clojure.string/join " aka " aliases)))

14:07 justin_smith: nys-: you can't have a binding without a value or value without a binding in let's binding vector

14:07 devth: 2, 4, etc

14:08 ridcully_: nys-: this is an even number. the first one is a vector the second one a list. what you see there is destructuring

14:08 nys-: yup. this is from the clojure koans

14:09 I dont really get why this isn't working then? wouldn't this be an even number?

14:09 devth: it does work

14:09 ridcully_: what is "does not work"?

14:10 if the test there fails, its most likely due to missing " " in your str

14:10 nys-: I added that " "

14:10 but my repl is complaining of the non-even binding vectors

14:10 justin_smith: after last-name too

14:10 devth: ,(let [[first-name last-name & aliases] (list "Rich" "Hickey" "The Clojurer" "Go Time" "Lambda Guru")] (str first-name last-name (clojure.string/join " aka " aliases)))

14:10 nys-: thats it ^ i think

14:11 clojurebot: "RichHickeyThe Clojurer aka Go Time aka Lambda Guru"

14:11 justin_smith: two missing spaces

14:17 nys-: good stuff

14:17 my problem was that i was breaking the let function into multiple lines in repl

14:17 which is why i got that error

14:18 justin_smith: why would line breaks change anything about let?

14:19 nys-: i dont know, I put the expression in one line and i actually got a string returned and not that error :x

14:20 i'm very new to this, so sorry if this is very newbie

14:21 justin_smith: nys-: it's just that I can't think of a valid let block where a line break would change it from a correct one to incorrect, unless the line break was in the middle of a symbol

14:24 kopasetik: Question: How do I turn a number into a vector of its digits?

14:25 BRODUS: ,(into [] ((comp seq str) 123))

14:26 clojurebot: [\1 \2 \3]

14:26 ridcully_: ,(map #(- (int %) (int \0)) (str "42666"))

14:26 clojurebot: (4 2 6 6 6)

14:27 justin_smith: BRODUS: that seq call is redundant

14:27 ,(into [] (str 123))

14:27 clojurebot: [\1 \2 \3]

14:29 BRODUS: didn't realize that, since I thought strings weren't sequences

14:29 i mean, i didn't realize that into did the conversion

14:30 kopasetik: BRODUS: Thanks!

14:33 justin_smith: ,(reverse (ffirst (drop-while (comp not zero? second) (iterate (fn [[i r]] [(conj i (rem r 10)) (quot r 10)]) [[] 420]))))

14:33 clojurebot: (4 2 0)

14:33 justin_smith: in case you want to do it without strings / chars :)

14:34 ,(ffirst (drop-while (comp not zero? second) (iterate (fn [[i r]] [(conj i (rem r 10)) (quot r 10)]) [() 420]))) ; simplified

14:34 clojurebot: (4 2 0)

15:10 Trioxin: okay so.. I can do some basic things in clojure. still learning best practices but now I'm interested in what to do should I want to use some java lib that nobody has wrapped or whatever for clojure. is there a tutorial for this?

15:10 justin_smith: Trioxin: have you looked at the clojure.org page on interop? I'd play with some basic classes in the repl (things like Date or UUID).

15:11 Trioxin: k

15:11 justin_smith: Trioxin: http://clojure.org/java_interop in case you have not seen it

15:11 ,(.getTime (java.util.Date.)) ; simple interop

15:11 clojurebot: 1450901505490

15:13 Trioxin: that's built into java though right? from this page it looks like using other classes is a bit of a task. I was hoping for some code generating or conversion tool

15:13 justin_smith: Trioxin: what?

15:13 Trioxin: if you have a dep that pulls it in, it can be used as above

15:14 Trioxin: ooooh

15:14 favetelinguis: is there a way to check the status of a core async channel, im trying to use close! but not sure if the channel is closed

15:14 justin_smith: so you use lein or boot or whatever to specify you want that artifact, the interop syntax will work with objects in that class

15:15 favetelinguis: if reading from a channel returns nil it is closed

15:15 Trioxin: duh "Member Access" doesn't imply having to do anything crazy

15:15 * Trioxin hides

15:15 justin_smith: Trioxin: right, if you know the field name its simple

15:15 Trioxin: interop is a lot easier than most people who don't use it think it would be

15:16 Trioxin: so I'll be using the class but it's not the same exactly like I'm dealing with instantiation and inheritance and all that?

15:19 justin_smith: Trioxin: I don't think I understand that question

15:19 Trioxin: instantiating a class is straightforward (java.util.Date.) make a new date object using the no-arg constructor

15:20 ,(java.util.Date. 0) ; epoch

15:20 clojurebot: #inst "1970-01-01T00:00:00.000-00:00"

15:21 justin_smith: ,(java.net.URL. "http://example.com")

15:21 clojurebot: #error {\n :cause "denied"\n :via\n [{:type java.net.MalformedURLException\n :message "denied"\n :at [java.net.URL <init> "URL.java" 619]}\n {:type java.lang.SecurityException\n :message "denied"\n :at [clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69]}]\n :trace\n [[clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69]\n [clojurebot.sandbo...

15:21 justin_smith: :P

15:21 bots

15:21 dnolen: http://swannodette.github.io/2015/12/23/year-in-review/

15:42 jonathanj: is there a convenient way to turn a prismatic schema validation error into something more user-friendly?

16:38 TimMc: jonathanj: If you find out, let me know!

16:38 I haven't tried super hard to find out, and certainly not recently, but it was a mildly annoying thing a while back.

17:15 Trioxin: omg i ate too much shrooms what do I do

17:15 code?

17:15 yes

17:15 devth: ,(doc shrooms)

17:15 clojurebot: excusez-moi

17:16 Trioxin: lol

17:17 sdegutis: ToxicFrog: ugh not the shrooms again

17:17 justin_smith: Trioxin: the best thing to do on shrooms is learn vi

17:17 or ed, if you already know vi

17:17 sdegutis: cant even spell ur own name rite lol

17:18 Trioxin: sed?

17:18 vi is just a text editor right?

17:18 i always use pico/nano

17:18 justin_smith: Trioxin: it's a text editor which will be maximally enjoyable while tripping

17:21 Trioxin: haven't actually done that in a few years but when I do I'm typically out doing some craziness though the possible meditation value is not lost on me. Coding though? doubt much good would come of it

17:22 or maybe some breakthrough. The double helix was imagined on lsd

17:22 justin_smith: Trioxin: I figured if you were managing IRC you couldn't actually be very far gone

17:23 sdegutis: What about that regex based one that Go Man uses?

17:23 Oh yeah. Sam and Acme.

17:23 Do you use those?

17:23 justin_smith: sdegutis: same is awesome

17:23 *sam

17:23 sdegutis: I have a hard time believing that.

17:23 If it was, you would be using it.

17:23 justin_smith: acme is pretty cool if you have a real 3 button mouse

17:24 sdegutis: it's not extensible like emacs is, and three isn't a good distro of it anymore

17:24 Trioxin: never heard of those

17:24 sdegutis: justin_smith: my mouse is 3 button afaik, third is scroll wheel

17:24 justin_smith: but I'm not a fan of using it

17:24 not in my text editor

17:25 justin_smith: sdegutis: yeah, that sucks for acme, because acme does chords - like "click buttons 2 and 3 together for this action" which sucks on that kind of mouse

17:25 sdegutis: ah

17:25 emacs tho is a solid 5/7

17:25 super customizeable

17:25 justin_smith: you want like a proper 3-real-buttons mouse, which you basically can't get any more

17:25 sdegutis: i used to have that one once

17:25 Trioxin: jetbrains ftw

17:25 justin_smith: yeah, that's why I'm using it - also inertia of course

17:26 sdegutis: naturally

17:27 Trioxin: jetbrains should make an ide that combines all their products since all their IDEs are the same with different tools

17:27 the VS of jetbrains so to speak

17:27 ridcully_: ultimate is basically this

17:27 Trioxin: oh

17:27 ridcully_: might lack c++ and c#

17:28 BRODUS: what makes jetbrains so good?

17:28 sdegutis: Got a good Forth tutorial please?

17:29 All ones I find are either too verbose with unnecessary irrelevant details, or too primitive.

17:33 Trioxin: BRODUS, it just is. i've never had any complaints. that's not to say others aren't good too but I started using it a long time ago and am used to it.

17:35 taf: BRODUS, I'm a big fan of how they handle "shortcuts" with search boxes for commands, means you don't have to memorise loads of key combinations

18:28 btcNeverSleeps: Long story short: working at the REPL, not realizing project ain't compiling, made several commits. Try to run lein test, failure. Try to cider-jack-in: fail.

18:28 Error is now very cryptic and hard to track.

18:29 Is this common?

18:30 All I've got is a super long stack trace and the only sense I can make out of it is: "something fails to compile", but I don't understand what.

18:34 jessicaj: hi

18:35 skdjfhaskjdfhdas: hi

18:35 i'm looking for a way of converting an empty list to the string "()"

18:35 when i call str on [], i get "[]"

18:35 likewise, str on #{} gives me "#{}" and str on {} gives me "{}"

18:36 but calling str on '() gives me "clojure.lang.PersistentList$EmptyList@1"

18:36 rhg135: ,((comp str seq) [])

18:36 clojurebot: ""

18:36 rhg135: ,((comp pr-str seq) [])

18:36 clojurebot: "nil"

18:37 rhg135: ,((comp pr-str empty) [])

18:37 clojurebot: "[]"

18:37 sfz-: ,(pr-str '())

18:37 clojurebot: "()"

18:37 rhg135: ,((comp pr-str list seq) [])

18:37 clojurebot: "(nil)"

18:37 rhg135: ,((comp pr-str list* seq) [])

18:37 clojurebot: "nil"

18:37 sfz-: skdjfhaskjdfhdas: (pr-str '())

18:38 skdjfhaskjdfhdas: sfz-: thanks!

20:50 felixn: https://gist.github.com/munro/36f82883eb89d38c4452 <-- anyone have some tips to clean this function definition up? core.logic function to solve concat vars

20:51 justin_smith: felixn: I don't know if line 1 was just a side effect of simplifying your real code, but it's a no-op

20:51 felixn: just put it there to show what m/ was

20:51 justin_smith: OK, makes sense

20:52 ,(:use '[this does nothing])

20:52 clojurebot: nil

21:40 sdegutis: Hi.

21:40 justin_smith: you awake?

21:40 justin_smith: sup

21:40 sdegutis: justin_smith: you ever wrote you a prog lang?

21:41 justin_smith: I kind of tried once it wasn't good

21:41 sdegutis: :D

21:41 man its just a dream i just cant shake

21:57 justin_smith: sdegutis: my town has a bird named owl capone and it is known for unprovoked attacks on on cyclists and pedestrians

21:58 TEttinger: justin_smith, haha

21:58 same bird?

21:58 sdegutis: justin_smith: well then!

21:58 justin_smith: TEttinger: yes, it's a single owl who likes to attack and harass humans

21:59 TEttinger: we have a cute lil' babby owl that makes freaky noises at night but is durn cute

21:59 (in our neighborhood here)

21:59 sdegutis: justin_smith: while my wife and i surely did enjoy that antidote, I can't quite figure out the relevance

21:59 TEttinger: also red-whiskered bulbuls

21:59 (which aren't even native to this hemisphere)

21:59 justin_smith: sdegutis: not really relevant at all

21:59 sdegutis: justin_smith: well i enjoyed it!

22:01 justin_smith: TEttinger: https://twitter.com/despair/status/679136039303278593

22:01 TEttinger: not sure if I should open chrome now; copying several million files (again) (different larger files)

22:01 sdegutis: justin_smith: merry christmas!

22:01 justin_smith: and to you as well

22:02 sdegutis: aww you're so nice

22:03 TEttinger: I got a christmas present. I found out about windows robocopy utility

22:03 sdegutis: ok i really need to buckle down and figure out what to do with my time instead of wasting all of it

22:03 TEttinger: is it great?

22:03 TEttinger: it seems quite a bit faster that copy or gnuwin32 cp

22:04 sdegutis: oooh, my only experience with using copy on windows is that i installed cygwin for my son to experient with C and Lua and it has 'cp'

22:04 so that's convenient.

22:04 TEttinger: this is a step it's doing now that previously either listed every file as it copied it (using copy, but slightly faster it seems) or has to list a wildcard's contents before copying and that's slow

22:05 justin_smith: TEttinger: I am sure robocopy is an improvement over the previous version "remove that file from the recycling bin, you have 15 seconds to comply"

22:05 TEttinger: cp was slowest by a good amount on this windows 7 machine, then copy was faster, then robocop is a pretty incredibad movie, then robocopy is pretty good

22:06 it appears to have copied about 20K not-tiny files in the span of this conversation

22:07 sdegutis: TEttinger:LOL

22:07 good pun bro i like that pun

22:07 TEttinger: might be a lot more

22:07 sdegutis: more puns coming up you mean?

22:07 TEttinger: I think justin_smith made the reference first!

22:07 sdegutis: i could be okay with that

22:07 oh man!

22:07 i totally didnt even understand his reference!

22:08 TEttinger: also searching for robocopy gets you lots of results for robocop

22:08 sdegutis: i tought it was just some pushy dialog that windows users know about

22:08 TEttinger: does gnu cp have a multi-threaded option on linux?

22:10 justin_smith: TEttinger: not that I can see, and it wouldn't make much sense to cp on more than one thread - all the CPU work needed should be doable in much less time than you have to wait for hardware anyway.

22:10 TEttinger: maybe with an encrypted system multi-threading cp would help?

22:10 TEttinger: no idea

22:10 I know there is a CPU-based step

22:11 (figuring out what to copy)

22:11 justin_smith: TEttinger: reductio ad absurdum version - you need your files printed faster, so you start a new thread for each print job

22:11 TEttinger: sure, but I assure you waiting for the hardware is the bottle neck

22:11 TEttinger: for cp it actually isn't at first

22:11 cp takes two steps, one it writes no files

22:12 (at least here)

22:12 justin_smith: TEttinger: right, but the read is also bound by the physical medium, not computation speed

22:12 TEttinger: it is probably reading like mad though

22:25 sdegutis: TEttinger: what are you copying that takes so long?

22:25 personally my advice is to delete it

22:25 not worth the time, man.

22:25 justin_smith: sdegutis: star wars episode IVII

22:25 err, wait

22:25 I mean ILII

22:25 ,(require 'clojure.pprint)

22:26 clojurebot: nil

22:26 TEttinger: sdegutis: it's uh a lot of rendered images

22:26 justin_smith: ,(clojure.pprint/cl-format nil "~@r" 42)

22:26 clojurebot: "XLII"

22:26 justin_smith: ahh, that's the one

22:26 TEttinger: ,(Math/pow 2 20)

22:26 clojurebot: 1048576.0

22:26 TEttinger: ,(Math/pow 2 21)

22:26 clojurebot: 2097152.0

22:26 sdegutis: ,(clojure.pprint/print-table [:a :b] [{:a 1 :b 2} {:a 3 :b 4}])

22:26 clojurebot: \n| :a | :b |\n|----+----|\n| 1 | 2 |\n| 3 | 4 |\n

22:26 TEttinger: that's on par

22:26 sdegutis: I use that. It's nice.

22:27 TEttinger: oh crap!

22:27 I'm copying way more than needed

22:28 sdegutis: 4% battery

22:28 guys

22:29 im prolly gonna exit

22:29 by circumtance

22:29 sorry im not good at goodbyes

22:30 justin_smith: thanks for always being so helpful

22:30 oh man 3% til the laptop dies

22:30 justin_smith: sdegutis: you know if you have one of those new-fangled computers that can charge via usb-c you can get a battery pack that will fill your laptop twice for less than $50 and if you get on amazon real quick it might come in the mail before your batteries run out

22:30 sdegutis: justin_smith: you can have my stereo

22:30 justin_smith: sdegutis: np

22:31 sdegutis: oh wait 4% still woooo

22:33 justin_smith: you cant have my stereo until im gone

22:33 justin_smith: k

22:33 sdegutis: ok this joke is too dark now

22:33 gonna stop it w/ the dark joke

22:34 justin_smith: sdegutis: don't go softly into the dark night, rage rage at the falling of the light!

22:34 or however that goes

22:35 sdegutis: sorry i dont listen to 80s songs

22:35 so i dunno how it gos

22:36 justin_smith: TIL Dylan Thomas was an 80's song

22:36 sdegutis: im not into pokemon so i dunno who thomas dylan is sorry

22:48 TEttinger: justin_smith: isn't that a famous poem or something?

22:48 justin_smith: TEttinger: yes, quoted badly from memory, and an apt riff on his talking about "going dark" when he ran out of laptop battery, I thought

22:48 TEttinger: mm

22:49 I prefer "I WARNED YOU DOG! I TOLD YOU ABOUT STAIRS!" as my anecdote for when someone drops offline

22:50 sweet, even with filtering out files I'm not using (an extra step), it seems faster

22:51 sdegutis: i like the raven one better

22:52 it rhymes and has good timing

22:52 quoth the raven, "nopin on outta here"

22:52 or smth

22:56 TimMc: OK, I want to rename my URL library. Is "earl" a terrible name?

22:56 get it get it

22:56 justin_smith: duke

22:56 TEttinger: the java mascot?

22:56 TimMc: Why duke?

22:56 TEttinger: duke of earl

22:56 sdegutis: TimMc: i like it

22:56 TEttinger: duke of url

22:56 sdegutis: TimMc: you have my vote

22:57 TEttinger: urletha franklin

22:57 TimMc: TEttinger: I... see.

22:57 ha

22:57 Also, how do I tell if someone is already using the name I want?

22:57 TEttinger: Burle

22:58 TimMc: Maybe "earnest".

22:58 TEttinger: Furl

22:58 justin_smith: TimMc: did you know the English used the title Earl instead of Count because of a common mishearing of the latter? True story.

22:58 sdegutis: TimMc: https://github.com/search?utf8=%E2%9C%93&q=earl

22:58 TEttinger: Sorrel

22:58 sdegutis: TimMc: thats the canonical repository of taken project names

22:58 BRODUS: whURLwind

22:58 TEttinger: Purl (not to be confused with prl)

22:58 perl

22:58 sdegutis: TimMc: AND MY AXE!

22:58 TEttinger: Squrl

22:59 TimMc: Hmm, that github search turns up too many URL-related libs.

22:59 BRODUS: TURLTLE

22:59 TEttinger: Gurl, followed quickly by new releases Gurrl, Gurrrl, and Gurrrrrrrrrrl

22:59 justin_smith: TimMc: I am going to make a twitter specific URL api, urly-bird

22:59 TimMc: TEttinger: winner

22:59 sdegutis: hmm i think i waited too long to make that reference

22:59 justin_smith: (throw "oh no you dint")

22:59 TEttinger: ha

23:00 TimMc: It's currently called johnny and I was thinking of versioning it as johnny2, johnny3, etc.

23:00 TEttinger: mm-hm.

23:00 justin_smith: TimMc: but then you'll end up hittin johnny5

23:00 TimMc: yep!

23:00 sdegutis: oh man

23:00 rhg135: Johnny43

23:01 sdegutis: that brings back memories

23:01 i suddenly feel so sad for a robot

23:01 justin_smith: TimMc: regarding the etymology of Earl, it wasn't an issue for female royalty, and they are still called Countess, there is no female equivalent to the title Earl

23:01 sdegutis: WAIT A SECOND

23:02 * TimMc spinloops

23:02 sdegutis: THIS GUY LOOKS LIKE STEVE JOBS https://en.wikipedia.org/wiki/Short_Circuit_2

23:03 justin_smith: the fact that there is a thing called an Earldom seems prime for an awesome ajax/react flavored pun

23:04 TimMc: I was originally calling it "johnny" because I wrote it in anger; the complaint was "why can't johnny read URLs".

23:04 justin_smith: historically, earldoms were replaced by shires

23:04 TMYK

23:04 TEttinger: there's also the really agonizng wikipedia page on "pearling", which I suggest never looking up ever especially at work

23:05 sdegutis: plot twist: it's about the really tedious job of farming oysters for their pearls

23:05 TEttinger: parts of me hurt thinking about it

23:05 justin_smith: TEttinger: perling is one of the two essential parts of knitting, the other being called knitting, funny enough

23:05 TEttinger: this is with an a

23:05 justin_smith: I know

23:05 TEttinger: and it's purl I thought

23:05 TimMc: But now it's almost ready for beta, and johnny the library *can* read URLs, so the clever title is now really stupid.

23:06 justin_smith: TEttinger: oh you are correct

23:06 earldoms were replaced by shires, so I say shire

23:06 dunno

23:06 TimMc: Maybe "earnest" would be a good name.

23:07 TEttinger: I think any wikipedia page that is in the category of body modification and includes something like "in russian prisons" is gonna be a pretty painful read

23:07 justin_smith: TEttinger: challenge: find a wikipedia page for a body modification that causes no physical pain

23:07 TEttinger: oddly enough, "in swedish prisons" wouldn't be bad at all

23:07 stick on tattoos

23:08 dentures

23:08 justin_smith: TEttinger: the page must mention "body modification"

23:08 TEttinger: not doin' it

23:08 * justin_smith watches TEttinger go vandalize the page for temporary tattoos.

23:08 TEttinger: IIRC the pearling page has uh pictures. but I think I've blocked them from memory

23:10 TimMc: good ol' wikipedia

23:10 TEttinger: I had a nice book about animals that right near the end had a two-full-page closeup of a solifugid's "face" I think it was.

23:11 I think that book went flying shut at that point

23:13 I mean, if you're making a horror game, you don't really need to start making up horrible creatures. wikipedia has rather involved details on things like bedbugs and the way they reproduce, which involves stabbing internal organs hoping to hit something connected to the bloodstream so they can transfer genetic material.

23:13 TimMc: TEttinger: I have an amazing video for you: https://www.youtube.com/watch?v=5uzuYRY2faQ

23:14 TEttinger: pretty sure I'm not clicking that for a few reasons

23:14 justin_smith: TimMc: oh man, those things

23:14 TEttinger: oh yeah, nope

23:14 tailless whipspider agh

23:14 thanks my lazybot on another server

23:14 TimMc: It's a totally gorgeous but also utterly alien sight.

23:14 TEttinger: mantis shrimp are totally gorgeous/alien

23:14 "thumbsplitters"

23:15 "terrors of aquariums"

23:15 justin_smith: TimMc: the sound track is a nice touch

23:15 TEttinger: have you heard of bobbit worms? guess how they got the name

23:15 TimMc: justin_smith: Apparently it was used in an art piece to accompany the music.

23:15 TEttinger: oh yeah, they're pretty cool looking

23:15 TimMc: Oh yeah, I was gonna say... bobbit worms are the real terror of the aquarium.

23:15 TEttinger: what, 6 foot long underwater worm with razorjaws?

23:15 TimMc: uh

23:16 bobbit worms don't shatter the glass for fun

23:16 justin_smith: TEttinger: and they cut things in half, and cause permanent paralysis of nerves

23:16 TimMc: couldn't think of the name though

23:16 There is that. But pistol shrimp are stronger, right?

23:16 TEttinger: no

23:16 justin_smith: I think I'd rather a smashed aquarium rather than losing a finger and never having feeling in my hand again

23:17 TimMc: this video is really great

23:17 TEttinger: mantis shrimp hit twice. once is a puny shrimp hit. the other is caused by recoiling so fast it creates a bubble of vacuum, that collapses at incredible speed, heating the target to temperatures around that of the surface of the sun

23:18 if a mantis shrimp strikes too many times, they eventually start lose the exoskeleton on their strikers

23:18 constantly growing, constantly trying to eat

23:18 justin_smith: like a car wearing down its brake pads

23:18 TEttinger: yep

23:18 if the car was creating miniature explosions to stop

23:19 justin_smith: yeah, analogy falls well short

23:19 TimMc: Cars create miniature explosions to go. :-P

23:19 TEttinger: the pistol shrimp is similar

23:19 but can't direct its hit in any one direction

23:19 TimMc: "miniature explosions to go", there's a startup for you

23:19 TEttinger: ha

23:19 underwater creatures are crazy

23:19 justin_smith: "uber, for flatulence"

23:21 TEttinger: symbion pandora for instance. location: on the "lips, or whatever those things are" of norway lobsters. Sex: M/F/Declined to State <-- male and female are circled and they took the liberty to fill in another category

23:21 justin_smith: TEttinger: oh yeah, their breeding cycle is insane

23:22 TEttinger: its lifecycle is in the territory of "wait are we talking a non-fictional animal?"

23:24 lobsters even. good ol ordinary lobsters. their brain is so underpowered that to flip the visual image generated by rods and cones in an eye with a lens, it would be too much work. so they make each segment of their compount eye very long and thin, with a shallow angle that forces the light to hit a mirrored surface on the sides -- flipping it with hardware

23:25 meanwhile, you have cuttlefish carrying out visual-language-like communication with two other cuttlefish simultaneously -- one side of the body is showing off for a female, the other is in full threat display for a male

23:26 every part of their skin has multiple dilate/contract muscles for the pigment spots it uses

23:26 (well, one muscle per spot)

23:27 (layers of spots though)

23:27 justin_smith: and I can't even wink properly without looking like a dumbass

23:27 TEttinger: ha

23:27 I can raise my left eyebrow but not my right

23:29 can't move my ears. can move everything else in uh unusual ways. this may hurt you to look at, but it doesn't hurt me at all really http://i.imgur.com/47RoA.jpg

23:34 TimMc: TEttinger: Both pages on Symbion pandora that I've looked at so far lack a lifecycle diagram for no particular reason I can discern.

23:34 TEttinger: awww

23:34 it involves asexual budding, the female destroying her digestive system to form her reproductive system to generate a ton of baby males, ete.

23:35 I'm sure I'm getting something wrong

23:35 it's very complex

23:35 TimMc: I think this one page said the female generates just one egg and then dies.

23:35 which seems entirely wrong

23:35 TEttinger: no it's mostly right I think

23:36 she turns her digestive system, needed to live, into a baby

23:36 justin_smith: TimMc: http://icb.oxfordjournals.org/content/42/3/641/F2.large.jpg

23:36 TimMc: Sounds like they've decomplected gene exchange from multiplication.

23:36 TEttinger: the asexual stage I think makes more asexuals with identical DNA

23:36 yep

23:36 alien.

23:37 justin_smith: TEttinger: but stage 14 is "MALE SETTLES" - so on a deep level, I can relate

23:38 (followed shortly by "FEMALE ESCAPES" - story of my life)

23:43 sohail: Hey, I got the cljs repl working in Emacs, but it requires me to execute special setup code every time. Is there any way to set up project.clj to automagically execute the required setup code?

23:43 TEttinger: replacement of buccal funnel, boy if I had a nickel

23:43 justin_smith: sohail: you could define a profile with the right injection

23:43 TEttinger: lol

23:43 sohail: justin_smith: that sounds like what I need to do, but what is the mechanism for said injection?

23:44 ah, I think I understand. The :main function

23:45 justin_smith: sohail: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L156 - this code gets run on startup

23:45 sohail: oh that's even nicer

23:45 thanks justin_smith

23:45 justin_smith: np, good luck

23:46 devth: so i was hoping if I created an instance of a record inside a binding, that binding would stick. apparently it doesn't https://gist.github.com/devth/24c930ed95b8f7100664

23:47 justin_smith: devth: yeah, you could manually capture the binding while inside the form, but that code actually accesses the var that leaves bound scope

23:47 devth: trying to think of any clever tricks i could use to forcibly leak the scope into the instance and make it stick.

23:48 justin_smith: the capturing version would be (let [v *foo*] v)

23:48 devth: oh. hm

23:48 justin_smith: but that would need to happen when you create the record, not inside one of its methods

23:49 devth: (fn [] (->AA *foo*)) would work, if you changed foo to have a field

23:50 err, changed AA to have a field, that is

23:50 devth: yeah

23:50 the important part is that the outer dynamic var. a bunch of other fns depend on it.

23:51 ok i think i need to rethink this

23:52 i could do like you said and make AA take a field, then i'd have to pass that field around all over the place when using other outside fns that "AA" depends on

23:53 or rebind *foo* in every one of A's function (in reality there are 10). pretty gross

23:54 justin_smith: devth: one thing to remember is if you make code that can use explicitly passed in args, that's the most flexible thing you can have. It can easily be wrapped in macros or convenience functions that use dynamic scope, or a global atom, or partial application, or whatever.

23:54 devth: but none of those other options are as flexible - passing the arg explicitly is the powerful and explicit form from which all of them can be derived.

23:54 devth: right

23:55 this is an awkward side-effect of going from supporting a single slack configuration to multiple. i used to have a (def config (get-slack-config))

23:55 then it became (def ^:dynamic *config*)

23:56 then i moved to using protocols for the first time on top of that

23:56 almost like i want OOP

23:56 justin_smith: yeah - so I (and many others here) learned the hard way, each of those will code you into a corner eventually. But explicit arg passing, though tedious feeling at times, always leaves you a way out.

23:56 devth: yeah. it's starting to sound better all the time

23:56 hmm

23:57 justin_smith: devth: one way to do it is with an opts map, taken as the first arg

23:57 or as last

23:57 that way in can hold as many random-ass things as you want to propagate, each can used namespaced keywords

23:57 and you have explicit control of the bindings in that map

23:58 devth: yep. i am quite sick of binding madness :)

23:58 what do you mean by namespaced kws?

23:58 :foo/bar?

23:58 i usually don't have to resort to namespacing them..

23:59 justin_smith: devth: namespacing is good because it clarifies who cares about that key

Logging service provided by n01se.net