#clojure logs

2013-12-14

00:05akhudekwow, gloss is much slower at reading than writing
00:13cljr,(-> (concat (repeat 10 0x00) (repeat 2 0xff) [127 0 0 1]) (map char) (apply str))
00:13clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IFn>
00:14cljr,(->> (concat (repeat 10 0x00) (repeat 2 0xff) [127 0 0 1]) (map char)
00:14cljr (apply str))
00:14clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
00:18cljr,(->> (concat (repeat 10 0x00) (repeat 2 0xff) [127 0 0 1]) (map char) (apply str))
00:18clojurebot"
00:20cljrspeaking of gloss, ive got a frame defined as an ascii string, and when i write out the above data using that frame, the hex output ends up like 00 .. 00 3f 3f 7f 00 00 01, when im expecting 00 .. 00 ff ff 7f 00 00 01, im a newbie at this, am i doing something wrong encoding-wise?
00:23akhudekhttps://www.refheap.com/21752
00:23akhudekouch
00:24akhudekcljr: I'm not sure. Are you sure the string encoding is right? Maybe it's utf-16 or something?
00:25cljrwell, when i use (str ..) that is a utf-16utf-16 string, rights?
00:25cljrBut even if i change the frame to use that, i get even weirder hex output than i would expect
00:27akhudekcljr: looks like you can specify the encoding in your frame definition
00:28akhudekhttps://github.com/ztellman/gloss/wiki/Introduction
00:29cljrakhudek: yeah, that is what i mean, when i change it to :utf-16, output is even more off
00:33akhudekcljr: ah, I don't know then
00:42akhudekyikes, a custom reader takes only 7.7msec vs 4428msecs using gloss.
00:43deadghostis there a sleep function to delay running code?
00:43deadghostor do I need to roll my own/pull from java
00:43akhudekdeadghost: Thread/sleep
00:44akhudekdeadghost: if you need to schedule code to run later and continue, then you can start a thread where the first call is Thread/sleep
00:44akhudekdeadghost: there are also scheduling libraries if you want more sophisticated functionality
00:46TEttingerdeadghost, overtone's at-at is very good.
00:56cljrwell, maybe i know what my issues is, is a char[] in C/C++ the same as a String in Java?
00:59dsrxno
01:02dsrxa String in java is more like a std::string in C++
01:06amalloycljr: ascii is a 7-bit encoding, right? so i'm not sure it's well-defined what gloss "should" do if you ask it to encode (char 0xff)
01:14akhudekcljr: unicode-8 is not a simple char[]
01:14akhudekcljr: however, you should only encounter a difference if you have data that is outside the standard ascii set
01:18marcopolo2anyone use clj-webdriver? It crashes my nrepl server whenever I spawn a new browser, anyone experience that?
02:29ddellacostawhat do I use to get cider to recognize functions declared in the namespace I'm working in?
02:29ddellacostaC-c M-n doesn't seem to do it
02:51divyansr__, (list 1 1 )
02:51ddellacostanevermind, needed to use C-c C-n.
02:51clojurebot(1 1)
02:54alfredhelp
03:22TEttingerAlfred, do go on
03:53bitemyappAlfred: refheap.com
04:11PupenoIs there a html template for Clojure that automatically escapes strings unless they been marked as safe, like Rails?
04:12justin_smithI think any of the moustache-derived ones should do that
04:15Pupenojustin_smith: it seem so, from mustache's docs: "All variables are HTML escaped by default. If you want to return unescaped HTML, use the triple mustache: {{{name}}}."
04:15PupenoIs Hiccups the only structure-based template?
04:15justin_smiththe one I use is the one we developed for caribou, antlers
04:15justin_smithwhat do you mean by structure-based - like the input is edn?
04:16justin_smithif so laser and enlive both can use edn data structures in templating
04:17Pupenojustin_smith: not sure what edn is, but what I mean is that you build a tree so you cannot accidentally open a tag without closing it, like hiccups or in rails, haml.
04:17justin_smithedn is the clojure equivalent of json
04:17justin_smiththe basic data literals
04:17Pupenoenlive reminds me too much of the zope/plone template engine. It seemed like a good idea in paper but in the day to day it was a nightmare.
04:19Pupenolaser seems of the same kind as enlive and zope's
04:19PupenoTAL, that was the name of Zope's.
04:20justin_smithI can say those are the ones I can think of off the top of my head, but usually it is the front end guy doing the template stuff, so we use something based on moustache because it is a syntax they are familiar with
04:21justin_smithso I don't have much experience with clojure-centric templating
04:21justin_smith(though antlers is done in clojure and uses clojure in the helpers)
04:22PupenoIn all the teams I been, frontend was done by the same people as everything else, so I stopped choosing template engines based on how easy it would be for someone used to HTML.
04:22PupenoI'm not saying that this is the only way, just what tends to be true for me.
04:23justin_smithyeah, we clearly have different environments
04:24sverihi, anyone here using cursive? whichupdate channel do i have to use for the intellij 13 release?
04:24Pupenosveri: I am.
04:25Pupenosveri: I used this one: http://cursiveclojure.com/plugins-13.xml
04:25Pupenoif that's what you are asking.
04:25sveriyea
04:25sverithank you, i was not sure cause the doc said that this is for the EAP release
04:26PupenoYeah, intellij was just released and the docs are out of date.
04:26sveriok
04:26sveriawesome, thank you very much
04:26PupenoAFAIK
04:26Pupenosveri: just getting started with it?
04:27sveriPupeno: i tried it some time ago, but got not rly warm with it
04:27sverihowever, emacs lacks some things for me too and as awesome as lighttable is, there are a lot of features missing too (regarding general editing capabilities)
04:27PupenoThe fact that by default it's in structural mode was confusing (http://cursiveclojure.com/userguide/paredit.html).
04:27Pupenobrb
04:35PupenoI used to play with La Clojure back in the day, before Cursive.
04:53pepijndis there a way to use neo4j via clojurescript
04:55TEttingerpepijnd, like via node.js?
04:55TEttingeryou mean clojurescript not clojure?
04:56pepijndTEttinger, no from the browser. neo4j has a rest api
04:57TEttingerhttp://clojureneo4j.info/
04:57TEttingerfirst result for: clojure neo4j rest api
04:58pepijndTEttinger, thats
04:58pepijndnot cljs
04:58TEttingerright forgot
05:10pepijndwow https://github.com/zubairq/coils#client-side-neo4j-cypher
05:11pepijndis Clojure on Coils any good?
05:13gunsgfredericks joked once about "Clojure on Clails"; funniest damn thing I've heard on IRC.
05:16pepijnd?
05:17gunssorry; just thinking about unfortunately named clojure libraries
05:17pepijndI dont know what clails are
05:17gunsit's a joke. Unlike Clojure on Coils apparently
05:21pepijndyea. point is that the name doesnt sound very solid/professional. ao given that anyone can put up some code and pretend it's the next RoR, i'm hesitant to start using it
05:22guns"secure client side SQL" sounds crazy
05:24pepijndI think it's a macro that does some public key crypto, but it does soud weird
05:29gunsit sounds like a poorly thought out hack; even if it is secure, a web client should never need direct access to the database
05:29pepijndphpmyadmin?
05:30gunsI'm not sure if you're trying to illustrate my point :)
05:30pepijndbut in that case, you would want "sql injection"
05:31pepijndY NO LIKE phpmyadmin?
05:31gunsif he wanted to use macro magic, he could use macros to have code in a template actually execute on the server without piping SQL over the network
05:32pepijndmaybe they does that
05:33gunsthen he shouldn't call it "client side"; I'm going to look for the source
05:37gunspepijnd: No, it looks like he's throwing _symmetrically_ encrypted SQL over the network
05:37pepijndoh...
05:40gunsplus, the cipher is PBEWithMD5AndDES, which you could crack with your kid's ps3
05:42gunspepijnd: https://github.com/zubairq/coils/blob/coilsdemo/src/webapp/framework/server/encrypt.clj#L9-L17
05:42gunsand he uses UUID/randomUUID as a test password in development!
05:43pepijnd...
05:43gunsI hope nobody finds this chat, or somebody's client sites are going to get hacked
05:44pepijndthats better than "password" I guess.
05:48gunsWell, I see that java's randomUUID is actually random (I thought it was one of the less random variants), so I guess I'll back off on that one
05:50pepijndi feel tempted to try cracking http://www.nemcv.com ... for educational value, but probably still a bad idea.
05:50gunsyou've already blown it by mentioning it here :)
05:52pepijndlol, now it's all my fault if they get hacked
06:05pepijndso what is the preferred micro framework these days?
06:07pepijndi like moustache...
06:10pepijndwat.. weavejester wrote clout AND compojure...
06:11Raynespepijnd: And everything else.
06:11RaynesSrsly
06:12pepijndhaha
06:12pepijndbut who needs more than one router? :P
06:12RaynesHe's basically like people perceive me (lein release clojars new libraries so often that it automatically writes them now).
06:14Raynespepijnd: Also, Compojure uses clout for routing.
06:14RaynesFor matching routes, I mean.
06:15pepijndahhh. so compojure is more than routing? never knew
06:15S3thc0nIs it practical to use monads instead of accessing values (as an atom for example) globally from within functions?
06:15RaynesWell, it's much higher level, pepijnd.
06:16pepijndok
06:16RaynesWith a few macros to make things super pretty.
06:16RaynesAn amazingly well designed API.
06:16pepijndwill try
06:16RaynesAnd goodies like some middleware sets pre-made for common use-cases.
06:16Raynespepijnd: You're only just seeing the world!
06:17RaynesI'm so happy. ;')
06:17pepijndhaha, its been way to long since I did clojure webdev
06:18RaynesMe too, man.
06:18RaynesI need to give refheap some lovin'.
06:18RaynesAnd stop writing Go.
06:18pepijndhaha
06:19RaynesThere is a possibility I might take some Go work soon, so I've been playing with Go for the last week. Been hacking http://github.com/Raynes/goheap like mad.
06:19RaynesIt's fun, but I need either better static type systems or dynamic type systems in my life. :p
06:20pepijndyou could port all the good things from go to clojure... oh wait, core.async.
06:20RaynesBut Go has...
06:20RaynesWhat about...
06:20RaynesYeah, no clue.
06:21pepijndI'm doing my first clojure job now, hence the webdev
06:21RaynesI mean, as far as C-like syntaxes go, I'm quite fond of it. Tabs turned me off big time, but it really makes no difference when you're writing code and you're expected to run 'go fmt' to computer-format your code anyways.
06:22RaynesNice, congrats on it.
06:22RaynesI'm currently coming off my first Clojure job. :p
06:22pepijndgo is C like?
06:22RaynesAye.
06:23RaynesI mean, it's in the C family of languages
06:23RaynesBeyond syntax it doesn't resmble a whole lot.
06:23clojurebotIt's greek to me.
06:23pepijndoh, ya
06:23pepijndyou quit the family tree thing?
06:24RaynesHah, well, I didn't quit it.
06:24RaynesUnfortunately the company had to lay some folks off.
06:24pepijndoh...
06:25pepijndthat sucks
06:25RaynesWell, that's how it always feels at first.
06:25Raynes:p
06:26AeroNotixSo you got fired?
06:26pepijndhah, enjoying some freedom?
06:26RaynesBut I've got some pretty cool opportunities to pursue. I'm trying to remain in LA because I quite fancy it.
06:26RaynesAeroNotix: Nope.
06:27AeroNotixRaynes: what's goheap for? play.golang.org
06:27AeroNotixDone.
06:27Rayneshrm
06:27RaynesAeroNotix: What do you mean?
06:28AeroNotixRaynes: play.golang.org is the 'pastebin' service which is more pervasive for Go.
06:28emil0rhi. does anyone know what to put in leiningen in order to get clojure 1.6.0-master-SNAPSHOT as a dependancy?
06:28RaynesAeroNotix: Oh, goheap is an API client for refheap.com
06:28pepijndmagic
06:28RaynesIt's a Clojure pastebin I wrote that the Clojure community uses.
06:29RaynesOr, tends to use in any case.
06:29AeroNotixRaynes: so you upload Clojure code from Go? I don't get it
06:31RaynesAeroNotix: refheap.com is a pastebin that supports tons of languages and has an API. goheap is a library wrapper around it's API (like gist's API and the various clients for it).
06:31AeroNotixI se..
06:31AeroNotixsee
06:31RaynesNow if someone perhaps wanted to write a program that pasted something to refheap for some reason and they wanted to write it in Go, they could use goheap to easily do that.
06:32pepijndbut gist is not invented here
06:32RaynesIt was more of a learning project than anything.
06:32RaynesThe first thing I do in languages usually is write a refheap API client.
06:32AeroNotixI see
06:33pepijndRaynes next time try google safe browsing, for a challenge...
06:34Raynespepijnd: ?
06:34pepijndcomplicated api
06:34RaynesOh!
06:34RaynesHah.
06:35RaynesAeroNotix: http://jobsearch.about.com/od/firedtermination/qt/fired-laid-off.htm for an explanation of the difference between laying off and firing. I'm not sure if it's just a USA thing or not.
06:37AeroNotixI see
06:44Raynespepijnd: Or! The WolframAlpha API.
06:44RaynesGo look at it. I dare you.
06:44pepijndok, not now, but i will
06:47progoenlive with XPath support would be great
07:34piranhaanybody using cljs repl in browser here? If I did 'defn' of a function, it gets defined nicely. But when I change it and try to execute it (I have my emacs connected to a browser) it's not redefined
07:34piranhaany pointers what should I do?
08:44poppingtonichi people
09:41cYmenhm...
09:42cYmenWhen I do (apply max-key #(...) (filter ...somestuff...)) it is an error when the filter returns an empty list. How do I fix that?
09:49pdkmake the #(...) function check its argument is nil?
09:50hyPiRionfind some minimal value
09:50hyPiRion(apply max-key fn min-value (filter ...))
09:54cYmenhm...yeah I did approximately that but I simply added a value that will not be filtered away
10:06mi6x3mhey, beginner clojure here, but computer scientist. I am just looking at do's details
10:06mi6x3mam I right that it's "do" which allows the non-strict binary tree syntax?
10:06mi6x3mlike
10:06mi6x3m(a b c)
10:06mi6x3m(a b c d) etc.
10:12mi6x3mlong story, short: can someone explain "do" :)
10:14jonasenmi6x3m: http://clojure.org/special_forms (search for "do")
10:14mi6x3mjonasen: was reading that
10:14mi6x3mI can't understand something
10:15mi6x3mwhy is it the case that program forms aren't always binary trees?
10:15jonasenmi6x3m: not sure I understand what you mean. But why should each form be _binary_?
10:16Bronsami6x3m: 'do is usually used when you need side-effects
10:16mi6x3mjonasen: (+ 1 (/ 4 2)) is in fact a binary tree
10:16Bronsae.g (do (println "foo" 1)
10:16Bronsae.g (do (println "foo") 1)
10:17jonasenmi6x3m: there are three elements in each of those lists
10:17mi6x3mok, here is a better example
10:17mi6x3m(+ 1 2 3) should technically be (+ 1 (+ 2 3)), without do?
10:17justin_smithmi6x3m: not at all
10:18jonasenno. + can accept any number of arguments
10:18justin_smithvariable arity is deep in the language
10:18jonasennot all operators are binary
10:18mi6x3mjustin_smith: ah, okay, I see. so do is really just about evaluating a number of expressions and returning the result?
10:18mi6x3mno other purpose
10:19Bronsayes.
10:19justin_smithmi6x3m: the point of do is to ignore some of the expressions in between
10:19justin_smithassumed for side effects
10:19Bronsajustin_smith: ignore is probably a bad choice of word there :)
10:19mi6x3moh, okay, this clarifies it
10:19mi6x3mthanks
10:19justin_smithlet, fn, catch, etc. have implicit do blocks
10:20justin_smithBronsa: yeah, good call
10:20justin_smithignore the return value
10:20justin_smithwhile evaluating the expression
10:20mi6x3myes, this is what was confusing me
10:26`cbpdoes anyone have a merge fn for vectors handy? or a fill fn?
10:27`cbplike (f [1 2 3] [1 1 1 1 1]) -> [1 2 3 1 1]
10:29mi6x3manother question
10:29mi6x3mcan I only use symbols for let bindings?
10:30`cbpsymbols or destructuring
10:31opqdonut,(into [1 2 3] [1 1 1 1 1]) -- `cbp
10:31clojurebot[1 2 3 1 1 ...]
10:31opqdonutoh, merge, bah
10:31`cbpi did (concat a (drop (count a) b))
10:31opqdonutI thought concat :)
10:31`cbpstupid stress doesnt let me think
10:31opqdonutyeah that should do it
10:31opqdonutinto is slightly nicer than concat because you get a vector out
10:32`cbpyoure right
10:38andyfBronsa: jonasen: Up early, or up all night? :-)
10:38andyfNow that Bronsa is the master of Clojure contrib libs, I am going to throw some 3rd party libs into the Eastwood crucible for additional testing.
10:50Bronsaandyf: I sleep 5am/2pm :P
10:51andyfexcellent. Exactly what my schedule was in grad school :)
11:01mi6x3mare let bindings always proceeded (evaluated) in order?
11:01mi6x3mis this guranteed?
11:01Bronsayes
11:02opqdonuthes
11:02opqdonut*yes
11:03opqdonutthe documentation that tells you that: http://clojure.org/special_forms
11:04mi6x3mand their evaluation will be immediately before the evaluation of the rest of the do expressions?
11:04mi6x3mopqdonut: not everything is there :)
11:08andyfmi6x3m: If an expression bound by let is lazy (e.g. the results of map, filter, and many other Clojure functions that their docs say are lazy), then they will not be fully evaluated, only a bit.
11:09michaelr526hello
11:09andyfThat statement is independent of whether the lazy expression occurs in a let, or anywhere else
11:10jonasenandyf: early? It's 6PM here :)
11:10andyfjonasen: Sorry, I should better remember your time zone. Finland, yes?
11:10jonasenyes
11:12andyfHoly cow, the days must be getting short there now
11:12hyPiRionSun sets at 2:30 pm over here, so I guess it's the same over there
11:12jonasenandyf: yep.. only a few hour days here... It gets dark at 4pm
11:13jonasenhyPiRion: probably
11:14andyfIf it weren't terribly expensive or dangerous, I would once like to see the sun go around above the horizon in 24 hours at one of the poles.
11:15hyPiRionHurray for Fennoscandians and their crazy longitude.
11:15hyPiRionandyf: I would guess it would be possible in Alaska during summer?
11:16hyPiRionWell, that's not a pole, but you'll see the sun following a sine wave
11:17andyfLooks like it. I hadn't checked how much land is actually in the Arctic circle.
11:17jonasenandyf: hyPiRion: Alaska might be expensive but I don't think its dangerous :)
11:18andyfjonasen: Cool. I'll have to see if there are any decent hotels in northern Alaska, for a mid-summer visit.
11:25andyfGoogle is wonderful "arctic circle hotel" finds 3 in Finland :-)
11:29jonasenandyf: http://www.icehotel.com/ seems cool!
11:32bbloomdnolen: ping
11:39logic_proghow does one develop a sense of absolute control over one's emotions, to be not rattled by anything?
11:39poppingtonicpracice mindfulness.
11:40poppingtonic*practice
11:40mi6x3mhey, what is the difference between (nth [1 2] 1) and ([1 2] 1) ?
11:41poppingtoniclogic_prog: When you're present to your every emotion, you can choose which to express. But it takes quite a long time to master.
11:41poppingtonic,(nth [1 2] 1)
11:41clojurebot2
11:41poppingtonic([1 2] 1)
11:41poppingtonic,([1 2] 1)
11:41clojurebot2
11:42justin_smithmi6x3m: nth works on anything sequential, [] as an IFn invokes the get method
11:42logic_progpoppingtonic: is there a way to practice this?
11:43andyfjonasen: :deprecated linter throws exception when trying to find protected methods, because of its use of Class/getMethod. Worth changing?
11:43justin_smithmi6x3m: get is always O(7) at worst, nth has O(n) complexity for seq
11:44mi6x3mjustin_smith: how come?
11:44mi6x3mwouth nth just iterate?
11:44justin_smithfor a seq, yes
11:44mi6x3mokay
11:44justin_smithfor [] it calls get ([] is actually a special hash for fast lookup / tail insertion)
11:44jonasenandyf: yes, I think we should use getDeclaredMethod instead
11:45poppingtoniclogic_prog: why do you want so much control?
11:45andyfjonasen: I'll test with that local change for a while and see how things go.
11:46logic_progpoppingtonic: it's a matter of self control
11:46logic_progto avoid being emotionally manipulated by others
11:46logic_progit's impossible to lead if one can not even control one's own emotions
11:46poppingtonicThen write. About what makes you feel whatever emotions you notice. When you do this, you'll realize what your triggers are. The things that make you happy, for instance, are the triggers you should be keeping track of, so you know when it's appropriate to express the emotion.
11:47logic_progso it's like a tracing debugger
11:47logic_progyou add "println" 's all over your life
11:47logic_progthen when you feel a certain emotion,you look at th elog file and be like "what happened before this emotion"
11:48poppingtonicRemember the dictum "whatever is measured gets improved"? Consider writing about your emotions a somewhat-contrived instance of that.
11:48poppingtoniclogic_prog: sort-of like that.
11:48justin_smiththere are also some heuristics
11:49justin_smithurgency - someone telling you you don't have a choice
11:49poppingtonichmmm
11:49poppingtonicO
11:49poppingtonicsorry
11:50logic_proglol
11:50logic_progso basically ignore everyone!
11:50mi6x3mis the gathering "operator" & a macro?
11:50poppingtonicWhat's the simplest way to lazily write data to a file?
11:50mi6x3mor just sugar
11:50logic_progisn't that a bad idea?
11:51logic_progwhen I write ot a file, I want persistence
11:51justin_smithmi6x3m: a part of the destructuring special form
11:51logic_progI'd be rather unhappy if clojure is like "yeah, I'm going to pretend to write to the file, but not actually write to it"
11:51andyflogic_prog: Learn to rationally evaluate whether someone else's opinion of you matters. In most cases, it is their problem if they are trying to get to you, not yours. I'd say it is OK to be rattled by someone important in your life.
11:51justin_smithmi6x3m: http://clojure.org/special_forms#Special Forms--Binding Forms (Destructuring)
11:53justin_smiththat link pasted weird
11:53poppingtoniclogic_prog: I mean in the sense that I'm programmatically creating files according to some specification. I don't want them to exist before they're absolutely needed. Like a fog of war. I'm making a randomly-generated text-adventure game.
11:58poppingtonicA file describes a particular location as a map. When a player is (= n 2) hops away from that location, the file describing it is created. My specification is in development, and very incomplete.
12:07andyfjonasen: Looks like getMethod searches superclasses and other implemented interfaces for a method name, but getDeclaredMethod does not. Ugh. Maybe I'll try doing both, only using getDeclaredMethod if getMethod throws a NoSuchMethodException
12:12Bronsaandyf: FWIW clojure.reflect recursively uses getDeclaredMethod on the Class ancestors
12:13andyfBronsa: Thanks for the pointer. I'll try that out.
12:32ghadishaybanBronsa: I updated the tail clearing patch to clear interop invocations as well
12:33Bronsaghadishayban: saw that thanks, I'm going to push the update soon
12:35ghadishaybanBronsa: I'm not sure it's the ideal approach right now, Christophe has some interesting ideas about emission. But it works right now, and makes straight reducers super fast.
12:39Bronsaghadishayban: sure -- I'll try to experiment a bit with alternative solutions too but in the meantime yours works. No big deal to revert a couple of line changes if a better solution comes up
12:42ghadishaybanBronsa: heh nice! I am really super excited to start experimenting with t.emitter.jvm over the next few weeks
12:43Bronsaghadishayban: I see t.a.jvm/t.e.jvm as a good way to experiment with those compiler changes, it's so much faster/easier to change things and immediately see the result compared to hacking on Compiler.java
12:43ghadishaybanBronsa: tell me about it. I have been working on and off on that patch for a month
12:47Bronsaghadishayban: just wondering, shouldn't your patch handle keyword invokes/new calls too?
12:51ghadishaybanBronsa: I think that the patch should only handle the minimum amount - jumping from one frame of execution to the next. keyword invoke (even in tail position) just grabs a val and dumps it on the stack - not really long lived.
12:51ghadishaybanBronsa: as for new -- I haven't explored that too much but I'd love to be proven lazy by a good test case
12:55Bronsaghadishayban: you're probably right regarding the kw-invoke case, I'll try and see if I can find a case where not clearing this before new causes the issue
12:56ghadishaybanBronsa: sorry for the shit ton of jira notifications, I thought edited notifications would be somehow debounced =/
13:15logic_progdoes anyone fucking unerstand how deletinos in red black trees work? I'm trying to understand Clojure's persistent data structures; and I get rb-tree insertion, but rb-tree deletion is fucking confusing with red, black, double black, and negative black nodes
13:17dnolencore.async + om is solid gold
13:22logic_progwhat is om?
13:24kmicuhttps://github.com/swannodette/om
13:25dnolenom + core.async https://gist.github.com/swannodette/7915826
13:26dnolenlogic_prog: it's a bridge to Facebook's React optimized for ClojureScript
13:32xeqidnolen: is om 0.1.0 published or do I need clone/install
13:35meoblast001as far as web frameworks in Clojure, is Luminus a pretty popular one? if not, what good alternatives are there?
13:36dnolenxeqi: clone/install, want to play with this a bit more before pushing it out - it's getting close!
13:37SegFaultAXmeoblast001: Luminus isn't really a web framework so much as a set of default libraries with some obligatory boilerplate taken care of.
13:38SegFaultAXmeoblast001: That's a feature by the way, not a drawback.
13:38SegFaultAXPedestal and Caribou are also worth looking into, though.
13:38meoblast001okay. i'm looking over it and it passes my test as something i want to look into more
13:39meoblast001but if it's something that is a dead project or something the entire clojure community hates, i don't even want to start looking
13:39meoblast001so it should be fine to carry forward?
13:40SegFaultAXmeoblast001: To reiterate, Luminus is just a set of sane defaults.
13:40SegFaultAXAnd those defaults are the de facto libraries in the Clojure web community.
13:40meoblast001okay. thanks
13:41SegFaultAXmeoblast001: Try this `lein new luminus test-app && tree test-app`
13:41SegFaultAXmeoblast001: You'll see there isn't very much to it at all.
13:41meoblast001yeah
13:41SegFaultAXI'd also strongly recommend you take a look at Liberator.
13:43meoblast001SegFaultAX: on the topic of sane. is clojurescript something sane or just a toy project?
13:46SegFaultAXmeoblast001: I can't really speak to that from personal experience, but it appears to be stable enough to do real work with.
13:47SegFaultAXmeoblast001: All of the cljs core team idles in this channel though. so you might direct your questions at them.
13:47SegFaultAXdnolen: *poke* ^
13:48dnolenmeoblast001: not a even remotely close to a toy
13:48meoblast001ah, cool
13:54meoblast001ouch
13:54meoblast001when i do lein new luminus guestbook, it creates a project named luminus in a directory named guestbook
14:01munderwoHi all. Im doing some dev in the repl, and want to reload the code from a namespace. at the moment I'm doing (use 'bob.core) at the start. But how to I get it to reload so I can run my changes?
14:06matthavenermunderwo: i think you can do (use 'bob.core :reload)
14:07munderwoahh cool.. thanks matthavener
14:07matthavenermunderwo: you also might check out tools.namespace https://github.com/clojure/tools.namespace
14:07matthavener(refresh) will then reload all your namespaces nicely
14:44nopromptdnolen: is om cool to "beta" test?
14:44dnolennoprompt: getting really close, working on TodoMVC right now and it seems pretty rocking so far
14:45nopromptdnolen: nice. looking forward to it. hopefully a version on clojars soon?
14:45dnolennoprompt: yep
14:46nopromptsuch good news
14:55rovarhow do I get frodo in my classpath so that I can load it?
14:55rovarI'm trying to follow the instructions at https://github.com/james-henderson/lein-frodo
14:55rovarfrodo seems to work as a plugin, but it is not present when I run lein repl
15:20poppingt`Do watches keep track of metadata in refs?
15:21poppingt`rovar: is it in clojars?
15:21rovarpoppingt`, it is: jarohen/lein-frodo
15:21rovarhowever, I have it included in my project as a plugin
15:21rovarbecause it is..
15:22rovarhowever.. some instructions also mention (requiring) it
15:22rovarwhich fails.
15:26poppingt`do you have Nomad installed?
15:28rovari unno, I assume it would pull in nomad when I referenced frodo
15:41gfredericksdnolen: the docstrings for fd/+ and fd/* don't specify the arg order; is that worth a jira ticket?
15:41dnolengfredericks: hrm, what do you mean?
15:41gfredericksI still don't know how core lib maintainers prefer to handle tiny doc changes
15:42gfredericksdnolen: every time I go to use it I can't remember if the sum is first or last
15:42andreiShould there be a huge performance difference between starting a repl with 'lein repl' vs just running 'clojure-1.5'?
15:43gfredericksandrei: what does running clojure-1.5 do?
15:43andreigfredericks: that's just the clojure binary that my distribution installed
15:43coventryandrei: Do you mean in startup time? lein repl starts two jvms by default.
15:43andreigjl_package=clojure-1.5
15:43andreigjl_main="clojure.main"
15:43andreisource /usr/share/java-config-2/launcher/launcher.bash
15:43andreicoventry I mean runtime
15:44dnolengfredericks: fixing
15:44andreihttp://0xab.com/pi-clojure.clj
15:44andreiTakes 4.7 seconds in the repl that 'lein repl' sets up
15:45gfredericksdnolen: cool, thanks!
15:45andrei1.6 seconds in the repl that 'clojure-1.5' sets up
15:45dnolengfredericks: https://github.com/clojure/core.logic/commit/9b9b3a8bb87ab5ccac2491fb5fdd80af18c47847
15:46andreiMy profiles.clj file is empty ( {} ) and I'm strating running 'lein repl' in a directy that is not a clojure project
15:46gfredericksdnolen: perfect
15:46hyPiRionandrei: yes, should be faster to run clojure-1.5. `lein repl` starts up two JVMs, whereas clojure-1.5 starts up just one
15:46coventryandrei: Might be a tiered compilation issue. Try 'LEIN_JVM_OPTS= lein repl'
15:46coventryhttps://github.com/technomancy/leiningen/wiki/Faster#tiered-compilation
15:47andreihyPiRion: That's startup time, I mean runtime of an algorithm
15:47justin_smithandrei: that's where tiered compilation comes in
15:47andreicoventry: That did it
15:47justin_smiththere are different optimization settings
15:47andreiOh, ok. Is there some doc that I should have read that would have pointed me in this direction?
15:48hyPiRionandrei: ah. Well, if you're on the newest leiningen version, add in :jvm-opts [] in your project.clj or do as coventry proposed
15:48justin_smithandrei: if you use criterium it gripes if you don't have optimizations on
15:48hyPiRion(for older version, you'd have to do :jvm-opts ^:replace [])
15:49gfredericks(inc dnolen)
15:49lazybot⇒ 13
15:49andreiThanks for the help everyone!
15:49andreiDoes this mean that there exist options which will produce even faster code?
15:50coventryandrei: Check out the leiningen wiki page I linked above. Don't know whether any of the other suggestions will help, though.
15:50andreicoventry: Will do. Thanks!
15:51hyPiRionfaster is relative. You could check out tiered compilation or tweak the garbage collector settings
15:51hyPiRionandrei: Generally http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html is a nice webpage for performance
15:52andreihyPiRion: Awesome, thanks!
15:52hyPiRionit doesn't tell you how to tune them properly, but at least it tells you what's available
15:54andreiIf I wanted to extend basic numeric operations in clojure, but the multimethod way is far too slow
15:54andreiWhere would I look?
15:54andreiI'm willing to spend time learning and implementing whichever approach will produce the fastest code
15:54andreiHowever low-level or involved it is in any language
15:54amalloyandrei: you can't really do it. just define a new function with a name that's different from +, which is what you use for adding your quasi-numbers
15:55andreiamalloy: Sadly that won't be sufficient in my case, the name has to be the same
15:55TEttingeryou can redefine + can't you?
15:56amalloyTEttinger: you can't make the + that some other namespace uses behave like you redefined +
15:56andreiTEttinger: If I redefine it in one file in a project, how does that carry over to all of the other files in the project?
15:56andreiamalloy: Oh, I see what you mean. That's fine.
15:57andreiamalloy: I'm willing to put some use line at the top of each file which needs this feature
15:57TEttingerwhat is the extension for?
15:57andreiamalloy: So if I redefine + I can get the same performance that clojure's implementation of + gets?
15:58TEttingerprobably not? I haven't tried, but it might be helpful to read the clojure source
15:58andreiTEttinger: I do research in AI/ML and I regularly perform nonstandard interpretation of numeric programs
15:58amalloyno, you can't, because clojure.core/+ can emit a single bytecode operation when it's working with primitives
15:58TEttingerneat, andrei
15:58andreiamalloy: And there's no way to get a user function to do the same?
15:58amalloyobviously you won't have primitives, you'll have these weird made-up numbers you want to invent
15:58amalloyno jvm bytecode knows how to add them
15:59andreiamalloy: Sure, but I'm willing to pay the cost for 1 branch
15:59andreiamalloy: For every math operation
15:59amalloyi don't see what you're getting at
16:00amalloyyou'll have some Object which represents a number in your program, and some function named + that you want to use to add it
16:00TEttingerhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L936
16:00andreiamalloy: I want to mix my numbers and standard numbers
16:00amalloyan Object, no matter what it contains or how you work with it, will be much more heavy-weight than a primitive
16:00andreiamalloy: When both operands to + are primitives I want the old behaviour + speed with the cost of 1 branch
16:00andreiamalloy: Like so: https://github.com/abarbu/AD/blob/master/AD.scm
16:01amalloymmmmmm, you can probably do that
16:01andreiTEttinger: Thanks!
16:01TEttingerandrei, you will notice some fun stuff right away
16:02TEttingerlike the more-than-two-args version being much heavier
16:02andreiTEttinger: Yeah.. that's pretty common. I'll do the standard trick of writing a macro to expand them out
16:03amalloyit's going to be pretty tricky to *tell* whether the operands are primitives, though
16:03andreiamalloy: Oh?
16:04TEttingerbecause of auto-boxing?
16:04amalloyyou can't introspect that at runtime, because it's a decision made at compile time; and i don't know of a way for a macro to ask a question like "given the current &env, what is the type of expression e?"
16:05andreiamalloy: There's no runtime 'primitive?' function?
16:05amalloyno
16:05coventrytyped clojure gives you no leverage there?
16:05amalloyall functions receive Object args
16:05amalloythe way clojure.core/+ works is it unconditionally expands to (RT/add x y), and later a special compiler pass replaces that with a single bytecode op iff x and y are both primitives of the same type
16:05andyfamalloy: Some Clojure fns receive primitive args, if they have <= 4 and are type-hinted, yes?
16:06andyfamalloy: Not that that invalidates any of your previous statements on the difficulty of mixing boxed and unboxed at run-time.
16:06amalloyandyf: sure
16:06amalloybut i don't think you can use that to implement "primitive?"
16:07amalloybecause (defn primitive? ([^long x] true) ([^double x] true) ([x] false)) will call the long version if x is statically known to be a boxed Long, i think
16:07amalloyi'm not sure about that though
16:07clojurebotExcuse me?
16:08justin_smithhttps://github.com/ztellman/primitive-math what about the checks primitive-math does?
16:08justin_smithit gives reflection warnings if boxing of numbers happens
16:10TEttingerjustin_smith, that might be key.
16:10TEttingerhttps://github.com/ztellman/primitive-math/blob/master/src/primitive_math/Primitives.java he uses java to implement that part
16:10justin_smithoh, interesting
16:11andreiAh, that looks like a good way to go
16:11TEttingerand then he wraps it in clojure
16:12Bronsahttps://github.com/ztellman/primitive-math/blob/master/src/primitive_math/Primitives.java#L212 how is this valid in Java?
16:12TEttingerhttps://github.com/ztellman/primitive-math/blob/master/src/primitive_math.clj looks pretty simple, but the README shows the limitations
16:12justin_smithI learned about primitive-math in the "Clojure High Performance Programming" book. Good, dense with info, though pricy for the short page count.
16:12andreijustin_smith: Awesome. Thanks! I'll check it out
16:12amalloyBronsa: empty statements are allowed
16:12Bronsaamalloy: didn't know that, thanks
16:13amalloyalthough i'm a little surprised to see that statements are allowed at the top level of a class declaration
16:13amalloylike, ;;;; would be valid a lot of places, i just didn't realize this was one of them
16:14Bronsaisn't int foo; a statement too?
16:14dsrx,;;;;
16:14amalloycertainly
16:14clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
16:14amalloyoh, i see
16:14Bronsa:)
16:16andreiIn https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L936, why are there two versions of every math operator?
16:17andreiA quoted one and an unquoted one
16:17amalloyBronsa: in a class declaration those actually aren't statements, exactly
16:17amalloycheck out http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.1.6, where ; is explicitly allowed
16:17TEttingerone auto-promotes ints to bigInts
16:17TEttingerandrei ^
16:17TEttinger,(+ 1111111111111111111111111111111111 11111)
16:17clojurebot1111111111111111111111111111122222N
16:17TEttingerwat
16:18Bronsaamalloy: I see
16:18amalloyTEttinger: 1111111111111111111111111111111111 is already a bigint
16:18TEttinger##(+ 1111111111111111111111111111111111 11111)
16:18lazybot⇒ 1111111111111111111111111111122222N
16:18TEttingeroh
16:18TEttingerherp
16:19TEttinger##(reduce + (repeat 100 16rfffffff))
16:19lazybot⇒ 26843545500
16:19TEttingergah
16:19amalloy&(reduce * (repeat 100 16rfffffff))
16:19lazybotjava.lang.ArithmeticException: integer overflow
16:19amalloyez
16:19TEttinger##(reduce +' (repeat 100 16rfffffffffffffff))
16:19lazybot⇒ 115292150460684697500N
16:20davWhat is the purpose of 'do' given that if you just put the forms one after the other it seems to work just as well as without the do-statement?
16:20TEttingerI just woke up haha
16:20amalloydav: (if x (do y z) n)
16:20andreiTEttinger: Thanks!
16:20TEttingerdav, it's very useful when you have stuff like if, things that only allow one form... also when you want to return something after calculating something else
16:21amalloyimagine (if x y z n). how do those group?
16:21davamalloy: so you would never do (let [..] (do ...)) ?
16:21amalloydav: well, "never" is a strong word. i could imagine doing it on occasion
16:21amalloyto emphasize side effects or something
16:21amalloybut you never *need* to
16:22TEttinger,(do (print "whee ") 0)
16:22clojurebotwhee 0
16:22TEttinger,(do (print "whee "))
16:22clojurebotwhee
16:22TEttingeroh that's interesting, clojurebot doesn't show the nil?
16:22amalloy,(do (do (do (do 'whop))))
16:22clojurebotwhop
16:22davTEttinger / amalloy - thx. is there a reason to use when rather than if other than for clarity ?
16:23TEttingerwhen allows multiple forms
16:23TEttingerother than that, not really? it is clearer
16:24Bronsadav: some (myself included) use when instead of if when there's no else branch, others only use when for side-effects
16:24also,(macroexpand '(when x a b c))
16:24clojurebot(if x (do a b c))
16:24TEttingerwhen returns nil if the condition is false, so it can be handy when passed to some fns that expect nil rather than false
16:24davamalloy / TEttinger / Bronsa - ok i think I have the clear picture. thanks!
16:25amalloyTEttinger: wat
16:25amalloythat last one makes little sense
16:25BronsaTEttinger ##(if false 1)
16:25lazybot⇒ nil
16:25TEttingerI am fairly certain I encountered one in the std lib...
16:26amalloyobviously there are functions that care about nil vs false, but that doesn't distinguish if from when at all
16:26TEttingerhttp://clojuredocs.org/clojure_core/clojure.core/keep
16:27TEttingersure, it just saves typing nil as an else statement
16:27amalloydid you...read what Bronsa just sent you?
16:27TEttingeroh herp
16:27TEttingerthat won't work for multiple forms though, you need.... do !
16:34technomancyclojurebot: when?
16:34clojurebotwhen is for side effects
16:34Bronsa>:(
16:36amalloyif technomancy *and* clojurebot both think this independently and without any collusion it must be true!
16:38hyPiRionclojurebot: technomancy?
16:38clojurebottechnomancy codes while wearing gravity boots to increase the blood flow to the face transplant he got after discovering the world does not treat build tool creators kindly
16:39hyPiRionoh, I've not seen that before
16:46alsoclojurebot: clojurebot?
16:46clojurebot"More human than human" is our motto.
16:47bitemyappLOL
16:47bitemyapphyPiRion: I hadn't seen that one before.
16:48alsoclojurebot: lazybot?
16:48clojurebotlazybot is echo ~lazybot
16:48bitemyappI happen to agree with clojurebot and technomancy. when is for side-effects.
16:48alsowhy is that?
16:49tim__, (when (:a {:a 42}) "we have a")
16:49clojurebot"we have a"
16:49tim__no side effects needed.
16:51SegFaultAXIt's a matter of convention.
16:52SegFaultAXIt's not like you /have/ to use it for side effecting code, obviously.
16:53SegFaultAXBut since if and if-not don't require an alternative branch, when and when-not are used for side-effecting code by convention.
16:53tbaldridgeah, good point. Forgot about the optional branch
17:12cYmenSince when does if not require an alternative branch?
17:12Bronsasince always?
17:13cYmenhuh
17:13cYmenodd...wonder where I got that idea, then
17:14alsocYmen: i was confused by the first example for kibit: https://github.com/jonase/kibit
17:17cYmenhm...can't remember...maybe :)
17:22cYmenWell, I checked out the 4clojure source and now have a local copy running.
17:22cYmenNow, what to do. :p
17:28cYmenFuck...
17:45logic_proghow do I get format in clojurescript?
17:45logic_progwhat library/namespace is it part of?
17:46rovarjava string?
17:46rovar,(find-doc format)
17:46clojurebot#<ClassCastException java.lang.ClassCastException: clojure.core$format cannot be cast to java.lang.String>
17:46rovar,'(find-doc format)
17:46clojurebot(find-doc format)
17:46alsologic_prog: i don't think it exists. javascript doesn't provide format
17:47rovaroh.. I didn't read the word clojurescript
17:47rovaryea.. it's a native
17:47justin_smith(doc format)
17:47clojurebot"([fmt & args]); Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax"
17:48logic_prognon-existence is useful
17:48logic_progthanks!
17:49rovarso how do people work with local-repo?
17:50rovarI find it odd how poor the support in lein is for compiling dependencies for other projects
17:54dnolenok the fact that every node in the om tree has its path is pretty awesome
17:54justin_smithrovar: I usually just run lein install in each project, without using local-repo
17:55cYmenhm...can't seem to install cider
17:55cYmenfails to download :/
17:55justin_smithyeah, known issue with the emacs archive
17:55cYmenbut fairly recent, I take it?
17:55justin_smithnot a cider bug, a bug in the archive server
17:57cYmenbut the issue is new?
17:57cYmenbecause I think it installed just fine on three machines a couple of weeks ago
17:58rovarjustin_smith, when you use that approach, how do you reference one project from the other?
17:58justin_smithin project.clj
17:59justin_smithas I would any other dependency
17:59rovardoes install put it into the ~/.m2?
17:59justin_smithyeah
18:36sorenmacbethis there already a fn that does (interleave (keys m) (vals m))?
18:36justin_smith(mapcat m) ?
18:37justin_smith,(mapcat {:a 0 :b 1})
18:37clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core/map>
18:37justin_smitherr
18:37justin_smith,(mapcat identity {:a 0 :b 1})
18:37clojurebot(:a 0 :b 1)
18:38rukor(flatten (seq m))
18:38justin_smith~flatten
18:38clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
18:39sorenmacbethflatten doesn't do what I want
18:39justin_smith,(flatten {:a 0 :b [1 2] :c 3})
18:39sorenmacbethyes, like clojurebot says
18:39clojurebot()
18:39rukorright
18:40sorenmacbeth,(mapcat identity {"foo" [:bar]})
18:40clojurebot("foo" [:bar])
18:40sorenmacbethyeah, that's what I need
18:40sorenmacbethcheers
18:40coventry,(apply concat {1 2 3 4})
18:40clojurebot(1 2 3 4)
18:40sorenmacbeth,(apply concat {"foo" [:bar]})
18:40clojurebot("foo" [:bar])
18:40justin_smithI wonder what the mapcat identity / apply concat tradeoff comes down to
18:41coventryProbably the mapcat version is faster.
18:41hyPiRionit's the other way around
18:41hyPiRionmapcat is just (apply concat (apply map f coll))
18:42coventryHuh.
18:42justin_smithcool, thanks hyPiRion
18:42seangrove,(reduce concat (seq {"foo" [:bar]})) ; just for fun
18:42clojurebot["foo" [:bar]]
18:42hyPiRion(apply concat coll) would be faster, if performance was an issue
18:43hyPiRion,(reduce into [] {1 2 3 4}) ; could probably be a competitor
18:43clojurebot[1 2 3 4]
18:46justin_smith(persistent! (reduce (fn [vc [k v]] (-> vc (conj! k) (conj! v))) (transient []) {1 2 3 4}))
18:46justin_smithlikely the big winner
18:49sorenmacbeththanks pals
18:49sorenmacbethgonna go with (apply concat amap) for now
18:49justin_smithgood call
18:49hyPiRionwould be surprising if that's your bottleneck anyway
18:50justin_smithyeah, most likely not a bottleneck
18:50justin_smithbut it is fun to bytecode-cycle-golf
19:03nkozosomebody knows how to make a _bidirectional_ binding in seesaw?
19:21gfredericksjustin_smith: man it'd be fun if there were a expr->bytecode-cycles
19:22gfrederickswhat's the easiest way to get such a thing?
19:22gfredericksprobably optimizing jvms would make the results irrelevant anyhow :/
19:23andyf_gfredericks: What is this bytecode-cycles you refer to?
19:24gfrederickswelp
19:24gfredericksyunno.
19:24gfredericksnumber of bytecode instructions executed during the evaluation of an expression?
19:26andyf_gfredericks: Yeah, I'm pretty sure most of the code that you care how fast it runs does get optimized by the JIT.
19:27dsrx,(apply concat [[1 2] [3 4] [5 6]])
19:27clojurebot(1 2 3 4 5 ...)
19:28dsrx,(doc mapcat)
19:28clojurebot"([f & colls]); Returns the result of applying concat to the result of applying map to f and colls. Thus function f should return a collection."
19:32hyPiRionHrm
19:32hyPiRion,(coll? "hey")
19:32clojurebotfalse
19:33TEttingerhyPiRion, that's interesting
19:33hyPiRionI guess it should return a seqable item instead
19:33hyPiRion,(mapcat identity ["foo" "bar"])
19:33clojurebot(\f \o \o \b \a ...)
19:51lalalais there anyone who has used Pedestal on a project who would be willing to tell me about their experience using it?
19:52dnolenTodoMVC in progress - https://github.com/swannodette/todomvc/tree/om/labs/architecture-examples/om
19:55alsodnolen: awesome!
19:58dnolenrepresenting your UI as EDN rocks so hard
20:01alsoi've been avoiding all the javascript template libraries...they all feel wrong
20:01rovarI rather like dommy
20:02rovarand I'm generally picky about that sort of thing
20:02dnolenI do not believe in templates anymore
20:02dnolenor string based ones anyway
20:06bitemyappgod I am exhausted.
20:07andyf_god already knew that
20:07bitemyappandyf_: teaching people is tiring.
20:07bitemyapptalking is tiring
20:07bitemyappthinking is tiring
20:08andyf_Teaching people who aren't learning very well? I find teaching people who are paying attention and interested in learning invigorating.
20:08bitemyappandyf_: well it's fun, but you still have to repeat yourself some.
20:08bitemyappandyf_: but I've noticed a difference in how draining it is depending on speed of uptake.
20:09andyf_What are you teaching?
20:09bitemyappandyf_: Haskell!
20:10andyf_Ah, came to the #clojure channel to relax your mind, eh? :-)
20:11bitemyappandyf_: I just have a lot of people I really like here.
20:11pdk#clojure
20:11pdka place for friends
20:11bitemyappandyf_: there are really nice people in #haskell too, I just don't know as many of them
20:11bitemyapppdk: lol!
20:25rovardoes #clojure have a history somewhere?
20:25rovarI need to rediscover a url that someone gave me
20:25coventryhttp://clojure-log.n01se.net/ http://logs.lazybot.org/
20:25Bronsarovar: http://clojure-log.n01se.net/
20:25clojurebotExcuse me?
20:26Bronsamph.
20:26Bronsa(inc coventry)
20:26lazybot⇒ 5
20:26coventryThe n01se.net has gone down at times, so I think it may be incomplete, but it has the better interface.
20:26coventry*.net one
20:28rovarthis was it : https://github.com/halgari/clojure-conj-2013-core.async-examples/blob/master/src/clojure_conj_talk/core.clj
20:28andyf_Bronsa: I am running into some cases where Eastwood analyzing multiple namespaces in a single run causes exceptions with some namespaces, but when I do those namespaces by themselves, there is no exception. Have you seen such things before? Would you be interested in looking at an example of this?
20:28rovarI need to tell google to increase the pagerank of that page
20:29Bronsaandyf_: I've seen such things before and am horrified at the thought of debugging that again.
20:29Bronsabut please, let me know what's failing
20:30andyf_Bronsa: I'll file one as an Eastwood issue, since it might be specific to how Eastwood is using tools.analyzer. Should I try to minimize the source code size first?
20:31Bronsaandyf_: but first, make sure you are using the last snapshot of tools.analyzer.jvm && have lein install'ed the master version of eastwood, I really thought i had that fixed
20:32Bronsaandyf_: file the issue for now, so I can look into that. If you want you can try to minimize the failing source code later :P
20:33andyf_OK, wiping my .m2 out first, git pull'ing, making sure everything up to date before filing the issue.
20:35bitemyappandyf_: kind of you :)
20:37BronsaI just went in a hurry to the kitchen with a feeling I had something really urgent to do there.
20:37BronsaBut then I didn't.
20:37andyf_Dinnertime? :-)
20:37BronsaIt's 2.35AM here
20:37bitemyappBronsa: 1737
20:38andyf_Bronsa: You are going to hate this one even more, because it requires 3 namespaces to give the exception on the 3rd one. Any 2 of them gives no exception :-(
20:39Bronsaduh.
20:39bitemyappandyf_: admittedly, you could prove that conclusively with a generative test.
20:41seangrovetechnomancy: Is this kind of 503 error on an initial clojure push sermi-normal for Heroku? https://www.refheap.com/c654aa6acc97e8f9fbe270e78
20:41Bronsaandyf_: does it involve a defprotocol?
20:42andyf_I think the crux of the issue is a Java import in an earlier namespace, with a type-hint on a function return value for a Java class, and then the function is called in a later namespace that doesn't have the import. But that is a guess at this point.
20:42Bronsamh.
20:42seangrovetechnomancy: It gets a little bit further along each time I push it though
20:42andyf_The exception is that the Java class is not found during the :deprecations linter.
20:44andyf_Sorry, the exception is during the analyzer, not the linter.
20:44andyf_Almost done reproducing with fresh checkouts.
20:44Bronsayeah, doesn't sound like what I thought it would be.
20:44Bronsadamn.
20:46andyf_Oh, I also saw a line of code in the Seesaw lib today where it does (extend (fn-call-that-returns-class) ...)
20:46andyf_Or a fn call that returned something, maybe it wasn't a class. Anyway, it wasn't just a symbol.
20:47andyf_I'll file a TANAL ticket for that one for consideration.
20:47Bronsaok
20:49dnolenso om pretty must leaves JS client side frameworks in completely dust as far as rendering performance
20:49dnolenand instead of pointless models - just data
20:54akhudekdnolen: om looks really neat, looking forward to giving it a try
20:55dnolenakhudek: I'm pretty psyched about it
20:59andyf_Bronsa: The 3-namespace issue: https://github.com/jonase/eastwood/issues/28
21:00Bronsaok, will look into that thanks
21:06seangroveWell, that only took ~15 `git push heroku master` attempts.
21:06bitemyappgood to see relying on magic is paying off for some people.
21:06bitemyappI bet you could script that.
21:07bitemyappI'm pretty sure that's how keynesianism works. When magic isn't working, layer on more magic.
21:07TEttingermagic/more magic switch
21:13andyf_you have to get it working correctly once before you can automate.
21:24bitemyappandyf_: false.
21:26SegFaultAXbitemyapp: (iterate magic (magic))
21:26SegFaultAX(drop-while not-working? (iterate magic (magic))) to be precise.
22:02logic_prog_is there anything like slingshot (try+, catch+) for clojurescript ?
22:12rukorhow do you represent this.props.children from react.js in om?
22:17solussdom?
22:18bitemyappsolussd: it's a library.
22:19solussdah
22:19rukorhttps://github.com/swannodette/om
22:20solussdoh neat, fancy new :include-macros option in require
22:20seangroveActually what caused the new :include-macros in cljs in the first place, heh
22:22bitemyappseangrove: what?
22:22seangrovebitemyapp: om is what pushed dnolen over the line to add the :include-macros option to cljs, I believe
22:23bitemyappseangrove: that validates my suspicion that increasing his pain is the way to force a painkiller.
22:23rukorhaha
22:24seangrovebitemyapp: Any easy way to get korma to play nice with dev and heroku?
22:24seangroveI struggle with this every time I push a new app
22:24bitemyappseangrove: I can think of several.
22:25bitemyappmost of them involve an environment variable and weavejester's library.
22:27dsrxlogic_prog_: (try* (throw "world") (catch e (js/alert (str "hello " e))))
22:27bitemyappseangrove: if you get specific (you need to configure a database URI that needs to vary between dev and heroku? simultaneously?) I can be more helpful.
22:27seangrovebitemyapp: Well, I always struggle to get korma to connect to Heroku's pg. Seems like there's some incantation that gets the ssl stuff to work properly
22:28bbloomdnolen: have you succeeded in reproducing the (goofy) todo mvc toy yet? curious to see how your wrapper scales to there & beyond
22:28dsrxlogic_prog_: try in cljs is just a macro for try* that does type dispatching, try* maps pretty directly to try/catch in JS
22:28logic_prog_dsrx: noted, thanks
22:29bitemyappseangrove: http://stackoverflow.com/questions/13175655/trouble-connecting-to-postgresql-db-on-heroku-with-korma-clojure this looks promising.
22:29seangrovebitemyapp: Heh, if browser history were like ant trails, that'd be a very thick line
22:30seangroveIf you haven't heard of the challenges, don't worry about it, I'll try to narrow it down more
22:31Bronsayet another bug fixed. I can now go to sleep satisfied.
22:31bbloomdsrx: try* is an implementation detail
22:31bbloomuse (catch :default ...)
22:32Bronsabbloom: an implementation detail.. that doesn't even exist anymore :P
22:32bbloomBronsa: oh right, i forgot. even better
22:32bbloomlogic_prog_: see https://github.com/clojure/clojurescript/blob/master/test/cljs/cljs/core_test.cljs#L480-L482
22:32bitemyappseangrove: I understand the problem, you just need to default and vary some stuff between dev/prov in a config.clj from environment variables.
22:32bitemyappseangrove: I've solved this many times before, demonstrated ways to structure it, etc.
22:32bitemyappI'd do virtually the exact same thing in Haskell too.
22:36xeqidnolen: do you have a gist of the om based todo?
22:37coventryxeqi: https://github.com/swannodette/todomvc/tree/om/labs/architecture-examples/om
22:37xeqicoventry: thanks
22:39bbloomnice
22:40bbloomlooks like it still has a long way to go though
23:08logic_prog_how do I write "document.documentElement.style.overflow = 'hidden'; " in cljs? I want to disable scrollbars
23:22dsrxI've got this project.clj, and leiningen wants to pull down clojure 1.2.1 https://gist.github.com/tomjakubowski/8ecc91adea9245c22d0a . Is there a way I can see which dependency has clojure 1.2.1 as a dep without waiting for all the dependencies to download (i'm on a slow connection at the moment)?
23:23logic_prog_http://stackoverflow.com/questions/7836204/chrome-fullscreen-api <-- how do I make this work with clojurescript
23:24rukorlogic_prog_: (-> js/document (.-documentElement) (.-style) (.-overflow) (set! "hidden"))
23:24logic_prog_rukor: got that working already
23:25rukorlogic_prog_: ok
23:25logic_prog_just changed the html :-)
23:25rukor:-)
23:25logic_prog_rukor: however, please help with the full screen api
23:25SegFaultAXNot sure why, but this problem took me an hour to solve: http://www.4clojure.com/problem/124
23:25logic_prog_ (let [el (.-documentElement js/document) rfs (.-webkitRequestFullScreen el)] (. js/console log rfs) (. js/console log el) (.call rfs el))
23:25logic_prog_somehow doesn't work
23:26SegFaultAXBut my answer is among the shortest of those I'm following. So that's awesome :)
23:27rukorlogic_prog_: is it not intended to be called from an event handler?
23:27logic_prog_why can't I call it out of an event handler,
23:27logic_prog_i.e. in window.onload
23:28logic_prog_http://stackoverflow.com/questions/9454125/javascript-request-fullscreen-is-unreliable on shit
23:28logic_prog_I can only call it from an event handler?
23:29rukorlogic_prog_: does it work when you do? from the SO page, it says it has to be within the context of a user interaction
23:29logic_prog_well, let me hook something up :-)
23:29logic_prog_this is fucking annoying though
23:29logic_prog_as I have events sent to core.async go channels
23:29logic_prog_s/hands/fists
23:29rukorlogic_prog_: that would make sense though, as I have always clicked a button to go full screen :-)
23:30rukorlogic_prog_: http://johndyer.name/lab/fullscreenapi/
23:30dsrxlogic_prog_: specifically it can probably only be called from a user-initiated event callback, like for creating popup windows
23:31logic_prog_rukor, dsrx: this makes sense now, thanks for clarifying!
23:31rukorlogic_prog_: np
23:36andreiHow can one require multiple libraries and assign them to the same alias?
23:40dsrxnice, now for some reason it's also pulling in clojure 1.3.0-alpha6
23:43logic_prog_rukor, dsrx: it works now, bound ctrl-0 to full screen and it works
23:45rukorlogic_prog_: nice
23:52amalloyandrei: you can't. a namespace's aliases are a map from alias-symbol to namespace
23:54nathanielksmithhiya. My tests (in test/<projname>/test/<testfile>.clj) are unable to require things in my actual code (src/<projname>/<file>.clj).
23:54amalloySegFaultAX: an hour seems pretty reasonable for 4clojure 124. there's a lot to do
23:54nathanielksmithI'm running with lein test.
23:54nathanielksmithIt's finding and running the tests fine
23:54nathanielksmithThe tests just can't see the <projname> namespace
23:55nathanielksmithany suggestions?
23:55rovarwhat is the easiest way to map a function across the vals of a hashmap while leaving the keys in-tact?
23:56andreiamalloy: Ah, too bad. Thanks!