#clojure logs

2014-10-24

01:08domokatohi guys
01:09domokatois there any way to preserve line numbers inside expanded macros (i.e. in stack traces)?
01:17rritochdomokato: What are you using to print your stack traces? All of my stack traces use clojure.repl/pst which always seems to report the line number of the macro (preserving line#)
01:18domokatorritoch: I mean during an exception. do i have control over how those print?
01:19rritochdomokato: Sure, just catch the exception (try ... (catch Throwable t (clojure.repl/pst t))
01:21domokatorritoch: thanks! i'll try that
01:23rritochDoes anyone know of a syntax using something like partial for the case where you want to append arguments? ex. instead of (map #(get % "id") mylistofmaps) something like (map (??? get "id") mylistofmaps)
01:28domokatorritoch: what about stack traces in compile errors? pst wouldn't work, would it?
01:31TEttinger,(defn post-partial [f & args] (fn [& args2] (apply f (concat args2 args))))
01:31clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
01:32rritochdomokato: No, I don't know any way to catch compile errors other than manually compiling from repl (try ... (compile 'some.ns) ...
01:33rritochdomokato: If your using leiningen maybe you could make a custom plugin, but I'm fairly sure that leiningen already uses something similar to pst to properly format clojure errors
01:34domokatorritoch: hm, ok. i have a macro that is like a let block, and any compile errors inside get compacted onto one line :(
01:35rritochdomokato: I see, that is the appropriate behavior, to debug your code you can use macroexpand and use the expansion in place of your code for debugging.
01:37TEttinger,(((fn post-partial [f & args] (fn [& args2] (apply f (concat args2 args)))) get "id") {"id" 1})
01:37clojurebot1
01:37TEttingerok, it does work...
01:37TEttinger,(defn post-partial [f & args] (fn [& args2] (apply f (concat args2 args))))
01:37clojurebot#'sandbox/post-partial
01:37domokatorritoch: clojure could in principle accurately report the line numbers where the body of the macro call used to be, couldn't it? that would be a good feature to add to the language
01:37TEttinger,((post-partial get "id") {"id" 1})
01:37clojurebot1
01:38domokatorritoch: that's a good idea
01:38rritochTEttinger: Cool, that works for me, but I was hoping clojure already had it in its codebase
01:38TEttingerrritoch, how does that post-partial work for you?
01:38TEttingeroh ok
01:39TEttingeryeah, it's hard to think of every possible use case for mixing and matching fns and then to stick all of those in the std lib :)
01:39domokatorritoch: and how come clojure's core macros don't have this problem?
01:39clojurebotExcuse me?
01:44rritochdomokato: The best way I can answer that question is that clojure macros have gone through a lot of testing so any bugs with the macro's have been repaired already. When you see line#'s within clojure from macro expansions it will be to the function the macro called. I've never seen an inter-macro line# in a stack-trace.
01:46domokatorritoch: i meant when you use let and there is a compile error inside the body, you'll get a line number. but i guess let is a special form, so maybe that's why it works
01:47rritochTEttinger: How could I go about getting registered with clojurebot?
01:50TEttingerI didn't know clojurebot needed registration
01:51rritochOH, so what do I prefix with to use it?
01:51TEttingercomma
01:51TEttingerstart a line with a ,
01:52TEttingerlazybot uses & or ## but ## will also work in the middle of messages. ##(str "like " "this")
01:52lazybot⇒ "like this"
01:54rritoch,(macroexpand ~(let [x 1] (println x)))
01:54clojurebot1\n#<IllegalStateException java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.core/unquote>
01:54rritoch,(macroexpand `(let [x 1] (println x)))
01:54clojurebot(let* [sandbox/x 1] (clojure.core/println sandbox/x))
01:54rritochdomokato: I can't find where the let* function is defined, but I believe it is a function which is why your getting line numbers
01:55TEttinger(doc let*)
01:55clojurebotExcuse me?
01:55TEttingerI guess it doesn't have docs
01:55rritoch,(type let*)
01:55clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: let* in this context, compiling:(NO_SOURCE_PATH:0:0)>
01:56rritochodd
01:57rritochdomokato: apparently let has some "magical" functionality with it
01:57domokatolet* can't be a function, otherwise it would evaluate its body immediately before any bindings could be made
01:57TEttingerit's probably private
01:57justin_smithrritoch: let* is a special form
01:58justin_smithrritoch: the special forms are defined in the java code
01:59domokatoi've actually been avoiding writing macros that take bodies because it's hard to figure out where compile errors are...
02:33borkduderepost from #clojurescript: can someone take a look at this project why weasel isn't working in the browser? keep getting connection refused. start weasel by typing lein repl + (brepl). https://github.com/borkdude/todo-cljs
02:57rritochDoes anyone know what app clojuredocs.org uses to generate it's documentation? I'm currently using codox and lein-marginalia but neither compare to the quality @ clojuredocs.org
03:05justin_smithhttps://github.com/zk/clojuredocs
03:11rritochjustin_smith: Thanks, I didn't realize it was a web app but I should be able to use it for my own projects. It doesn't have a generator to produce static pages?
03:20Geeky_Vinanyone here used clojure to connect and create triples in allegrograph?
03:22clgv~anyone
03:22clojurebotanyone is anybody
03:22clgv~anybody
03:22clojurebotJust 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 ..."
03:23Geeky_Vinokay, sorry for that.
03:24Geeky_Vindoes anybody here used clojure to connect and create triples in allegrograph?
03:24clgvno need to apologize. ;)
03:24clgvwoah, the second message was the important one :P
03:25Geeky_Vincan you please pont me to a working code that would do that, cause the one I found in the franz site seems to be buggy and outdated.
03:25clgvyou should ask your concrete problem - if anyone used allegrograph for that they can immediately answer ;)
03:25Geeky_Vin*point
03:31Geeky_Vinhas anybody used Allegrograph?
03:36clgvGeeky_Vin: maybe you have more luck later today when all the americans are here ;)
03:38mskoudIs there a library which provides cursors into atoms? I'm struggeling making updates in deep nested maps/vectors. I can find the location i want to update with filter functions, but that does not helt me when i want to update this location.
03:39clgvmskoud: "atom" as in clojure.core/atom or did you just mean values of nest maps/vectors?
03:40mskoudLets say i have {:sublocation-id 2 :locations [{ :id 1 :name "A"} { :id 2 :name "B"}]} and the sublocation-id identifies i need to change element {:id 2 :name "B"} to fx :name "C"
03:40clgvmskoud: do you have a path to the update location or do you want to visit the structure and decide when you are at a location that you want to update that location?
03:41mskoudi do not have a path to it.
03:42mskoudbut i could build a path in a vector, that might be the best way.
03:42clgvin this case you have a path to the collection in which you dont know which element to change
03:42TEttingeryou know about zippers, right mskoud? http://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip/
03:42clgvas TEttinger says, zippers could be a solution
03:42mskoudok! ill look into zippers. thanks.
03:43clgvbut if you know the partial path and then just have to search the collection via a predicate you can build a function for that scenario
03:43TEttingerzippers are yet another handy tool in clojure's toolbox for dealing with data
03:43rritochmskoud: You could always utilize a mutable data-type like java.util.HashMap (*duck*)
03:43clgve.g. (modify-in data [my path] predicate update-fn arg1 arg2 ...)
03:44clgvrritoch: why should that be a good idea?
03:44TEttingeryeah, it doesn't solve much here
03:45clgvrritoch: depending on his context that might even cause severe problems (data in atom/ref)
03:45rritochclgv: It's not really clojure(esque) but it's a lot easier to traverse HashMaps for deep updates
03:46clgvrritoch: but in his case it doesnt have real benefits but will forbid usage of that data within atoms or refs...
03:47rritochclgv: forbid use within atoms?
03:49rritoch,(type (deref (atom (java.util.HashMap.))))
03:49clojurebotjava.util.HashMap
03:49mskoudThink i'll be using swap! and update-in and define a helper function like (defn find-position-in-vector [vector-of-maps map-key map-val])
03:57clgvrritoch: yes they wont work correctly anymore. you'll loose the consistency guarantees
03:58clgvmskoud: just build something like (modify-vector v predicate modify-fn)
04:01rritoch,(let [x (atom (java.util.HashMap.))] (swap! x #(do (.put %1 :k %2) %1) :v) (.get (deref x) :k))
04:01clojurebot:v
04:01rritochLooks good to me
04:01clgvrritoch: single threaded yes.
04:01clgvrritoch: start firing multiple threads at it manipulating the atom
04:01hyPiRionno, not even single threaded
04:02hyPiRionor well, eh – practically yes
04:02hyPiRionbut there's no guarantee the function passed to swap! won't be called multiple times
04:02clgvhyPiRion: why? If there are no retries, no consistency checks are needed ;)
04:02rritochclgv: I'm under the understanding that any swap! ops are serialized so there shouldn't be a problem
04:03justin_smithrritoch: no
04:03clgvrritoch: there is. because of how the "atomicity" guarantee works. it is only guaranteed for clojure's persistent data structures
04:04justin_smith(doc swap!)
04:04clojurebot"([atom f] [atom f x] [atom f x y] [atom f x y & ...]); Atomically swaps the value of atom to be: (apply f current-value-of-atom args). Note that f may be called multiple times, and thus should be free of side effects. Returns the value that was swapped in."
04:04justin_smithif it was just serializaiton, there would be no retries
04:04clgvor well datastructures built to fulfill the same contracts as clojure's datastructures ;)
04:05clgvrritoch: in fact it uses compare and swap
04:05justin_smithrritoch: it does the ops optimistically, and then retries if it changed in the mean time
04:05justin_smithrritoch: with actual mutation, it won't be doing what you want at all
04:09rritochjustin_smith: Can you demonstrate an example where this fails? It has never failed for me?
04:14rritochThis is a second example per clgv's comment about the compare and swap which again functions
04:14rritoch,(let [x (atom (java.util.HashMap.))] (swap! x #(do (.put %1 :k %2) %1) :v) (swap! x #(do (.put %1 :k2 %2) %1) :v2) (list (.get (deref x) :k) (.get (deref x) :k2)))
04:14clojurebot(:v :v2)
04:15clgvrritoch: you need concurrent modification of that hashmap, since this is the critical case where `atom` provides you consistency guarantees for clojure's persistent data structures
04:16clgvwell, of the atom containing the hashmap to be exact
04:18rritochclgv: If you need a thread-safe hashmap, see http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#synchronizedMap%28java.util.Map%29
04:19justin_smithif you need a thread safe hashmap use {}, and use the fine tools that clojure supplies to modify it properly
04:21rritochjustin_smith: My point is simply that it is possible to reduce the complexity of accessing/modifying deep structures using HashMaps instead of clojure's Persistent versions.
04:22clgvrritoch: you are missing the whole point here... :(
04:23alexherbo2Hi
04:31justin_smithrritoch: https://www.refheap.com/92236
04:31rritochchecking...
04:31justin_smithif that were a proper clojure data structure in the atom, it would simply be shuffled
04:31justin_smithinstead we lose data
04:34borkdudeweasel problem solve
04:34borkduded
04:35justin_smithborkdude: what was the issue?
04:35borkdudejustin_smith https://github.com/tomjakubowski/weasel/issues/33
04:36borkdude(I wasted some hours on this, yuck :(
04:36justin_smiththat's too bad
04:38rritochjustin_smith: Arrays aren't thread safe, the same should work with http://docs.oracle.com/javase/7/docs/api/index.html?java/util/concurrent/atomic/AtomicIntegerArray.html
04:38rritocherr
04:38clgvunlikely ;)
04:38rritochWell, it would, but I'm actually looking at AtomicReferenceArray which is more generic
04:39clgvrritoch: just plugin the AtomicIntegerArray into the code of justin_smith
04:40rritochIt isn't an array so the aset commands won't function
04:40rritochIt works with .get and .set operations
04:40clgvrritoch: yeah you have to replace those with the read/write functions of that class...
04:40clgvbut it will fail anyway
04:41clgvrritoch: additionally don't forget that your suggestion was to use hashmap within other clojure data
04:41justin_smithrritoch: yes, arrays are not thread safe. Earlier you suggested putting a hash map in an atom. Point is, atoms do nothing for you if you don't give them an immutible data type, if you are using a thread safe mutible, putting it in an atom is pointless
04:42clgvotherwise you'd switch completely to mutable java class, but then you come close having to ask the question "why again am I using Clojure in the first place?"
04:44clgvjustin_smith: it'll even fail using the threadsafe class there. as long as he does not rewrite the code completely to use update (read+write combined) operations of that threadsafe class.
04:45hyPiRionrritoch: the point of persistent data structures in Clojure is mainly to make programming simpler by removing mutability. they decomplect identity and time compared to their mutable counterparts
04:46justin_smithclgv: right, but even if you use the threadsafe class properly - at best you are pointlessly using an atom to no benefit
04:46hyPiRionthe fact that it makes concurrent programming easier is sort-of a side effect of them being simpler by nature
04:47clgvjustin_smith: indeed
04:49clgvhyPiRion: the reason for the original question, is just that a lot convenience functions for "deep data manipulations" are missing. maybe a library is needed
04:50justin_smithclgv: I have never had too much issue with get-in, assoc-in, update-in, and the occasional clojure.walk/postwalk
04:51clgvjustin_smith: well the previous data manipulation question is not too uncommon. I found myself in similar scenarios multiple times ;)
04:51rritochclgv: As is, your right his code doesn't work
04:51clgvjustin_smith: but it is probably not frequent enough for clojure.core
04:51rritochalgv: But I got it to work using (locking a)
04:52clgvrritoch: great, then you lost all benefits of atom ;)
04:52justin_smithrritoch: OK, then why is it in an atom?
04:52rritocherr... (locking a ...
04:52justin_smithit does work! it demonstrates that mutable types in atoms are pointless and broken
04:53justin_smithany fix involves a) something you could do easier without an atom b) using an immutible type inside the atom as intended
04:53justin_smithone of those
04:55justin_smithAnd, btw, one of those benefits of atoms being that unlike locking, it won't deadlock your code.
04:55rritochjustin_smith: well, locking on the mutable object resolves the issue, and the point of using an atom in this case is for mutability, so if you have long running apps that have an internal cache of the mutable object a reset process can load a new map into the atom without effecting running processes so processes started after the update would get the new map.
04:56justin_smithrritoch: you could do the same thing with a var
04:56rritochEach new thread started would get the new mutable object, but existing threads would keep the old one
04:56justin_smithand with a var you wouldn't be pretending to get correctness that an atom is not giving you
04:56justin_smiththat's not how atoms work
04:58rritochSo how would you update the value of the var? It isn't exactly "good" programming practice to redefine vars.
04:58rritochBinding them is useful but won't update for all new threads
04:58clgvspeaking of good Clojure programming practice ... ;)
04:58justin_smithrritoch: it isn't good practice to replace the contents of an atom, or to put mutible objects inside them
04:59hyPiRionjustin_smith: replace the contents? Isn't that... what swap! and reset! do?
04:59justin_smithhyPiRion: with a bit more subtlety than what he is describing, sorry, I worded that poorly
05:02icelessteaJust exec some Scheme or some such in a separate thread, do the loop there and using set!, and then pipe its output back to Clojure - simple and cheerful !
05:02justin_smithhyPiRion: point being that the way he is describing using the atom provides no benefit he wouldn't get from reassigning a var, so I say better to dispose of the pretence and just use a var
05:02rritochjustin_smith: replacing a mutable object in an atom is an ideal way to handle "transational" state information for transactions which require multiple threads
05:02justin_smithrritoch: and what does this do that reassinging a var would not do?
05:03rritochjustin_smith: I honestly don't know, I never reassign vars, I always use atoms when I need mutable data.
05:04justin_smithrritoch: answer is nothing, using an atom to hold a mutable value is giving the illusion of correctness it cannot provide
05:04clgvrritoch: the take away is, just don't use mutable data in atoms or refs (not even transitively)
05:06hyPiRionI'm perhaps confused here, but I still don't grok why atoms + persistent data structures doesn't suffice here.
05:07justin_smithhyPiRion: they do suffice, rritoch was trying to tell someone their problem would be easier to deal with if they put a mutible hash map in their atom
05:07hyPiRionThe combination is effectively thread-safe mutable data structures with snapshot capabilities.
05:07hyPiRionalright
05:07clgvhyPiRion: they suffice for the original question of mskoud. just some tools functions are needed
05:08hyPiRionright. If you want a cache, you'd likely use some variant of cace from core.cache inside an atom
05:08mskoudthey do indeed, a simple update-in with a helper function to obtain an index.
05:08rritochclgv: I have 30 years programming experience, do you think I'm going th change my programming practices simply because you say so? The world doesn't work like that. I need to see actual proof that one way is better than another and I've already dealt with modifying deep structures with clojures persistent maps, its a nightmare, which is why I resort to using mutable maps for any deep structures.
05:08clgvmskoud: great :)
05:09rritochclgv: Eventually someone will probably come up with some good functions for updating deep items of structured data in clojure, but until then data with a great deal of structure is easier to manage with mutable data.
05:09clgvrritoch: great argument - do as you like. I was just trying to help you to avoid painful consistency errors with atoms
05:10justin_smithrritoch: you are ignorant about clojure, stubborn about learning to use it properly, and trying to give novice clojure users advice on using the language. In my opinion at least one of these things should probably change.
05:10Chousukewhat's the problem with update-in? is it too slow?
05:10rritochjustin, I'm not a "novice" I've been professionally programming in clojure for nearly 6 months
05:11rritochI've also read all of the official documentation (not counting the API refrence)
05:12rritochI've been programming with LISP since college, ~ 20 years experience there.
05:12hyPiRionrritoch: If I may ask, what exactly is the problem you have with updating deep items in structures?
05:13hyPiRionthe problem as in the difficult part of it
05:13Chousukeit's trivial
05:13Chousukejust use update-in
05:13Chousukeif it's too slow, then you might need another solution
05:13rritochMerging back takes a ton of assoc statements which is fairly non trivial
05:13justin_smithrritoch: then you aren't using update-in
05:14rritochChousuke: that may be a solution, I've never used update-in
05:14clgvChousuke: the actual question involved a predicate to find the elements that really need to change. so there could be useful helper function for that - but nothing critical
05:14hyPiRionMaybe you should try out update-in and assoc-in. They usually fit well
05:15justin_smithrritoch: I wasn't saying ignorant as an insult. update-in is one of the most important functions in the language, and addresses the problem of deep changes in immutible data structures in most cases.
05:15hyPiRion,(update-in {:a [1 0 3]} [:a 1] + 40)
05:15clojurebot{:a [1 40 3]}
05:16Chousukeclgv: well, yeah, then you need to walk the entire datastructure anyway, which is less trivial. but isn't there a contrib library?
05:17clgvChousuke: in fact a combination of update-in and walking the sequential collection suffices
05:17justin_smithChousuke: there is clojure.walk/post-walk, or zippers, both were mentioned in this conversation
05:18clgv(modify-when coll pred f) would be a useful helper function.
05:18clgvbut it's written quickly and then you can put it in tools lib you use ...
05:19rritochWell, anyhow, thanks for the "update-in", it is my first time seeing that function, and yes, it does solve every problem I've ever had with deep structures.
05:19hyPiRionyay!
05:19justin_smithrritoch: http://clojure.org/cheatsheet
05:20clgvso let's get those mutable class from the table for non-performance optimization scenarios ;)
05:20clgv*classes
05:21clgvs/from/off ...
05:32rritochGrumble, this assoc-in & get-in could have saved me at least 50 hours of headaches, someone should really add that to http://clojure.org/data_structures
05:34rritochWhy isn't dissoc-in in clojure.core? That would also be helpful to complete the "set" of modification methods.
05:35rritochI've been abusing -> since I wasn't aware of get-in
05:36hyPiRionIt's not evident how dissoc-in should act if the map turns empty
05:37hyPiRionshould (dissoc-in {:a {:b 3}} [:a :b]) return {:a {}} or {} (or nil)?
05:38hyPiRion(But it's been discussed, see http://dev.clojure.org/jira/browse/CLJ-1063)
05:38rritochhyPiRion: Well, I'd expect it to return {:a {}}
05:40SagiCZ1,(= (:a {:a nil}) (:b {:a 5})
05:40clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
05:40SagiCZ1 ,(= (:a {:a nil}) (:b {:a 5}))
05:40clojurebottrue
05:40SagiCZ1isnt this weird?
05:40rritoch,(dissoc {:a 1} :a)
05:40clojurebot{}
05:41hyPiRionme too. I usually define it à la (defn dissoc-in [m keys] (update-in m (butlast keys) dissoc (last keys)))
05:41hyPiRionSagiCZ1: when the key is not in a map, it returns nil. If you pass it another parameter, that will be returned if the value is not found
05:42hyPiRion,[(:a {:a 1}) (:a {:a 1} :not-found) (:a {}) (:a {} :not-found)]
05:42clojurebot[1 1 nil :not-found]
05:42hyPiRionor (get {:a 1} :a :not-found)
05:43SagiCZ1yeah but not finding the key returns the same thing as when there IS a key with VALUE nil
05:43rritochSagiCZ1: If you want to know if a key exists, check for the key instead of the value
05:44hyPiRionSagiCZ1: yes? That's why you can pass in a default value
05:44hyPiRionIf you want to check for existence and read its value in one function, use find
05:44hyPiRion,[(find {:a 1} :a) (find {} :a)]
05:44clojurebot[[:a 1] nil]
05:44SagiCZ1good ideas.. thanks
05:44hyPiRion,(find {:a nil} :a)
05:44clojurebot[:a nil]
05:46rritochhyPirion: is find faster than some?
05:47rritoch`(some (partial = :k) (keys {:k nil}))
05:47rritoch,(some (partial = :k) (keys {:k nil}))
05:47clojurebottrue
05:48hyPiRionrritoch: yes. But if you just want to check whether a key exists, you can use `contains?`.
05:48hyPiRion,(contains? {:k nil} :k)
05:48clojurebottrue
05:50rritochOk, thanks. I've used contains before but I have an in? function in all of my apps which uses some so I usually just abuse that function
05:50noncomto people who used overtone: how do you go about sequencing your music ?
05:50hyPiRionnp
06:01SagiCZ1how do you document a defmethod?
06:02clgvSagiCZ1: same as yesterday, document the defmulti
06:02SagiCZ1clgv: I am sorry I didnt catch the yesterday's response and forgot to check logs, thank you
06:16ChazeHi. Is there any way to perform an eval with lexical bindings as bound variables?
06:16ChazeMy problem is, that I can do (let [x 1] (eval `(+ 1 x))
06:19clgvchaze: you have to inject those bindings
06:20Chazeclgv: can't google it. what do i do? :)
06:20clgv,(let [y 1] (eval `(let [x# ~y](+ 1 x#))))
06:20clojurebot2
06:21clgvthe need for gensym arises from syntax-quote otherwise you'd need to use ~'x everywhere inside the list to eval
06:21clgvwhich you usually should not.
06:22clgvChaze: why do you need `eval` anyway?
06:23Chazeclgv: I'm thinking of writing a constraint propagation DSL as an exercise, and want the user to be able to pass conditions along the lines of '(< x 3)
06:24clgvChaze: you do not necessarily need eval for that. with macros you can construct functions for that shortcut predicates directly
06:24clgvs/that/these/
06:27Chazehow would a macro help me get around an eval here? at the time the predicate is defined by the user, none of its variables are bound to a value. then i need to evaluate them with different binding permutations
06:28clgvChaze: the macro can expand to (fn [x] (< x 1)) which is then kept to use it later on
06:28clgvChaze: the concrete solution depends much on how the DSL is structured
06:29Chazeclgv: ah. I could also expand to (fn [value-map] (< (value-map "x") 1)) or something along these lines?
06:30clgvChare: though I'd prefer (fn [{:strs [x]}] (< x 1)) since you do not need to alter the specified form, which might get complicated
06:31clgvChaze: that's map destructuring in case you want to look it up
06:32Chazeclgv: yeah, that's a nice solution. thx.
06:34clgvChaze: another potential pitfall - if you can, let the user of the DSL decide how to name the bindings instead of doing that implicitely
07:57CookedGryphonIs there a good reason rseq doesn't work on strings? Or is it just unimplemented?
07:58clgvCookedGryphon: you want to cheat a palindrom exercise? :P
07:59BronsaCookedGryphon: rseq is devined to operate in constant time
07:59Bronsadefined*
07:59CookedGryphonBronsa: yeah.... and strings are indexed such that you can just make an iterator run over it backwards
07:59Bronsahm, I guess it would be trivial to implement a RStringSeq though
07:59Bronsayeah
08:00BronsaCookedGryphon: dunno, no good reasons beside impl details then
09:28GlenjaminHi everyone, i'm going to be running a cljs workshop at my local user group - I'm trying to decide between using Om and Reagent - anyone feel like weighing in with advice?
09:29Glenjamini'm planning to focus on building a declarative UI and keeping data & rendering neatly separated for figwheel-style reloading
09:29vermaGlenjamin, what's the background of people? I did a presentation recently and decided to go with Reagent
09:30CookedGryphonunless the workshop is fairly advanced, I think om can be a bit confusing
09:30vermafor my group, the background was javascropt
09:30vermaso Om would have been too much
09:30Glenjaminit's the FP group, i don't think anyone else knows clojure, but most know JS
09:30CookedGryphonand reagent shows off nice clojurey data structures/transformations
09:30vermayes, agree with CookedGryphon
09:43CookedGryphonYou know what would be awesome, if the repl in emacs could drop clojure data structures in an expandable tree structure like the JS console in chrome does with js objects
09:43CookedGryphonso often even pprint comes out hard to read and full of irrelevant data
09:44Glenjamincheers for the input, will have a go with reagent
09:50puredangeryou might also look at Quiescent https://github.com/levand/quiescent
09:50puredangerat the very least the readme has pretty good comparisons of om, reagent, and itself
09:51puredangerCookedGryphon: you can use the clojure inspector for that
09:51puredangerhttp://clojure.github.io/clojure/clojure.inspector-api.html#clojure.inspector/inspect
09:51puredangerpops up a swing window on a clojure data structure
09:52ssboisenanyone familiar with the new ref-cursors in om?
09:55CookedGryphonpuredanger: don't really like the idea of popping up a separate window, much less a swing one! but it might help
09:55CookedGryphontried it and it doesn't work for lists of maps or anything nested
09:55puredangerhmm, I thought it did but admittedly I don't use it much
09:58CookedGryphonbut yeah, it would be much nicer if there was something inline in the emacs buffer
09:58CookedGryphonthat just used a tree-widget or something
09:59lgrapenthinCookedGryphon: I would use it
09:59mmeixVery basic question: when is it advisable to use "for"-constructs instead of map/reduce/filter/...? Readability? Style? Or are there cases, where only "for" is possible? (Didn't find such a case so far, admittedly being a newbie)
10:00stuartsierraI almost never use `for`
10:00lgrapenthinCookedGryphon: Have you tried cider-inspect?
10:00CookedGryphonooh, no
10:00CookedGryphonwhat does that do?
10:00puredangermmeix: readability - for is occasionally clearer (but I rarely use it either)
10:01lgrapenthinCookedGryphon: pretty much what you describe
10:01mmeixbut there are not cases, where for is the only possible solution, right?
10:01lgrapenthinCookedGryphon: C-c M-i if you are on cideer 0.7.0+
10:01mmeixno' cases
10:01CookedGryphonmmeix: for is great for more complex list comprehensions, say (for [x (range 4), y (range 4), z (range 4) :when (not= x y z)] ...)
10:02puredangerCookedGryphon: yes, exactly - when there are multiple dimensions (x, y, z), I think it's useful
10:02CookedGryphonwill evaluate the body for all combinations of x y and z where they aren't all equal in a list
10:02mmeixah, I see ... in this case it's easier to reason about
10:03mmeixand speed is no big difference, I guess
10:04mmeixthanks!
10:05CookedGryphonit's also good that you can reuse bindings/destructure without quite so much fn boilerplate floating around
10:06CookedGryphon(for [[a b] map-of-things-that-map-to vectors, item b] ...)
10:07CookedGryphondidn't mean reuse bindings, I just meant use bindings as things to enumerate as part of the same for loop
10:08mavbozo#<CompilerException java.lang.OutOfMemoryError: PermGen space,
10:08mavbozowhat does that mean? should I increase jvm max heap limit?
10:10mmeixCookedGryphon thanks: this makes sense for me ...
10:23ssboisenanyone familiar with the new ref-cursors in om?
10:37CookedGryphonthat inspector is better, but still not what I wanted lgrapenthin
10:38CookedGryphonI want a tree expander, not to navigate down the tree
10:38CookedGryphonI might want to compare two items in a vector by some value nested in their maps
10:38CookedGryphonwith a lot of extraneous information all around
10:50the_dankogreetings friends! i think today will be a beautiful one.
10:51the_dankoanyone doing anything cool this weekend?
10:52stuartsierramavbozo: The PermGen is where the JDK stores compiled code.
10:52joobusthe_danko: trying to take over the world!
10:52stuartsierramavbozo: It's separate from the regular heap.
10:53the_dankojoobus: that's awesome! via software, drugs, charm, or what? do you expect us to know you have taken us over or will it be more subtle?
10:53stuartsierramavbozo: There are command-line options to increase the size of the PermGen space; search.
10:53joobusthe_danko: why are you pressing me for all these details?!
10:54joobusthe_danko: I'm more of a high level guy
10:54the_dankojoobus: haha i get that
10:55the_dankoi am feeling the joy of clojure
10:55joobusi'm here today to absorb some clojure brilliance because I'm still a relative noob
10:56joobusthe_danko: the book joy of c?
10:56the_dankonice, me too! ok i lied. i haven't felt the joy fully yet but i know it is coming
10:56the_dankoyeah rocking the book and lispcast now
10:57the_dankolithuania? don't they have beautiful women there?
10:57joobusi injured myself at the end of July, and for about 2 months had a cast and such on, and all I did during that time was program clojure, read clojure, watch rich hickey videos on youtube, etc.
10:58joobusnow I'm in this limbo between OO programming at work, and thinking in clojure/immutable data types most of the time
10:58the_dankovery interesting. you prefer the clojure style?
10:58joobusyes
10:58CookedGryphonI hate that, wondering why your java's complaining then realising you don't have a return statement
10:59joobusthe complaint with OO-programming hiding state all the time resonated with me
10:59joobusbasically, every OO program is a fairly implementation dependent thing. All the code at work does this and it's a mess.
10:59the_dankoi was a trader until last week. wrote in java. now i am taking some time off to learn how i can help build the future.
11:00joobusnot sure if clojure would fix that but that is where my mind has wandered
11:00the_dankoyeah we ended up talking as much about software as we did about trading
11:00joobustrader as in stock/futures trader?
11:00the_dankowell about java in particular
11:00the_dankohigh frequency trading
11:00the_dankoso yeah
11:01joobusi was a trader for 6 years. had the series 7,55,63, but then the Fed started printing money and I wanted no part of the whole thing. no i program.
11:01the_dankonice
11:01joobus*now i program
11:04the_dankodo you use cursive by chance?
11:04joobusno
11:04joobusi'm a vimmer
11:04the_dankogot it
11:06the_dankodo any of y'all do mixed-source java and clojure projects in cursive/intellij?
11:07joobusi got lein droid to build the default project the other day; i thought that was cool. did some hot reloading via the repl to the android device, sweet. Now I'm wondering how/if it is possible to combine a clojure/clojurescript/android project as one project. I want the Web facing stuff to also be the UI for the android app, and written in cljs. Right now I'm just thinking on it for a while.
11:08the_dankointeresting stuff, looking forward to hearing how it goes
11:09Atlanisyou could use cljx to build it. Unfortunately, I don't have much more info than that
11:09Atlanishttps://github.com/lynaghk/cljx
11:14the_dankohow's your arm doing now joobus?
11:14joobusi screwed up my finger pretty good. now I get to live with it.
11:14the_dankojoobus: that is rough.
11:18joobusanyone used bitcoij in clojure? just curious...
11:18joobus*bitcoinj
11:21jonathanjcan i reload my project from `lein repl` without restarting the repl?
11:22jonathanjit's kind of time consuming to keep restarting the repl (and maybe losing some state) after each code change
11:22arohnerjonathanj: https://github.com/pallet/alembic
11:23arohnerdoesn't work perfectly, but better than nothing
11:23EvanRjonathanj: did you try (:require 'myproject.core :reload-all) in the repl
11:24jonathanjno, i did not
11:24the_dankojonathanj: i use cursive. awesome video here. http://vimeo.com/103812557
11:25the_dankojonathanj: well, that is part 2. probably want to watch part 1 first. you can reload easily using the repl tehre. i am a n00b though so if any others have better advice i would go for it.
11:26arohnerah, sorry, I assumed 'project' == 'project.clj'
11:26arohneryeah, if you want to reload your own source code, use your IDE
11:26arohnernrepl/cursive/vim fireplace, whatever
11:26arohnerany decent clojure plugin will support it
11:26EvanRi had a hard time reloading a project in cursive intellij
11:27justin_smitharohner: I still do (require 'some.ns :reload) like a caveman
11:27EvanRi only do that if im testing the whole program
11:27EvanRtesting pure pieces in isolation is easier
11:28jonathanjis anyone here familiar with instaparse?
11:28arohnerjustin_smith: ouch :-(
11:28jonathanji have a rule like: foo = letter { letter }
11:28arohnerjonathanj: I used it for the first time yesterday so that must make me an expert
11:28jonathanjwhich produces output like [:foo 'F' 'O' 'O']
11:29jonathanjsorry, "F" "O" "O"
11:29jonathanji would rather have [:foo "FOO"]
11:30jonathanjis there a way to get that by only modifying the grammar?
11:30arohnerI had that same issue, didn't figure it out
11:30arohnerI know that if you use regex literals, that goes away, but the parsing rules are different because regex are greedy, while 'normal' instaparse isn't
11:34jonathanjlooks like the answer is to do something like insta/transform {:foo str} (parser-thing ...)
11:35jonathanjarohner: what about specifying an exact number of matches?
11:35arohnerfoo = bar bar bar
11:46the_dankook so the joy of clojure says i need to put in (:require clojure.set) at the top of my file to use clojure.set
11:46the_dankoor at least that's what i thikn it says
11:46the_dankohowever this works fine
11:46the_danko(ns cljlearn.core)
11:46the_danko(println (clojure.set/intersection #{1 2 3} #{ 1 2 6}))
11:47Bronsathe_danko: that's because clojure.repl or some other namespace that your repl loads requires clojure.set
11:47the_dankoany idea why the :require doesn't seem to be necessary?
11:47the_dankoahh
11:47Bronsathe_danko: don't count on that though, you should always require the namespaces you need
11:47the_dankoBronsa: awesome, thanks!
11:48Bronsathe_danko: also it's pretty rare to use (:require some.ns) alone
11:48Bronsathe_danko: you usually do (:require [some.ns :as alias]) or (:require [some.ns :refer [var]]) or even a combination of both
11:48mearnshthe_danko: https://github.com/technomancy/leiningen/blob/master/src/leiningen/repl.clj#L3
11:49the_dankoahh sweet!
11:51the_dankoBronsa: thanks, reading up on the second form in the joy of right now. think i got it! it's awesome being able to hear the best practices, general usage patterns, etc. much appreciated.
11:53Bronsathe_danko: np
12:04mtgrubbhello all. I’m looking for some advice. I’m wanting to create a function that when passed a URI can return a record based on the scheme of the URI. These record “types” are an open set, so I can’t just build a static lookup table. I’d also like for the user of this library to only have to include the providers of these records in the dependencies list, but not have to explicitly require each one. So basically I want my function to be abl
12:04mtgrubbsearch through the classpath for suitable providers, something similar to how Leiningen templates work. I looked through the leiningen code but couldn’t really see what I was looking for. Any advice?
12:08Glenjamini think leiningen templates work on the premise of standard naming
12:14cminusmtgrubb: you could require a namespace based off of the scheme and come naming convention and then look up a well-known fn in that namespace and call it.
12:15mtgrubbcminus: thanks, I think i’ll try that.
12:17puredangermtgrubb: there are also mechanisms in Java to declare new url connection providers based on scheme. it's probably way more than you want to deal with, but that is actually an open system built into Java. It does not handle the classloading/require aspects though.
12:18puredangerthere is also the ServiceLoader mechanism which requires declaring new service impls for an interface in the jar manifest. the jvm then helps you be able to answer a question like "what are all the registered implementations of this interface?" which otherwise is not answerable in Java without class path scanning
12:18puredangerutilities exist for class path scanning as well of course
12:20mtgrubbpuredanger: are you talking about pomegranate or aether?
12:20puredangerno
12:22noncomdoes anyone use overtone here ?
12:38justin_smithnoncom: if this is regarding the sequencing thing, I think the idea of at-at was that it was for sequencing musical events in overtone originally
12:45stompyjwhat do people use overtone for?
12:45stompyjwhat camp is it in?
12:45stompyjtracker / reaktor / csound / max|msp ?
12:45justin_smithstompyj: it is a frontend for supercollider
12:46justin_smithsupercollider is like max|msp but without the GUI
12:46justin_smithand instead, a UDP based messaging protocol for constructing the patches
12:46stompyjaha, so yeah, csound/kyma/max|msp
12:46stompyjawesome
12:46stompyjI gotta check that out sometime
12:46justin_smithstompyj: I have high hopes for pink
12:47stompyjwhat is that?
12:47justin_smithit is by steven yi, one of the core csound devs
12:47justin_smithand it is a synth engine in pure clojure
12:47justin_smithwhereas overtone ships a separate c++ program that does all the synthesis
12:47stompyjwhoa
12:47stompyjvery cool
12:47justin_smithit's very young still
12:47justin_smithbut promising
12:48stompyjI used to be knee deep in that stuff in early 2000s, but I had to go hard analog with my music to ensure I wasn’t in front of a computer 24/7
12:48stompyjhaha
12:49mtgrubbpuredanger: so it looks like I can use clojure.tools.namespace.find and clojure.java.classpath to search for namespace prefixes then load the namespaces that are named appropriately and call an init function.
12:49justin_smithstompyj: it's funny how the definition of "analog" has changed since ~1989 or so - I remember when it meant you had no DSP in your equipment
12:50justin_smithstompyj: well no dsp, and no microcontroller based sequencing / switching either
12:51justin_smithstompyj: now I often see it mean "not a laptop"
12:52stompyjjustin_smith: hahaha, yeah, exactly
12:52stompyjand good point
12:52stompyjfor me, I just mean, all my MIDI input is driven via keyboard, maschine, and then live inputs via bass/drums
12:52justin_smithI mean today it's hard to find electronic music equipment without digital logic, for the bypass functionality if nothing else
12:53justin_smithstompyj: and of course we both know that the keyboard is digital, and the maschine is a computer
12:56donbonifaciohow could I use core.async to handle requests? for example, I'm at the request handler, and I need to fetch something from the DB, and after that provide some result. Is it a good match for this scenario?
12:58justin_smithdonbonifacio: what is the functionality you would get from using core.async in your request handling?
12:58nooniandonbonifacio: it's hard to use core async for that if you are using ring since it expects the response as the result of your handler function
12:59donbonifacioI was thinking about doing 2 parallel requests
12:59justin_smithnoonian: you could be using websockets, and use core.async to put the result on that socket
12:59noonianjustin_smith: yeah, that works fine
12:59justin_smithdonbonifacio: as in from the same client?
13:00donbonifaciojustin_smith: two independent webservices that I must call, for example
13:00donbonifaciosomething like call them both in parallel and wait on them
13:00donbonifaciodon't know if core.async is good on this scenario, but I was trying to use it somewhere :)
13:01justin_smithnoonian: another example - I have used core.async to manage the on-demand resizing of image assets (if I don't have a given resize cached already), where I pass a filename on the channel, put the same filename into the template, and then when the client asks for that file, that finds the result of the async (or waits until it is done as needed)
13:01noonianjustin_smith: nice
13:01justin_smithnoonian: since I shouldn't need to wait for the file to resize before sending the html
13:08justin_smithdonbonifacio: yeah, if in order to handle a request, you need to pull in multiple remote resources, you can use core.async to ofload the requests so they can be done parallel
13:08justin_smithdonbonifacio: but the IO should not be in go blocks
13:08justin_smithdonbonifacio: which complicates things
13:08bbloom:-( "fns taking primitives support only 4 or fewer args"
13:09bbloommy signature matches that of System.arraycopy
13:09donbonifaciokay justin_smith, I'll think on this a litter more. btw, just completed my first rest service and you helped me several times. thanks :)
13:09puredangerbbloom: that is one of my least favorite errors
13:09bbloompuredanger: you run in to it often?
13:10puredangerI did when working on the alioth programs :)
13:10justin_smithbbloom: I think it's because of the same problem you see with java library classes, where each use of primitive args must be defined separately (ie. a nearly identical method signature but taking an int or long)
13:10justin_smithdonbonifacio: np
13:10bbloompuredanger: i'm not sure how to handle it, this is a perf sensitive function
13:11puredangerbbloom: it's one of my least favorite because there just isn't always a good way to handle it
13:11bbloompuredanger: although i have been considering iterator/range style objects for these types... seems like a major refactoring i don't want to deal w/ at this point in time
13:12puredangerbbloom: one option is to fold the function into the caller or use a macro to get that effect
13:12puredangeror you can fold multiple prims together into an array
13:13bbloomyeah, was just considering the macro approach, but it's kinda ugly
13:13puredangeroh these are all worse than what you want to do, no question
13:14bbloompuredanger: i'm wondering how bad it would be if i just remove the type hints
13:14bbloomi'm gonna do that to unblock myself for now
13:14puredangeryou only need to remove one :)
13:14puredangerI'd recommend casting it back into a long or whatever when you get into the fn
13:15bbloompuredanger: no, you need to remove one *argument*
13:15bbloomnot one hint
13:17puredangeroh right
13:20puredangerbbloom: this is all limited by the number of generated interfaces at https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L97 - 4 seemed like a good place to stop the explosion I guess
13:20Bronsapuredanger: I've often been wondering if generating prim interfaces on the fly would be problematic
13:20bbloompuredanger: yeah, i understand the motivation. this is the first time i hit this problem
13:25bbloomit's weird b/c writing slow clojure and then making it fast has been very pleasant compared to writing java
13:25bbloombut eaking out that last bit of perf has been challenging
13:25bbloomit's forcing me to do more rewriting of code than i normal, but that's probably a good thing
13:26seangrovebbloom: You need a better JIT/Compiler/Language/Type|Effect System/datastore
13:27seangroveI'd work on those first, and then build the thing you're working on
13:27bbloomseangrove: shhh, i can only solve all the problems in the world one at at ime
13:33stompyjjustin_smith: haha, exactly re: keyboard / computer
13:33andyfTo anyone at Cognitect: I've seen mentions of not being able to use Leiningen for most projects you work on. Out of curiosity, what do you use to fire up a repl with desired class path?
13:33stompyjwhen they exposed core cells in reaktor, I lost a year of my life
13:33puredangerI don't know about "not being able" - we certainly use leiningen all of the place
13:34stuartsierraWe always start with Leiningen. Lots of projects have spawned their own one-off tools.
13:34puredangerthere are some other projects that use shell scripts in tandem with maven to do stuff (basically using maven just for dep mgmt)
13:35bbloomandyf: i generally do use lein for that purpose, but I often miss the old big-co svn style of reproducible dependencies: ....
13:35bbloomthat is dump all your jars in a single directory manually
13:35bbloomset the classpath to that
13:35adereth`donbonifacio: Have you seen Spiral? https://github.com/dgrnbrg/spiral
13:36bbloomi really wish union mount file systems caught on
13:36puredangerfrom working on Clojure itself, I actually end up using the ant version of the build there more than the Maven one. I have a branch where I have replaced the Ant stuff with just Maven though for Clojure. maybe some day I'll finish that off.
13:36bbloomrather than `lein deps :tree`, i really just want to type `ls lib`
13:37technomancydownstream packagers will really not like it if you introduce a circular dependency for packaging clojure/lein =)
13:37andyfI may have misinterpreted a statement of mr halloway's that led me to believe Leiningen was not usable for well over half of his projects. Can't find it quickly
13:38technomancyadereth`: hey, did you see this? https://github.com/technomancy/atreus/blob/master/atreus.rkt
13:38stuartsierraandyf: At the time, I think Stu Halloway's only project was Datomic. :)
13:38tuftis it common to use exceptions for error handling or something more like monads in clojure? i've been trying to use things like some-> but it's getting awkward
13:38andrewhrpuredanger: +1 for maven only, just for the sake of having only one task/dep on single project
13:39adereth`technomancy: No! Nice! Reading now...
13:39andrewhrbut is only my OCD talking louder :P
13:39technomancytuft: option types aren't really tenable without built-in pattern matching, unfortunately
13:39andyfSo if you have a Maven only project, is there an easy way to fire up a repl with correct class path, without needing an extra script?
13:39puredangeryeah
13:40puredangermvn clojure:repl or something like that
13:40puredanger(I don't do this often)
13:40tufttechnomancy: hmm indeed
13:40technomancyadereth`: output: http://p.hagelb.org/atreus-brd.svg
13:40technomancyadereth`: well, the tracing is still done by hand
13:40justin_smithstompyj: I should make a wooden box with a set of knobs that are just sections of an oak branch (bark still on) that is just big enough to totally cover a laptop, the knobs all sending parameters via USB - a digital to analog interface converter
13:40bbloomcan't you also just do `CLASSPATH=$(mvn classpath) java -jar $CLOJURE_HOME/clojure.jar
13:40bbloomor something like that
13:40technomancyI mean the copper traces
13:41stompyjyou’d sell out here in BK in minutes
13:41stompyjorganic redwood
13:41technomancyandrewhr: my first bug report to clojure was "hey, the instructions in the readme for mvn don't work; only ant works" =)
13:41technomancy(november 2008)
13:42puredangerinside the clojure proejct itself, I usually just do "java -cp target/classes clojure.main"
13:43justin_smithstompyj: the trick is you need software to go with it that is as simple as a dedicated device is - ie. one button that totally resets state to a known place, no weird corners in state / UI that would require more than a few lamps and the positions of some knobs to understand
13:43stompyjyeah
13:44justin_smithstompyj: I have thought about making my beaglebone usable on stage, and the trick is making something simple enough, as simple as one of my stompboxes
13:44stompyjjustin_smith: I used to know some guys from Berklee who were experimenting with those kinds of ideas
13:45andrewhrtechnomancy: nice. maybe maintaining one build system woulbe be a good thing™
13:45justin_smithstompyj: also, I have some plans to work with an open dsp box design, using some arm cortex chips, audio IO, and a couple knobs, plus arduino style connectors - a friend of mine has the boards made and the CPUs in place we just need to place the grosser externals
13:46justin_smithstompyj: the same chip as a modern smart phone, but bare metal, and a bus interface that we can supposedly attach desktop ram to(!)
13:47stompyjhaha, very cool
13:49justin_smithstompyj: it will be a big shift in brain gears to program for bare metal...
13:50justin_smithbut it is exciting, he has a botique audio components business so this could lead to some actual products...
13:56ohpauleezandyf: I also use CMMA - https://github.com/ohpauleez/cmma
13:56ohpauleezA Makefile that can sit on top of any deps tooling. It starts my REPL, launches CLJ targets, etc
13:58noonianspiral looks pretty sweet
13:59andyfbbloom: Closest I've found to that so far is 'mvn dependency:build-class path' but it's output includes too much to be usable in that way
14:00ohpauleeznoonian: Please see the mailing list about the claims made in spiral: https://groups.google.com/d/msg/clojure/rKqT13Ofy4k/H9xvkZA9Yy4J
14:00bbloomandyf: sounds like maven :-/
14:01stompyjjustin_smith: yeah, I think there is a ton of open space there. I think 2013 was the first year where people spent more money on music gear, then purchased music
14:02andyfpuredanger: Yep 'mvn clojure:repl' does fire up a repl, and prep ending that cmd with rlwrap works as expected, except Ctrl-D does not exit, only ctrl-c
14:03noonianohpauleez: thanks for the link
14:03bbloompuredanger: i forgot a bit of feedback on the survey: i want concrete inheritance. not b/c i like concrete inheritance, but b/c some poorly designed java APIs require it, and it's annoying to have to write java wrappers for that purpose
14:03andyfMy goal in asking is to figure out how to make Eastwood easier to use from non-Leiningen repls
14:04andyfAnd Leiningen repls, too. Should not be difficult to do - I just need to know what to expect from the environment, which may be almost nothing
14:04puredangerbbloom: concrete inheritance is not something that will ever exist as a generic tool BUT Rich is considering something specifically for this use case w/Java
14:04bbloompuredanger: i know that ra and timsg ran in to the same problem w/ clojure-unity
14:05bbloompuredanger: basically all unity stuff must subclass Component, so they just hacked clojure-clr's deftype
14:06puredangerthere is a ticket for this. can't find it atm
14:06borkdudecurrent status: watching cognitect webinar
14:06technomancyandyf: my recollection is that a while back relevance had a policy that mvn must be used "officially" for libs (back when lein couldn't deploy to central) but that people didn't use it during development much
14:07technomancybut that was a long time ago and a fuzzy recollection
14:08puredangerwe only use mvn for the contrib libs b/c that's all hooked into how the maven central deployment stuff works
14:08puredangermost of the contrib projects also have lein projects and a lot of devs use lein as well
14:09puredangerbut only the maven pom is used in build/deploy
14:10puredangerat the time all that was built (before I was involved) I don't think lein had enough support to handle everything that needed to be done. I suspect that would be a much smaller gap now.
14:10technomancythis was around the time of lein 1.5 iirc
14:10puredangerbut it's hard to prioritize time to overhaul a ton of projects with working infrastructure now
14:11puredangertechnomancy: do you know off the top of your head of any obstacles to doing maven central signed deployment with lein?
14:12technomancypuredanger: I think the main obstacle is that cemerick is the only one who has done it, and he's never on IRC =)
14:12puredangerI've done it with Maven, but not ever tried with lein
14:12technomancylet me see if I can find the email about it
14:13technomancyoh, he made a PR for it. what a champ!
14:13technomancyhttps://github.com/technomancy/leiningen/blob/master/doc/DEPLOY.md#deploying-to-maven-central
14:13mdeboardlol
14:13mdeboardHe's batman, basically.
14:14puredangeroh yeah, that's great
14:15puredangerso that doesn't actually do the close and release/promote in nexus, would need that too. that's easier than it used to be to automate though.
14:15andyftechnomancy: I happened across the discussion after this article including instructions by you on making things more easily available in repl - I will look into that: http://stuartsierra.com/2013/11/04/command-line-intransigence
14:17puredangerI have achieved about "85% Stuart" abilities in understanding and maintaining the contrib library infrastructure. thankfully he's still there to ask the other 15% of the time. it's no picnic.
14:18stuartsierrapuredanger: :)
14:18puredanger(inc stuartsierra)
14:18lazybot⇒ 12
14:18puredangerwat!?
14:18stuartsierra"85% Stuart, 99% rant-free"
14:18puredangerI rant in private :)
14:18stuartsierrapuredanger: See, that's why people inc you.
14:19stuartsierra(inc puredanger)
14:19lazybot⇒ 18
14:21bridgethillyerthose are both way too low. Was there a global reset recently?
14:21puredangerok, I'm gonna go to lunch. no one break anything while I'm gone.
14:21justin_smithbridgethillyer: they answer the hard questions, which are fewer in number - you get more incs helping the newcomers, and anyone can do that
14:22bridgethillyerahh
14:22TimMcor just spend way too much time on IRC
14:22TimMc$karma TimMc
14:22lazybotTimMc has karma 73.
14:22justin_smithTimMc: that too
14:23TimMcand invent terrible things that people inc you for because the alternative is facing up to the thin barrier between production code and madness
14:23bridgethillyer^
14:24puredangerI would say not just anyone can help newcomers and I hugely appreciate the people that do that here relentlessly
14:24joshuafcoleTimMC: Where do you work? I'd love to have a thin barrier.
14:24TimMcjoshuafcole: Brightcove
14:24Anniepoo.
14:24puredangerand with great humor and grace
14:25bridgethillyerhear hear
14:25joshuafcole:) Our shop has a live video broadcasting with serious social interaction system built on top of Drupal…. Drupal 6.
14:25joshuafcoleThat we're slowly transitioning onto NodeJS / MongoDB from
14:25joshuafcoleI have stared into the abyss
14:25TimMchaha
14:26TimMcTo be clear, I haven't actually used swearjure at work. I do try to keep it separate.
14:26joshuafcolehah
14:26justin_smithjoshuafcole: migrating to mongo?
14:27joshuafcoleI'm not high enough up to make those architectural decisions, justin_smith
14:27joshuafcoleI just try to make the best of a bad situation
14:27quilejoshuafcole: are you at least able to use clojurescript on node?
14:27justin_smithjoshuafcole: not criticizing - the grammer was unclear to me
14:27joshuafcole:)
14:27bbloomjustin_smith: i am criticizing: never migrate to mongo
14:27bbloomlol
14:27joshuafcolequile: If only. At home I get to enjoy it though
14:27justin_smith"transitioning onto nod / mongo from"
14:28mbacwhat's the thing i want to do for fast 2d graphics
14:28mbacin clojure
14:28joshuafcolembac: Not sure what level you're looking to draw at, but I've had decent success splatting into byte buffers and loading those into LibGDX pixmaps
14:29mbaci want to plot pixels mostly
14:29joshuafcoleI'm procedurally generating my graphics though
14:29stuartsierraI've asked before, trying again: does anyone have a reference for the phrase "Getting SLIMEd" earlier than technomancy in 2010?
14:29joshuafcoleThat may be a good route for you then, though you'd need to make your own drawing routines or look for a lib to do it
14:29mbaci'm doing some kind of realtime sound visualization
14:29mback
14:29mbacsure
14:29technomancystuartsierra: I got it from a co-worker, but I can't remember which one. maybe pjstadig or hiredman.
14:32stuartsierratechnomancy: Thanks. Do you know if it existed in the Common Lisp world before then?
14:32stuartsierra(this is for a talk)
14:32technomancystuartsierra: hm; I don't think so
14:34stuartsierraOK, thanks.
14:35justin_smithmbac: I think the main thing is not going to be the overhead of putting the pixels on screen as much as the overhead of calculating the values. Things like cache-line friendly layout will make a really big difference if things need to be realtime.
14:54TimMcjoshuafcole: Do you do your own video processing?
14:54joshuafcoleTimMC: We do all our production and touching up in house, but I'm not actually familiar with the specifics
14:55TimMc*nod*
14:55joshuafcolecreativelive.com
14:55TimMcI'm mildly curious if your company is a customer of my company. :-P
14:55joshuafcoleAfter a year of labor you can hardly smell the drupal anymore!
14:55TimMcha!
14:56joshuafcoleI was actually curious about that too, but I don't think so (or at least, not directly). We manage our broadcasts via Ustream currently. We've wanted to move off them for more than a year, but we've had more… pressing concerns
14:56stompyj(inc joshuafcole)
14:56lazybot⇒ 1
14:58TimMcI'm sure Ustream has built their own stack.
14:59joshuafcoleYeah, their reliability has been pretty awful though
14:59joshuafcoleand there's not much we can do but twiddle our thumbs and buffer when the streams go down
14:59joshuafcolewhich isn't very good for what's supposed to be a live and interactive online experience
15:00TimMcLive is pretty hard.
15:00joshuafcoleYeah, in fairness, their awful is still 100x better than I could provide at half the scale. :)
15:01gfredericksdoes anybody know if java.jdbc lets me express "UPDATE foo SET bar = bar +1" without the general do-commands fallback?
15:06justin_smithgfredericks: I looked and did not find it
15:07gfrederickslooks like do-commands returns what I want for an UPDATE anyhow, so that's not terrible
15:07gfredericksjustin_smith: thanks
15:08justin_smithgfredericks: had to do something similar in a webapp, settled for do-commands
15:13bbloomhyPiRion: do you lean "decreasing" the constant factors? :-)
15:14hyPiRionbbloom: ?
15:14bbloomhttp://hypirion.com/musings/understanding-persistent-vector-pt-3 first paragraph
15:14hyPiRionOh, hahah
15:14clojurebotCool story bro.
15:15bbloomhyPiRion: great pictures, btw
15:15hyPiRionThat sentence is technically correct though. Perhaps a bit ill-advised.
15:16hyPiRion(inc bbloom) ; thanks
15:16lazybot⇒ 47
15:16bbloomhyPiRion: (Thread/sleep 123)
15:16bbloomconstant factors: increased!
15:17hyPiRionOh, it's on hacker news
15:17joobus(dec joobus)
15:17lazybotYou can't adjust your own karma.
15:17joobuslulz
15:19bbloomthe top comment being pedantic about "effectively" constant time is hilarious too
15:19bbloomwhich reminds me of one of my favorite alan perlis quotes:
15:19bbloom"for every polynomial-time algorithm you have, there is an exponential algorithm that I would rather run"
15:20bbloomthe comment that it's a "scam" that we claim "effectively" O(1) for our structures is funny. big-O is already a massive approximation
15:21bbloomit's not really useful in practice other than to communicate "this is how much you should care about the magnitude of N"
15:21bbloomanswer for vectors: not at all
15:24hyPiRionArrayList.add is O(n) and not O(log n). conj on a vector is O(log n).
15:24tbaldridge"we have constant time lookup on this array!"
15:25hyPiRionthen again they both are O(n!). So much for that valuable property.
15:25tbaldridge"Not with a CPU cache that small you dont..."
15:25bbloomtbaldridge: ha, yeah, that's the other hilarious part
15:25bbloomeverything is basically always log(N), thanks to hierarchical caches
15:26bbloomtbaldridge: btw, checked out pixie a bit ago. seems neat!
15:26tbaldridgebbloom: thanks, I'm pretty happy with it so far.
15:27bbloomtbaldridge: how close do you plan to stick to clojure?
15:28bbloomtbaldridge: while working on eclj i realized that i wanted to veer further away than would really make sense to still call "clojure"
15:28bbloombut you just tossed the clojure name from the get-go :-)
15:29bbloomoh, i see your note about that in the readme now
15:29bbloomnevermind!
15:30athinggoingonhi, I'm trying to install cider from melpa and am getting "failed to verify signiture queue". Is there another way to install an older version of cider from the pckage manager?
15:31technomancyathinggoingon: marmalade has a stable version
15:31justin_smithathinggoingon: queue is in melpa, but yeah, using stable is a good idea
15:31technomancybonus points: it uses TLS so you're not installing
15:31justin_smitherr... well queue is in one of the gnu emacs package sources
15:31technomancy*installing MITM-able packages
15:32justin_smithTLS: bonuses including not
15:32TimMctechnomancy: You're no fun!
15:32justin_smithTimMc: oh, I thought that was a companion animal
15:41bbloomi'm curious: why bother with this if-check? https://github.com/clojure/clojure/blob/38d7572e4254afdd7f02b78095ccdb27065754d2/src/jvm/clojure/lang/ATransientSet.java#L28
15:42bbloomdoes it serve a purpose really?
15:42whodidthis_how do i choose a thingie in undotree
15:43hfaafbclick the thingie
15:44whodidthis_no mouse :(
15:44capiscebbloom: seems superfluous
15:44whodidthis_whats like a select type of command
15:44bbloomcapisce: yeah, but it's such a small/clear function, it seems unlikely to be an oversight, but you never know w/ the clojure codebase
15:44justin_smithwhodidthis_: usually hitting return in that kind of UI in emacs
15:44bbloomw/ rich, you might get "who cares" or "no, that seemingly simple thing is very very important"
15:45tbaldridgebbloom: transients sometimes create new collections, sometimes not.
15:45whodidthis_it says buffer is read only, maybe i did some bad command
15:45amalloybbloom: assignments might bust some caches or inlining or something? which could make it worth the cost of checking, to avoid unnecessary setting
15:45tbaldridgebbloom: don't store the field if you don't have to.
15:45bbloomamalloy: tbaldridge: yeah that's what i was wondering...
15:46bbloomboth conj and disjoin both do it
15:46amalloytbaldridge: i mean, the "obvious" way to do it is just "impl = impl.assoc(val, val)"
15:46bbloombut i wonder if rich benchmarked it or whatever
15:46whodidthis_http://www.emacswiki.org/emacs/UndoTree it looks really useful and i can move around but how do i select a point
15:47bbloomi mean, field writes always risk a write barrier or whatever in the GC, but this is a transient, presumably it lives in the nursery most of the time
15:47whodidthis_wait, or am i supposed to choose one, am i being stopid again
15:47bbloomi couldn't imagine that if check helping much
15:47justin_smithhttp://www.dr-qubit.org/undo-tree/undo-tree.el see the comments here at the top of the file
15:48whodidthis_oh dear, sorry about that just realized how it works
15:48tbaldridgebbloom: benchmark it and see ;-)
15:48bbloomtbaldridge: i have so much lower hanging benchmarking fruit ;-)
15:49tbaldridgeseems like it would be slightly faster, I'm just surprised someone bothered.
15:49bbloomtbaldridge: i mean, faster is kinda the point of transients
15:49bbloombut then there's the safety check for editability all the time
15:49bbloomso *shrug*
15:49tbaldridgebbloom: well it seems cgrand wrote it back in 2009, so perhaps ask him ?
15:50bbloomoh heh
15:50athinggoingonjustin_smith: thanks for your response. Since queue is in melpa, and I have added melpa to my list of package archives, shouldn't installing cider automatically install queue?
15:52justin_smithathinggoingon: sorry, not melpa, elpa - is elpa also one of your package sources?
15:53justin_smithelpa is the "official" one (melpa is for contrib stuff)
15:53justin_smithhttp://www.emacswiki.org/emacs/ELPA
15:53mikefikesI was curious: Is there a general sense of roughly how far off ClojureScript is from being deemed 1.0?
15:55bbloommikefikes: ignore the version number, it's widely used in produciton & is very reliable
15:55mikefikesYes. I'm using it in production.
15:56mikefikesMore of a curiosity. Roadmap type stuff...
15:56athinggoingonjustin_smith: is this it? (add-to-list 'package-archives
15:56athinggoingon '("org" . "http://orgmode.org/elpa/&quot;))
15:56athinggoingon
15:56mikefikesWondering if there are new features, or just bugfixes between now and 1.0
15:56amalloymikefikes: i expect it will just depend on something whimsical. one day, rich will decide "sure, this seems like a 1.0"
15:56justin_smithathinggoingon: yeah, probably best to find where you are already settng up your package-archives and throw that one in there too
15:57justin_smithathinggoingon: also you can do M-: package-archives<return> to see the current value
15:58technomancyagain with the non-tls package source. =(
15:58justin_smithtechnomancy: wait, what's the tls package source for queue.el?
15:59justin_smithmelpa does not have it, it seems (which seems to be the source of this issue)
16:00technomancyjustin_smith: I don't know. if there is none, the first thing to do would not be to install it insecurely but to report a bug.
16:01technomancyM-x package-install-from-file with a manual download works
16:02justin_smithtechnomancy: cool, I did not know that was a thing
16:02technomancyel-get also supports installing straight from https it
16:02technomancygit
16:02bbloomtechnomancy: how come i need to type my secret key 3 times to deploy to clojars?
16:03technomancybbloom: sounds like your agent isn't caching your passphrase
16:03bbloomhow do i make it do that?
16:03technomancyon a mac? ... I don't know =( it just works on debian
16:04technomancybut `lein help gpg` might tell you
16:05bbloomtechnomancy: i'm afraid to fuck with it, since it took so long to get working in the first place!
16:05athinggoingonjustin_smith: I'm running into failed to download gnu archive
16:05athinggoingonhttp://stackoverflow.com/questions/26108655/error-updating-emacs-packages-failed-to-download-gnu-archive
16:05technomancywe don't have a lot of OS X users on the core lein team unfortunately
16:06bbloomtechnomancy: i uncommented the "use-agent" line in my config, will hope that works next time
16:06technomancythat sounds promising
16:06bbloomtechnomancy: remember i told you that so when it inevitably explodes, you can help me fix it :-)
16:07justin_smithathinggoingon: you should try one of the other options technomancy suggested above
16:07justin_smithathinggoingon: though if you don't have gpg installed, installing that and trying again couldn't hurt
16:08bbloomanyway, debugging hilarious complicated macros is now awesome thanks to Fipp 0.5.1's new code-dispatch pretty printing :-)
16:08bbloom(inc maxkreminski) ; for his awesome work there
16:08lazybot⇒ 1
16:08technomancybbloom: have you seen racket's stepping macro debugger?
16:08bbloomtechnomancy:
16:08bbloomyes
16:09bbloomsadly
16:09bbloomwow enter key failure
16:09bbloomtechnomancy: yes, sadly we don't have nearly enough machinery in clojure for that to be possible
16:09technomancyI'm half in awe of how sophisticated it is and half terrified of ever writing anything that would need it.
16:10stuartsierrabbloom: These articles helped me http://coredump.io/blog/2013/04/29/gpg-for-people-that-dont-like-gpg/ http://sudoers.org/2013/11/05/gpg-agent.html
16:11bbloomstuartsierra: than you
16:11bbloomtechnomancy: i'm not convinced racket's macro-heavy approach is a good idea though
16:11bbloomtechnomancy: in fact, thanks to their incredibly strong research work, i'm convinced that it's not a good idea
16:12bbloomtechnomancy: they have worked out all the little details and basically proven that macros are a hack
16:12stuartsierra(rejoining the discussion) bbloom: a hack for what?
16:12technomancymy gut says if anyone can get macro-heavy code right, it's racket; the question remains whether it's a good idea to begin with
16:13bbloomstuartsierra: partial/abstract evaluation and syntactic abstraction
16:13technomancy(obviously trivial macros for which the expansion is obvious at a glance are a win no matter what)
16:13stuartsierraah
16:14bbloomdespite it's many flaws, mathematica's approach works much nicer than macros for both partial evaluation and syntactic abstraction
16:14bbloomalthough it lacks severely in the abstract evaluation department, which is a bummer
16:17amalloyheh. i just saw recap spelled as "re-cap": sounds like it literally means putting your hat back on
16:17amalloy(dec amalloy) ; off-topic
16:17lazybotYou can't adjust your own karma.
16:22bbloomztellman: hey, i think i found a riddley bug: https://github.com/ztellman/riddley/blob/b1471263409d9aac5837606dc92d33e93906971b/src/riddley/walk.clj#L172-L175
16:23bbloomztellman: i'm trying to rewrite a particular symbol, but that if check prevents (.method obj) from rewriting 'obj -- i don't think there's any harm in just unconditionally doing the then branch of that else....
16:32whodidthisbut if i use emacs where should i bind tmux prefix, whats a god unused ctrl+? button
16:32technomancywhodidthis: ctrl-z is good
16:32whodidthisthanks
16:32technomancyif you have tmux, you never need to background emacs =)
16:33whodidthisoh right it was that button
16:33amalloyyeah, C-z is where i hear folks putting tmux/screen stuff
16:33stuartsierrawhodidthis: I use ctrl-t "t for tmux"
16:34gfredericksbut ctrl-t is for transposition!
16:34amalloystuartsierra: i think C-z, C-i, and C-m are the only letters i don't use regularly
16:35technomancyamalloy: huh, can tmux tell apart C-i and tab?
16:35stuartsierragfredericks: Yes, so you would never type C-t twice in a row.
16:35technomancyin some contexts they are represented the same way, so I wouldn't recommend that
16:36justin_smithstuartsierra: repeated control-t pushes a letter forward in a word
16:36mgaareI bind tmux prefix to `
16:36stuartsierrajustin_smith: huh, true. I never thought of using it that way
16:37amalloytechnomancy: i dunno
16:38gfredericksstuartsierra: in any case, are you saying it only works for you as a tmux key when you press it twice?
16:38amalloygfredericks: no, the other way around
16:38amalloythe tmux key passes itself through to the application if you press it twice
16:38whodidthisyeah i was wondering why beginning of line was 2x ctrl-a
16:38gfredericksooh, the point being that having to double up your usage isn't a burden
16:38gfredericksin contrast to C-b
16:39technomancyC-a and C-b are just abysmally bad defaults
16:39amalloyfor what is C-b the default?
16:39gfrederickstmub
16:39gfrederickstmux
16:39amalloythose are indeed quite bad
16:39amalloyi gotta learn tmux one of these days
16:39technomancythey're like ... "maybe when the machines burn civilisation to the ground, they'll actually be justified" bad
16:39amalloyi put a little effort into screen once, but it never really took hold over me. i'm one of those barbarians who just uses N OS shell windows
16:40stuartsierragfredericks: I mean I don't have a reason to type C-t C-t in Emacs, so I can use C-t C-t as 'transpose' and one C-t for tmux.
16:40mearnshtmux is pretty user friendly
16:40whodidthismosh + tmux is great
16:40amalloymearnsh: what need has an emacs user for user-friendly software?
16:40stuartsierraI think ever Cognitect employee has a different preferred tmux prefix. ;)
16:41stuartsierra*every
16:41mearnshamalloy: haha. well it's sufficiently powerful too
16:45gfredericksamalloy: I use tmux less for the multiplexing and more for the remote persistence
16:45gfredericks95% of the work I do is in an emacs running on a server
16:46sritchiebmabey: hey man, saw your airbrake library -
16:46TimMcwhodidthis: It doesn't do port forwarding and I've basically never wanted SSH access to a server without forwarding.
16:46sritchiebmabey: do you know of any cljs wrapper?
16:46TimMcso that makes me sad
16:47whodidthis:(
16:47technomancyTimMc: I basically use it for erc and nothing else =)
16:48bmabeysritchie: not that I know of.. we just use it on the jvm (BTW, we been using it lately to hit https://rollbar.com/)
16:48sritchieyeah, was looking at that
16:48sritchiebmabey: thinking of going full client side with this redesign,
16:48sritchieand trying to wrap my head around how to do authentication over sockets
16:48sritchiewith JWT
16:48TimMctechnomancy: C-b is bad because of distance on a qwerty keyboard?
16:49technomancyTimMc: no, because readline uses it
16:50bmabeysritchie: I'd probably just wrap the rollbar JS lib
16:51whodidthisthis emacs-live thingie is much better than whatever i came up with with vim
16:53amalloyTimMc: C-b is terrible because that's how you go back one character :P
16:54justin_smith~emacs-live
16:54clojurebotI don't understand.
16:55justin_smithI thought we had a factoid for that
16:55justin_smithwhodidthis: if you keep using emacs, you may want to switch from emacs-live to technomancy 's better-defaults setup
16:56TimMcamalloy: Oh! Yes, right.
16:56thedankolispcast video three is starting to get heady
16:56thedankolots of maps eh
16:56justin_smithalso, how much do I hate web forms that turn on bold text when I just wanted to back up a few chars
16:58technomancyjustin_smith: O_O
16:58justin_smithtechnomancy: really it's my fault for muscle-memory typign C-b
16:58technomancywhat wretched hives of scum and villainy are you visiting?
16:59justin_smithterrible places that allow commenting
16:59technomancyIt's dangerous to go alone, take this. *hands justin_smith a noscript*
16:59justin_smithhaha
17:00mearnshi was confronted with this web form UI horror the other day: https://dl.dropboxusercontent.com/u/29566112/ss/form.png
17:00technomancyoh dear
17:01mearnshre-entered several times before shaking my fist
17:01justin_smithmearnsh: what a weird place to change fonts
17:01justin_smithmearnsh: or whatever they are doing there
17:02dbaschmearnsh: this is worse: https://www.dropbox.com/s/0si5h8ocq96p5nk/verizon.png?dl=0
17:03dbaschsecurity reasons wat
17:03tickingadditionally the star probably links to a billion password limitations leaving a password space of 2^8
17:04EvanRis {:a 1 :b 2} more or less idiomatic than {:a 1, :b 2}
17:04upwardindexHow can I (def something) but specify the metadata (it seems the metadata gets overwritten by the def when I use (with-meta)
17:05dbaschEvanR: most people don’t seem to use , in literals but I’d say it’s a matter of taste
17:05technomancyupwardindex: use ^{:foo :bar} preceeding the var name
17:06technomancyEvanR: I wouldn't put a comma in a small map like that, but it can be useful when you want to do a more complex one on a single line
17:06mearnshEvanR: just use commas where they might enhance readability
17:06tickingupwardindex: you have to be carefull where you asign the metadata on. you want it on the war but it seems you currently place it on the object in it
17:06ticking'var
17:07upwardindextechnomancy, ticking: Hmm, perhaps what I’m trying to do is very kosher, I’ll rework the code, thanks!
17:07technomancyupwardindex: no, it's fine
17:11EvanRi noticed its in the map pretty print
17:12tickingEvanR: they are just whitespace so you *could* put them everywhere
17:13justin_smith(defn, shatner-walk, [f, ...] (walk/post-walk, f, ...))
17:14justin_smithor wait that should be walken-walk
17:18tickingI think we should use them to highlight semantics.
17:18ticking(->
17:18ticking ,,,,,,,,,,,
17:18clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
17:18ticking , 1 ,
17:18clojurebot1
17:18ticking ,,,,,,,,,,,
17:18clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
17:18ticking , inc ,
17:18clojurebot#<core$inc clojure.core$inc@493d4a>
17:18ticking ,,,,,,,,,,,
17:18clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
17:18ticking , print ,
17:18clojurebot#<core$print clojure.core$print@49cbde>
17:18ticking ,,,,,,,,,,,
17:18clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
17:18ticking)
17:18sritchieis anyne here working on a websocket app w/ sente or friends that uses authentication across the websocket channel?
17:19tickingpoor clojurebot :(
17:19seancorfieldsritchie: yes, we do it via sending credentials over the WS and getting a response back, as well as a periodic ping to verify session is alive
17:19seancorfieldand the server tracks that an individual connection has authenticated
17:20ztellmanbbloom: I think that seems right to me
17:20sritchieseancorfield: using sente? yeah, I guess I can use the :uid field that sente provides -
17:20ztellmanbbloom: pull request welcome
17:20bbloomztellman: already sent a PR
17:20bbloom:-)
17:20ztellmanoh, ha
17:20sritchieseancorfield: you can’t really “log in” over that channel, right
17:20bbloomztellman: the PR simply calls f in the else branch
17:20sritchieseancorfield: if you’re trusting cookies to handle whether or not a user has authenticated
17:20bbloomztellman: solved my problem
17:21sritchieseancorfield: like, if they start on my SPA unauthenticated, websocket connection established for page redirects, etc,
17:21bbloomztellman: i was trying to find all mentions of a field name, but trying to call a method on a field name (.meth field) meant that the field wasn't found
17:21seancorfieldsritchie: we require credentials to authenticate on the server, the server verifies each request is from an authenticated connection
17:21sritchieseancorfield: okay, so there’s no unauthenticated mode for you guys
17:21seancorfieldso the app can operate in non-authenticated mode, but very limited
17:22aaelonyhas anyone used Clojure to create new UDFs for Hive/Hadoop? I have seen http://eigenjoy.com/2011/04/29/custom-hive-udfs-in-clojure/ and wondering if there has been an update?
17:22sritchiebut can it switch to authenticated mode without re-establishing the websocket?
17:22whodidthisoh no, how do i shut down the repls started up via cider-jack-in
17:22seancorfieldyes, because the server tracks the state as well as the client
17:23dbaschwhodidthis: M-x cider-quit
17:23sritchieseancorfield: okay, so you’re not tracking authentication via a cookie, right
17:23seancorfieldand the server won't allow / process various messages without it knowing the client has authenticated
17:23seancorfieldcorrect
17:23whodidthisi tried cider-quit but them jvms still up, should i just kill them
17:23sritchieseancorfield: so the user has to log in every time they visit your site?
17:24seancorfieldthat's a separate concern and can be done via a cookie (we don't currently)
17:24dbaschwhodidthis: sure, why not
17:24whodidthiswas just wondering whether theres some other command i should know
17:24sritchieseancorfield: yeah, with a cookie, and then you’d have to reestablish the websocket connection
17:24seancorfieldthe client can request a unique token from the server (after authentication) that can be used once for login without supplying credentials
17:24sritchieseancorfield: so that it could be initiated with the cookie
17:25sritchieseancorfield: and then store it in local storage or something, I guess?
17:25seancorfieldI guess - we haven't gotten that far yet :)
17:25sritchiegotcha
17:25sritchieokay, sounds like I need to poke around a little more :)
17:25seancorfieldright now the app is internal only and we require authentication on each visit
17:25sritchieah
17:25sritchiereestablishing the websocket connection doesn’t seem too bad
17:26sritchieahahhh
17:26sritchiehttps://github.com/ptaoussanis/sente/issues/63
17:26sritchiewhoops, too many “ahh”s
17:28seancorfieldyeah, we have a timed session store in our app already so we'll connect that up at some point, then use the reconnect trick to deal with the cookie I expect
17:45mikerodHmm. I thought that lazy evaluated values still captured the surrounding dynamic binding values at the time they were created
17:46mikerode.g. I thought dynamically bound var values would be "closed over" in when the lazy values were actually realized
17:46mikeroduhh i.e.
17:47mikerodI guess this is discussed @ http://dev.clojure.org/display/design/Improve+Binding
17:48turbofailhm. i'd imagine that sometimes you'd want that, and sometimes you wouldn't
17:48turbofaili.e. it's probably something you'd want explicit control over
17:48mikerodYes, I see some good arguments in both directions now that I look at it closer
17:49mikerodin the more general case
17:49mikerodI just had sometheing like a (binding [x 10] (for [v (some-list)] (+ v x))) and was confused that there was no bindings conveyance in the lazy seq realization
17:49mikerod(it wasn't as obvious as this)
17:50mikerodJust have to be careful with laziness in the scope of dynamic bindings I suppose :D
17:51whodidthisoh no my beautiful dreams, terminal+tmux+emacs dont seem too friendly
17:53amalloywhodidthis: there's not any conflicts between them that i'm aware of
17:53aaelonywhodidthis: I use tmux and vim for that reason. Otherwise, I prefer emacs.
17:54amalloymikerod: you do have explicit control! if you don't want conveyance, write the code you did write; if you do, you can capture the dynamic bindings via a lexical binding: (binding [*x* 10] (let [x *x*] (for ...)))
17:54aaelonyamalloy, you're right. I think it's tmux and vim that shares ctrl-b
17:55amalloyaaelony: well, as we were saying earlier, you need to choose a good tmux key; c-b may be a good default for vim users, but it is abysmal for emacs
17:55whodidthisim not getting C-9 or C-0 through, probably something going on with tmux
17:56aaelonyamalloy: true. screen is nice, but tmux is awesome.
17:56mikerodamalloy: yes indeed. the explicit control makes me all powerful!
17:56amalloycan anyone recommend a tmux tutorial for me? i have a minimal understanding of what tmux is supposed to do but no real experience with how to use it
17:57mikerodamalloy: I understand the issues involved and why it is explicit control now. It can just be a pretty sneaky thing in some contexts. Then again, I think dynamic bindings are a very sneaky thing in general.
17:58aaelonyamalloy: this is a start: https://www.youtube.com/watch?v=wKEGA8oEWXw tmux tutorial
18:01aaelonyhttps://gist.github.com/MohamedAlaa/2961058 <-- tmux cheatsheet
18:22whodidthisits probably my lovely mosh-chrome/secureshell sending out some bad stuff with ctrl-numerals for whatever reason, dosent work without tmux either :(
18:23whodidthisis there some other interesting key i could use instead, like esc can be used instead of meta
18:23raspasov /msg NickServ identify iSch051065c
18:24raspasovoops
18:24raspasov#stupidShitOnIRC
18:25justin_smithraspasov: this is why I only identify from my #freenode window
18:25raspasovyea :)
18:25raspasovok changed lol
18:25amalloyman, i let znc identify for me. typing it manually would be sad
18:25raspasovthere was a space at the front LOL
18:32tuftmy favorite thing i got working in tmux is os x clipboard integration
18:32EvanR/msg nickserv id l01b167175
18:32EvanRoops
18:38TimMcHow did you manage that? Prefixing with /say?
18:40amalloyTimMc: that's how i usually do it
18:41amalloy/msg TimMc if you don't know that you must be a noob
18:41EvanR/n00b
18:42amalloyEvanR: does that password mean something funny if you type it into a calculator and turn it upside down? it looks like it should
18:43EvanRits irc, dont you speak leet?
18:43justin_smithEvanR: clojure is so uncool, we can'
18:43justin_smitht even do nerd-cool
18:44justin_smith(stupid fat fingers)
18:44tickingI thought clojure is seen as a hipster language
18:44EvanR"clojure is considered a hipster language" hahaha
18:44tickingI mean. Most hipster things could also be advertised with clojures slogan.
18:45tickingFixie Bike: Simple made easy.
18:45justin_smithticking: walmart: simple made easy
18:45amalloyeugenics: simple made easy?
18:46justin_smithamalloy: I am really glad that one doesn't really work
18:46amalloyclojurebot: justin_smith is really glad eugenics doesn't really work
18:46clojurebotRoger.
18:46tickingdoubt?! To the sharks with him!
18:49justin_smithticking: I live in pdx, so I can say with some authority that hipsters still prefer ruby, with node coming a close second place
18:49amalloydo folks use tmux for their local machine? it seems like all the tutorials out there are like "you can manage windows locally but really tmux is all about persistent server sessions"
18:49justin_smithamalloy: locally I just use the tab feature on my terminal emulator
18:49tickingjustin_smith: yeah, node IS a hipster language, but clojure still might be perceived as one ;)
18:50tickingamalloy: yes
18:51Shayanjmjustin_smith: hipsters prefer ruby for no reason ;)
18:51tuftamalloy: i use it locally for the window management and for keyboard copy/paste
18:51justin_smithShayanjm: hipster reasons are strange and neigh inscrutible in general
18:51nextstephello, clojure newbie here. I would like to create an app that processes a large stream of data by applying several functions to it in a pipeline-like fashion, with dependencies and splits. What would you use, eep?
18:52Shayanjmtrue that
18:52mearnshamalloy: yeah both local and on all my servers
18:52mfikeseschew complection, espouse immutability
18:52amalloyjustin_smith: neigh? hipsters are horses?
18:53justin_smithnextstep: my first inclination would be to use thread pools and queues, perhaps via the core.async abstraction
18:53justin_smithamalloy: horpsters, either that or I am shit at spelling
18:53tickingif hipsters were horses, beggars would ride..... wait what?
18:53justin_smithnigh
18:53mfikesnextstep: If the problem is large enough, Storm
18:54tickingnextstep: depends, something between sequences, core.async, and bigdata, depending on the use case :)
18:55EvanRcan i split on a string that is not a regex
18:55tickingEvanR: hurm?
18:55amalloy&(doc clojure.string/split)
18:55lazybot⇒ "([s re] [s re limit]); Splits string on a regular expression. Optional argument limit is the maximum number of splits. Not lazy. Returns vector of the splits."
18:55EvanRmy string contains | and stuff that i dont want to escape
18:55amalloyEvanR: so, looks like no, but you can quote the regex
18:55nextstepmfikes, ticking: its not too big, i was actually looking for sth simple
18:56EvanRlike (re-pattern '"foo") ?
18:56tickingnextstep: a simple sequence should work
18:56nextstepwill run on the same machine
18:56amalloy,(clojure.string/split "foo|?|bar|?|whatever" #"\Q|?|\E")
18:56clojurebot["foo" "bar" "whatever"]
18:56nextstepticking: but i need splits and i have a large number of functions to map
18:57tickingnextstep: splits?
18:57amalloyEvanR: \Q..\E is the regular expression quoting mechanism
18:57nextstepticking: sorry, splits are bifurcations of the pipeline in the jargon of some libraries
18:58nextstepi.e. applying a function only to the elements of a stream that satisfy this and that condition
18:58nextstepafter applying another function
19:01tickingnextstep: so you basically have to go full DAG processing?
19:02mfikesnextstep: I wonder if Prismatic Graph applies
19:03nextstepticking: yes, a tree rather than a DAG would suffice for the moment
19:04tickingnextstep: well, even with sequences you can do conditional maps
19:04tickingif that is too simple, then you'll have to go up a notch with something like graph as mfikes mentioned, core async, or lamina
19:05tickingafter that comes storm, or flambo
19:05nextstepticking: ok, thanks. I'm fond of plain sequences but perhaps applying many conditional maps would be a bit clunky
19:06nextstepand difficult to parallelize
19:07dbaschnextstep: why do you need conditional maps instead of one function composing all individual functions and conditions?
19:09nextstepdbasch: could you illustrate how to compose everything with a function?
19:09mdeboardjustin_smith: I think last week you and i were talking about hide-show minor mode in Emacs. Just realized I bound it a long time ago https://gist.github.com/mattdeboard/119feedf99053e4c8610 I have a mouse with a ton fo buttons, so I set it up a long time ago to use one of the thumb ones to toggle show/hide. Go figger
19:09dbaschnextstep: you are processing a stream of individual inputs, right? the output for each input doesn’t depending on any other inputs
19:10dbaschnextstep: if so, for each input you just need to apply a function e.g. if a do b and c, otherwise d and e, etc.
19:11dbaschs/depending/depend
19:11justin_smithmdeboard: hah, nice
19:13aaelonymearnsh: tmux locally and on all your servers sounds like Inception, a dream within a dream, with a ...
19:13aaelonywithin a ..
19:14mearnshsessions should be nested with care, unset $TMUX to force
19:14mearnshi don't go that far
19:15aaelonydidn't know about unset $TMUX
19:15nextstepdbasch: yes, my inputs are independent
19:15amalloyi look forward to having N nested tmux sessions so that i need to hit C-z 2^n times to talk to the innermost one
19:15nextstepbut some functions depend on other function applications
19:15mdeboardNow I need to fully exploit this mouse in emacs.
19:16dbaschnextstep: but they depend on the application of the function to an individual item, so you need to construct a function with all the conditions and then map that to the sequence
19:16amalloymdeboard: if your hands leave the home row while you're using emacs, there's room to improve your workflow, by not doing that
19:16mearnshwell i don't nest sessions on the same machine, but yeah, if i want to talk to my servers' tmux it's C-z z, fortunately that's rare for me
19:16mdeboardnaw never
19:16amalloyso what's the mouse for, then?
19:16mdeboardwell
19:17aaelonypaperweight
19:17mdeboardI do use the mouse to switch between workspaces on xmonad
19:17mdeboardwith multiple monitors
19:17amalloyaaelony: hold down the Ctrl key by putting your mouse on it? i like that
19:17aaelonyheheh
19:17technomancyamalloy: how do you think everyone was typing in all caps the other day?
19:17mdeboardand sometimes, if there's a casual, sensual lingering on my pointing device, well... I can't be blamed for what might happen next amalloy
19:18dbaschamalloy: you can always get a foot mouse
19:18mdeboardI'm only human, after all
19:18amalloydbasch: i tried footpedals for my modifier keys
19:18aaelonyreplicant!
19:18technomancyit's adam and even not adam and minnie
19:18technomancy*eve
19:18mdeboardamalloy: If your toes leave your homerow, you're doing somethign wrong.
19:19amalloyit was cool but coordinating between a foot and a finger is way harder than coordinating between fingers: i just couldn't get things as seamless
19:19mdeboardI'd like to see an experienced drummer do that kind of setup with emacs
19:19mdeboardI bet it would be ridiculous to see
19:19noonianamalloy: interesting, i was considering trying out that setup
19:19dbaschamalloy: I built a few foot click buttons years ago, didn’t use them for very long
19:19mdeboardsince they come to the table with very good bilateral hand/foot coordination
19:20amalloynoonian: i'd still recommend it if the goal is to reduce finger fatigue, but not if you want to increase throughput
19:20amalloymdeboard: yeah, but fingers and hands aren't really the same
19:20mdeboardactually, one place my hands do leave the homerow but still stay on keybaord is flipping through buffers
19:20mdeboardC-x left/right arrow
19:20noonianamalloy: yeah i'm just trying to save my wrists/hands the strain
19:21amalloymdeboard: put that on a better key then, silly
19:21mdeboardAll my wrist strain went away after binding ctrl to caps
19:21technomancyhttp://p.hagelb.org/arrowed.jpg
19:21amalloyyeah, mine too, mdeboard
19:21mdeboardoh strongbag
19:21mdeboardbad.
19:21technomancypff--ctrl on the thumbs is where it's at
19:21mdeboardtechnomancy: check your thumb privilege
19:22amalloytechnomancy: i remember last time someone suggested that to me, i was like "but i use my thumbs for spacebar! i could never change that!"
19:22mdeboarddamn i haven't seen homestar runner in so long but "arrowed" and "sworded" is still a common reference
19:22Bronsaamalloy: both thumbs?
19:22technomancymdeboard: oh right I forgot some of us haven't evolved opposable thumbs yet my bad
19:22amalloythen after typing for a while i discovered i was actually using my right index finger for spacebar
19:22technomancyspoiler alert, etc
19:22amalloylike, when did i pick *that* habit up
19:22mdeboardtechnomancy: that's what my prehensile tail is for
19:22noonianmassdrop is still manufacturing my ergodox
19:22mdeboardamalloy: wat
19:23BronsaI have never pressed spacebar with my left thumb in my life
19:23mdeboardI bet that's not true
19:23mdeboardunless you don't have a left thumb
19:23mdeboardor a spacebar
19:23mdeboardor if you JUST popped into existence
19:23Bronsamy left thumb rests on the touchpad
19:23mdeboardOh, I disable my touchpad asap
19:23mdeboardhate it
19:24Bronsait's disabled while I type and for 0.3s after I stopped typing, and touch clicking is always disabled
19:25technomancyit is nice for scrolling
19:25mdeboardI use my Kinect for that
19:25mdeboardor voice commands
19:25mdeboard"Scroll down *flails*"
19:25Bronsayeah scrolling while reading is 80% of what I use my touchpad for
19:26technomancyI got one of these for my birthday http://www.amazon.com/Griffin-Technology-NA16029-Multimedia-Controller/dp/B003VWU2WA/
19:26technomancypretty handy
19:26Bronsanice
19:26dbaschthe kinesis keyboard forces you to use your right thumb for space among other things
19:27amalloytechnomancy: what for?
19:27technomancyamalloy: scrolling?
19:27technomancyI don't have a trackpad
19:27mdeboardwhat on earth
19:28amalloyi don't really get what's wrong with the arrow keys or spacebar for scrolling
19:28technomancyalso when I'm not at my desk my trackpoint is covered by my keyboard anyway
19:28amalloyi guess those mostly work for the browser
19:28technomancyamalloy: you can't press the arrow keys harder to make it scroll faster
19:28technomancy(but if you could, it would be awesome and I would do that instead)
19:28mdeboardI just use my mouse'ss croll wheel
19:28mdeboardit has two modes
19:28Bronsatechnomancy: well now you know what your next project will be :)
19:29mdeboardone is incremental scrolling (normal) and I can unlock it so it free scrolls. Pretty sweet.
19:29technomancyBronsa: I have literally looked into pressure-sensitive analog switches to build this myself but haven't found anything suitable =)
19:29amalloymdeboard: sure, i do too. but i can see how apple folks, or others without a mouse, want something similar to a scroll wheel
19:29mdeboardOh yeah
19:29mdeboardForgot about that
19:29mdeboardCan macs not use just regular mouse?
19:30nextstepdbasch: but how do i coordinate the order in which the mappings take place?
19:30amalloythey can, but those like...magic bluetooth touchpad things are popular
19:30mdeboardoh yeah
19:30aaelonycan't stand the newish finger swiping mac os stuff
19:30technomancyif anyone knows of a suitable easily-mountable pressure-sensitive analog switch please let me know =)
19:30dbaschnextstep: what exactly do you mean by mapping? so far my interpretation is (map f s)
19:31technomancyhm... maybe a distance sensor
19:31dbaschamalloy: I have a bluetooth touchpad attached to the middle of my kinesis keyboard
19:32amalloyman, you and ninjudd/lancepantz would get along great
19:32RaynesOh God.
19:32RaynesWe have one of them here too amalloy.
19:32mdeboardtechnomancy: http://en.wikipedia.org/wiki/Theremin
19:32mdeboardtechnomancy: do it.
19:32technomancymdeboard: suuuuper tempted
19:33mdeboardThat would be pretty amazing.
19:33nextstepdbasch: (map g s) depends on the result of (map f s0)
19:33nextsteps should only contain some items in s0 that
19:34nextstepsatisfy certain condition
19:34mdeboardtechnomancy: http://www.moogmusic.com/products/Etherwave-Theremins
19:34nextstepi have this pattern many times, so a whole tree of processing
19:34dbaschnextstep: not really, you said g(x) depends on f(x)
19:35nextstepdbasch: sorry, its late here and my explanations kinda suck
19:35dbaschnextstep: at any point one of your functions can yield nil so the rest of the functions pass it through
19:35dbaschand you can map (or keep, to ignore nils) your composed monster function
19:35nextstepi simply want to pass a stream through a tree of function mappings
19:35{blake}I do this weird thing...only in clojure, so I'm not sure why, exactly...but I'll be working my REPL and over the course of a few days, functions that I write will no longer be in the source file. Like, I've deleted them somehow.
19:36nextstepand run as much as possible in parallel
19:36dbaschnextstep: if you’re mapping a function, it’s a given that it can be parallelized
19:37{blake}It makes me wish "source" worked in the REPL.
19:37nextstepdbasch: ok, will try to see if i can come up with decent code
19:37nextstepthat's true
19:38dbaschamalloy: http://i.imgur.com/pPYmGrK.jpg <- my keyboard at the office
19:38amalloydbasch: i don't need a picture; i've seen that exact setup every day for years
19:38amalloy(from ninjudd and lancepantz)
19:38dbaschheh
19:38amalloymy keyboard is like a $5 piece of garbage
19:39RaynesMy guy here doesn't use a trackpad.
19:39RaynesI have a $180 das 4.
19:39dbaschage makes fingers less able to deal with crappy keyboards
19:39RaynesI'm definitely a keyboard crazy, but not an ERGO keyboard crazy.
19:39amalloyi don't need any stinkin keyboard pants, technomancy
19:40RaynesWhere crappy keyboard is effectively any staggered keyboard?
19:40dbaschyes, the staggered format needs to die soon
19:40technomancyamalloy: dude, I've moved on
19:40dbaschthese are not typewriters
19:40technomancyamalloy: wait, have you not seen http://atreus.technomancy.us?
19:41RaynesPerhaps one day I'll have hand issues that change my opinion.
19:43amalloytechnomancy: it seems like if you're going to retrain your hands anyway to use that minimal number of keys, you might as well do something better than qwerty. as you say, these aren't typewriters
19:43joshuafcoletechnomancy: Whoah, you were behind the atreus?
19:44technomancyamalloy: I don't use qwerty on my own board, and the firmware ships with colemak and dvorak options
19:44RaynesIn front of it a couple of times too, joshuafcole.
19:44technomancyjoshuafcole: yup
19:44joshuafcoleI'd read quite extensively about it when reviewing alternate keyboards
19:44technomancyoh nice
19:44joshuafcoleLooks awesome
19:44dbaschI tried dvorak for a while but didn’t find it convincingly better
19:44technomancyI haven't actually put much effort into promoting it because I'm busy designing a circuit board to make the assembly process easier
19:45technomancydbasch: TBH if I were starting over I'd probably use colemak
19:45zwerjoshhead did you test datahand keyboard?
19:45zweroh I guess you were reading reviews, not writing them
19:46tickingtechnomancy: have you considered moving all the keys one row up? making the number row the new qwert and freeing up the bottom row as thumb modifiers.
19:46zweranyway I'd give datahand keyboard a try if it was discountinued and sold for $1500 used
19:47technomancyticking: the bottom row is already thumb modifiers
19:47technomancyticking: oh, you mean a layout for a conventional keyboard? not a bad idea, but I wouldn't use it myself.
19:47tickingtechnomancy: I mean't on a regular keyboard, like a laptop ;)
19:47tickingyeah
19:47joshuafcolePrice has been a primary limiter in my search. I can easily justify $100, but $200 and up requires a lot of research
19:48joshuafcoleIn order to ensure that I'm making the best call with that cash
19:48tickingtechnomancy: yeah, after a few years of using custom keyboards and layouts I found that carrying around keyboards is not work the hassle ;)
19:48tickingworth
19:49technomancyticking: yeah... that's why I made one that's only 26cm wide and under 300g
19:49mearnshbeen using colemak for over a year now, recommended
19:50tickingtechnomancy: yeah yours is the most portable I've seen, but it's still an extra device
19:50tickingtechnomancy: but thinking about it, I think it would be nice to combine it with an ipad, where one has to carry a keyboard around anyways
19:51TimMczwer: https://github.com/dodohand/dodohand
19:56tickingtechnomancy: btw, is there a reason you lasercut instead of 3d print?, you could shave a lot of material of if the keyboard was just the outline of the keys ;)
19:57technomancyticking: 3D printing is weak sauce
19:57technomancyit's a lot more expensive, very flimsy, and much less precise
19:57technomancyat least for designs that can be layered
19:57arrdemmainly the flimsy bit...
19:57tickingtechnomancy: it kinda depends on the process
19:58tickingthe pla material most diy printers use is pretty rock hard
19:58tickingI'd say twice the strength of plywood
19:58technomancywell, the harder stuff is way slower to print
19:59technomancyso it comes out being a lot more expensive
19:59tickingtechnomancy: sorry I don't follow you. It takes me about 4 hours to print something the size of your keyboard
19:59TEttingerleather keyboard from ponoko :D
20:00tickingwhile I'm asleep
20:00technomancyticking: these cut in about 12m at a dollar a minute
20:00tickingso how does that increase price?
20:00tickingtechnomancy: yeah but where do you pay 3d printing at a minute rate?
20:00TEttingerthat's laser cutting
20:00technomancyat the local hacker space
20:01andyfAny reason folks prefer tmux over vnc ? We share desktops between devs via vnc frequently at my work
20:01tickingevery service that I know of is material usage * material cost
20:01technomancyanyway there's really no comparison in the feel vs wood that has been sanded and oiled with some wax mixed in
20:02tickingtechnomancy: and if you have a 3d printer yourself you pay only the filament which is dirty cheap
20:02technomancyandyf: latency mostly
20:03technomancyI've done acrylic too which can be cool since it's transparent, but the texture of the wood is more appealing
20:03tickingtechnomancy: yeah, but I'd still prefer less border and less weight ;)
20:03arrdemandyf: for various projects & contests we prefer tmux/screen because we're doing sysadmin & server side work where vnc doesn't really apply nicely
20:04technomancyticking: it's an OSS design. someone has made their own printed case, I just don't think it would sell very well.
20:04andyfBecause no X libs/apps installed there?
20:04TimMcDoes tmux do shared sessions more effectively than screen does?
20:04arrdemandyf: that's one reason
20:05arrdemTimMc: they're equally bad
20:05TimMcYou can also use ttyrec and ttyplay with the follow feature.
20:05technomancyTimMc: it's a lot nicer than screen, you just chmod a socket
20:05technomancyinstead of running screen as setguid root
20:05TimMcgood
20:05TimMcbecause that sucks and I don't do it
20:05technomancyalso tmux sizes the screen according to the smallest client rather than the latest to join. >_<
20:05TimMctechnomancy: Screen actually does some combo of that.
20:06TimMclatest-smallest
20:06technomancyTimMc: hm; maybe it's improved since I used it. always drove me nuts.
20:06TimMcIt's sticky is what it is.
20:08technomancyticking: this guy is doing 3D printed cases, but I think it's specifically because it's not a design that lends itself to stacking flat layers https://www.crowdsupply.com/multiplxd/axios-keyboard
20:09tickingtechnomancy: yeah that looks a tad overengineerd :D
20:09technomancyit's been "right around the corner" since january; go figure
20:09tickingtechnomancy: I like the one hand two hand approach of only using a PCB as the entire structure
20:10tickingthis seems to make assembly a lot easier and also uses minimal space/weight
20:10technomancyit's a cool hack, but I wonder how it would hold up to getting tossed in a bag
20:11tickingtechnomancy: I think this is where the 3d printing stuff really shines, one could easily create a case that is screwed on
20:12tickingto give structural integrity and protect the user from pointy leads
20:12arrdeminteresting... anyone know how coveralls does code coverage analysis?
20:12tickingyou don't need sub 0.1 mm precision then
20:13tickingtechnomancy: also if you want a version for your desktop you could print stell or ceramics
20:13technomancyticking: yeah, and being able to iterate on designs that you intend on throwing away is appealing
20:13tickinghttp://www.shapeways.com/materials/steel
20:13tickinghttp://www.shapeways.com/materials/ceramics
20:14technomancyactually been thinking about hand-carved hardwood
20:14TimMcarrdem: You can't talk about code in here, this is the #clojure room!
20:14tickingtechnomancy: cnc milled hardwood?
20:14arrdemTimMc: sorry I thought this was #emacs for a while there
20:15technomancyticking: or that, yeah
20:15arrdemI should do a kickstarter for a real TANAL/partial evaluator backed code coverage tool..
20:15arrdemrather than execution tracing..
20:17tickingtechnomancy: so yeah PCB layout + pluggable backshells = win
20:20whodidthismaybe its easy to change paredit shortcuts into some C-alpha + ( etc combis or something, defaults seem impossibl to get to work
20:22technomancywhodidthis: recommended
20:26mj_langford👍 arrdem
20:30TimMcLooks like the dodohand is in fact still in active development: http://geekhack.org/index.php?topic=41422.300
21:42azeirahGuys, is it possible to connect to the internet in a macro? Ex, when you're working with wikipedia pages, you could gather the data at compile-time
21:47TEttingerazeirah, yes it should be possible. I'm not a macro master, but you can try it out with just calling (slurp "http://google.com&quot;)
21:48TEttingerwhich will fetch the source of that HTML page as as string
21:48azeirahInteresting, thanks! I believe there lies great untapped power in macros
21:52justin_smithazeirah: and, as usual with great power, the ability to make a huge mess :)
21:53azeirahX] can imagine, yeah
21:57gfredericksazeirah: macros are mostly just for creating new syntax; I don't think I've ever seen a compelling use for side effects in a macro
21:58mj_langfordThat really looks like I'd consider having a build time script to do that sort of work
21:58gfrederickscompile-time side effects just sound unnecessarily surprising
22:02arrdemUsing macro time for side-effects is something I would call immensely suspect if not an outright code smell. Having a make or bringup subprogram that's explicitly run before or at bringup is much nicer.
22:05azeirahThe example I mentioned was only to make it clear what I was talking about
22:06azeirahI see a potential use-case for docstring gathering
22:13dbasch“sorry, you need network connectivity to compile this program” <- horror
22:13justin_smithazeirah: we have build time tools like marginalia for that sort of thing (depending on what you mean by "gathering"
22:20oskarkvI'm trying to use JavaFX, but apparently I can't import Label, but I can import some other things from JavaFX. Any ideas? https://www.refheap.com/1e9bd839e8b74222a12517527 http://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Label.html
22:22justin_smithoskarkv: I have a hazy memory that there is something in javafx that needs to be explicitly initialized, and some classes break if you try to refer to them before that initializations occurs, this has something to do with how clojure handles side effecting code in class initializers iirc
22:23justin_smithoskarkv: hopefully someone else can tell you something more specific
22:23oskarkvjustin_smith ok
22:23oskarkvThanks
22:24oskarkvjustin_smith So there is some method out there that I can call to fix it? :p
22:25justin_smithoskarkv: relevenat SO http://stackoverflow.com/questions/23365409/clojure-cant-import-javafx-classes-with-static-initializers
22:25oskarkvthanks
22:28justin_smiththat post talks about using ButtonBuilder instead of Button - maybe you could figure out a way to use LabelBuilder? http://docs.oracle.com/javafx/2/api/javafx/scene/control/LabelBuilder.html
22:32_gizmo385Is it possible to make a type a subtype of another type?
22:32_gizmo385For example, if I want to define a graph
22:32_gizmo385But also define a graph with special properties that "extends" from my base graph definition?
22:32justin_smith_gizmo385: in clojure we do extension by encapsulation or interface implementation, not by inheritence
22:33justin_smith_gizmo385: though with defmulti you can use 'derive' to specify inputs that should be treated the same way a more general case would be
22:33_gizmo385So how does encapsulation work in Clojure?
22:34_gizmo385Do you know of any good examples that I could delve into to get an idea of it?
22:34justin_smith_gizmo385: for example, if you use defrecord to define a record type, you can use assoc to attach new keys
22:34justin_smith_gizmo385: immutibility is the best encapsulation you can get
22:34justin_smith_gizmo385: stuartsierra has some good articles on this iirc, let me see if I can dig up a link
22:35_gizmo385Awesome, thansk :)
22:35_gizmo385thanks*
22:36TravisDWhat is the recommended emacs package for editing clojure?
22:36arrdemclojure-mode is good...
22:37TravisDI also see something called cider, is it worth looking at?
22:37arrdemcider is sometimes unstable and opinions are mixed
22:37danneuTravisD: + paredit-mode
22:37TravisDHi again guys, by the way :) It’s been a few months since I’ve been on
22:37justin_smithhello
22:37arrdemTravisD: cider is the successor to nrepl.el. Cider works like... 95% of the time in my experience, less in that of others.
22:37arrdemTravisD: however nrepl.el still totally works
22:38arrdemI think some people here are still using slime even...
22:38justin_smithTravisD: cider is a fast moving target, and the default way of installing will get you new versions before they are verified not-broken
22:38TravisDcool :) Is there a place to read about the alternative options?
22:38danneui had to switch from cider back to nrepl.el.
22:38justin_smithTravisD: that said, if you install 0.7.0, it should just mostly work
22:39danneui was on that snapshot until it broke for me a month ago.
22:39danneuthen i rage-revert my emacs.d
22:40arrdemyeah not gonna lie I've had days when cider just fucking broke
22:40justin_smith_gizmo385: this article from stuart sierra has a nice explanation of what we do in the clojure world instead of inheritance, and why we don't use it: http://www.ibm.com/developerworks/java/library/j-clojure-protocols/
22:40arrdemwhich is OK, because I'm only a student and I'm not reliant on cider to do work to get paid
22:40arrdembut it's not exactly comforting either
22:40arrdemhowever, #clojure-emacs is that way, and feel free to bitch at bbatsov when shit breaks :D
22:41arrdem'cause I sure will
22:41TravisDlol
22:41danneuyeah. wake up early on a saturday. ready to kill a sideproject idea youve had for a while. nope, looks like it's gonna be an .emacs.d day
22:41TravisDmaybe I’ll stick to clojure-mode for now
22:41_gizmo385Awesome, thanks justin_smith :)
22:41arrdemTravisD: I'm serious that I think the stability issues of cider are overstated for the most part
22:41danneuTravisD: i think there are just two things you need to figure out how to do to write clojure: 1) manage parens, and 2) eval stuff in your editor (nrepl.el)
22:42TravisDIs evaulating in the editor really necessary?
22:42arrdemno but it's hella nice
22:42justin_smith_gizmo385: the one extra thing that I would add to that article is that he focuses on protocols, and those are good for high performance, but multimethods are less brittle in interactive development (you can redefine them in your repl without things just breaking, unlike protocols)
22:42TravisDWith other languages I often just keep a repl running and reload my files whenever I make changes to test
22:42danneuTravisD: well, my clojure workflow is to fake my way through a function while spamming "eval-buffer" til it works
22:43TravisDdanneu: Lol
22:43TravisDA sensible strategy
22:43arrdemdanneu: yep. same strategy here.
22:43danneuif im fancy i'll throw a bunch of `assert`s at the bottom to test said function
22:43danneuuntil there are no errors
22:43justin_smith_gizmo385: and starting with a multimethod that dispatches on 'type', then upgrading to a protocol if performance is an issue is not difficult
22:43arrdemTravisD: it's nice to have a keybinding for "reload this shit" instead of having to do it manually at a prompt
22:43TravisDYeah, that is a nice thing
22:44TravisDbut it’s also kind of annoying not to have readline :(
22:44arrdemreadline?
22:44arrdemyou totally get a standalone repl buffer..
22:44_gizmo385Awesome :)
22:44_gizmo385The multimethods might look like they solve my problem as well
22:44justin_smithTravisD: with other languages the startup time is such that it's no big deal to just kill it and restart with the new code :)
22:44TravisDBut all my readline shortcuts don’t work :) Like ctrl + R to reverse search through my command history
22:45danneuisn't there a way to use rlwrap
22:45TravisDAh, I’ve been using julia which actually has nontrivial startup time :(
22:45arrdemTravisD: oh. Yeah that is inconvenient.
22:45TravisDdanneu: In the emacs repl buffer?
22:45arrdemdanneu: yeah. `lein repl` uses rlwrap
22:45arrdemIIRC
22:45TravisDarrdem: that sounds right
22:45justin_smith_gizmo385: the big picture idea is you could define a multimethod for each method you would have defined in your base class in the java design, then make records that each get the appropriate defmethod for each one they implement
22:46arrdemit's that java -jar clojure.jar doesn't that drives ppl nuts
22:46justin_smitharrdem: iirc at this point lein uses a java readline wrapper, but yeah, it gets the right behavior
22:46danneuTravisD: oh. in an emacs buffer i use stuff like line autocomplete.
22:47TravisDdanneu: Yeah, there are probably good options in the buffer
22:47arrdemdanneu: what do you use? nrepl? cider's autocomplete is sketch as hell for me.
22:47TravisDI’m just not used to it :(
22:47_gizmo385How would such a record work? How would I call a specific defmethod from inside a record?
22:47_gizmo385Or would I just have to set up the dispatching correctly so that it works automatically
22:47justin_smith_gizmo385: it's different
22:47justin_smith_gizmo385: in java land, of course, methods belong to a class
22:47justin_smithin clojure land, functions and multimethods are first class
22:48danneuarrdem: id need to open it to jog my memory since it's all muscle mem by now. but one thing i use is C-x C-l from evil-mode to cycle through line completion candidates like in vim
22:48justin_smiththey are not owned by some object or class (though they live in a namespace)
22:49_gizmo385So when I define a record and implement an interface, how are those function definitions being handled?
22:49justin_smith_gizmo385: so the idea is that you have a generic functionality you define (think along the lines of an interface in java), and then you use defmethod to extend that functionality to a specific datatype
22:49justin_smithyou define the record, and then use defmethod to extend the multimethod onto that type
22:50justin_smithor you extend a protocol inside the record definition, as another option (as I mentioned, performs better, less flexible for interactive development)
22:50_gizmo385So instead of "extending types" you more so expand your function definitions to handle those new types?
22:50justin_smithright
22:51justin_smithand it's more general than that - a multimethod can dispatch on any function, not just type
22:51justin_smithbut type of the first argument is the common case
22:52_gizmo385Awesome
22:52justin_smith_gizmo385: and I think that article I linked does a decent job of explaining why we do it that way, rather than via inheritance
22:53_gizmo385Fantastic. I've tinkered with functional programming before but I've never really dove into the paradigm so it's a bit strange to wrap my head around
22:53justin_smith_gizmo385: the other part of this, is that with a protocol or multimethod you can actually extend a built in type onto your method / protocol
22:54justin_smith_gizmo385: one of my favorite quotes on that subject is the one from Perlis: "It is better to have 100 functions operate on one data structure than 10 functions that operate on 10 data structures"
22:54_gizmo385Isn't that one on the Wiki as well haha?
22:54justin_smith_gizmo385: it's a popular quote
22:55justin_smithbut that's part of the rationale for why we allow and encourage attaching a new multimethod / protocol to an existing datatype
22:56justin_smithand sicne we are not mutating anything, this has slim to none risk of breaking invariants in existing code
22:57_gizmo385The convention that I've been following in my code thus far is that whenever I have a function that operates on the structure of a data type, I always return a new instance of that type. Is that the correct thing to do?
22:58justin_smith_gizmo385: the built in data types do not mutate, any "modification" is really creating a new immutible instance
22:58justin_smiththis includes any defrecord you create, and the default for deftype as well
22:58justin_smithunless you go out of your way to use underlying mutable classes via interop, you don't need to do defensive copying, it's built in
22:59justin_smith,(def a [0])
22:59clojurebot#'sandbox/a
22:59justin_smith,(def b (conj a 1))
22:59clojurebot#'sandbox/b
22:59justin_smith,b
22:59clojurebot[0 1]
22:59justin_smith,a
22:59clojurebot[0]
22:59justin_smithconj does not change the vector, but makes a new one (that is allowed to share structure, since we know it won't be mutated)
23:00_gizmo385Awesome, thanks :)
23:01justin_smith_gizmo385: I am sure if you have significant OO experience this all seems like bizarro world
23:01justin_smithbut there are real benefits that you'll hopefully see pretty early on
23:03_gizmo385I'm starting to see the advantages. A lot of the functions that I'm writing are a lot easier to express and the type system makes things a lot more easy than it is in standard OO languages
23:04justin_smithif nothing else the fact that defensive copying is something you need to explicitly opt out of simplifies so much code...
23:04justin_smithor effectively defensively copying, at least
23:05justin_smithbut the type thing - clojure is more likely to get a runtime type error than many languages, so that part is double edged
23:05justin_smithand we have various approaches for mitigating it (core.typed, prasmatic/schema)
23:08TEttingeror my favorite approach, writing all code yourself so no one can yell at you for breaking something
23:08TEttinger(but I've heard good things about core.typed)
23:09justin_smithTEttinger: how have you achieved this blessed status of not yelling at yourself when you break your own shit?
23:12TEttingerjustin_smith: you know that article, The Bipolar Lisp Programmer? when a bipolar person's various mental currents are all flowing the right way, we can get plenty done.
23:12justin_smith:)
23:13danneui've ported haskell's type system into the comments of my clojure projects
23:13danneujust havent ported the type checker
23:13TEttingerand my 133 day streak agrees with me https://github.com/tommyettinger
23:13justin_smithoh, very nice
23:13justin_smithkeep up the good work, hope you don't crash
23:13TravisDyowzah
23:13TEttingerwhat have you been working on lately, justin_smith, other than your massive karma score here?
23:14arrdemgrowing his karma score :P
23:14justin_smithI am theoretically working on a client site right now in the window next to this one. Cleaning up an article link preprocessor, maintinance work.
23:15justin_smithI also do harsh noise, I've been doing more recording than usual lately
23:15TravisDharsh noise?
23:15justin_smithTravisD: like industrial music without the musical parts - most people hate it
23:15TravisDcool lol
23:16TravisDhave an example?
23:17justin_smiththis is a guy I knew ages ago, I saw a concert of his recently https://www.youtube.com/watch?v=ba1oxuIIY1I start with the volume low and slowly ease it up
23:17justin_smithlike I said, most people hate it, and I can't make any excuses, it's just a weird acquired taste
23:18TravisDPretty interesting actually :) Do you use it as background noice while working or something?
23:19TEttingernon-harsh non-noise https://www.youtube.com/watch?v=hZcyu5bAi8w&amp;feature=youtu.be&amp;t=1s
23:19justin_smithTravisD: sometimes - or as a catharting thing to crank up and listen to. I enjoy making it.
23:19justin_smithTEttinger: heh
23:20TravisDjustin_smith: Cool. How big is the community, roughly?
23:20justin_smithTEttinger: the roots of harsh noise are actually pretty strongly in prog / free jazz / 20th century "classical"
23:20TEttingerthat's a surprisingly modern-sounding album that I'd never heard of from 1971.
23:21justin_smithTravisD: in a major metropolitan area, you can see an internationally renowned artist that gets positive reviews in pitchfork, that was well publicised, and expect less than 100 people to show up
23:22TEttingerjustin_smith: in the not-too-distant future, music will all be dubstep drops all the time, and genres will be based on how much of pitbull's voice is sampled on top of it
23:22justin_smithTravisD: it was briefly more popular in the late '90s / early '00 years and you could see maybe twice the crowd
23:22justin_smithTEttinger: heh
23:24justin_smithTEttinger: anyway, back to the question - programming, answering questions on irc and SO, making noise, re-reading Samuel Beckett's three novels trilogy
23:24TEttingerso, what are some clojure libraries that people are finding useful for productivity in general? I'm unfortunately unable to use core.async on this next project because the code flow is handled by Java (libgdx's Application stuff makes porting easier to android though)
23:25justin_smithTEttinger: marginalia has helped me a lot, it's a nice way to browse my codebase
23:25TEttingeris prismatic still churning out nice libs?
23:26justin_smithas far as I know, I keep intending to try schema - maybe I'll pull it in right now actually it may just help...