#clojure logs

2015-12-23

02:19qsys: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?
02:21qsysThe 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
02:38owlbird,(let [args ["alice" "bob"] func (fn [args] (map (fn [x] (prn "func1" x)) args) (map (fn [x] (prn "func2" x)) args))] (func args))
02:38clojurebot("func2" "alice"\n"func2" "bob"\nnil nil)
02:39owlbirdthe first (map xxx) won't execute ?
03:16Kneiva,(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))
03:16clojurebot"func1" "alice"\n"func1" "bob"\n"func2" "alice"\n"func2" "bob"\n(nil nil)
03:55keep_learningHello everyone
03:56keep_learningI am currently working on trip advisor scrapper
03:56keep_learningand written a simple code
03:56keep_learninghttps://www.refheap.com/113021
03:56keep_learningSo far I have learned that scrapping ajax pages are hard
03:57keep_learningCurrently I am using firefox to execute the javascript calls (ajax)
03:57keep_learningand it's working fine.
03:58keep_learningNow I wanted to switch headless browser and using Phantomjs
03:58keep_learningbut it's throwing NoSuchElementException
03:59keep_learningand after some modification
03:59keep_learningTimeoutException
04:00keep_learningAfter digging some web I got to know that
04:00keep_learninghttp://docs.behat.org/en/v2.5/cookbook/behat_and_mink.html
04:00keep_learningAlso, you can’t do AJAX with a headless browser.
04:01keep_learningSo in nutshell
04:01keep_learningAjax is making the life bit hard.
04:02keep_learningI am trying to find a way to solve this and came with one solution
04:02keep_learningSimulating browser communication via some library
04:03keep_learningbut I don't have clear idea
04:03keep_learningI am looking for some feedback on scrapping trip advisor
04:04AeroNotixkeep_learning: ajax is just another kind of http call.
04:04AeroNotixkeep_learning: why "can't" you do ajax with a "headless browser"
04:04aurelianafaik -- phantomjs and ajax: basically you'll have to wait some seconds after making the call
04:05aurelianas in "I make ajax call to /news.php and I wait for 5 seconds"
04:05aurelian"then I should see rainbows"
04:05keep_learningAeroNotix, http://docs.behat.org/en/v2.5/cookbook/behat_and_mink.html
04:05keep_learningAeroNotix, It's written there
04:06keep_learningaurelian, I waiting there till the time
04:06AeroNotixkeep_learning: bollocks.
04:06keep_learningpage is loaded
04:06keep_learning (t/get-url "https://www.tripadvisor.in")
04:06keep_learning (t/wait-until #(= (t/title) "TripAdvisor: Read Reviews, Compare Prices & Book"))
04:06aurelianI see
04:07keep_learningaurelian, My code is not working with Phantomjs
04:07AeroNotixkeep_learning: I think it means "this implementation of a headless browser can't do ajax"
04:07aurelianoh, ok, have fun!
04:08keep_learningAeroNotix, Ok,
04:08AeroNotixkeep_learning: doesn't TripAdvisor have an API you can use?
04:08keep_learningAny idea on how to solve my problem
04:08AeroNotixkeep_learning: yes it does https://developer-tripadvisor.com/content-api/
04:09AeroNotixuse the API, scraping is for noobs
04:09AeroNotixor should be used as an extreme last resort
04:11keep_learningAeroNotix, In my case it's kind of last resort
04:11AeroNotixkeep_learning: why can't you use this API?
04:11AeroNotixwhat data do you need from tripadvisor?
04:11keep_learningAeroNotix, Right now we are small startup
04:12keep_learningand trying to build some analytics over trip advisor data
04:12keep_learningso it's kind of commercial use.
04:12keep_learningand our funding is also very small
04:12AeroNotixand you don't want to pay
04:12AeroNotixyeah I'm not helping scrubs
04:12keep_learningfor the moment
04:12AeroNotixgood luck
04:12keep_learningAeroNotix, Thank you
04:13AeroNotixdisrupt the market by implementing crappy scrapers
04:13AeroNotixlol
04:13keep_learningAeroNotix, Thank you for you suggestion but at one point every startup goes like this
04:13keep_learningby writing crappy software
04:13keep_learningand keep improving
04:13AeroNotixwhatever. Enjoy!
04:14keep_learningAeroNotix, I am really enjoying this problem :)
06:42reizukihow do I refer to MAX_INT in clojurescript?
06:43reizukiThe way I'm doing it in .clj, Integer/MAX_VALUE, gets highlighted as cannot be resolved by IDE
06:44reizukiwhile working perfectly well in .clj files and not being highlighted by IDE
06:51ridcully_Number/MAX_VALUE then?
06:52ridcully_JS only has Number for everything (or at least that is my impression)
07:05reizukiyeah, I found 3 actually
07:06reizukiNumber.MAX_VALUE Number.POSITIVE_INFINITY and in a new ECMA standard Number.MAX_SAFE_INTEGER
07:06reizukiI just wonder how I could nicely render an infinity sign to the user when displaying Number.POSITIVE_INFINITY, which matches my use case
07:08shanks_hello can somebody help me with something
07:10shanks_hello
07:13shanks_?
07:15qsys_:)
07:15qsys_something is a little vague :p
07:15bhajana^^
07:16qsys_I'm pretty sure someone can help with something
07:23reizukihow do I skip the string sanitation in cljs?
07:24reizukiwhen I try to print infinity sign via "∞" it gets translated to "∞"
07:25shanks_oh this is my doubt:
07:26shanks_does a function like (<= (*big list*)) evaluate all elements to return a result
07:27shanks_or does it return false as soon as it sees one element > the next
07:28qsys_shanks_ : https://clojuredocs.org/clojure.core/%3C=
07:28qsys_,(<= 2 3 4 5 6)
07:28clojurebottrue
07:28qsys_,(<= 2 3 4 6 5 7)
07:28clojurebotfalse
07:29qsys_there you have it :)
07:29shanks_yes, but it does not say hw the function is evaluated
07:29shanks_does it keep computing after it encounters one element > next
07:30shanks_or does it return with flase right away
07:30qsys_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
07:31shanks_(defn isSorted?
07:31qsys_it stops whenever false is found: https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L1020
07:32shanks_wow. this was exactly what i was looking for. thanks qsys
07:34qsys_seizuki : not sure, but if I try that, it prints the string as expected (http://clojurescript.net/ web repl)...
07:35noncomshanks_: i'd just mention that the idiomatic code style would be (defn sorted? ...)
07:35noncomwithout "is" since there's the ?, and no camelcaes
07:37qsys_seizuki : so maybe, well, some code might help (maybe, dunno)?
07:38shanks_:) will keep that in mind. im a total clojure noob coming from java. so, mixed both styles :D
07:40noncomqsys_: reizuki: it is actually a google closure thing: http://stackoverflow.com/questions/14408377/clojurescript-and-html-entities
07:40noncomshanks_: yeah, instead of camelCase you'd use hyphen-case
07:41noncomjust a note :) so you don't waste time on the wrong styling
07:44ridcully_shanks_: you can also do (source <) in your repl
07:50noncomi 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?
07:56xemdetianoncom, I don't think there should be. I mean that is the principle of most distributed systems
07:58xemdetiaI mean with that problem description you may as well just describe an ssh session to any random unix box.
07:58noncomyeah
07:58noncomlooks like so
07:59noncomthe idea is to have a clojure OS shell instead of bash though
07:59noncomor even instead of windows cmd
08:00xemdetiawell that's fine too, but the principle is sound. How you do it is up to you
08:41shanks_hey guys,
08:41shanks_can somebody check this code http://pastebin.com/u7apZ4Su
08:42shanks_why is function much slower than the original '<= ' function?
08:44ghost_Idiomatic way of creating a deck of cards?
09:08noncomhow do i kill a cider repl buffer with the repl in it properly? just like a regular buffer?
09:10vijaykiranM-x cider-quit
09:26keep_learning,(get {:a 1, :b 2, :c 3} :a)
09:26clojurebot1
09:27keep_learning,(:a {:a 1, :b 2, :c 3})
09:27clojurebot1
09:27keep_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")})
09:28keep_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")})
09:28clojurebot#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...
09:29keep_learningCould some one please tell what is wrong with this code
09:29keep_learningI am trying to extract the :content
09:31ridcully_keep_learning: ("14")
09:32ridcully_,("14")
09:32clojurebot#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...
09:32ridcully_,'("42")
09:32clojurebot("42")
09:34keep_learningridcully_, Thank you
09:55lokien_How to manage state here? I'm doing a card game and I need some kind of state
09:57ridcully_isn't some "game" value enough?
09:58ridcully_e.g. a game has players with cards in hands, the pile, ...
09:59lokien_Isn't that.. Too many values?
10:00ridcully_its a map
10:00lokien_Isn't that too many maps?
10:01lokien_And maps of maps
10:02ridcully_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:03geirbythat's the way. An atom pointing to a map of maps (tree). Think of it as a single database
10:03lokien_Mau Mau. I think it isn't very popular in US/UK
10:04lokien_I need to represent state of a "stack" where card's "superpowers" are waiting to evaluate
10:04ridcully_ah that's neunerln here
10:04lokien_Hard to describe to someone who hasn't play the game
10:05lokien_ridcully_: yeah, that's exactly it
10:06lokien_Wouldn't having state simplify things a lot?
10:08ridcully_wouldnt it just separate things?
10:08ridcully_each step in that game has some clear outcome
10:09lokien_So, just game and functions to transform it?
10:11ridcully_if you need an example get going, on this years conj(?) one presentation was about modelling a card game
10:12lokien_Oh, thanks, I'll watch it
10:13lokien_(do you remember the title? ridcully_ )
10:13ridcully_https://www.youtube.com/watch?v=Tb823aqgX_0
10:14lokien_You're wonderful
11:04somnasper_What's the state of Clojure with respect to WebGL, right now? I've seen GitHub experiments, but nothing much substantial
11:05somnasper_Is that because Clojure + Threejs is such a nonissue, or because the mutable state causes issues?
11:05justin_smithsomnasper_: 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:05justin_smithsomnasper_: that stuff's just clumsy from cljs imho
11:05somnasper_Thanks, justin. I figured that was probably the usual course of action
11:09dnolensomnasper_: justin_smith: hrm?
11:09dnolenClojure + Three.js isn't a thing
11:09dnolenClojureScript + Three.js is a thing
11:09justin_smithdnolen: yes, I did clarify cljs
11:10dnolentoxi has a zillion libs around this stuff so clearly it can be done quite well
11:11dnolenhttp://thi.ng
11:17troydmI 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:18troydmit seems like even when I do (run* [q] (== q data)) it stucks executing some function which I'm not familiar with
11:18troydmthe data itself is already computed
11:18troydmnow my guess is that it stucks when trying to printout the actual structure
11:19dnolentroydm: doubtful, if you have enough recursion you'll likely get stuck
11:19dnolenin that the search space has become too large
11:19troydmdnolen: (run* [q] (== q data)) this is the actual code that get's stuck
11:20troydmdata is already computed nested vector
11:20troydmI'm only trying to bind it to q variable
11:20dnolen@troydm need a minimal case, otherwise sounds unlikely
11:20troydmdnolen: yeah I'll try to reproduce that issue on a minimal case
11:23luxbock bb
11:23luxbockops
12:04noncomin emacs prelude clojure more how do i disable the "over 80 chars in the line" special illumination?
12:37nys-hello
12:46justin_smithnoncom: that's going to be part of whitespace-mode
12:46justin_smithnoncom: check out M-x customize-group whitespace-mode<return>
12:46justin_smitherr, no, customize-group whitespace
12:46justin_smithnot whitespace-mode
12:48noncomjustin_smith: found that: http://joxi.ru/GrqM17YFNkXW8r is this correct or should i set something else there?
12:48justin_smithnoncom: you can customize the face used for going over 80 chars, or change that number 80 to a different one
12:48noncomif i set nil it says it will use fill-column.. :/.
12:49noncomlooks like the 99999 have no effect
12:49justin_smithyeah, a large number works if you never want that warning (as would default-face for the long line face)
12:49justin_smithnoncom: you probably have to turn global-whitespace-minor-mode off and then on again
12:50justin_smithnoncom: ah! M-x global-whitespace-toggle-options
12:50justin_smiththat's your ticket
12:50noncomyeah, just killed-reopened the buffer it worked. so i switch it off-on globally
12:51justin_smithOK, - but global-whitespace-toggle-options is still worth checking out
12:52noncomi did - thre're some options that could be toggled for me globally, i toggled the face option
14:04devthdefonce, y u no accept a docstring?
14:06nys-let requires an even number of forms in binding vector <-- can somebody explain this?
14:07devth(let [x 1])
14:07ridcully_(let [a 1 b 2])
14:07nys-(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:07justin_smithnys-: you can't have a binding without a value or value without a binding in let's binding vector
14:07devth2, 4, etc
14:08ridcully_nys-: this is an even number. the first one is a vector the second one a list. what you see there is destructuring
14:08nys-yup. this is from the clojure koans
14:09nys-I dont really get why this isn't working then? wouldn't this be an even number?
14:09devthit does work
14:09ridcully_what is "does not work"?
14:10ridcully_if the test there fails, its most likely due to missing " " in your str
14:10nys-I added that " "
14:10nys-but my repl is complaining of the non-even binding vectors
14:10justin_smithafter last-name too
14:10devth,(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:10nys-thats it ^ i think
14:11clojurebot"RichHickeyThe Clojurer aka Go Time aka Lambda Guru"
14:11justin_smithtwo missing spaces
14:17nys-good stuff
14:17nys-my problem was that i was breaking the let function into multiple lines in repl
14:17nys-which is why i got that error
14:18justin_smithwhy would line breaks change anything about let?
14:19nys-i dont know, I put the expression in one line and i actually got a string returned and not that error :x
14:20nys-i'm very new to this, so sorry if this is very newbie
14:21justin_smithnys-: 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:24kopasetikQuestion: How do I turn a number into a vector of its digits?
14:25BRODUS,(into [] ((comp seq str) 123))
14:26clojurebot[\1 \2 \3]
14:26ridcully_,(map #(- (int %) (int \0)) (str "42666"))
14:26clojurebot(4 2 6 6 6)
14:27justin_smithBRODUS: that seq call is redundant
14:27justin_smith,(into [] (str 123))
14:27clojurebot[\1 \2 \3]
14:29BRODUSdidn't realize that, since I thought strings weren't sequences
14:29BRODUSi mean, i didn't realize that into did the conversion
14:30kopasetikBRODUS: Thanks!
14:33justin_smith,(reverse (ffirst (drop-while (comp not zero? second) (iterate (fn [[i r]] [(conj i (rem r 10)) (quot r 10)]) [[] 420]))))
14:33clojurebot(4 2 0)
14:33justin_smithin case you want to do it without strings / chars :)
14:34justin_smith,(ffirst (drop-while (comp not zero? second) (iterate (fn [[i r]] [(conj i (rem r 10)) (quot r 10)]) [() 420]))) ; simplified
14:34clojurebot(4 2 0)
15:10Trioxinokay 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:10justin_smithTrioxin: 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:11Trioxink
15:11justin_smithTrioxin: http://clojure.org/java_interop in case you have not seen it
15:11justin_smith,(.getTime (java.util.Date.)) ; simple interop
15:11clojurebot1450901505490
15:13Trioxinthat'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:13justin_smithTrioxin: what?
15:13justin_smithTrioxin: if you have a dep that pulls it in, it can be used as above
15:14Trioxinooooh
15:14favetelinguisis 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:14justin_smithso you use lein or boot or whatever to specify you want that artifact, the interop syntax will work with objects in that class
15:15justin_smithfavetelinguis: if reading from a channel returns nil it is closed
15:15Trioxinduh "Member Access" doesn't imply having to do anything crazy
15:15justin_smithTrioxin: right, if you know the field name its simple
15:15justin_smithTrioxin: interop is a lot easier than most people who don't use it think it would be
15:16Trioxinso 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:19justin_smithTrioxin: I don't think I understand that question
15:19justin_smithTrioxin: instantiating a class is straightforward (java.util.Date.) make a new date object using the no-arg constructor
15:20justin_smith,(java.util.Date. 0) ; epoch
15:20clojurebot#inst "1970-01-01T00:00:00.000-00:00"
15:21justin_smith,(java.net.URL. "http://example.com&quot;)
15:21clojurebot#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:21justin_smith:P
15:21justin_smithbots
15:21dnolenhttp://swannodette.github.io/2015/12/23/year-in-review/
15:42jonathanjis there a convenient way to turn a prismatic schema validation error into something more user-friendly?
16:38TimMcjonathanj: If you find out, let me know!
16:38TimMcI haven't tried super hard to find out, and certainly not recently, but it was a mildly annoying thing a while back.
17:15Trioxinomg i ate too much shrooms what do I do
17:15Trioxincode?
17:15Trioxinyes
17:15devth,(doc shrooms)
17:15clojurebotexcusez-moi
17:16Trioxinlol
17:17sdegutisToxicFrog: ugh not the shrooms again
17:17justin_smithTrioxin: the best thing to do on shrooms is learn vi
17:17justin_smithor ed, if you already know vi
17:17sdegutiscant even spell ur own name rite lol
17:18Trioxinsed?
17:18Trioxinvi is just a text editor right?
17:18Trioxini always use pico/nano
17:18justin_smithTrioxin: it's a text editor which will be maximally enjoyable while tripping
17:21Trioxinhaven'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:22Trioxinor maybe some breakthrough. The double helix was imagined on lsd
17:22justin_smithTrioxin: I figured if you were managing IRC you couldn't actually be very far gone
17:23sdegutisWhat about that regex based one that Go Man uses?
17:23sdegutisOh yeah. Sam and Acme.
17:23sdegutisDo you use those?
17:23justin_smithsdegutis: same is awesome
17:23justin_smith*sam
17:23sdegutisI have a hard time believing that.
17:23sdegutisIf it was, you would be using it.
17:23justin_smithacme is pretty cool if you have a real 3 button mouse
17:24justin_smithsdegutis: it's not extensible like emacs is, and three isn't a good distro of it anymore
17:24Trioxinnever heard of those
17:24sdegutisjustin_smith: my mouse is 3 button afaik, third is scroll wheel
17:24sdegutisjustin_smith: but I'm not a fan of using it
17:24sdegutisnot in my text editor
17:25justin_smithsdegutis: 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:25sdegutisah
17:25sdegutisemacs tho is a solid 5/7
17:25sdegutissuper customizeable
17:25justin_smithyou want like a proper 3-real-buttons mouse, which you basically can't get any more
17:25sdegutisi used to have that one once
17:25Trioxinjetbrains ftw
17:25justin_smithyeah, that's why I'm using it - also inertia of course
17:26sdegutisnaturally
17:27Trioxinjetbrains should make an ide that combines all their products since all their IDEs are the same with different tools
17:27Trioxinthe VS of jetbrains so to speak
17:27ridcully_ultimate is basically this
17:27Trioxinoh
17:27ridcully_might lack c++ and c#
17:28BRODUSwhat makes jetbrains so good?
17:28sdegutisGot a good Forth tutorial please?
17:29sdegutisAll ones I find are either too verbose with unnecessary irrelevant details, or too primitive.
17:33TrioxinBRODUS, 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:35tafBRODUS, 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:28btcNeverSleepsLong 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:28btcNeverSleepsError is now very cryptic and hard to track.
18:29btcNeverSleepsIs this common?
18:30btcNeverSleepsAll 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:34jessicajhi
18:35skdjfhaskjdfhdashi
18:35skdjfhaskjdfhdasi'm looking for a way of converting an empty list to the string "()"
18:35skdjfhaskjdfhdaswhen i call str on [], i get "[]"
18:35skdjfhaskjdfhdaslikewise, str on #{} gives me "#{}" and str on {} gives me "{}"
18:36skdjfhaskjdfhdasbut calling str on '() gives me "clojure.lang.PersistentList$EmptyList@1"
18:36rhg135,((comp str seq) [])
18:36clojurebot""
18:36rhg135,((comp pr-str seq) [])
18:36clojurebot"nil"
18:37rhg135,((comp pr-str empty) [])
18:37clojurebot"[]"
18:37sfz-,(pr-str '())
18:37clojurebot"()"
18:37rhg135,((comp pr-str list seq) [])
18:37clojurebot"(nil)"
18:37rhg135,((comp pr-str list* seq) [])
18:37clojurebot"nil"
18:37sfz-skdjfhaskjdfhdas: (pr-str '())
18:38skdjfhaskjdfhdassfz-: thanks!
20:50felixnhttps://gist.github.com/munro/36f82883eb89d38c4452 <-- anyone have some tips to clean this function definition up? core.logic function to solve concat vars
20:51justin_smithfelixn: I don't know if line 1 was just a side effect of simplifying your real code, but it's a no-op
20:51felixnjust put it there to show what m/ was
20:51justin_smithOK, makes sense
20:52justin_smith,(:use '[this does nothing])
20:52clojurebotnil
21:40sdegutisHi.
21:40sdegutisjustin_smith: you awake?
21:40justin_smithsup
21:40sdegutisjustin_smith: you ever wrote you a prog lang?
21:41justin_smithI kind of tried once it wasn't good
21:41sdegutis:D
21:41sdegutisman its just a dream i just cant shake
21:57justin_smithsdegutis: my town has a bird named owl capone and it is known for unprovoked attacks on on cyclists and pedestrians
21:58TEttingerjustin_smith, haha
21:58TEttingersame bird?
21:58sdegutisjustin_smith: well then!
21:58justin_smithTEttinger: yes, it's a single owl who likes to attack and harass humans
21:59TEttingerwe have a cute lil' babby owl that makes freaky noises at night but is durn cute
21:59TEttinger(in our neighborhood here)
21:59sdegutisjustin_smith: while my wife and i surely did enjoy that antidote, I can't quite figure out the relevance
21:59TEttingeralso red-whiskered bulbuls
21:59TEttinger(which aren't even native to this hemisphere)
21:59justin_smithsdegutis: not really relevant at all
21:59sdegutisjustin_smith: well i enjoyed it!
22:01justin_smithTEttinger: https://twitter.com/despair/status/679136039303278593
22:01TEttingernot sure if I should open chrome now; copying several million files (again) (different larger files)
22:01sdegutisjustin_smith: merry christmas!
22:01justin_smithand to you as well
22:02sdegutisaww you're so nice
22:03TEttingerI got a christmas present. I found out about windows robocopy utility
22:03sdegutisok i really need to buckle down and figure out what to do with my time instead of wasting all of it
22:03sdegutisTEttinger: is it great?
22:03TEttingerit seems quite a bit faster that copy or gnuwin32 cp
22:04sdegutisoooh, 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:04sdegutisso that's convenient.
22:04TEttingerthis 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:05justin_smithTEttinger: 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:05TEttingercp 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:06TEttingerit appears to have copied about 20K not-tiny files in the span of this conversation
22:07sdegutisTEttinger:LOL
22:07sdegutisgood pun bro i like that pun
22:07TEttingermight be a lot more
22:07sdegutismore puns coming up you mean?
22:07TEttingerI think justin_smith made the reference first!
22:07sdegutisi could be okay with that
22:07sdegutisoh man!
22:07sdegutisi totally didnt even understand his reference!
22:08TEttingeralso searching for robocopy gets you lots of results for robocop
22:08sdegutisi tought it was just some pushy dialog that windows users know about
22:08TEttingerdoes gnu cp have a multi-threaded option on linux?
22:10justin_smithTEttinger: 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:10justin_smithTEttinger: maybe with an encrypted system multi-threading cp would help?
22:10TEttingerno idea
22:10TEttingerI know there is a CPU-based step
22:11TEttinger(figuring out what to copy)
22:11justin_smithTEttinger: reductio ad absurdum version - you need your files printed faster, so you start a new thread for each print job
22:11justin_smithTEttinger: sure, but I assure you waiting for the hardware is the bottle neck
22:11TEttingerfor cp it actually isn't at first
22:11TEttingercp takes two steps, one it writes no files
22:12TEttinger(at least here)
22:12justin_smithTEttinger: right, but the read is also bound by the physical medium, not computation speed
22:12TEttingerit is probably reading like mad though
22:25sdegutisTEttinger: what are you copying that takes so long?
22:25sdegutispersonally my advice is to delete it
22:25sdegutisnot worth the time, man.
22:25justin_smithsdegutis: star wars episode IVII
22:25justin_smitherr, wait
22:25justin_smithI mean ILII
22:25justin_smith,(require 'clojure.pprint)
22:26clojurebotnil
22:26TEttingersdegutis: it's uh a lot of rendered images
22:26justin_smith,(clojure.pprint/cl-format nil "~@r" 42)
22:26clojurebot"XLII"
22:26justin_smithahh, that's the one
22:26TEttinger,(Math/pow 2 20)
22:26clojurebot1048576.0
22:26TEttinger,(Math/pow 2 21)
22:26clojurebot2097152.0
22:26sdegutis,(clojure.pprint/print-table [:a :b] [{:a 1 :b 2} {:a 3 :b 4}])
22:26clojurebot\n| :a | :b |\n|----+----|\n| 1 | 2 |\n| 3 | 4 |\n
22:26TEttingerthat's on par
22:26sdegutisI use that. It's nice.
22:27TEttingeroh crap!
22:27TEttingerI'm copying way more than needed
22:28sdegutis4% battery
22:28sdegutisguys
22:29sdegutisim prolly gonna exit
22:29sdegutisby circumtance
22:29sdegutissorry im not good at goodbyes
22:30sdegutisjustin_smith: thanks for always being so helpful
22:30sdegutisoh man 3% til the laptop dies
22:30justin_smithsdegutis: 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:30sdegutisjustin_smith: you can have my stereo
22:30justin_smithsdegutis: np
22:31sdegutisoh wait 4% still woooo
22:33sdegutisjustin_smith: you cant have my stereo until im gone
22:33justin_smithk
22:33sdegutisok this joke is too dark now
22:33sdegutisgonna stop it w/ the dark joke
22:34justin_smithsdegutis: don't go softly into the dark night, rage rage at the falling of the light!
22:34justin_smithor however that goes
22:35sdegutissorry i dont listen to 80s songs
22:35sdegutisso i dunno how it gos
22:36justin_smithTIL Dylan Thomas was an 80's song
22:36sdegutisim not into pokemon so i dunno who thomas dylan is sorry
22:48TEttingerjustin_smith: isn't that a famous poem or something?
22:48justin_smithTEttinger: 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:48TEttingermm
22:49TEttingerI prefer "I WARNED YOU DOG! I TOLD YOU ABOUT STAIRS!" as my anecdote for when someone drops offline
22:50TEttingersweet, even with filtering out files I'm not using (an extra step), it seems faster
22:51sdegutisi like the raven one better
22:52sdegutisit rhymes and has good timing
22:52sdegutisquoth the raven, "nopin on outta here"
22:52sdegutisor smth
22:56TimMcOK, I want to rename my URL library. Is "earl" a terrible name?
22:56TimMcget it get it
22:56justin_smithduke
22:56TEttingerthe java mascot?
22:56TimMcWhy duke?
22:56TEttingerduke of earl
22:56sdegutisTimMc: i like it
22:56TEttingerduke of url
22:56sdegutisTimMc: you have my vote
22:57TEttingerurletha franklin
22:57TimMcTEttinger: I... see.
22:57TimMcha
22:57TimMcAlso, how do I tell if someone is already using the name I want?
22:57TEttingerBurle
22:58TimMcMaybe "earnest".
22:58TEttingerFurl
22:58justin_smithTimMc: did you know the English used the title Earl instead of Count because of a common mishearing of the latter? True story.
22:58sdegutisTimMc: https://github.com/search?utf8=%E2%9C%93&amp;q=earl
22:58TEttingerSorrel
22:58sdegutisTimMc: thats the canonical repository of taken project names
22:58BRODUSwhURLwind
22:58TEttingerPurl (not to be confused with prl)
22:58TEttingerperl
22:58sdegutisTimMc: AND MY AXE!
22:58TEttingerSqurl
22:59TimMcHmm, that github search turns up too many URL-related libs.
22:59BRODUSTURLTLE
22:59TEttingerGurl, followed quickly by new releases Gurrl, Gurrrl, and Gurrrrrrrrrrl
22:59justin_smithTimMc: I am going to make a twitter specific URL api, urly-bird
22:59TimMcTEttinger: winner
22:59sdegutishmm i think i waited too long to make that reference
22:59justin_smith(throw "oh no you dint")
22:59TEttingerha
23:00TimMcIt's currently called johnny and I was thinking of versioning it as johnny2, johnny3, etc.
23:00TEttingermm-hm.
23:00justin_smithTimMc: but then you'll end up hittin johnny5
23:00TimMcyep!
23:00sdegutisoh man
23:00rhg135Johnny43
23:01sdegutisthat brings back memories
23:01sdegutisi suddenly feel so sad for a robot
23:01justin_smithTimMc: 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:01sdegutisWAIT A SECOND
23:02sdegutisTHIS GUY LOOKS LIKE STEVE JOBS https://en.wikipedia.org/wiki/Short_Circuit_2
23:03justin_smiththe fact that there is a thing called an Earldom seems prime for an awesome ajax/react flavored pun
23:04TimMcI was originally calling it "johnny" because I wrote it in anger; the complaint was "why can't johnny read URLs".
23:04justin_smithhistorically, earldoms were replaced by shires
23:04justin_smithTMYK
23:04TEttingerthere's also the really agonizng wikipedia page on "pearling", which I suggest never looking up ever especially at work
23:05sdegutisplot twist: it's about the really tedious job of farming oysters for their pearls
23:05TEttingerparts of me hurt thinking about it
23:05justin_smithTEttinger: perling is one of the two essential parts of knitting, the other being called knitting, funny enough
23:05TEttingerthis is with an a
23:05justin_smithI know
23:05TEttingerand it's purl I thought
23:05TimMcBut now it's almost ready for beta, and johnny the library *can* read URLs, so the clever title is now really stupid.
23:06justin_smithTEttinger: oh you are correct
23:06justin_smithearldoms were replaced by shires, so I say shire
23:06justin_smithdunno
23:06TimMcMaybe "earnest" would be a good name.
23:07TEttingerI 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:07justin_smithTEttinger: challenge: find a wikipedia page for a body modification that causes no physical pain
23:07TEttingeroddly enough, "in swedish prisons" wouldn't be bad at all
23:07TEttingerstick on tattoos
23:08TEttingerdentures
23:08justin_smithTEttinger: the page must mention "body modification"
23:08TEttingernot doin' it
23:08TEttingerIIRC the pearling page has uh pictures. but I think I've blocked them from memory
23:10TimMcgood ol' wikipedia
23:10TEttingerI 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:11TEttingerI think that book went flying shut at that point
23:13TEttingerI 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:13TimMcTEttinger: I have an amazing video for you: https://www.youtube.com/watch?v=5uzuYRY2faQ
23:14TEttingerpretty sure I'm not clicking that for a few reasons
23:14justin_smithTimMc: oh man, those things
23:14TEttingeroh yeah, nope
23:14TEttingertailless whipspider agh
23:14TEttingerthanks my lazybot on another server
23:14TimMcIt's a totally gorgeous but also utterly alien sight.
23:14TEttingermantis shrimp are totally gorgeous/alien
23:14TEttinger"thumbsplitters"
23:15TEttinger"terrors of aquariums"
23:15justin_smithTimMc: the sound track is a nice touch
23:15justin_smithTEttinger: have you heard of bobbit worms? guess how they got the name
23:15TimMcjustin_smith: Apparently it was used in an art piece to accompany the music.
23:15TEttingeroh yeah, they're pretty cool looking
23:15TimMcOh yeah, I was gonna say... bobbit worms are the real terror of the aquarium.
23:15TEttingerwhat, 6 foot long underwater worm with razorjaws?
23:15TEttingerTimMc: uh
23:16TEttingerbobbit worms don't shatter the glass for fun
23:16justin_smithTEttinger: and they cut things in half, and cause permanent paralysis of nerves
23:16TimMccouldn't think of the name though
23:16TimMcThere is that. But pistol shrimp are stronger, right?
23:16TEttingerno
23:16justin_smithI think I'd rather a smashed aquarium rather than losing a finger and never having feeling in my hand again
23:17justin_smithTimMc: this video is really great
23:17TEttingermantis 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:18TEttingerif a mantis shrimp strikes too many times, they eventually start lose the exoskeleton on their strikers
23:18TEttingerconstantly growing, constantly trying to eat
23:18justin_smithlike a car wearing down its brake pads
23:18TEttingeryep
23:18TEttingerif the car was creating miniature explosions to stop
23:19justin_smithyeah, analogy falls well short
23:19TimMcCars create miniature explosions to go. :-P
23:19TEttingerthe pistol shrimp is similar
23:19TEttingerbut can't direct its hit in any one direction
23:19TimMc"miniature explosions to go", there's a startup for you
23:19TEttingerha
23:19TEttingerunderwater creatures are crazy
23:19justin_smith"uber, for flatulence"
23:21TEttingersymbion 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:21justin_smithTEttinger: oh yeah, their breeding cycle is insane
23:22TEttingerits lifecycle is in the territory of "wait are we talking a non-fictional animal?"
23:24TEttingerlobsters 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:25TEttingermeanwhile, 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:26TEttingerevery part of their skin has multiple dilate/contract muscles for the pigment spots it uses
23:26TEttinger(well, one muscle per spot)
23:27TEttinger(layers of spots though)
23:27justin_smithand I can't even wink properly without looking like a dumbass
23:27TEttingerha
23:27TEttingerI can raise my left eyebrow but not my right
23:29TEttingercan'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:34TimMcTEttinger: Both pages on Symbion pandora that I've looked at so far lack a lifecycle diagram for no particular reason I can discern.
23:34TEttingerawww
23:34TEttingerit involves asexual budding, the female destroying her digestive system to form her reproductive system to generate a ton of baby males, ete.
23:35TEttingerI'm sure I'm getting something wrong
23:35TEttingerit's very complex
23:35TimMcI think this one page said the female generates just one egg and then dies.
23:35TimMcwhich seems entirely wrong
23:35TEttingerno it's mostly right I think
23:36TEttingershe turns her digestive system, needed to live, into a baby
23:36justin_smithTimMc: http://icb.oxfordjournals.org/content/42/3/641/F2.large.jpg
23:36TimMcSounds like they've decomplected gene exchange from multiplication.
23:36TEttingerthe asexual stage I think makes more asexuals with identical DNA
23:36TEttingeryep
23:36TEttingeralien.
23:37justin_smithTEttinger: but stage 14 is "MALE SETTLES" - so on a deep level, I can relate
23:38justin_smith(followed shortly by "FEMALE ESCAPES" - story of my life)
23:43sohailHey, 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:43TEttingerreplacement of buccal funnel, boy if I had a nickel
23:43justin_smithsohail: you could define a profile with the right injection
23:43justin_smithTEttinger: lol
23:43sohailjustin_smith: that sounds like what I need to do, but what is the mechanism for said injection?
23:44sohailah, I think I understand. The :main function
23:45justin_smithsohail: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L156 - this code gets run on startup
23:45sohailoh that's even nicer
23:45sohailthanks justin_smith
23:45justin_smithnp, good luck
23:46devthso 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:47justin_smithdevth: yeah, you could manually capture the binding while inside the form, but that code actually accesses the var that leaves bound scope
23:47devthtrying to think of any clever tricks i could use to forcibly leak the scope into the instance and make it stick.
23:48justin_smiththe capturing version would be (let [v *foo*] v)
23:48devthoh. hm
23:48justin_smithbut that would need to happen when you create the record, not inside one of its methods
23:49justin_smithdevth: (fn [] (->AA *foo*)) would work, if you changed foo to have a field
23:50justin_smitherr, changed AA to have a field, that is
23:50devthyeah
23:50devththe important part is that the outer dynamic var. a bunch of other fns depend on it.
23:51devthok i think i need to rethink this
23:52devthi 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:53devthor rebind *foo* in every one of A's function (in reality there are 10). pretty gross
23:54justin_smithdevth: 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:54justin_smithdevth: 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:54devthright
23:55devththis 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:55devththen it became (def ^:dynamic *config*)
23:56devththen i moved to using protocols for the first time on top of that
23:56devthalmost like i want OOP
23:56justin_smithyeah - 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:56devthyeah. it's starting to sound better all the time
23:56devthhmm
23:57justin_smithdevth: one way to do it is with an opts map, taken as the first arg
23:57justin_smithor as last
23:57justin_smiththat way in can hold as many random-ass things as you want to propagate, each can used namespaced keywords
23:57justin_smithand you have explicit control of the bindings in that map
23:58devthyep. i am quite sick of binding madness :)
23:58devthwhat do you mean by namespaced kws?
23:58devth:foo/bar?
23:58devthi usually don't have to resort to namespacing them..
23:59justin_smithdevth: namespacing is good because it clarifies who cares about that key