#clojure logs

2013-12-27

00:00rhg135i get what js is but it doesn't actually send it
00:01rhg135i'm stumped
00:02rhg135it's actually logging everything, just not sending it or blocking a second request works fine
00:02rhg135well not fine but it does log for it
00:11rhg135any ideas why that .write call isn't writing to the client?
00:26jebberjebls
00:26lazybotbin data lib lost+found media proc sbin swap sys var
00:46ianeslickHas anyone dealt with using macros in a file used in both clojure and clojurescript?
00:46ianeslicki.e. ^:shared ns
00:47ianeslickI'm guessing that unless I use something like cljx, there is no way to conditionally use :require-macros only in the clojurescript case?
01:46ddellacostabitemyapp: ping
02:28v4nIf I want to set a local variable within a defn (e.g. system time), would using let be my best choice?
02:29rhg135Yup
02:30v4nAny way to avoid having to wrap my entire function body with let for just setting the local time variable?
02:30rhg135Well not variable as it doesn't vary usually
02:30v4n*Scope
02:31rhg135Not that I know
03:34sverihi, i trying to figure out whats the best way to convert a vector like this [1 2 3 4 5 6] into a string like this: "1,2 3,4 5,6"? should i just use loop/recur or one of the helper functions?
03:38sm0ke,(clojure.string/join "," [1 2 3 4 5 6])
03:38clojurebot"1,2,3,4,5,6"
03:39TEttingersveri, with every other pair having a comma separating them?
03:41sverism0ke: i only need commas between pairs
03:41TEttinger&(clojure.string/join " " (mapv #(clojure.string/join "," %) (partition-all 2 [1 2 3 4 5 6])))
03:41lazybot⇒ "1,2 3,4 5,6"
03:42sveriTEttinger: ah, thats nice, thank you :-)
03:42TEttingernp
03:46rhg135Any reason for mapv?
03:47rhg135As opposed to just map
03:49ddellacostarhg135: lazy sequence vs. vector?
03:50rhg135It doesn't affect join?
03:50rhg135Or does it
03:50ddellacostarhg135: I assume join is going to realize the sequence, so doesn't really matter in that context I suppose
03:51rhg135I guess not
03:51ddellacostaor rather, join *does* realize it, to be clear
03:54TEttingerrhg135, I used mapv to make clear that it wasn't going to produce lazy output
03:55TEttingerthey're very similar on performance, right?
04:25sm0kejava sucks
04:26sm0kecant seem to find an equivalent of promise for last 2 hours
04:36Raynes$google java.util.concurrent.FutureTask
04:36lazybot[FutureTask (Java Platform SE 7 ) - Oracle Documentation] http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/FutureTask.html
04:36Raynessm0ke: ^
04:36RaynesOh, promise.
04:36RaynesWow. Somehow I managed to see 'future'
04:36RaynesApologies.
04:38sm0kehmm i guess
04:38sm0keFuture can be used very much to copy promise
04:39sm0kein some ways
04:39sm0keit infact has set and get which would behave the same i guess
04:40sm0keonly clojure makes distinction between future and promise
04:41sm0kehmm sensible developers should have named methods for Promise as kept, broken etc. Seems like a very sensitive api to have
04:41sm0keexplains why its not there
06:05nones,t
06:05clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: t in this context, compiling:(NO_SOURCE_PATH:0:0)>
06:05nones,foo
06:05clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0:0)>
06:32daGrevisHello! I'm doing Clojure koans
06:32daGrevishttp://vpaste.net/qRWeT What's wrong with this?
06:33hyPiRiondaGrevis: What is (+ 1 2 3) in Clojure?
06:34daGrevishyPiRion, lazy expr?
06:34nonesdaGrevis: you need to compare lists, (0 1 2 3 4 5) not list
06:34hyPiRiondaGrevis: It's an expression, where the function `+` is evaluated on the arguments 1, 2 and 3
06:34hyPiRionwith the arguments, rather
06:36daGrevisso I guess the correct answer is http://vpaste.net/MikBn
06:36daGrevisor at least I pass ;D
06:36ddimano
06:36ddimawhat hyPiRion tries to say: by default the first element of a list is interpreted as the function to be invoked with the rest being arguments
06:37nones,(0 1)
06:37clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
06:37ddimaso you need to make clojure look at it as a "pure" list and not invoke anything
06:37nones,(list 0 1)
06:37clojurebot(0 1)
06:37ddimasorry, pure is a bad word, "simple"
06:37ddima,`(0 1)
06:37clojurebot(0 1)
06:37hyPiRiondaGrevis: Unless you explicitly tell a lisp to not evaluate the list, it will be evaluated
06:37daGrevisto tell it not to eval it, I say '(something) ?
06:38ddima` is shorthand for quote
06:38ddima,(quote (1 2 3))
06:38clojurebot(1 2 3)
06:38hyPiRiondaGrevis: Exactly! quote, or ', will avoid evaluation
06:39ddimaor, as nones pasted before, you can use the "list" function
06:39ddima,(= `(0 1 2 3) (for [x (range 4)] x))
06:39clojurebottrue
06:39daGrevishyPiRion, I learned Haskell a bit before. everything is lazy in it by default. so in Clojure everything is NOT lazy unless you say it to be lazy? mm?
06:39hyPiRion`, or backquote, will do something similar, but that's not neccessary to know before you go into macros
06:39Raynes&'(0 1)
06:39lazybot⇒ (0 1)
06:40daGrevis,(= '(1) `(1))
06:40clojurebottrue
06:40hyPiRiondaGrevis: evaluation of code is not lazy, but generally, list operations will be
06:40daGrevisthank you, guys :)
06:40ddimahf
06:40hyPiRiondaGrevis: so (foo a b) will always be called, but e.g. (map + '(1 2 3) '(4 5 6)) will produce a so-called lazy sequence
06:40ddimahyPiRion: you're a natural teacher ;)
06:41hyPiRionddima: oh what, that's a first
06:41daGrevishyPiRion, I think I got it, thanks :)
06:41hyPiRionthanks I guess =) / :p
06:41nonesbut remember:
06:41nones,(= `(0 1 (+ 1 1) 3) (for [x (range 4)] x))
06:41clojurebotfalse
06:41nones,(= (list 0 1 (+ 1 1) 3) (for [x (range 4)] x))
06:41clojurebottrue
06:42ddimawell, i liked how you tried to help him find his own answer while explaining the the mechanics
06:42ddimainstead of "quote/list, neext" ;)
06:43daGrevismany ways to do a thing, pretty weird for a python dev ;d
06:43ddimanot really
06:43ddimaprefer list for that
06:43hyPiRionddima: oh yeah, it's a good way of learning stuff I think.
06:44daGrevis,(= list(1 2) '(1 2))
06:44clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
06:44daGrevisyelp! :D
06:44deadghostidk feels like clojure gives some guidance
06:44deadghostby making some things more difficult
06:44daGreviswoah sorry
06:45daGrevis,(= (list 1 2) '(1 2))
06:45clojurebottrue
06:45daGrevisthere :)
06:46ddimaused to happen to me all the time, $functionname($args) thing in clojure ;)
06:46ddimamuscle memory
06:50logic_progdoes keyword destructuring i.e. (let [{:keys [foo bar]} {:foo 20}] ... ) provide a way to provide a _default_ value
06:51logic_progi.e. I want bar to be bound to "0" rather than "nil" when there is no key for bar
06:52hyPiRionlogic_prog: yes, you can use the :or keyword. For instance, ##(let [{:keys [foo bar] :or {bar 0}} {:foo 20}] {:foo foo :bar bar})
06:52lazybotjava.lang.RuntimeException: Unable to resolve symbol:   in this context
06:52hyPiRion,##(let [{:keys [foo bar] :or {bar 0}} {:foo 20}] {:foo foo :bar bar})
06:52lazybot⇒ {:foo 20, :bar 0}
06:52clojurebot#<RuntimeException java.lang.RuntimeException: Reader tag must be a symbol>
06:52hyPiRionheh, whoops
06:53logic_proghyPiRion: nice, thanks!
06:55logic_proghyPiRion: do you have any cool clojure projects on github?
06:57hyPiRionlogic_prog: depends on what you mean by cool. I mostly contribute to Leiningen either directly or indirectly through plugins
06:58logic_progah, I just remember seeing you here quite a bit
06:58logic_progand was curious if there were any projects whose code I could learn from
06:58logic_prog(the other day, I learned "lein pdo" and it changed the way I use lein)
07:02hyPiRionlogic_prog: well, Leiningen isn't a good place to learn idiomatic Clojure, because it's not your usual Clojure program.
07:08hyPiRionTo be fair, I'm not sure what a good library to learn from is. Perhaps starting with https://github.com/weavejester/medley or https://github.com/flatland/useful, as they are rather easy to read.
07:12hyPiRionbut the best is to code much, and when you need to use a library, attempt to understand what's going on behind the covers if you got time
07:12logic_proghyPiRion: oh, by "learn from", I didn't mean learn clojure
07:12logic_progbut rather "a nice library I can pull in that may be useful"
07:12logic_progfor example, my current project.clj has 22 dependencies
07:12logic_progbut always looking for cool clojure _libraries_ to learn to use,
07:12logic_prognot actually learn how to write clojure code :-)
07:13hyPiRionaha
07:13logic_progso for example, learning core.logic was awesome
07:13logic_progas was match / ring / compojure
07:14hyPiRioninstaparse is good
07:15logic_progi found it really slow at parsec to be better
07:15logic_progi never understood why anyone wanted _all parses_ rather than make the grammar unambigious
07:15logic_progit goes against a fundamental principle of CS
07:15logic_progdon't be ambigious
07:16arrdem... wat
07:16arrdemyou can totally define an ambiguous grammar that has meaning in multiple parse trees
07:16logic_progyeah
07:16logic_progbut when is this iseful in practice?
07:16arrdemnow will a sane grammar be unambiguous? sure, but that's a performance tweak usually.
07:17logic_progno, see packrat parsing
07:17arrdemlogic_prog: natural language :/
07:17logic_progyou take a CFG, then specify precedence
07:17logic_progand boom, no ambiguity
07:17hyPiRionenviron is also nice to know of, although I tend to use edn for environment vars these days
07:17logic_progarrdem: for that, you need probabilistic techniques
07:18arrdemlogic_prog: I mean to do it "right" sure, but how is probabalistic analysis any different from having multiple ambiguous yielded trees?
07:18logic_progthey have probabilites associated with them
07:18hyPiRionlogic_prog: the instaparse perf isn't good, true, but I find it useful for mocking up parsers
07:18logic_progand generally, you can prune stuff
07:19hyPiRion(Okay when you have deadlines and stuff)
07:20arrdemhyPiRion: instaparse is amazing when you want a parser yesterday for a well defined language.
07:20arrdemEg. Pascal or Scheme or something else you just want to plug and chug with a BNF on
07:20arrdems/on/for/
07:45bitemyappbwahahaha...plans are made...another soul gets converted tonight...
07:47bitemyapparrdem: hey I'm not the one making snake-oil in code form >:D
07:48arrdembitemyapp: dogecoin is totally legit I don't know what you're talking about
07:48bitemyapparrdem: I actually meant snake oil => anticipating the sine wave
07:48bitemyapparrdem: but I'm VERY curious to see how the returns, even if not large in magnitude, come out quantitatively
07:49bitemyappWRT alpha, overall risk, etc.
07:49arrdembitemyapp: haha yeah I'm still trying to get a handle on the problem so I can throw a neural network at it :P
07:49bitemyappwat
07:51arrdembitemyapp: it's like throwing a brick at something, except that when iterated the brick eventually figures it's stuff out and hits its mark
07:58arrdembitemyapp: sillyness asside I'm working on slapping togehter a logging system so that I can do some testing and answer those questions before going live.
08:15pepijndevosSo persistent datastructures in JS, nothing stops silly JS libs from setting modifiying them, right?
08:15pandeiroanybody working with datomic-console? i'm trying to get it set up for datomic-free; no luck so far
08:16daGrevis,(map + (1 2))
08:16clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
08:16daGreviswhy it doesn't work?
08:17arrdemdaGrevis: you want to use [] for a sequence literal.
08:17daGrevisin short, I want to get sum of list
08:17hyPiRiondaGrevis: (list 1 2) vs. (1 2)
08:17arrdemdaGrevis: by writing (1 2) you are saying (apply 1 2) which makes no sense
08:17daGrevis,(map + (list 1 2))
08:17clojurebot(1 2)
08:17daGrevis:/
08:17daGrevisokay, i got rid of error
08:17daGrevisthought exepected result was 3
08:17arrdemdaGrevis: check out reduce
08:17nones,(reduce + (list 1 2))
08:17clojurebot3
08:18daGrevisright! i knew about reduce, just didn't thought to use it :)
08:18daGrevisi present to u my first code in clojure
08:18daGrevis,(reduce + (filter #(zero? (mod % 3)) (filter #(zero? (mod % 5)) (range 1 999))))
08:18clojurebot33165
08:19daGrevisdo u like it? :D
08:21hyPiRiondaGrevis: Good start :)
08:22gilleshi can anybody answer a basic core.logic question ?
08:22hyPiRionJust fyi, (range a b) would return all elements from a up to, but not including b.
08:23hyPiRion,(last (range 1 100))
08:23clojurebot99
08:23hyPiRion~anybody
08:23clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
08:25nones,anybody
08:25clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: anybody in this context, compiling:(NO_SOURCE_PATH:0:0)>
08:25gillesI declare a "parent" defrel and then some facts about joe is parent of suzy etc... how can i find pairs of persons which are not in a parent relationship ?
08:25nones~anybody
08:25clojurebotanybody is anyone
08:26arrdemnones: ~ invokes an inference and pattern matching system
08:26arrdemnones: , evals code
08:26daGrevishyPiRion, how is it related to my code?
08:28hyPiRiondaGrevis: If you want to find the sum of all the multiples of 3 or 5 below 1000, you should do (range 1 1000) instead. Just have a suspicion that's what you wanted to do.
08:30daGrevishyPiRion, imo below 1000 means 999 and NOT 1000
08:31daGrevishyPiRion, but you are right about me currently finding sum of numbers that are mod 3 and mod 5. i need OR conditional
08:31hyPiRiondaGrevis: (range 1 1000) returns (1 2 3 ... 997 998 999)
08:31hyPiRionand yeah, I was about to mention that, but I guess you figured =)
08:31daGrevishyPiRion, imo I could fix it by creating two lazy lists, then filtering both. one my mod 3 and other by mod 5. the I merge em and get sum like before.
08:32hyPiRiondaGrevis: yep, that's a good idea. Just remember to remove duplicates
08:32daGrevishyPiRion, so the question is: is 0 a natural number because wikipedia isn't super sure :D
08:32daGrevishyPiRion, good point about removing duplicates
08:34hyPiRiondaGrevis: Whether 0 is a natural number or not isn't that important in this case. 0 + x = x, so it wouldn't change your result
08:34daGrevisyou are right
08:35daGrevisyes, set up lein exec. much better :)
08:40daGrevishyPiRion, thanks, just understand what you meant
08:40daGrevisif I write (range 999), it really gives me 998 as last elem
08:41hyPiRionyup
08:41daGrevisso I present the solution to you :)
08:41daGrevishttp://vpaste.net/6d24h
08:41daGrevisdunno if I get how to indent corretly thought
08:41hyPiRiondaGrevis: yup, that looks correct :)
08:41instilleddoes someone have a working clojure/nrepl/emacs debugging setup and would be willing to share some insights? i'm currently bbatsov's excellent prelude. is ritz-* still the way to go? i can debug with eclipse or intellij but that's not really what I want.
08:45hyPiRiondaGrevis: most editors support some sort of autoindentation, but I wouldn't worry too much about it right now
08:47daGrevisI guess this indentation looks more decent http://vpaste.net/Sp8lv
08:47daGrevishyPiRion, ye, I guess. I'm using Vim with Vim-clojure
08:48daGrevishyPiRion, http://i.imgur.com/hMa8UZD.jpg
08:50hyPiRiondaGrevis: not a guru on vim, but I think `filetype plugin indent on` should help you on the autoindentation
08:51daGrevishyPiRion, u r correct and ft is on. i got niceties like autocomplete from standard lib. this doesn't change the fact that indentation doesn't work. ;D maybe it's turned off by default because Lisp and parens and something. gotta google
08:52gphilipparthere
08:52gphilippartcan anyone answer a core.logic question on relations ?
08:53AimHereWe don't know. The best way to ask a question on IRC is to blurt it out and wait
08:54AimHereUnless all you wanted to know if anyone could answer a core.logic question on relations, in which case, we don't know. Depends on the question.
08:54gphilipparthow do you find answers which do not satisfy a relation in core logic ?
08:57AimHereNot sure that's in general possible - this is some old musings on the subject, David Nolen being the guy who should know everything to know about core.logic: https://groups.google.com/forum/#!topic/clojure/hz63yeQfiQE
08:59gphilippartthanks for the heads up, that's the topic i was looking for
09:05gphilippartso, the answer is : it's possible since David added nafc in core logic to support Negation as a failure.
09:11AimHeregphilippart, well you'll have to refer to the current state of core.logic for that; last time I looked at core.logic, tthere were sweeping changes that broke all the tutorials!
09:17turbopapeHi people,
09:17turbopapedid anyone write something real-time in clojure ?
09:18turbopapeI mean, tiny servers that do content transformation on the fly, namely... ?
09:18turbopapeany pointers that can help ?
09:30broquaintturbopape: Something like this? https://github.com/schani/clojurec
09:32turbopapebroquaint maybe, but is this ready for production yet ?
09:39broquaintNo idea I'm afraid.
09:48pepijndevosWhy doesn't this work in clojurescript? (.indexOf [1 2 3] 2)
09:49hyPiRionturbopape, broquaint: No, not production ready.
09:49pepijndevosIntended result: 1, like [1,2,3].indexOf(2)
09:50turbopapeok...
09:51BobSchackpepijndevos [1 2 3] is a clojurescript vector not a javascript array
09:51glosolipepijndevos: Isn't indexOf meant for String type ?
09:51glosoliah sorry :)
09:51pepijndevosBobSchack, but it doesn't give an exception, just nil.
09:52pepijndevosWhich suggests indeOf is defined to do *something*
09:52justin_smithpepijndevos: I think that is becuase [1 2 3] is not a javascript array
09:53justin_smithit is a clojurescript immutible vector
09:53hyPiRionDoesn't explain why .indexOf is prototyped though.
09:53pepijndevosI know that. Question is, how do I get the index of an element from it
09:54BobSchackpepijndevos: http://clojuredocs.org/clojure_core/clojure.core/nth
09:54pepijndevosAnd if Clojurescript is anything like Clojure, its collections implement the native interfaces.
09:54pepijndevosBobSchack, that's the other way around. I HAVE an item, I WANT its index.
09:54BobSchackoh my mistake
09:56pepijndevosMaybe I should hack an implementation using keep-indexed
09:57justin_smithpepijndevos: I don't know why they don't implement .indexOf, but clearly they don't. Doing it with native clojure functions is possible I guess.
09:58hyPiRion(ffirst (keep-indexed #(if (= item %2) %1) coll)) -- poor man's indexOf
09:59hyPiRionur, an f too much there
09:59pepijndevosyea
09:59pepijndevosI was wondering.. do you return a seq?
09:59justin_smith(first (keep-indexed #(if (= %2 2) %1) [1 2 3])) works in cljs-fiddle
09:59pepijndevosyea, I independently arrived at the exact same code :)
10:00pepijndevosthough I'm curious what the .indexOf is doing...
10:01justin_smithI think under the hood in most javascript an "array" is really a hash-map from index to value with numeric keys
10:02justin_smithlikely something very similar to the code above actually
10:16Wild_Catjustin_smith: really? Interesting, that sounds... Baroque.
10:16hyPiRionsounds efficient
10:16justin_smithhttp://stackoverflow.com/questions/365975/how-are-javascript-arrays-implemented
10:18Wild_Catthanks for the info
10:18Wild_CathyPiRion: efficient? Sounds more like wasteful of memory and slower to iterate over to me.
10:19Wild_Cat...although I just now realized that Javascript doesn't have foreach-type iteration.
10:19hyPiRionWild_Cat: Sorry, it's hard to convey sarcasm over the Internet :p
10:19Wild_CathyPiRion: ooh. Also note that I haven't had my morning coffee yet, which makes it harder for me to sense it :D
10:19justin_smitharrays are defined to behaviors of "objects" AKA hash-maps with magic attached
10:20justin_smith(defined by the js spec that is)
10:24rovarwhatevs: https://developer.mozilla.org/en-US/docs/Web/API/Int32Array?redirectlocale=en-US&amp;redirectslug=Web%2FJavaScript%2FTyped_arrays%2FInt32Array
10:27justin_smithrovar: I am unfamiliar with mdn formatting - if there are no compatibility notes does that imply only mozilla based browsers, or all browsers?
10:30rovarjustin_smith: it's any browser that supports WebGL, as those extensions were added to support that.
10:30justin_smithoh, OK, I missed that, thanks
11:05daGrevishi again
11:05daGrevisWhy isn't this working as expected? http://vpaste.net/Yl5Sb The result is wrong.
11:06ghadishaybandaGrevis: the # symbols need to wrap the 'or' itself instead of the inner clauses
11:07daGrevisghadishayban, woah, thanks. I wonder why it didn't blow up :(
11:08ghadishaybanor checks for truthiness, and functions are truthy (only nil and false are falsey) so it was being filtered only by the first # fn
11:11daGrevisghadishayban, thanks :)
11:17gfredericksshould I infer from the fact that clojure/west hasn't been announced yet that its existence is questionable?
11:18sritchiecemerick: first step toward the liberator + friend integration I wanted to write about: https://github.com/clojure-liberator/liberator/pull/95
11:21cemericksritchie: yup, got it in a tab now; keeping an eye on it :-)
11:29mdrogalisI guess as a Lisp programmer, one could describe him/herself as a data entry professional.
11:32cjfriszmdrogalis: -_-
11:32dabdI was comparing ghci with clojure in a simple example: ,(->> (filter odd? (map #(* % %) (iterate inc 1))) (take-while #(< % 10000000000)) (reduce +))
11:33dabdtakes a long time with clojure and is almost instantaneous with haskel: sum (takeWhile (<10000000000) (filter odd (map (^2) [1..])))
11:33dabdl. Anyone knows why?
11:34mdrogaliscjfrisz: Yeah, everyone at my office just did that to me after I said it out loud lol
11:38jcromartieso you want the sum of the square of all odd numbers under 10000000000
11:39dabdnvm it was the gc...
11:39dabdpls ignore my question
11:40dabdand i suppose clojure version will be faster with a type hint
11:40jcromartieyeah I was going to say I get 200ms
11:41jcromartieand there are certainly faster ways to write it in Clojure
11:41mdrogaliscjfrisz: Two SQL tables walk into a bar.
11:41mdrogalisGoing for broke there. ;[
11:49cjfriszmdrogalis: You need to make sure there's a stand-up comedy spot in the lightning talks at next year's Conj
11:58mdrogaliscjfrisz: Rich, Stu, and Chouser walk into a bar.
11:58mdrogalisIt's a great way for me to offend everyone in a single pass.
11:58jcromartieand only one of them will emerge victorious
11:59otfromsritchie: I like the friend/liberator stuff you are working on. I'm going to be using that PR when it happens
12:00sritchieyeah, it's been really good
12:01gfredericksA man at a bar orders a rich stew chowder
12:02mdrogalisDoes the man end up complaining about the meal not being composable?
12:02technomancyotfrom: I have to ask... your nick? is there a story?
12:04technomancyor at least a pronunciation guide?
12:04gfredericksobviously hir name is Obvious Tfrom?
12:04otfromtechnomancy: to goes <- way and from goes -> way
12:04otfromis was *really* clever in 1999
12:05otfroms/is/it
12:05gfredericks(defn clever? [nick year] ...)
12:05otfromevery time I write that function it *always* returns false
12:05otfromweird
12:07otfromtechnomancy: and it is only 6 letters and available as a .com
12:08gfrederickstechnomancy.com is in a holding pattern
12:09technomancyotfrom: ah, not bad
12:11gfrederickstechnomancy bar jokes: repeatability is important for beer
12:13nenorbotis there a min function that accepts a function for value comparison?
12:13gfredericksdabd: I'm surprised that didn't crash from numeric overflow
12:14gfredericksnenorbot: min-key could work if you can map your items to appropriate numbers
12:14nenorbotsounds good! thanks
12:20hyPiRionOtherwise just use compare
12:21hyPiRion,(reduce #(if (neg? (compare %1 %2)) %1 %2) [1 2 -2 4 -3 -10 10 1023])
12:21clojurebot-10
12:22daGrevisi love that you can do (source func).
12:26gfredericksI have typed (use 'clojure.repl) 5838 times so far
12:26gfredericksdoes anybody know cider well enough to tell me how to bind that to a key? :)
12:28justin_smithgfredericks: you could make that an :injection in you :develop profile
12:28justin_smithor are you one to switch to project namespaces in the repl
12:29gfredericksyes I am
12:29gfredericksuser is usually well-equipped I think
12:29gfredericksalternatively I could try learning to automate the process of making user useful for everything
12:30justin_smithI just stay in the user ns and never have that problem, I guess that is just a different strokes for different folks thing
12:30gfredericksI don't want to assume my jvm process is always running locally with the :user profile though
12:30gfredericksso e.g. :user dependencies wouldn't always be around
12:30justin_smithright
12:31gfredericksso ideally this would be in elisp I guess
12:31justin_smithfor me I am in the user ns for the repl, but test namespaces don't have user
12:31justin_smithgfredericks: yeah, there is definitely an elisp function that evaluates some string in the current repl. I only have nrepl still though, so can't help you with that part
12:32justin_smithbut the ielm elisp repl + (apropos "thing") work wonders with elisp
12:32justin_smithalso C-h f "name"
12:32justin_smithonce you figure out a few basics, emacs self-documents really well and very deeply
12:33justin_smithI like ielm rather than M-: because it reminds me of using a real lisp
12:33justin_smithwarm fuzzys
12:33gfredericksC-h is backspace for me :)
12:34gfredericksgotta figure out how to bind help to something else
12:34gfredericks#thingsyoushouldhavedonealongtimeago
12:40justin_smithgfredericks: M-x describe-function
12:41dabdgfredericks: indeed, it should overflow ints
12:42gfredericksdabd: and longs I'd think
12:42gfredericks,(#(* % %) 10000000000)
12:42clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
12:42gfredericksassuming ten billion is what you were dealing with; I might've misread
12:42justin_smith,(#(*' % %) 10000000000)
12:42clojurebot100000000000000000000N
12:43gfredericks,'''*'''
12:43clojurebot(quote (quote *'''))
12:44justin_smith,*'
12:44clojurebot#<core$_STAR__SINGLEQUOTE_ clojure.core$_STAR__SINGLEQUOTE_@1a9aa17>
12:44gfredericks,(fn $_STAR__SINGLEQUOTE_ [x] "you're a star, singlequote!")
12:44clojurebot#<sandbox$eval125$$_STAR__SINGLEQUOTE___126 sandbox$eval125$$_STAR__SINGLEQUOTE___126@1c4b127>
12:45justin_smith,(-> #'*' meta :doc)
12:45clojurebot"Returns the product of nums. (*) returns 1. Supports arbitrary precision.\n See also: *"
12:45gfredericksjustin_smith and I alternate between providing useful information about obscure clojure functions and making stupid repl jokes
12:46justin_smithas I see
12:46clojurebotIt's greek to me.
12:46gfredericks~greek
12:46clojurebotPardon?
12:46justin_smith~foo
12:46clojurebotfoo is bar
12:46gfredericksclojurebot: greek is it to me
12:46clojurebotRoger.
12:46justin_smith~greek
12:46clojurebotgreek is it to me
12:47justin_smithtransitive equality, nice
12:47justin_smithclojurebot: it is greek to me
12:47clojurebotYou don't have to tell me twice.
12:47justin_smith~it
12:47clojurebotit is a lie
12:47justin_smith:(
12:47gfredericksit is a lot of things
12:47gfredericks~it
12:47clojurebotit is a lie
12:48gfredericks~it
12:48clojurebotit is greek to me
12:48gfredericksor two things at least
12:48justin_smith~it
12:48clojurebotit is for clojure.pprint/cl-format :)
12:48[1]briani'm doing clojure koans
12:48[1]brianhttp://pastebin.com/37tD7QD9
12:49[1]briancan someone tell me why looping backwards instead of forwards is preferable?
12:49justin_smith[1]brian: for one thing, many things stop at 0
12:50justin_smithconventions speed comprehension
12:50AimHereThe given solution probably should use 'zero?' for the zero comparison
12:50[1]brianwell my version didn't work with bigger numbers
12:50[1]briani'm wondering why looping forward would fail
12:50AimHereNeither version will
12:50daGrevisis this the correct way to solve the koan? seems unusally too hard http://stackoverflow.com/a/8395229/458610
12:51justin_smith[1]brian: replacing * with *' will fix that issue
12:51AimHereUse *' and +' instead of * and + to promote large integers to bigints when necessary
12:51daGrevis[1]brian, hi, im doing koans as well ;)
12:51[1]briandaGrevis: :)
12:51daGrevishaha, im almost there
12:51daGrevishow did u solve last one?
12:51daGrevisrecursive-reverse
12:51AimHereBecause I'm a paranoid sort, I'd use <= or >= instead of '=' so the function will at least terminate when fed a non-integer
12:53[1]brian*' and +' duly noted
12:53[1]brianbut the solution doesn't use *' and +' and passes for larger N than mine can, simply because it loops backwards?
12:53[1]brianor am i missing something?
12:54daGrevis[1]brian, u r missing on answer to me :D
12:54daGrevis<daGrevis> how did u solve last one?
12:54daGrevis<daGrevis> recursive-reverse
12:54[1]briandaGrevis: i conjoined the first of coll to the reverse of the rest of coll, making sure the base case returns a vector
12:54[1]brianslow to type
12:54[1]brian:(
12:55daGrevisthanks! :)
12:55AimHere[1]brian, they both ArithmeticException at the same time for me
12:55daGrevis[1]brian, like this? http://stackoverflow.com/a/16345932/458610
12:55[1]briandaGrevis: yep
12:56gfredericksI like clojure's impl of reverse
12:56gfredericks(reduce conj () coll)
12:58gfredericks,((reduce conj () coll) [:a :b :c 42 :d])
12:58clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: coll in this context, compiling:(NO_SOURCE_PATH:0:0)>
12:58gfredericks,(#(reduce conj () %) [:a :b :c 42 :d])
12:58clojurebot(:d 42 :c :b :a)
13:09[1]brianhow does destructuring a map with :keys work exactly?
13:10[1]briandoes it just take the variable name, turn it into a keyword and take the value in the map?
13:11justin_smith[1]brian: pretty much, but remember it is not a variable, it is a symbol
13:11justin_smitha var is a specific thing, often when we use a symbol it is not pointing at a var
13:11justin_smitha symbol even works as an implicit map lookup
13:12justin_smith,('a '{a 0 b 1})
13:12clojurebot0
13:12justin_smithno vars to be seen
13:12justin_smithin a let binding a symbol points to the innermost visible binding, rather than a var
13:13justin_smith,(let [foo "hello"] foo)
13:13clojurebot"hello"
13:13[1]briandoes the compiler just see :keys and be like this is this 2nd way of destructuring map
13:13[1]brian?
13:13justin_smith,(let [foo "hello"] #'foo)
13:13clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: foo in this context, compiling:(NO_SOURCE_PATH:0:0)>
13:13justin_smithas you can see it is not a var
13:13justin_smith[1]brian: yeah, you can also destructure a map more explicitly
13:13[1]brianwhat is #'foo
13:14[1]brian,(let [foo "hello"] 'foo)
13:14clojurebotfoo
13:14justin_smith,(let [{a "hello" b "world"} {"hello" 0 "world" 42}] [a b])
13:14clojurebot[0 42]
13:14justin_smith,(type #'+)
13:14clojurebotclojure.lang.Var
13:15justin_smith#' references a var by the symbol that would point at it
13:15justin_smithjust being pedantic about your usage of the word "variable"
13:15[1]briani know
13:15[1]briani'm trying to understand but I never fully grokked symbols in Scheme
13:16justin_smithso more to the point of your original question, :keys is just a shortcut, you can do a more flexible destructuring (as you see in my above destructuring example, I hope)
13:16[1]brian,(#'+ 3 5)
13:16clojurebot8
13:16justin_smithanother difference:
13:16justin_smith,[(meta +) (meta #'+)]
13:16clojurebot[nil {:arglists ([] [x] [x y] [x y & more]), :ns #<Namespace clojure.core>, :name +, :column 1, :added "1.2", ...}]
13:17justin_smiththe first is resolved (and thus metadata is no longer there) before meta is called
13:17raiskailijajustin_smith,
13:17justin_smiththe quoting ensures that we can see the metadata on the var for the second
13:17[1]briani see
13:17raiskailijaI am here to inform you of a great cause
13:17raiskailijaHis Shadow must be worshipped.
13:17[1]brianwhen would be a good time to use #'symbol vs symbol
13:18justin_smith[1]brian: for example when you have a handler for a server, and want to be able to redefine the function it uses at runtime
13:18justin_smithhave the handler point to the var
13:18justin_smithso redefinitions will be resolved
13:18justin_smitha var is a mutable object, so you use a var when you want mutation to happen
13:19justin_smithor like above if you want to reference the metadata that is on a var but not in the value it points to
13:20[1]briana <-- resolved var 'a <-- symbol #'a <--- yet unresolved var reference using a symbol
13:20[1]brianis that right?
13:20justin_smithyes
13:20justin_smithexactly
13:21[1]brianwas there something else?
13:21justin_smitha symbol is looked up first as a closure binding (let / function arg), then as a var
13:21justin_smithoh wait, it can also be a java class - that goes somewhere in that list
13:22justin_smiththe nested bindings thing should be very familiar, coming from scheme
13:22GlenjaminHi guys, i'm having a strange problem with ring, ring-codec in particular. The param middleware is unable to find ring.util.codec/assoc-conj
13:23[1]briani don't know what you mean by nested bindings, and i only used Scheme for 1 class
13:23Glenjamini've tried clearing my m2 repository, and checked the clj source inside the ring codec jar - the function *is* defined in that namespace
13:23justin_smithGlenjamin: have you checked that the version of ring you are using has that function? try looking in the jar and seeing what is actually defined in there / the actual version
13:23Glenjamincan anyone suggest what i should try next?
13:23justin_smithoh, you already tried what I suggested
13:24justin_smith[1]brian: I just mean that ##(let [a 0] (let [a 1] a))
13:24lazybot⇒ 1
13:24justin_smiththe innermost value assigned to the symbol is used
13:25[1]brianso do vars exist only at the global scope?
13:25justin_smithyou can create one in a let, but there is usually no reason for it
13:26[1]brianhow would you do that
13:26[1]brianthanks for bearing with me, this symbol stuff is just different from the usual imperative languages
13:27Glenjaminhere's some repl output: https://www.refheap.com/22250
13:27justin_smith[1]brian: np, working on an example of using a var directly - doesn't come up often so I don't have it off the top of my head
13:27GlenjaminI can call the function by switching namespace, but not form outside
13:27Glenjaminbut it's not private
13:27justin_smithGlenjamin: (meta #'assoc-conj)
13:28Glenjaminoh
13:28justin_smiththe value does not have the metadata, the var does, as I was just explaing to [1]brian :)
13:28Glenjaminthat rings a bell
13:28Glenjaminjust coming back to a project after a few months and trying to upgrade all deps
13:29Glenjaminright, that's more like it
13:29Glenjaminbut it's still not private or anything weird afaict https://www.refheap.com/22250
13:30Glenjaminalthough, the :file key is odd
13:32justin_smithmaybe it is defined in ring.util.data and ring.util.codec :use s it
13:32justin_smithanother reason to hate use!
13:32daGrevisguys, I have a problem
13:32daGrevisI'm doing clojure-koans
13:32daGrevisand Im at recursion
13:32daGreviswriting function for factorial
13:33daGreviswriting a function that calculates factorial for 1 and 2, nothing else
13:33Glenjamincodec should be this: https://github.com/ring-clojure/ring-codec/blob/master/src/ring/util/codec.clj
13:33[1]brianso, both var and symbols can have values, but while a var is mutable, a symbol value is not, it can only be overshadowed by another scope, an unquoted symbol looks up either a symbol value or var value of the same name, a quoted symbol is a literal that can be used to only resolve var value by prefixing it with # or can be used as a key for maps
13:33justin_smith[1]brian: not quite
13:33[1]briandarn
13:33justin_smitha symbol is just a symbol, but in many contexts is implicitly resolved
13:33daGrevisi wrote a function and it passed all other koans that checked factorial where factorial is a really big number.
13:33justin_smith[1]brian: sometimes a symbol is resolved to a let binding, sometimes to a var
13:34daGrevishttp://vpaste.net/FUrly
13:34daGreviswhere's my stack overflow?
13:34justin_smithsometimes as a java class, sometimes it stands as a symbol, unresolved
13:34[1]brian,(let [a 5] #'a)
13:34clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: a in this context, compiling:(NO_SOURCE_PATH:0:0)>
13:34GlenjamindaGrevis: you're getting a stack overflow when running this?
13:35justin_smithmaybe with a negative n you would get a heap overflow
13:35daGrevisGlenjamin, no. I expected one
13:35justin_smithdaGrevis: recur does not use the stack
13:35GlenjamindaGrevis: ah, (loop..recur) is magiv
13:35Glenjaminmagic even
13:35daGrevisbecause you know, if we follow koans, i should have written some shitty function that fails on big nums and then get enlighten
13:35[1]brianjustin_smith: what is the term for a vs 'a
13:36[1]brian-is +are -term +terms
13:36justin_smithdaGrevis: the new binding replaces the old one, the old one is immediately destroyed
13:36daGrevisGlenjamin, justin_smith: how would look that simple function?
13:36justin_smithso there is no buildup of context
13:36GlenjamindaGrevis: just call your function by name, no loop
13:36Glenjamin(defn fact [n] (* n (fact (dec n)))
13:37[1]brian,(let [{'a a} {'a 'a}] #a)
13:37clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
13:37justin_smith[1]brian: symbol vs. quoted sybol
13:37justin_smith[1]brian: a let block creates no vars
13:37justin_smithso #' makes no sense in that context
13:37daGrevisahh, okay
13:37justin_smithstill working on the creating a var in a let block example (it is possible, just weird)
13:38daGrevisso I wrote better version at 1st
13:38[1]brian,(let [{'a a} {'a 'a}] a)
13:38clojurebot#<Exception java.lang.Exception: Unsupported binding form: (quote a)>
13:38daGrevis[1]brian, did u solve all of recursion?
13:38[1]brianyes
13:38daGreviskewl, me too ;)
13:38jjttjjam I the only one who has an impossible time writing unit tests the second I stop copying a screencast and writing my own code? And yet I get the feeling that extensive tests would have saved more than one of the little side projects I eventually abandoned
13:39justin_smith[1]brian: ##'a
13:39lazybot⇒ a
13:39justin_smitherr...
13:39justin_smith##''a
13:39lazybot⇒ (quote a)
13:39justin_smiththat is what 'a expands to
13:39justin_smithyou can't use that as the lhs of a binding
13:39justin_smith,(type ''a)
13:39clojurebotclojure.lang.PersistentList
13:39[1]brianoh right
13:40justin_smithit is a list of two elements
13:40Glenjaminjjttjj: what are you using, and what are you used to?
13:40[1]brian,(let [{a 'a} {'a 'a}] a)
13:40clojurebota
13:40Glenjaminwhat is #' shorthand for?
13:40justin_smithvar
13:41[1]brian,(let [{a 'a} {'a 'a}] a)
13:41clojurebota
13:41[1]brianwhy is that a vs 'a
13:41justin_smithlevels of quotation
13:41Glenjaminaha, thanks
13:41[1]brian,(let [{a 'a} {'a 'a}] (type a))
13:41clojurebotclojure.lang.Symbol
13:41[1]brian,(type 'a)
13:41clojurebotclojure.lang.Symbol
13:42[1]brian,'a
13:42clojurebota
13:42[1]brian,''a
13:42clojurebot(quote a)
13:42jjttjjGlenjamin: as a testing framework or language? I'm actually more experienced with clojure than any other language and am very comfortable with it, I'm just more of a hobbiest type programmer and never properly learned testing. I've played arround with clojure.test and expectations and like the latter a little better, but really have almost no experience testing in general
13:42justin_smithGlenjamin: ##(macroexpand-1 '#'+)
13:42lazybot⇒ (var +)
13:42[1]brian,(type ''a)
13:42clojurebotclojure.lang.PersistentList
13:43Glenjaminjjttjj: ah, I see
13:43[1]brian,(quote a b c)
13:43clojurebota
13:43[1]brian,(= ''a 'a)
13:43clojurebotfalse
13:43Glenjaminimo the trick with tests is writing them to test expected behaviour, not implementation
13:44justin_smithyeah, a functional mindset makes testing much more straightforward
13:44Glenjaminyou think "i want to do X", so you write a test for X, and then implement something to pass
13:44justin_smithif the input values are right, the thing is a function and the output values are right, then there is nothing else left to worry about
13:44jjttjjGlenjamin: so you mean basically testing example usage of the functions, etc, as they would tend to appear in your program
13:44Glenjaminyes
13:44[1]brianjustin_smith: i think i almost learned something then everything fell out of reach :(
13:45Glenjaminthe trick is to use your functions before you write them
13:45justin_smithjjttjj: I think an important aspect of this is avoiding side effects (or limiting them to very specific places in your code)
13:45jjttjjOk cool def a good start
13:45Glenjamini often find it tricky to do this when starting an app
13:46justin_smithbecause of course if the "functions" have some kind of state tied to them, testing will be much harder
13:46jjttjjyeah that's where I'm at now
13:46Glenjaminbut once you have a skeleton, try writing a test before implementing any helper function
13:46justin_smithbut then again state makes everything harder
13:46Glenjaminor if you're extracting a helper function, write the tests before you do so
13:47jjttjjok cool
13:47jjttjjtrying to make a little twilio SMS bot
13:48jjttjjso I was just at a loss of where to really start test-wise, (= (process-incoming-messages) ?)
13:48justin_smithnow I have a question (that comes up in trying to answer [1]brian's question)
13:48Glenjamintesting remote http calls can be tricky (but doable), i'd start with testing the helper functions
13:48justin_smithcan I create a var in a local binding, or vars by definition only attached to namespaces?
13:48Glenjaminbah
13:49Glenjaminmy function not found issue was due to not running lein clean
13:49Glenjaminmanaged to find it via lein classpath
13:49[1]brian,'a
13:49clojurebota
13:49justin_smithGlenjamin: man, that is my voodoo answer of choice, sorry I did not mention it earlier
13:49Glenjamin[1]brian: think of it like this: when clojure sees "a", it unpacks the var. when you put the quote in front, it leaves it alone
13:50[1]brianthis from the docs helped me greatly "Yields the unevaluated form."
13:50[1]brianfor (quote form)
13:52[1]brian,(do (def a 1) #'a)
13:52clojurebot#'sandbox/a
13:52[1]brian,(do (def a 1) ##'a)
13:52clojurebot#<RuntimeException java.lang.RuntimeException: Reader tag must be a symbol>
13:52lazybot⇒ a
13:52justin_smith[1]brian: ##(with-local-vars [a 0 b 1] (dotimes [_ 10] (var-set a (+ @a @b)) (var-set b (+ @a @b))) (mapv (juxt identity deref) [a b]))
13:52lazybotjava.lang.SecurityException: You tripped the alarm! class clojure.lang.Var is bad!
13:52justin_smith:(
13:52justin_smith,(with-local-vars [a 0 b 1] (dotimes [_ 10] (var-set a (+ @a @b)) (var-set b (+ @a @b))) (mapv (juxt identity deref) [a b]))
13:52clojurebot[[#<Var: --unnamed--> 6765] [#<Var: --unnamed--> 10946]]
13:52[1]brian## is just a way to run lazybot right?
13:53justin_smithso you can use vars locally, as a mutable type
13:53justin_smithright
13:53justin_smithand , runs clojurebot
13:53[1]brianhow do i get a value from a var?
13:53justin_smith@, which is shorthand for #(deref %)
13:53[1]brian,(do (def a 1) @#'a)
13:53clojurebot1
13:54justin_smithright
13:54justin_smithjust like my above example, though the above was using local vars, and def creates a global one
13:54justin_smithbut both have the same mutable semantics
13:55[1]brian,(do (def a 1) @(var a))
13:55clojurebot1
13:55justin_smith,(do (def a 1) (deref (var a)))
13:55clojurebot1
13:55justin_smith@ is just a reader macro for deref
13:55justin_smithjust as #' is a reader macro for var
13:55[1]brianis (var ___) just a special form such that the ___ doesn't get implictly dereferenced?
13:56justin_smithno
13:56justin_smithit is a function that asks for a var object
13:56justin_smithby that name, using a specific lookup strategy
13:56[1]brianwhy doesn't a dereference to 1 and it become (var 1)
13:57justin_smithsorry, it is a macro, not a function
13:57[1]briani see
13:57justin_smithOOPS
13:57justin_smithnot a macro, a special form
13:57justin_smithone of the select few
13:58justin_smithso funny enough, since it is a special form, var is not a var :)
13:58justin_smithwhereas normal functions / macros are a var with some metadata attached to the value we use
13:59[1]briani think i got most of it
13:59[1]brian,(let [a 1] @'a)
13:59clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.util.concurrent.Future>
13:59[1]brianhow do you unquote a quoted symbol
14:00justin_smithlet bindings are not vars
14:00justin_smith[1]brian: by evaluating it
14:00justin_smiththe default action on a symbol is evaluation
14:00[1]brian,(let [a 1] (do 'a))
14:00clojurebota
14:00justin_smithyou can use resolve
14:00[1]brian,(let [a 1] (resolve 'a))
14:00clojurebotnil
14:01justin_smith,((juxt resolve identity) '+)
14:01clojurebot[#'clojure.core/+ +]
14:01justin_smithresolve is for vars though
14:02[1]brian,(let [a 1] (eval 'a))
14:02clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0:0)>
14:02[1]brian,(do (def a 1) (eval 'a))
14:02clojurebot1
14:03justin_smiththe kinds of resolutions are more limited with let bindings
14:03justin_smithalso do note that a var is a mutible container type, a let binding is not
14:04justin_smithso resolving is a weaker / more limited thing in the let binding case
14:06[1]brianok enough rabbit hole fun
14:06[1]brianback to koans
14:06[1]brianthanks justin_smith :)
14:07justin_smithsome folks on #emacs were joking about the clojure emacs in the browser project
14:07justin_smithcalling it bromacs
14:07justin_smithdude, do you even lambda lift?
14:07justin_smithlol
14:07[1]brianlink?
14:08[1]brianor is this clojure emacs in the browser project not a real thing? :(
14:08justin_smithit is one of many started but not yet usable attempts to re-implement emacs in $foo
14:09justin_smithhttps://github.com/hraberg/deuce
14:09justin_smith"Note: Almost NOTHING works yet. 0.1.0 developer preview ETA: when it's done."
14:09justin_smithit is so common as to be a running joke (see emacs in common lisp, emacs in haskell, emacs in ocaml, emacs in scheme...)
14:10TimMcNot to mention implementing a browser in emacs, of course.
14:10[1]brianemacs in emacs lisp
14:11[1]brianwhy can't emacs run emacs yet? this is a travesty
14:11justin_smiththat one almost works, to be fair :)
14:11justin_smithtry running emacs without any elisp code - you would not get much, if anything, usable I don't think
14:13justin_smiththe vast majority of emacs is elisp, just running emacs without elisp code gets you something that is basically unusable
14:19Glenjamini'm getting an NPE from a third-party lib i'm using - is therea ==
14:19justin_smith(-> #'== meta :doc)
14:19justin_smith,(-> #'== meta :doc)
14:19clojurebot"Returns non-nil if nums all have the equivalent\n value (type-independent), otherwise false"
14:19justin_smithonly for numbers
14:19Glenjamini'm getting an NPE from a third-party lib i'm using - is there a better approach to debug than moving it to a lein checkout and adding some statements into it?
14:20justin_smithGlenjamin: you can open it's jar and evaluate redefinitions in a repl
14:20justin_smithwithout needing to check anything out
14:20Glenjaminhrm, lets see if i can reproduce in a repl
14:20justin_smiththis is of course much easier if you are using an editor with repl integration, but it can be done even in a naked repl
14:21justin_smithGlenjamin: if you are running a server, start an nrepl server in the same code that runs the server, and connect to that
14:21justin_smithit makes debugging so much nicer
14:21Glenjaminin the main server process?
14:21justin_smithyeah
14:22justin_smiththen you can connect to that repl
14:22Glenjamindo i need to use drawbridge or something like that?
14:22justin_smithwhy would you?
14:22justin_smithjust use tools.nrepl to start a server
14:22Glenjaminah, right
14:22Glenjamini see
14:22justin_smithif the server process is running on localhost at least
14:23Glenjaminmm
14:23justin_smithand even if the server is on a remote host, an ssh tunnel is easy enough to make
14:24Glenjaminok, so i might as well have it always do this
14:24justin_smithGlenjamin: anyway, using clojure.tools.nrepl to open a repl port inside my server, then defining some atoms I can conj some interesting data onto, helps me solve things much faster than I would otherwise
14:24Glenjaminsounds like a good plan
14:24Glenjamincheers
14:24Glenjaminbbiab
14:25justin_smithof course you can use environment config to not open a repl port in production, etc.
14:25Glenjaminwas about to do that, but if its localhost only, i'm not too bothered
14:28[1]brian,(do (def a 3) (dosync (ref-set #'a 4)) a)
14:28clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.Ref>
14:28justin_smith[1]brian: you have your mutable types mixed up
14:29[1]brianwhat is the difference between a ref and a var
14:29[1]brian,(do (def a 3) (dosync (set! #'a 4)) a)
14:29clojurebot#<CompilerException java.lang.IllegalArgumentException: Invalid assignment target, compiling:(NO_SOURCE_PATH:0:0)>
14:30justin_smith,(do (def a 3) (alter-var-root #'a (constantly 4)) a)
14:30clojurebot4
14:30justin_smithor
14:30nDuff[1]brian: vars aren't even intended to be used as reference types -- they do locking rather than the retry semantics used by atoms and refs.
14:30justin_smith,(do (def a 3) (alter-var-root #'a inc) a)
14:30clojurebot4
14:33nDuff[1]brian: ...anyow, the big distinguishing thing between refs and atoms is that update of multiple refs can be done in a single transaction, whereas other reference types' updates are individually atomic but uncoordinated. (That's a little bit of a simplification, inasmuch as there's some transactional awareness for sends to agents, but not much of one).
14:34nDuff[1]brian: ...anyhow, in general, alter-var-root (which is the var equivalent to ref-set) is something you shouldn't be using absent a fairly specific reason.
14:37deniskahttp://pastebin.com/uqCQNNRr hello, is it correct ns syntax?
14:37justin_smithnDuff: yeah, absolutely, this is more being done to demonstrate what vars are as opposed to let bindings etc. - I hope that remains clear
14:38justin_smithdeniska: no
14:38justin_smithdeniska: I think you want an extra closing ] on the second line
14:38justin_smithand an opening [ at the beginning of the third
14:39deniskaoh, thank you, it works
14:39deniskaall my previous attempts on adding and removing brackets in different places resulted either in not working silently or not compiling at all
14:44[1]brianomg i'm finally to the macros koan
14:46nDuffdeniska: ...by the way, you might consider using a pastebin with fewer ads. We're fans of refheap.com here (since it's written by one of our own), but gist.github.com is also an improvement on pastebin.com.
14:47nDuffdeniska: ...pastebin.com is something of an eyesore to anyone not running adblock.
14:47gfredericks~paste
14:47clojurebotpaste is https://refheap.com/
14:47deniskaheh, as a fan of adblock I was not aware of it, sorry =)
14:48nDuffdeniska: yup, that's probably my biggest beef with adblock -- allows sites that make customer-unfriendly decisions about advertising to thrive despite those decisions.
15:21bitemyapparrdem: don't overtrain against historical data :)
15:27jcromartiethe logging output from clj-http is driving me nuts
15:28dakronejcromartie: which logging output? apache's?
15:28jcromartiethe full Apache HTTPClient wire log is going to my log4j output
15:28jcromartieyeah
15:28dakronejcromartie: you should definitely turn off DEBUG/TRACE for org.apache.http :D
15:28jcromartieany experience in turning that off? I know it's just because I set my own root logging level to DEBUG
15:28dakroneit is pretty insane
15:28jcromartieI don't understand log4j config :)
15:28dakronejcromartie: log4j.logger.org.apache.http = INFO
15:29dakronein your log4j.properties
15:29gfredericks(inc dakrone) ;; guy just swept in and fixed everything in 30 seconds
15:29lazybot⇒ 1
15:29jcromartieindeed
15:29dakrone:)
15:29jcromartie(doall (take 1000 (repeatedly #(inc dakrone)))) :)
15:30jcromartienothing quite like complaining on IRC and getting the library's author within seconds ;)
15:30dakronehaha, I get notifications whenever someone mentions "clj-http" or "cheshire" :D
15:31deniskahttp://storage7.static.itmages.ru/i/13/1227/h_1388176119_3947209_3b72676298.png does this code look terribly bad? =)
15:31gfredericksI wonder if he'll fix arbitrary things as long as you preface it with a clj-http complaint
15:31gfredericksclj-http is a clojure library and americans don't research political candidates before they vote
15:31dakronegfredericks: it guarentees I see it anyway ;)
15:32mercwithamoutho_O
15:33dakroneCHANGELOG for clj-http: clj-http now sends poll data when used for increasing research on voter uptake
15:33gfredericksphew
15:34mockerDang, wanted to read up on speclj the site is down.
15:35bitemyappmocker: speclj is a bad idea anyway
15:42winkmeh, there was supposed to be a table of lisp hackers at 30c3, either I don't find it or they're gone :(
15:43Leonidaswink: hi :-)
15:43winkhehe \o/
15:43Leonidasi remember there was a meeting in berlin, not all that impressiv
15:44Leonidas*impressive
15:48corecodewink: i'm here :)
15:48corecodenot at a specific table
15:50grzmI have a vector of functions and a value. I want to apply each function to the value, returning the first non-nil result.
15:50gfredericks,((apply some-fn [first rest]) [nil nil nil])
15:50clojurebot(nil nil)
15:51grzmcrikey
15:51gfredericksmaybe a confusing example but I think that does what you want :)
15:51gfredericks,((apply some-fn [first rest]) [false nil nil])
15:51clojurebot(nil nil)
15:51gfredericksas long as you can tolerate falses being skipped too
15:51grzmno, I've been banging my fingers against the repl for trying some combination of some-fn, or, map, filter, first that would work
15:51gfredericks,((apply some-fn [first rest]) [:truthy nil nil])
15:51clojurebot:truthy
15:51grzmyup
15:52grzmthanks, gfredericks
15:52gfredericksnp
16:05mrhanky(fn [& ds]) <- what does the & mean? optional argument?
16:06gfredericksvarargs
16:06gfrederickscan be called with any number of arguments
16:06gfredericksds is bound to a list of the args
16:06gfredericks,((fn [& ds] ["my args are" ds]))
16:06clojurebot["my args are" nil]
16:06gfredericks,((fn [& ds] ["my args are" ds]) 1 2 3)
16:06clojurebot["my args are" (1 2 3)]
16:08justin_smithworks nicely with destructuring
16:08justin_smith,((fn [& [a b c & z]] [a b c z]) (range 10))
16:08clojurebot[(0 1 2 3 4 ...) nil nil nil]
16:08gfredericksapply
16:09justin_smithoops
16:10justin_smith,(apply (fn [& [a b c & z]] [a b c z]) (range 10))
16:10clojurebot[0 1 2 (3 4 5 6 7 ...)]
16:10justin_smithmuch better
16:10mrhankyokay, thanks
16:11grzmgfredericks: ((apply some-fn [first rest]) [:truthy nil nil]) ends up evaluating the non-nil returning function twice, doesn't it?
16:11gfredericksno?
16:11clojurebotno is tufflax: there was a question somewhere in there, the answer
16:11gfredericksgrzm: having a hard time figuring out why you would think that
16:12grzmgfredericks: 'cause I'm naive and learning? let me think some more
16:12gfredericksnaive and learning is fine :)
16:12gfredericksjust couldn't figure out how to help
16:15logic_proghiredman: I have a complaint. In https://gist.github.com/hiredman/5167534 , on line 17, what is "storage" ?
16:15[1]brian,(let [a 1] ~'a)
16:15clojurebot#<IllegalStateException java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.core/unquote>
16:15amogh_Any clojure guys around who have worked with pdf generation using iText ?
16:15mrhankylogic_prog, maybe the js localStorage?
16:16justin_smith[1]brian: ~ is special, and used inside `
16:16logic_progmrhanky: it's not defined though. There is no (let [storage ...]) anywhere
16:16amogh_hey anyone with itext experience ?
16:16logic_progmrhanky: more importantly, how do I fix this? I'll figure out what is wrong later.
16:16logic_progamogh_: I have used itext. It's not bad.
16:16logic_progApachePdfBox is also pretty good.
16:16amogh_i am using
16:16amogh_clj-pdf
16:17amogh_which is a DSL over i text
16:17amogh_itext*
16:17amogh_I wanted to know.. how do we place some text on the right of an image
16:17mercwithamouthi can't seem to get ecstatic to work...or more so lein-bin. I've added lein-bin to my profile and I definitely saw it get pulled however it keeps saying 'bin' isn't a task
16:17amogh_everything i give comes one below another
16:18amogh_@logic_prog do u have any idea about such layout?
16:18logic_progamogh_ : not off the top of my head
16:18logic_progitext has nice documentation ...
16:19justin_smithdid you ever think to yourself "in a conversation, why would you deref the person you are talking to?"
16:19amogh_lemme check..
16:20amogh_I needed something like float:left in css...
16:20logic_progjustin_smith: you mean hashtag_irc_is_not_twitter ?
16:21gfrederickstwitter people sure do mention lots of different IRC channels
16:21justin_smithwell, reader-macros for popular topics make sense
16:21gfredericksmost of them aren't worth visiting though
16:21justin_smithlol
16:21logic_prog#beiber_forever
16:23logic_progthis is a dumbass and off topic question, but perhspa someone here knows: (1) Given: I can read pdfs in chrome (i.e. visit blahblah.pdf). (2) Question: Is there a way to for me to read render a svg as a DOM node in Chrome?
16:23logic_progit doesn't have to work in IE/Firefox; pure Chrome is fine.
16:23justin_smithread render?
16:23logic_prog?
16:23logic_progI want a webpage, where one my of my DOM nodes is showing a pdf
16:24justin_smith"is there a way to for me to read render" - I did not parse that
16:24justin_smithahh
16:24bitemyapplogic_prog: how are you getting from PDF to svg?
16:24deniskaI saw examples of manipulating SVG through JS
16:24deniskaNot sure if it's DOM
16:24bitemyappalso yes you can render SVG but that's not the part that confuses me
16:24justin_smithyou can use the dom to manipulate an svg yeah
16:25justin_smithanimated svg etc.
16:25logic_progbitemyapp: I don't have a svg yet. I just have a pdf right now.
16:26logic_progLet me rewrite my question. (1) I Know that Chrome can render pdfs (I can view Pdfs inside of Chrome). (2) Question: is there a way in Chrome to render a pdf as a _dom node_ ? so I can have a webpage, with a bunch of CSS Menus, then one part of it which, bam, renders a pdf.
16:27bitemyapplogic_prog: this is no longer SVG and the answer is not without a plugin.
16:28logic_progbitemyapp: noted, thanks for the clarification
16:30logic_progwait
16:30logic_progI can render the pdf in an iframe
16:30logic_progand overlay a div over the iframe
16:31Glenjaminyou can't guarantee the iframe will show it inline
16:32Glenjaminbut if you use pdf.js you can get the PDF as a canvas element
16:32Glenjaminwhich is what firefox uses internally, but it should also work on a web page
16:32Glenjaminhttp://mozilla.github.io/pdf.js/
16:32grzmgfredericks: What had me confused was reading the description of some-fn: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/some-fn
16:33logic_progGlenjamin: there's also http://pdfobject.com/
16:33gfredericksgrzm: some-fn is super weird once you start passing the returned function more than one arg
16:33grzmI read it as returning the *function* that returned the logical true value rather than retiring *a* function that returns the logical true value of the result of applying them
16:34grzmgfredericks: but super useful in this case :)
16:34gfredericksah ha
16:34gfredericksgrzm: well yeah because you're only passing one arg
16:35grzmgfredericks: i'll put a pin in that and work on it another day. thanks for helping me get around my issue
16:35gfredericksgrzm: no problem
16:37DerGuteMoritzwink: look for the chicken scheme banner, we are in the first assembly hall right before the gate towards the large assembly hall
17:00scottrHas anyone spent much time playing with Om? I'm having some trouble figuring out how to structure my app to work with it.
17:04bbloomscottr: the conventions of how to structure such an app are still evolving. in fact, Om itself is just one stack at that idea dnolen put together
17:04bblooms/stack/stab
17:05bbloomscottr: what issues are you running in to?
17:05scottrbbloom: I'm aware; he pretty clearly calls it pre-alpha in the readme, but I can't figure out how to get this one aspect working and it's sort of a dealbreaker.
17:05bbloomscottr: talk through it, i can probably help
17:05scottrbbloom: I can't get at data in the cursor unless in an om/update! call, and those are synchronous.
17:06scottrbbloom: this issue (https://github.com/swannodette/om/issues/14) describes getting data out of the cursor, but that seems... hacky and not the way it was envisioned.
17:07scottrbbloom: The root issue is that the update I need to perform is conditional on some data existing, but the data needs to be async fetched.
17:07jtoyare there any declaritive sql schema libraries that can auto update that actually work?
17:07bbloomscottr: hmm. i'd have to study what dnolen did here a bit. i'm not a big fan of the one-tree + metadata path-into-that-tree approach for a variety of reasons, but i was curious to see where he took it
17:08jtoyi looked through them and they dont seem to work, I will probably jsut end up using ruby for the schema management :(
17:08jtoyi would like to have it all in clojure if possible
17:08scottrbbloom: I spent the last hour looking through the cursor implementation to figure it out... and I cannot, for the life of me, understand their point.
17:08scottrNot the implementation, that's fairly trivial, but their purpose in the Om library as a whole.
17:09bbloomscottr: they were not reified as a data type last i looked, so give me a moment to study
17:09scottrbbloom: Happened yesterday, if the commit timestamp is to be trusted ;)
17:10bbloomdnolen: you there?
17:12bbloomscottr: hm, yeah dnolen seems to be running in to the problems that i was trying to warn him about :-)
17:13bbloomin short, having a single state tree is non tenable b/c you then need to have some sort of zipper that operates on that tree
17:13bbloomwhich is the cursor thing
17:13bbloomthen those cursor things become both "modified" trees but also are values from the past
17:14bbloomif the cursor itself offers the ability to "dereference" it, then you have to bake in a pointer to the current root, or an indirection through a mutable root
17:14scottrbbloom: I... followed none of that. Why do you need a pointer to root?
17:15bbloomscottr: you'll see that MapCursor and VectorCursor both have value/state/path triples
17:15bbloomthe value is the map or vector, the state is the root of the tree, and the path is the location of the current map or vector in the root tree
17:16scottrbbloom: AH. I wasn't really sure how value and state differed, but I needed so much state shared between my components that I just ended up passing the whole tree around...
17:16bbloomin effect, a cursor is a zipper. there are two types of zippers: 1) this kind, where you record the traversal path and 2) the huet kind where you invert pointers to be relative to the "current" spot
17:17scottrbbloom: Got it, I think. So (= value (get-in state path)), essentially, meaning `state` is always root?
17:17bbloomyeah, that's what it looks like
17:17bbloomthe problem with the zipper approach is that you have multiple "components" and each component wants to think about the world concurrently. when you have concurrent zippers, you need to worry about isolation
17:18scottrbbloom: Because of updates?
17:18bbloomscottr: yup
17:19bbloomoleg talks about multiple zippers & isolation modes here: http://okmij.org/ftp/continuations/zipper.html#zipper-fs
17:20bbloomwhat dnolen has coded can be called a "Kiselyov Zipper" that is representing a zipper as a suspended walk: like a stack of call frames
17:20bbloomsorry, this rant is kinda more for observers than for you scottr :-P
17:20scottrbbloom: No problem. I'm not familiar enough with zippers to really understand it yet.
17:22bbloomscottr: in short, a zipper represents a tree viewed from a position other than the root
17:23scottrbbloom: Ah. That makes sense.
17:23scottrbbloom: I don't think this addresses the original problem though, unless I'm just not seeing it.
17:23bbloomscottr: like i said, there are two types: 1) huet zippers = interior node + pointers going out. 2) kiselyov zaippers = root + path
17:24bbloomscottr: it's a round about way of saying that i think the problem is a design flaw in om, one that i've been trying to find the words to explain to dnolen :-)
17:26scottrbbloom: Possibly. I'm trying to reconcile the very abstract "single tree cursor/zipper" description with the very concrete problem I have.
17:26bbloomscottr: anyway, avoid capturing cursors. they are temporary objects that should go away after a "frame" has been updated/rendered
17:27scottrbbloom: I don't know if that's necessarily the problem. I'm trying to inspect a cursor to find a specific value, then async fetch data if that data doesn't exist yet. I'd schedule an update to the current frame after the data returns.
17:27bbloomscottr: my recommendation: store data externally
17:27bbloomstore only some token or ID in your tree, store that synchronously
17:28scottrbbloom: That's what I ended up doing for the top-level items. It just felt very awkward and I thought maybe I just didn't understand the library well enough.
17:29bbloomscottr: really, that's what you need to do & the library doesn't (yet) make that sort of thing easy for you
17:30scottrbbloom: Is it really necessary to store ALL of the data externally? A lot of the machinery of React itself presupposes having that data stored on the root component, much as is already done in Om.
17:31bbloomscottr: om is trying to make it easy to get to the data local to your "current" component, but generally that data should be small. ie just an id number or a setting or two
17:32bbloomscottr: all state MUST be external for react/om to work, but some state should *FEEL* local in order to be easy to reason about. which is what getState/setState provides in React
17:32scottrbbloom: I'm not sure I understand that.
17:32scottrbbloom: Shouldn't all of the data necessarily exist on the root component (assuming the whole page is React/Om controlled)?
17:33bbloomyeah, that's what i mean by external
17:33bbloomie not within the view structure
17:33bbloomthe view structure is an inert description of the view
17:33bbloomit doesn't have state, it's merely associated with state
17:33scottrRight. So if the root component updates its canonical data, and passes the whole thing to each component with the components' needed additional data (e.g. pointers into that tree), that would be sensible, yes?
17:34bbloomwell what is a "pointer" in to that tree? is it a path?
17:35bbloomis it a composite object that is a path plus the tree root itself?
17:35scottrOr an ID. Anything to reasonably attempt to fetch data from the source.
17:35bbloomyeah, see that's the tricky part of this whole thing: you need a consistent way to obtain and dereference identifiers
17:36bbloomom is using "path in the view hierarchy" as a convenient identifier for many use cases
17:36scottrI think it's less of a problem for my particular use case, since the data is naturally tree-like anyway.
17:36scottrAnd shallow, and (relatively) unchanging.
17:36bbloomtree-like data is always nice to work with :-)
17:37scottrSo, is that accurate, relative to how you've described "storing all data externally" (by which you meant on the root component)?
17:38scottrComponents should get the data and some reasonable method to access the relevant data from the source itself?
17:38scottrAnd that was the purpose of cursors in the first place, to give components said "reasonable method to access the data"?
17:38bbloomscottr: on or next to the root component
17:39bbloomyeah, i don't like the cursor idea
17:39scottr"Next to" might make it tricky to coordinate re-rendering when the update itself doesn't cause the root component to see a change.
17:39scottrThough I suppose a watch on an atom, like Om does, is reasonable enough for that.
17:39bbloomoh sure, "on" the component from the react user perspective, but from the react internals perspective, that state is stored "next to" the root component :-)
17:40scottrAh... totally unfamiliar with the internals yet. I haven't really poked around it much.
17:40bbloomthe distinction is one of who holds the pointer
17:40bbloomthe component itself does not contain a pointer to it's state
17:40bbloomthe component only holds an ID which can be used to look up it's corresponding state
17:40bblooms/it's/its
17:41scottrAh, which is the `data-reactid` attribute on the DOM nodes?
17:41bbloomi believe so, yes
17:41scottrInteresting. I should go poke around a bit to get a better grasp of it.
17:41bbloomreact "hydrates" components only when relevant
17:42bbloomthe components' lifetimes are disjoint from the lifetimes of the objects which provide their behavior
17:42scottrThat's interesting. It seems like you've looked into it a lot...
17:43bbloomI'm the guy who has been shouting at dnolen & a bunch of other folks in this channel to look at React since it came out. hell, i've been shouting about these ideas for much longer than that :-P
17:44bbloomhowever, since react is now available, i'm going to assume i can use it as a backend & am thinking about / working on something more ambitious one layer up :-)
17:44bitemyappbbloom: do you teach people 1:1?
17:44scottrHah. dnolen even mentions you by name in his benchmark post.
17:44bitemyappbbloom: not in IRC, that is.
17:45bbloombitemyapp: occasionally. why?
17:45scottrbbloom: Thanks for all your help. I'm not really sure how to reconcile the missing data still, but at least I feel better about maybe just accessing the data in the cursor and "just doing it".
17:46bitemyappbbloom: any particular techniques, tools, you use? do you do it face-to-face or over the internet? what subjects typically?
17:46bbloombitemyapp: pretty ad hoc
17:52bbloombitemyapp: curious why you ask
17:52devnboot is starting to get pretty cool, you can now build tasks that rely on tasks, and they compose nicely, in boot.edn: :tasks {:run-development-env {:require [some.dep :as foo], :main [:do [foo/bar "argument"] [(fn [_] (println "hello world"))]]}
17:55bitemyappbbloom: been teaching a lot of people lately, was looking to refine a few things.
17:56bbloombitemyapp: selfishly, i mostly teach for my own edification & clarity, so my teaching methods may be tuned differently than you'd desire :-)
17:56bitemyappbbloom: nah same here.
17:56bitemyappbbloom: did you really expect anything selfless of me? >:)
17:57bbloombitemyapp: when you switched from callen to the bitemyapp handle, it kinda rebooted most of the features my brain's personality classifiers depend on
17:57bitemyappbbloom: working as intended.
17:58bitemyappbbloom: Trying to set a better mold, but I'm not a martyr of my time.
17:58bitemyappwhen I teach, it's as much for me as the student.
17:58bitemyappstudents ask good questions :D
17:58bbloombtw, changing your handle screwing up my brain is similar to the identifier/state correspondence problem in UIs/OM discussed above :-P
17:59justin_smithtoday I finally figured out what the deal was with non-namespace vars, because of a question [1]brian asked
17:59bbloomhuman brains are bad at transferring attributes after rename, which you have capitalized on for the sake of your perception, but can hurt you if that's teh nature of the problem
17:59justin_smithand my struggle in answering it
17:59bitemyappbbloom: rumor has it using values instead of references to mutable data helps clear up the identity/state problem :P
17:59bbloomgreatly aids, but doesn't clear up completely :-P
18:00bitemyappbbloom: especially if the values are really just broadcast proxies of something that is changing.
18:00bitemyappthen it's a mechanical advantage, but not as much of a design one.
18:00bbloombitemyapp: computer science. it works bitches.
18:00bitemyappbbloom: speaking of, my christmas haul was good this year.
18:01bitemyappphysical copy of the homotopy type theory book and machine learning for hackers. :D
18:01bitemyappI might be getting the BCP Type Theory book as well, not sure yet.
18:01bitemyappbbloom: you get any good books?
18:01bbloombitemyapp: nah, my backlog of books is already crushing
18:02bitemyappI have a decent backlog, but I'm not feeling any crushing sensations.
18:02bitemyapphttp://liamoc.net/posts/2013-11-13-imperativereasoning.html
18:07logic_proganyone here know how to use pdfjs with clojurescript ?
18:08bitemyapplogic_prog: probably have to write your own exports or something.
18:08bitemyapplogic_prog: or turn off optimization.
18:09bitemyapplogic_prog: when you're integrating arbitrary JS libraries into a CLJS app you have to "Closure-ize" the packages that aren't made for it to begin with.
18:09bitemyappI highly recommend releasing the closure-ized versions for your fellow hackers.
18:09logic_progI thought I just import and call them
18:09logic_proglike (. js/console log)
18:09logic_prog(. foreign-javascript-library shit)
18:10bitemyappwell if you turn off optimizations that might work.
18:10bitemyappbut I'm pretty sure the imports/require system is all based on Google Closure
18:10bitemyappso if you don't have an exports file describing what to export from the package, then it probably doesn't know how to find it.
18:10nDufflogic_prog: the thing is that the Closure Compiler does name-mangling
18:10bitemyapplogic_prog: you should know that I'm working off memory here and I don't even use CLJS that much, and when I do, it's pure lein-cljsbuild and clojars.
18:10logic_progoh right, becuase with optimizations, (. foreign-javascript-library shit) gets minimized to (. a23 a24)
18:11bitemyappwhich is why I keep telling you to try shutting them off completely.
18:11logic_progso I need to tell cljs "don't rename foreign-javascript-libarry/shit"
18:11bitemyappbut if optimizations none doesn't work, you'll need to make an exports file.
18:11bitemyappit's not cljs...it's Google Closure...
18:11seangrovelogic_prog: Yeah, just include the pdf.js as a foreign-lib or extern.
18:11bitemyapplogic_prog: cljs is built on top of the Google Closure compilation toolchain.
18:11seangroveThe javascript file itself can double as its own extern file
18:12[1]brianlogic_prog: http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
18:12bitemyappseangrove: handy. Didn't know how to do that because I've only used clojars libraries.
18:12logic_prognDuff , bitemyapp , seangrove , [1]brian : noted, this is enough, I will return to hacking
18:12bitemyapplogic_prog: are you sure? I'd like to waterboard you some more.
18:12logic_progbitemyapp : stop making my stupid irc client beep
18:13bitemyappsorry :(
18:13logic_prog:-)
18:13bitemyappseangrove: how've you been?
18:13seangrovebitemyapp: Alive and kickin'
18:14seangroveBeen rethinking vacation policy a bit
18:14seangroveMight make the last ~2 weeks and first few days of the new year mandatory time-off.
18:15BronsaWith only 8 lines of clojure we can use datomic's datalog to query valid tools.analyzer ASTs: https://github.com/Bronsa/tools.analyzer.jvm.index/blob/no-database/src/clojure/tools/analyzer/jvm/query.clj#L7-L14
18:16bitemyappseangrove: mandatory time off is a good idea. We've got one of those unlimited vacation policies at my company but it only works because the founders and executives take time off - thereby setting the tone for everybody else.
18:16bitemyappseangrove: been doing a bunch of 1:1 tutoring lately and scoping out the lay of the land for finishing a release of Simonides. Talked to the founder of Heap recently.
18:16seangrovebitemyapp: Yeah, that's what I was thinking
18:17seangroveAnd it's valuable just to take time off and recharge for everyone
18:17seangroveHow'd the talk go?
18:19bitemyappseangrove: oh right the talk about Brambling. Fine I think. It's a good library to use as an excuse for explaining how Datomic works, limitations and all.
18:20bitemyappI finished the night with my talk, spent most of it explaining why you even need Brambling because of how Datomic works.
18:20seangrovebitemyapp: Yeah, seems like a good way of approaching the subject
18:20bitemyappseangrove: Heap founder seemed really nice btw. He represents his YC batch very well.
18:21seangroveAh, great. Most of them are pretty helpful (if not nice), one of the things I like a lot
18:21seangrovebitemyapp: And is Simonides making progress?
18:22bitemyappseangrove: definitely nowhere near shippable but I'm going to get traction soon. I expect to have something working by the time I return to work.
18:22bitemyappseangrove: Matin was impressed we slapped Simonides together in a weekend :)
18:23bitemyappI have books that should provide nice experiment ideas for Simonides and Keensweep.
18:23bitemyappseangrove: where's a good place to get sencha in the city?
18:23bitemyappI have an excellent supply of chinese teas but my sencha is wanting.
18:24edw,(+ 41 1)
18:24clojurebot42
18:24edwbitemyapp: What city?
18:24seangroveI don't know, I always pick up mine annually when I visit Japan
18:24bitemyappedw: San Francisco.
18:24bitemyappseangrove: that is bloody cheating, hahahaha.
18:24seangrovebitemyapp: Sacha is going back on Sunday, I can ask him to send some from Osaka/Kyoto
18:24edwAh. There is Japantown...
18:25bitemyappedw: I know where to get a futon in JT, but not tea. I guess I could just close my eyes and see where I land on the dart board.
18:25bitemyappI was hoping for a rec ;)
18:26edwbitemyapp: Meh. Opinions are like assholes. Spin the wheel!
18:26justin_smith,(+ (*) (*) (* (+ (*) (*) (*) (*)) (+ (*) (*) (*) (*) (*)) (+ (*) (*))))
18:26clojurebot42
18:26seangrovebitemyapp: Happy to have some sent here for you, probably take a week or so
18:26seangrovebitemyapp: In fact, consider it done
18:26edwjustin_smith: Well played.
18:27arrdemjustin_smith: ssssh we were trying to get hyPiRion to stop writing in that stuff.
18:28gfredericks,(* (+ (*) (*)) (+ (*) (*) (*)) (+ (*) (*) (*) (*) (*) (*) (*))) ;; is my favorite
18:28clojurebot42
18:28bitemyappseangrove: oh man, thank you! You'll have to give me Sacha's email so I can thank them as well. Also I'd like to get you dinner sometime, I'm on the wrong side of the balance sheet at the moment :)
18:32justin_smith,(+ (#(* % % %) (+ (*) (*) (*))) (#(+ % % % % %) (+ (*) (*) (*))))
18:32clojurebot42
18:33bitemyappjustin_smith: write a genetic algorithm for generating Swearjure that optimizes for brevity.
18:33hyPiRion,(#(* % (+ % (*)) (+ % % % (*))) (+ (*) (*)))
18:33clojurebot42
18:33justin_smithheh
18:33bitemyappjustin_smith: or just clone hyPiRion. That too.
18:34hyPiRionI'm actually trying to implement that genetic algorithm you're speaking of. Not enough time for it yet though
18:34hyPiRion2guys I figured out how to turn parentheses sideways
18:34hyPiRion2somehow this lets me generate arbitrary keywords in swearjure
18:34hyPiRionoh dang
18:34hyPiRionI've ignored nickname changes, so I actually have no idea who that is.
18:34bitemyapphyPiRion: I'll never tell!
18:35winkDerGuteMoritz: oh wow thanks :)
18:35hyPiRionbitemyapp: A secret kept by fellow IRCers
18:37arrdem(inc gfredericks)
18:37lazybot⇒ 34
18:38justin_smithsometimes a rename doesn't hide much, when people have distinctive favorite topics, conversation habits, or personalities
18:38bitemyappcase in point, me.
18:38justin_smithexactly
18:39bitemyappalways a little worried when something imports the IEEE-754 library.
18:39arrdemgood. you should be.
18:40bitemyapparrdem: written by bos though. Almost certainly fine.
18:44danneuHow can I see a list of lein templates?
18:44arrdembitemyapp: it's all fun and games until someone returns a -NaN with some top bits set
18:46bitemyapphastache is spooky good.
19:10logic_progis webworkers basically threads for javascript?
19:11em-dashworking in cljs, where should I put protocol extensions to native types? eg., in what file, how to ensure the protocol extension is available everywhere? I'm trying to use this: http://keminglabs.com/blog/angular-cljs-weather-app/
19:12nmwsi have a question about modeling data which can change underneath you. For instance, how would we model a thermostat that reports the current temperature?
19:13nmwsMy current thinking is to have a map where the key is :temperature and the value is a function that returns the latest temperature
19:13em-dashright now I have the extend-type call in a util.cljs file that I'm :requiring in via the ns macro wherein I want to have access to the protocol extension
19:15arrdemnmws: just use an OOP style getter. So you have some map or other datastructure that defines _which_ thermometer you are interested in. An instance if you will. Then you have (poll :: Thermometer -> Float) or whatever.
19:15arrdemnmws: https://github.com/fredericksgary/qubits is hardly a typical library but uses that accessor pattern.
19:18nmwsarrdem: hmm so then the poll function isn't really a pure function in this case, correct?
19:18arrdemnmws: right. it really can't be if it's dependant on an external data source.
19:18nmwsarrdem: but the value returned by the poll function is immutable, since it is one snapshot of a continuously changing value?
19:18arrdemnmws: also correct.
19:19Glenjaminoo, there was a lib that might be handy for stuff like that i saw today
19:19nmwsarrdem hmm thanks.. will chew on this
19:19Glenjaminthe example from https://github.com/weavejester/reagi almost exactly describes that
19:20nmwsglenjamin was that link for me?
19:20Glenjaminyes
19:21nmwsglenjamin ok will take a look.
19:22nmws(my larger project is to actually develop a clojure api for the lego mindstorms ev3 robot)
19:22arrdemnice!
19:23arrdemherm... so I've built an assembler assembler... now how to test it without including a simulator for the target processor...
19:24bitemyapparrdem: want to do it the hardware way?
19:24bitemyappor double validation way?
19:25bitemyapparrdem: you build a second assembler assembler - write a fuzzer-generator for the assembler...then crash whenever the two implementations disagree.
19:25bitemyapparrdem: then you're doing it aerospace style!
19:25bitemyappI'm quite serious :(
19:25arrdemI know you are
19:25arrdemand it's a reasonable approach
19:25bitemyapparrdem: you could also just add manual "known correct" test-cases.
19:26arrdemyeah I think I'm gonna start with checking against some hand-assembled cases.
19:26Glenjaminarrdem: are you concerned with correct program result, or correct assembler?
19:27arrdemGlenjamin: eventually both.
19:27bitemyappGlenjamin: oh you have a way of auto-validating program output without executing?
19:27bitemyappI'd like to see this >:)
19:27Glenjaminpresumably for anything non-trivial the latter is harder to distinguish
19:27Glenjamini was going to say a simuator is probably a reasonable approach
19:27Glenjaminif you want it to generate a program than runs and produces the output, rather than generating the program you expect it to generate
19:28Glenjaminwhich implies you could have done it by hand
19:28bitemyapparrdem: yeah actually, why is a simulator out of the question?
19:28bitemyapparrdem: also I strongly encourage the use of fuzzers for program validation.
19:28bitemyappthey hammer out SO MANY bugs.
19:28arrdem$google github arrdem batbridge
19:28lazybot[arrdem/batbridge · GitHub] https://github.com/arrdem/batbridge
19:29arrdembitemyapp: a bytecode simulator already exists. I'm just pondering if there's a better way.
19:29Glenjaminare your tests for validation, or a feedback mechanism?
19:29Glenjaminprogram validation is less useful for the latter
19:29Glenjaminimo, anyway
19:32arrdemmmkay. I'll probably do the dual input fuzzing once I've validated the processors against each-other.
19:33arrdemthanks for the feedback guys.
19:33bitemyapparrdem: http://i.imgur.com/M56m4yl.gif
19:34arrdembitemyapp: oh god why
19:35nmwsbitemyapp: some of us aren't that far away from asking these kinds of questions in clojure. :( Spent many years writing Java, and I feel like I'm learning programming all over again..
19:35bitemyapparrdem: if you want more "oh god why" https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved=0CCsQFjAA&amp;url=http%3A%2F%2Fivanych.net%2Fdoc%2FPessimalAlgorithmsAndSimplexityAnalysis.pdf&amp;ei=UBy-UqaVAsXzoATHr4Ag&amp;usg=AFQjCNFvMsu2RyJJeI-ous2xrHdwkifwog&amp;sig2=LCil287uk5mofzgxJYobXw
19:35bitemyappnmws: it's ,(+ 1 2)
19:35arrdembitemyapp: I've got all the oh god why I need right here http://codegolf.stackexchange.com/questions/16226/trolling-homework-questions-sorting
19:35bitemyapp,(+ 1 2)
19:35clojurebot3
19:36nmwsbitemyapp: heh not quite that bad, but close.. :)
19:36metellusnmws: the question is the least objectionable thing on that page
19:37nmwsmetellus: good point. I've stopped being shy about asking basic questions..
19:38bitemyappnmws: I don't bite...much. Ask questions!
19:38arrdembitemyapp: that paper is glorious.
19:38bitemyappThere was a study once where they found, neurologically speaking, the anticipation and fear of pain was more painful than pain itself.
19:38bitemyappnmws: ^^ meditate on that ;)
19:39nmwsbitemyapp :)
19:39Glenjamini feel like i'm missing something obvious, if i've got an environ map, what's a neat way to either get nil, or cast the field to an int if present?
19:40Glenjaminoh wow, (int) does not do what i expected anyway
19:40Glenjamini guess i need Integer/valueOf
19:40Glenjaminand a wrapper
19:40bitemyappGlenjamin: I write value-type wrappers for my environ stuff.
19:41arrdemGlenjamin: yeah #(when %1 (Integer/valueOf %1))
19:41bitemyappbenv, ienv, kenv, etc.
19:41Glenjamini've got it all wrapped up in a config namespace
19:41bitemyappzats what I do.
19:42hyPiRionmaan
19:42hyPiRion,(map #(some-> % Integer/valueOf) ["1" nil "3"])
19:42clojurebot(1 nil 3)
19:43Glenjaminoo, neat
19:44Glenjamingah
19:45Glenjaminis there a reason other than no-one has done it yet that (ns) errors are so cryptic?
19:52technomancyGlenjamin: two reasons: it's very difficult to get contributions accepted into clojure, and the core team doesn't place a high priority on usability
19:52Glenjaminboth those reasons make me sad :(
19:53Glenjaminby difficult, do you mean the CLA, or the review process?
19:55Glenjaminhrm, which bit of the stack causes "lein repl" to write out the .nrepl-port file?
19:55logic_progwhere can I read about how "lein cljsbuild auto" works with _multiple profiles_ -- for example, I have a dev profile with 'sourcemaps + no optimiations' and I have a release profile with "no source maps; advanced optimizations"; then, I weant "lein cljsbuild auto" to only auto rebuild the dev profile, and not touch the stable profile
19:56Glenjaminah, it's leiningen since 2.3.2 - found it in the changelog
20:01technomancyGlenjamin: the CLA is annoying, but it's symptomatic of deeper issues
20:02bbloomtechnomancy: i sense some seriously negative connotation to your statements :-P
20:08arrdembbloom: tiny bit
20:34BAMbandaif I fire "lein repl" it brings up a clojure repl, Im just curious, is it detecting the clojure install on my machine?
20:34BAMbandai am not executing it with java
20:40arrdemBAMbanda: no. Lein packages the Clojure repl and runtime. You are running Lein's clojure from inside the Lein JVM instance.
20:48mullrIn clojurescript, is there a preferred way to extend a protocol over both PersistentHashMap and PersistentArrayMap?
20:49arrdemdoes it need to be a protocol? seems like you could probably just have a type-agnostic function...
20:49mullrarrdem: well, the function is polymorphic
20:50mullrarrdem: it does different things for maps and vectors
20:51mullrhttps://gist.github.com/mullr/8155158
20:51gdevarrdem, when do you start working on CinC?
20:52arrdemgdev: whenever I get motivated :/
20:52arrdemgdev: that and I have another book or to on the JVM to track down and read
20:53arrdemgdev: what's up, got a special request or something?
20:53gdevarrdem, I have 125 bucks in amazon gift cards if there are any books you're missing =)
20:55arrdemgdev: thanks :P all I really need to do is track down a copy of "Inside the Java Virtual Machine, 2nd ed." and then stop letting bitemyapp and dogecoin distract me.
20:57BAMbandaim sorry, i asked this question before and I haven't had the time to configure it so I forgot, what is your recommended setup for emacs?
20:57BAMbandaslime?
20:57arrdemBAMbanda: slime is to be avoided at this point.
20:57BAMbandaok, so cider and nrepl?
20:57arrdemBAMbanda: nrepl.el is the "old" emacs repl support, but stable and working
20:57arrdemBAMbanda: Cider is new, somewhat unstable nrepl support
20:57BAMbandahmm, what do you personally use?
20:57BAMbandaarrdem
20:57arrdemcider
20:57BAMbandaok
21:00mullrrelated question: is there a uniform way to map over both the [key value] tuples for each? For the vector, the key would be its index.
21:01arrdem(seq {:foo :bar :baz :bung}
21:01mullr(to map over both hashes and vectors)
21:01arrdemmullr: ... hashes too? you're gonna have to bring for into this.
21:02mullrarrdem: I can do (for [[key val] x] ....) when x is a map
21:02gdevBAMbanda, I just use the emacs live setup
21:02mullrarrdem: but if x is a vector, of course that doesn't work. Conceptually though, a vector is also associative with and index key and a value
21:02gdevclone the github repo as your emacs.d folder and you have everything you need to start whacking away
21:03arrdemmullr: barely, but I see what you're saying. I don't think of a nice way to achieve that withought implementing a wrapper function to manually handling seq-ing the parameter seqable.
21:03BAMbandagdev, i just pasted in the script from the emacs-live page, it looks so promising, i installed it, but now what?
21:03BAMbanda"emacs-live" doesn't seem to be recognized as a command on my terminal
21:04mullrhmmmmm
21:04gdevBAMbanda, C-c A-j
21:04arrdemBAMbanda: just boot emacs
21:04gdevBAMbanda, in your project folder type emacs project.clj
21:04BAMbandaoh my
21:04gdevto get to other files C-f
21:04BAMbandaoh my, this is incredible
21:05arrdemHE HAS SEEN THE LIGHT. REJOICE BROTHERS.
21:05BAMbanda:)
21:05BAMbandai think im in a dream
21:05gdevI'll burn the white smoke in the vatican so RMS will know there is a new member in the church of emacs
21:05nonubyis there any behaviour difference between (put! ch val) and (go (>! ch val)) when used in a response callback of say a http-kit request
21:05RaynesThat seems quite unlikely
21:06Raynes:p
21:06BAMbandagdev, how do i get the repl up in emacs
21:06arrdemBAMbanda: C-c M-j
21:06gdev^
21:07BAMbandahmm, its undefined for me
21:07gdevgfredericks, are you watching the hawks game?
21:07gdevBAMbanda, A-x nrepl-jack-in
21:07arrdemBAMbanda: or M-x cider-jack-in
21:07arrdemgdev: what is this A- blaspehmy
21:08gdevAlt-x =p
21:08BAMbandaarrdem, cider-jack-in doesn't work but nrepl-jack-in works
21:08arrdemo. kay.
21:08BAMbandadamn, this is it
21:08arrdemBAMbanda: that's fine. just means that emacs-live still uses nrepl not cider.
21:09arrdemBAMbanda: this is a feature. do not touch until you feel brave enough to do so.
21:09BAMbandaarrdem, I will prostrate on the floor and thank God now
21:09BAMbandathis is nothing short of a gift
21:09gdevit's because sam hasn't updated the package
21:09gdevbut when he does all you have to do is pull the changes from the hub
21:10BAMbandaalright
21:12gdevBAMbanda, you'll also want to know how to cancel an evaluation in case you accidentally evaluate (range)
21:13BAMbandawhere do I type (range) into
21:13BAMbandaif the repl is busy evaluating
21:13xeqinonuby: I'd use (put! ch val). (go ...) creates a new channel to return and the >! happens asynchronously
21:14gdevBAMbanda, no, I meant if you accidentally evaluate something like (range) which is an infinite sequence, you'll want to know how to cancel it
21:14BAMbandagdev, ah how may that be
21:14gdevBAMbanda, https://github.com/clojure-emacs/cider study the keyboard shortcuts
21:14arrdemBAMbanda: C-c C-C
21:14arrdemBAMbanda: the usual EJECT EJECT EJECT EJECT keyboard mashing will work :D
21:15BAMbanda(range) automatically stops with 99 ...
21:15BAMbandathats good security
21:15arrdemwat
21:15arrdemcould not reproduce.
21:15BAMbanda(range) doesn't crash
21:16BAMbanda(range prints num from 1 - 99 and ends with ...
21:16pjstadig*print-length* in action
21:16gdevBAMbanda, probably because your print length is set
21:16BAMbandagdev, ah, intellisence in emacs, this is superb
21:17gdevokay, if you accidentally evaluate (Thread/sleep Integer/MAX_INT)
21:17mullrok, came up with something a bit nicer: https://gist.github.com/mullr/8155158
21:20gdevarrdem, is it too early to show him nyan-mode?
21:20arrdemgdev: NEVAR.
21:20arrdemBAMbanda: M-x package-install RET nyan-mode RET M-x nyan-mode RET
21:21BAMbanda"Install package: nyan-mode (No matches)
21:21BAMbanda:(
21:21BAMbandaarrdem
21:22arrdemwat
21:22arrdemBAMbanda: do you have elpa/marmalade set up yet?
21:22technomancymake sure you've added marmalade to your archive sources, maybe run M-x package-refresh-contents
21:23BAMbandai have elpa, let me take care of marmalde
21:25gdevmullr, what is that doing?
21:27mullrgdev: Just a depth-first search, giving back the path to each leaf of the tree. Given something like (all-paths {:a {:b [1 2]}}), gives back ((:a :b 0) (:a :b 1))
21:28BAMbandawow, cats and rainbows, thanks guys :)
21:28BAMbandamakes development a little more cheerful!
21:28mullrgdev: I'm trying to do two way synchronization between an atom in clojurescript and a https://www.firebase.com/ document
21:28arrdemBAMbanda: IS IT NOT GLORIOUS.
21:29BAMbandaarrdem, the internet age and cats. I would have never though
21:29BAMbandathought*
21:29arrdemBAMbanda: yeah. it's silly but sometimes it's all that's needed to make a hard debugging session doable.
21:29arrdemI suppose I should build doge-mode...
21:29BAMbandaarrdem, yeah i got it. It reminds us to smile. very healthy indeed!
21:31arrdemanyone have a cute keyboard shortcut for M-x shell?
21:32justin_smitharrdem: now I am imagining doge themed stack traces
21:32arrdemjustin_smith: first we need sane stack traces. then we can make them silly.
21:32justin_smithclojure.java.jdbc/with-connection* wow
21:32justin_smithmuch clojure.core/eval
21:32gdevarrdem, meta-!
21:33arrdemgdev: do like. very short. so stolen.,
21:33justin_smithI think comic sans, primary colors, and a doge face are exactly what clojure stack traces need
21:35gdevor even better a text-to-speech service that will say your stack trace in speed reading lawyer voice
21:35justin_smithI wonder if the micro-machine guy is available
21:35gdevlol that's who I had in mine
21:36gdevs/mine/mind
21:39arrdembitemyapp: lol made 14% so far in manual trading. wtf.
21:50technomancyarrdem: I use C-x m
21:51technomancyarrdem: but I have a secret plan to make an nrepl middleware that can render stack traces as terribly compressed jpegs with hell of artifacts
21:52arrdemtechnomancy: I have heard of this plan. I like that it will allow Clojure/nrepl to compete with drracket :P
21:52jcromartieI love it
21:53gdevtechnomancy, weren't you working on rich text format for nrepl output?
21:54technomancyrich media types, yeah
21:54technomancynecessarily
21:55justin_smithto fully embrace gigo, a stack trace could be replaced by a random image from a random /b/ thread
21:56technomancyat my last job there was a pool of gifs that would get posted to pull requests that resulted in build failures
21:57gdevand the price-is-right fail horn over the office PA system
21:58arrdemwasn't bitemyapp doing a gif a commit at some point?
21:59gdevI remember posted a picture of my pug on one of his pull requests and calling it a pug request
21:59gdevgithub lets you post images everywhere you can make comments, sometimes all you need is an image
22:00TEttingertechnomancy, how bad do you want uour compressed jpegs? http://www.mspaintadventures.com/sweetbroandhellajeff/archive/011.jpg
22:01technomancyTEttinger: just point me in the direction of the java lib
22:02TEttingerhaha
22:02gdevanother good use of being able to post images on github comments, instead of ascii picard face palm, you can post the real thing https://github.com/mikejdoyle/Quiz/commit/e26496db754bd201ed7e2ecead8aeb760d10f195#diff-eb0cd5ad98766cffd6b8a54a7329f3d4
22:02justin_smithtechnomancy: you can do it with java.awt.image.BufferedImage
22:02justin_smith+ javax.imageio.plugins.jpeg.JPEGImageWriteParam for setting that compression as intense as it goes
22:03jared314if you are going to use a meme, just use sad kitten or something
22:04gdevanimated gif stack traces
22:04TEttingerjMeme for all meme-related image needs
22:04technomancyjustin_smith: nice
22:05ryanfdoes anyone know of an open-source repo that is an example of building cljs to run on node with tests?
22:06ryanfit wasn't hard to get it building, but it's not clear to me how to simultaneously make a second build with tests in it
22:06ryanf(or whatever other approach would make sense)
22:07jared314http://memegenerator.net/instance/44379725
22:09justin_smithhttp://i.imgur.com/PXn2vPV.jpg
22:09arrdemyeah there'd better be an insanity wolf option :D
22:16logic_prog_https://github.com/mozilla/pdf.js/blob/master/examples/helloworld/hello.js#L30-L33 <-- how do I write these lines in cljs?
22:16bitemyapparrdem: lolwut
22:17arrdembitemyapp: ??
22:17lazybotarrdem: Definitely not.
22:17arrdemlazybot: did I ask for your oppinion?
22:19bitemyapparrdem: 14%
22:20arrdembitemyapp: yep. started playing with 12000 doge, now have 13686. 14% ROI.
22:21arrdembitemyapp: mining's faster tho...
22:46SirSkidmoreWhen using lein, I run lein new foo, enter that directory, run lein repl and then run (in-ns 'foo.core) when I try to run the placeholder function (foo 1) and it says it can't resolve the function
22:47SirSkidmoreany ideas why?
22:47amalloyin-ns doesn't load anything
22:47SirSkidmoredoesn't it switch the namespace?
22:48justin_smithsure, but it doesn't load the file
22:48amalloysure, it switches you into a namespace, creating it if it doesn't exist
22:48amalloybut it doesn't compile anything or read any files
22:48SirSkidmoreohhh
22:48SirSkidmorehow do I make lein load all of the project files when it starts?
22:48justin_smithSirSkidmore: make a namespace that requires all the others, and then require that from the repl
22:48amalloyyou don't do that; you (require) them
22:49SirSkidmoreoh
22:49SirSkidmorethank you :)
22:55mullrlogic_prog: (.render page #js {:canvasContext context, :viewport viewport})
22:55mullrerr, logic_prog_: see above
22:55logic_progmullr: I used js-obj
22:55logic_progwhere is #js documented ?
22:55logic_progthis looks badass if it's a edn
22:56mullrI think it's rather new, I found it in an Om sample
22:57mullrlogic_prog: https://groups.google.com/d/msg/clojurescript/mUVbtdnAvHA/LisdVWyAJKwJ
23:02yedianyone have some resources for getting started with datomic pro starter with clojure?
23:03yedithe main site's tutorial is in java, and i've been googling around and haven't found anything to resourceful yet
23:10bbloomyedi: i can't imagine the interface is dramatically different as to be confusing for a clojure programmer
23:19brainproxyyedi_: have you looked at the "day of datomic" stuff?
23:19yedi_yea im lookin at that stuff now, and workin through some of the examples
23:19yedi_hopefully thatll be enough for me to get up to speed
23:20logic_prog_yedi_: I also learned from day of datomic.
23:20logic_prog_mullr: thanks! (re: google link for #js)
23:49yedi_i guess in datomic, there's no schema type for edn?
23:50yedi_i should just store the edn as a string and parse it everytime