#clojure logs

2014-01-16

00:10ddellacostaFor those of you writing applications backed by a relational database, how do you find yourself organizing your namespaces with regards to the database mapping? Do you have namespaces which map to entities, like "my-namespace.thing1" and those which map to relations, like "my-namespace.thing1-to-thing2" (a.k.a one-to-many or whatnot)? Right now we have an overly simplistic mapping of namespaces to entities, and the relations tend t
00:10ddellacostaget put in one or the other, and it's not optimal.
00:11bitemyappddellacosta: generally end up with a flat models
00:11ddellacostabitemyapp: what do you mean by a "flat model?"
00:12ddellacostabitemyapp: you mean that you essentially don't normalize the db?
00:12Tolstoyddellacosta: as one data point, I have a namespace called "data" with functions like "users" or "accounts" or "things": (data/users) or (data/users-by-id db id) and so on.
00:13ddellacostaTolstoy: yeah, that's more or less what we have now, and it's not working out. :-(
00:13Tolstoyddellacosta: Too many different kinds of entities in the DB?
00:14ddellacostabitemyapp: if I'm understanding you correctly, and you mean something like this: http://en.wikipedia.org/wiki/Database_model#Flat_model, then I'm afraid we are too far gone for that...I'm trying to figure out how to map our current schema to a good namespace structure as we're stuck with it for now.
00:14ddellacostaTolstoy: there's not too many, I don't think--it's a relatively small number of entities in fact. It's just that, even at this size, the relationships are complex, and it's not always clear where to put stuff that joins multiple tables.
00:15Tolstoyddellacosta: Ah, right. What makes sense when you put something in a namespace doesn't seem to make sense when you're looking for something: the old filing vs lookup prob?
00:16ddellacostaTolstoy: yeah, although in our case it feels like filing and lookup are both a problem! In the end, it also makes it harder to reason about the overall complexity of the system.
00:17Tolstoyddellacosta: One of the presenters at Clojure West suggested using a "homeless" namespace for stuff you're not sure about until things shake out. Probably not what you need, but I loved that idea.
00:18ddellacostaTolstoy: yeah, I mean, I should probably just start by going with my initial idea, which is to build out some relationship-based namespaces (thing1-thing2) and see how well that works. As it is, I'm a bit stuck.
00:18TolstoySomething like: db/users db/servers db/whatever?
00:19TolstoyThen db/users/get-by-id db/users/get-by-name? That sort of thing?
00:19Tolstoydb/users/get-accounts-by-user
00:19Tolstoydb/accounts/get-users-by-account. ;)
00:19ddellacostaTolstoy: well, more like, db/users and db/user-documents and db/documents
00:19TolstoyOy.
00:19ddellacostaTolstoy: yes, you are describing the problem exactly. :-)
00:20TolstoyCould you go by the main limiter you're looking for?
00:20TolstoyIf you want to find all the documents for a user, that's user focussed.
00:21TolstoyAll the users a document is associated with, thats document focussed?
00:21TolstoyYeah, tough. Hm. Your suggestion is at least clear.
00:22TolstoyPITA if you change the schemas, though.
00:22ddellacostaTolstoy: I started with that--the problem is that if you want all of Dave's widgets, and that has a fair amount of qualifications on the widgets, you have a ton of logic for which kind of widget you want in your user namespace (for example).
00:23ddellacostaTolstoy: yeah, I'm not too worried about massive schema changes, not at this point.
00:23Tolstoyddellacosta: I work on a non-Clojure app at work with similar issues. Only that db is actually an object-database mapped onto an RDBMS.
00:23TolstoyNot foreign keys.
00:24TolstoyEverything is hooked together via Object Identifiers.
00:24TolstoyIn other words, it's not going to change because no one understands it anymore.
00:24ddellacostaTolstoy: woah, that sounds like a pain...haha
00:25dsrxi like that, code changes start quickly and then peter out as fewer and fewer people really understand it
00:25dsrxuntil it reaches a critical point where nobody can understand it anymore, and then change stops
00:25dsrxthen, if it's a front end web project somebody rewrites it in the latest framework and the process repeats.
00:26Tolstoydsrx: Yep. Meanwhile, you're STILL lectured about business "realities" when you ask to spend time addressing the problem.
00:26ddellacostadsrx: I try to avoid that by always identifying the parts of the codebase I don't understand and reading through them. If I can make the case that they are not well structured enough, then they become a target for re-factoring. Testing helps make that less painful. But it's easy when the codebase is smaller.
00:26Tolstoydsrx: it's like geology. "Ah, here's the iridium layer. After that, nothing."
00:27Tolstoydsrx: The app I've worked with is about 13 years old: you see all the Java fashions merged together.
00:27dsrxTolstoy: mercy
00:27Tolstoydsrx: Including using old m_instanceVar naming schemes and so on.
00:28Tolstoydsrx: And RMI! And XSLT! And SOAP! Those poor guys seem to have incorporated tech during the five minutes when it seemed like a good idea.
00:29dsrxfor about a year I worked in a university lab doing computational science. working with a fortran codebase started in the late 70s is a treat
00:31dsrxnice to see this sentence in the documentation: "All new code should be written in FORTRAN77." :)
00:31dsrxit was originally written in some compile-to-fortran language that included useful control structures like "while" and "when-else"
00:31TolstoyHard to believe Lisp and Fortran are contemporaries, eh?
00:32ddellacostaI don't even know what Fortran looks like
00:34bbloomddellacosta: http://en.wikipedia.org/wiki/File:4_train.jpg
00:35ddellacostabbloom: huh, I guess it must be pretty fast
00:35dobry-denHow would you go about spinning up a new JVM while serving requests on old JVM, and the swapping them?
00:35dsrxthe most memorable feature is its formatting rules. the first 5 or 6 columns or so are reserved for things like marking a comment, marking a line continuation (lines can be no longer than 66 columns), statement labels
00:35bbloomdobry-den: HTTP requests? use your load balancer :-)
00:36Tolstoydsrx: Didn't there used to be special paper you could write programs on ... before the "keypunch operator" make cards?
00:37Tolstoyhttp://upload.wikimedia.org/wikipedia/commons/thumb/1/18/FortranCodingForm.png/800px-FortranCodingForm.png
00:40dsrxTolstoy: haha, I'm fortunate to not have had to know about that at least
00:40rplacathat's why 72 and 80 columns are still magic numbers
00:42dsrxthe original 80-column punch card was made that way so it'd be the same size as a dollar bill at the time
00:43dsrxso the census cards could be transported in treasury dept. containers
00:49Tolstoywow
00:56technomancyman, I thought the @clojuremarkov spammers had given up, but it turns out they were just on vacation
00:58rplacatechnomancy: I hadn't seen that before. It's kind of awesome
00:59peterdon /quit
01:00andyftechnomancy: Ever find out what is going on there?
01:00technomancyit is ... a mystery
01:00rplacaI think it's a way to inflate follower counts
01:01technomancyyeah I need to do some science on the full network
01:01rplacaby having accounts that have tweets associated with them that can then follow others
01:01rplacaclojure is just a word in their dictionary that pops up from time to time
01:02technomancyoften in connection to india and outsourcing, oddly enough
01:02technomancywhich makes me curious about their source text
01:02rplacaso the goal is to have tweets that won't be detectable as fraudulant by the bots that try to detect that sort of thing
01:03technomancyjokes on them; I'm totally detecting them
01:03technomancyI'm not a bot though; I just think it's hilarious
01:03rplacaI assume they read from the firehose and put the words together in "likely" but original ways
01:03rplacatechnomancy: they don't care if you detect them, they just need to live for long enough to inflate the follower counts
01:04technomancyoh
01:04rplacacelebrities, brands etc. pay for followers
01:04technomancywell if I reported them it would kind of ruin my twitter account, so that's no good
01:04rplacathis way a service can show the customer that their follower count went up by 10k because of the promotion they did
01:05andyfhow would it ruin your twitter account by reporting them?
01:05rplacathey also need to follow others - you can't have a whole bunch of accounts that are only following one person/brand
01:05abaranoskysup foos?
01:06rplacatalking about markov twitter follower bots
01:06technomancyandyf: well if all my retweets disappeared
01:07technomancyrplaca: it is the most likely explanation
01:09rplacaalexis madrigal wrote a good article about it here: http://www.theatlantic.com/technology/archive/2013/11/why-did-9-000-porny-spambots-descend-on-this-san-diego-high-schooler/281773/
01:58testclo
01:58testclo(defrecord Alert [id amount unit])
01:58testclo(def alerts (map (fn[x] (Alert. x (* 2 x) (* 3 x))) (range 1000000)))
01:58testclo(count alerts) ==> I found every time I run this, the memory usage (show in jconsole) will bump up ,why? I expected when I first run it, memory usage should bump up as "alerts" is an lazy seq, but when run it more, it shouldn't use more memory,right? I run the command in "lein repl", hope it's not a problem for "lein repl"
02:03andyftraversing sequences often requires allocating memory to allocate objects for return values of seq and next.
02:03andyfI am not sure if that is what is happening in this case, but it could be.
02:05andyfSuch new allocated memory would become garbage after the call to count returned, but the next garbage collection will likely not be triggered until you approach the max heap size configured for your JVM
02:09testcloIf I want to use the lazy seq again and again, will a non lazy counterpart helps for performance ? Ad how to convert lazy one to non-lazy one?
02:12andyfI haven't done performance measurements comparing different kinds of things that implement seq for speed. You can convert it to a vector with vec
02:13allenj12hey, i wanted to get into web dev with clojure/clojurescript is there any good tutorials or books to start?
02:15andyfI only know of one book in that area, discussing server side web dev. Web Development in Clojure http://pragprog.com/book/dswdcloj/web-development-with-clojure
02:16andyfClojureScript only has one relatively short book out on it now, AFAIK, by Stuart Sierra. I don't have any on-line resources to recommend, not because they don't exist, but because I haven't looked.
02:17allenj12andyf: cool! ill check out both of those. ill keep looking for online resources to then ty.
02:17noidid
02:18quizdrI can't make heads or tales out of the difference between = and == can anyone assist with a concise explanation?
02:18noidiis there really no (comp first filter) in the standard library?
02:18noidiI seem to need that much more often than `some`
02:19allenj12andyf: is this the book you were talking about?
02:19allenj12andyf: http://shop.oreilly.com/product/0636920025139.do?sortby=publicationDate
02:19andyfallenj12: I do recall Mimmo Cosenza announcing a ClojureScript tutorial he wrote and publishes for free: https://github.com/magomimmo/modern-cljs
02:20andyfallenj12: yes, that is the one I have heard of. I haven't read it myself.
02:21quizdrhopefully that book has a lot more meat than the first book they wrote together for Apress
02:24allenj12andyf: o wow seems like a great resource ty. ill prolly go through that and buy one of the books
02:24andyfallenj12: You are welcome, but thank Mimmo more :)
02:24allenj12andyf: haha ok :)
02:38testcloIf I want to use the lazy seq again and again, will a non lazy counterpart helps for performance ? Ad how to convert lazy one to non-lazy one?
02:39SegFaultAXtestclo: Lazy seqs will memoize everything that is realized.
02:40fredyrquizdr: http://books.google.se/books?id=I8KdEKceCHAC&lpg=PA434&ots=wNmTT7Vba4&dq=clojure%20equality%20semantics&hl=sv&pg=PA434#v=onepage&q=clojure%20equality%20semantics&f=false
02:40fredyrouch what a link
02:49quizdrfredyr thanks
02:51fredyrsure
02:52testcloagent should return immeidately,since it's aync, but why the define of a on an agent took some time
02:52testclo(defrecord Alert [id amount unit])
02:52testclo(def alerts (map (fn[x] (Alert. x (* 2 x) (* 3 x))) (range 1000000)))
02:52testclo(def a (agent (zipmap (map #(.id %1) alerts) (repeat []))))
02:52testclothe last line took some time to run
02:58broquaintBecause the value has to be calculated first.
02:59andyftestclo: zipmap is eager, not lazy
03:05TEttingerthere's no lazy hashmap, just lazy seqs is why, right? that's why zipmap is eager?
03:08testcloI want to let the long calcuation be done in another thread, doing something in current thread, then use that value, agent can't do that? need to use promis?
03:09andyfBuilt-in, Clojure has no lazy set, maps, nor vectors
03:10andyfI seem to recall hearing about people devising such things, but I haven't looked into them.
03:13quizdrcan anyone tell me how this little function works? (#(identity %&) 1 "blarg" :yip)
03:13quizdridentity cannot take more than one argument, but there is a rest in there
03:14quizdrthis should equate to (identity 1 "blare" :yip) right?
03:14fredyrtestclo: a future seems appropriate
03:17TEttingerquizdr, %& is actually a single item, a seq
03:18quizdroh, it groups everything together, i see
03:18TEttingerexactly
03:19quizdrthis language is quite interesting. i don't know Scheme, but I know a fair amount of Common Lisp, and Clojure is what I'd kinda assumed Scheme must be like in many ways, with its streamlined structure
03:20quizdrseems really elegant, a lot more than common lisp
04:01jjl`_quizdr: clojure is closer to scheme, but they're quite different languages. scheme relies heavily on mutable data structures, has the dotted pair type and has a lot less syntax (no [] {} #{} #"" #())
04:02jjl`_i'm not sure on RH's argument that having syntax for more datatypes makes things MORE homoiconic. I tend towards the opposite
04:03quizdri got rather used to the parenthesis in lisp and didn't really find it intrusive.
04:03jjl`_heh. i've been writing lisp for years and it still bugs me sometimes
04:03quizdri would think you could just have a generic list datatype that if you structured it like a map, you could use map features. but i'm sure they have good reasons for doing it the way they are.
04:04quizdrby separating the datatypes
04:05jjl`_i can think of several reasons not to do that. top of that list is performance
04:05jjl`_of course most lisps don't have maps and you use alists instead
04:06quizdrmy pleasure of working with a lisp-1 revealed itself quickly over common lisp
04:07quizdrand not having so many competing functions for similar tasks also helps, like all the equality stuff in CL
04:07quizdror those awful loop macros
04:07quizdrClojure seems a lot more simplified
04:08jjl`_CL is about the most complicated lisp you could find. I generally prefer lisp-1
04:09quizdrare Haskell's monads in some conceptual way similar to Clojure's atoms/refs/agents?
04:09jjl`_not at all
04:10quizdrbut they are the way state/impurity is handled, just like the counterparts in Clojure
04:10jjl`_haskell does have STM support
04:10quizdri'm referring to matters of state, not concurrency
04:10jjl`_you're mixing concepts here
04:11jjl`_monads are effectively a hack to force sequencing (not that most avid haskellers would put it that way)
04:11quizdrin clojure when you want to handle impure state that can change, you work with it via agents/atoms/refs, while in haskell you can only work with state via a monad. hence my comparison
04:11jjl`_not exactly
04:12quizdroh that's fine, i've never used Haskell nor am I likely to, just curious
04:12jjl`_that do notation makes it look like you're mutating state, but you're not. the only piece of state that gets mutated is the RealWorld (haskell models "the real world" as a piece of data to keep the illusion of purity alive)
04:13jjl`_so everything just threads through purely
04:13jjl`_i'd be happy to explain to you in private if you'd like, but this isn't really the channel
04:15quizdrno that's alright, tanks
04:17jjl`_in any case, the reason monads were introduced was to fix a problem. they're a useful abstraction that isn't *required* in clojure (clojure is strictly evaluated). You can use them though. There are several monad libraries. They're quite a good abstraction in some cases
04:18TEttingergahhhhhh... does anyone use ztellman's primitive-math lib?
04:19TEttingerI have no idea if I'm using it right, but I'm getting a massive amount of warnings
04:19quizdri just saw this code in something, and am wondering what is meaningful about that zero in there: (reduce + 0 (map :size sym-parts))
04:19TEttingerit's the initial value, quizdr
04:19quizdrI know, but why would that matter in this case?
04:19quizdranything plus 0 is the same thing
04:19TEttingerwhich is 0 for + anyway, correct
04:19quizdrleaving out that zero would have no effect on the value of the expression, right
04:20TEttingerI believe so. it may have been to make it explicit
04:20jjl`_it means you always get a result. what should the return of reduce be if there are no items in the list?
04:20TEttingerah
04:20quizdrnow that's interesting
04:20TEttinger,(reduce + [])
04:20clojurebot0
04:20quizdr,(range 0
04:20clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
04:20quizdr,(range 0)
04:20clojurebot()
04:20TEttingeryou always do anyway, because + defaults to 0 when called with no args
04:20quizdr,(reduce + (range 0))
04:20TEttinger,(+)
04:20clojurebot0
04:20clojurebot0
04:21quizdri feel you
04:21TEttinger,(*) ; defaults to its identity value or whatever it is, 1
04:21clojurebot1
04:21jjl`_reduce + is a bit silly. they probably wanted apply
04:22jjl`_TEttinger: it's called a 'monoid'
04:22TEttingerthe identity for + and 0?
04:22TEttingers/0/*
04:23jjl`_yes. the 'plus monois' has the identity 0
04:23quizdri have heard from common lisp people that reduce is preferable to apply when it is convenient
04:25chareI AM BACK
04:25chareno fear
04:26jjl`_quizdr: sounds like cargo culting to me
04:26quizdrwas that cemerick's site that discussed cargo culling recently?
04:29ddellacostaquizdr: referring to previous conversation...Haskell is cool, you should give it a shot. It's got a lot of amazing qualities, and really bends your mind, in a meaningful and useful way.
04:30quizdrddellacosta if I had time, i probably would. learning clojure effectively as a hobby is enough for me for now.
04:31quizdrI did pick up this book, 7 Languages in 7 Weeks, and Haskell (and Clojure) are two of the languages, so I'll get a bit of exposure to it
04:31ddellacostaquizdr: yah, I hear ya. There's always more to learn. Just wanted to give you a nudge when you suggested that you're unlikely to ever touch Haskell. ;-)
04:31quizdrbut i have heard that it can take a long time to get fluent in Haskell, and that the syntax is a challenge more than most languages
04:32chareHASKELL I LOVE YOU
04:32charequizdr LEARN HASKELL FIRST
04:32ddellacostaThe syntax is pretty simple. The concepts are tough--they are very abstract. But you can get going relatively quickly, especially if you have some Clojure or other lisp under your belt. The biggest challenge for me is wrapping my head around all the higher-level category theory concepts, and learning how to apply them effectively. But you can do a lot of cool stuff even before that point.
04:33fredyrmeh what up with all the haskell trolls
04:33fredyr:)
04:33ddellacostafredyr: ha, I know, I should go hang out in Haskell. ;-) I'm excited about both Haskell and Clojure though, so it's hard to contain.
04:33quizdr"category theory" in itself sounds like a daunting term
04:34ddellacostaquizdr: Like anything, unfamiliar things are daunting at first.
04:34quizdrHaskell is very popular here in Singapore. There is a Fuctional Programming meet up group that meets every month. Last month it was at Google's headquarter's here. But the group might as well be called "Haskell Singapore" as that is the only language they discuss.
04:35charethe problem with Haskell is that my friends get scared of the static type system it has
04:36ddellacostaOh, that's too bad. I think Clojure is quite a nice language and worth discussing. I've heard racket and erlang have great qualities too, but haven't dug into either deeply yet.
04:36ddellacostaand of course there are many other functional languages out there worth talking about.
04:36quizdrerlang is also in this "7 Languages" book
04:37chareerlang is the only language I know of where out of the box the virtual machines running on different machines know about each other.
04:37ddellacostaalright, back to mucking about with clojure.tools.namespace...
04:37chareusually you gotta setup some rpc crap or something
04:46quizdrdoes anyone know where 4clojure is hosted, or what kind of host environment is necessary to host something like that?
04:48TEttinger(if (and (< ^long (quot i ^long wide) ^long (dec ^long high)) (> ^long (mod i ^long wide) 0)) (and (not= (aget ^doubles dd (dec (+ i ^long wide))) ^double dark) (= (aget ^doubles dd ^long (dec ^long (+ i ^long wide))) ^double wall)) false)
04:48TEttingersomeone, anyone
04:48TEttingerplease tell me this isn't needed
04:48broquaintquizdr: You might have better luck on the #4clojure channel, although I think the maintainers won't be online for a bit.
04:49TEttingerI can't do a primitive type hint on a def, only at the call site (terminology right?)
04:49TEttingerso every time i use the def'd numbers (numbers!) it needs a type hint to avoid a reflective call
04:50quizdrbroquaint thanks
04:51quizdrTEttinger wow
04:51quizdrcan't imaging that is necessary but i am also stumped
04:51TEttingerquizdr, I must be doing something stupid
04:53quizdras an IRC newbie, how does one "lock in" a nick, or is it up for grabs when you leave the room?
04:53metellusquizdr: /msg nickserv help
04:54metellusyou can register your nick
04:55quizdrmetellus thank you!
04:56TEttingerquizdr, indeed I was
04:56TEttingerI can def them as (int 33) or whatever
04:57quizdrso when you said you cannot do a primitive type hint on a def, actually you can?
04:57testclohow to check whether an agent compeleted the action without blocking?
04:58voldymananyone using clojure on ubuntu?
04:58voldymanhow did you upgrade to 1.5.1? the repo only has 1.4.0
04:59fredyrvoldyman: leiningen?
05:00voldymanfredyr: using leinigen? (i use the latest leiningen from the website)
05:01voldymani can use the latest version in projects but repl from command line is 1.4.0
05:02voldymanso lighttable can't find 1.5.1 which it needs to function
05:03fredyrah okay, idk how lighttable does
05:04TEttingerquizdr, it isn't actually a type hint I'm doing now. type hints are metadata, this is some kind of different function call
05:04TEttingerat least I think type hints are meta
05:06arcatanyeah, they are
05:10quizdranyone recommend a good user or two worth following on 4clojure?
05:10instilledhi. is anyone using bbatsov's excellent projectile? I'm wondering how to access the current project root from elisp code. anyone knows?
05:14TEttingerok, in two files using ztellman's primitive-math, i get so many warnings i can't even scroll back to read all of them.
05:14TEttingerthis is why my program is slow I imagine.
05:16instilledI've just found it. (projectile-project-root).
05:19noncomusing nrepl in my own project, i send *ns* for eval and then I do (response-values res) on the result, however the following error comes up: Could not read response value: #<Namespace user>, so why is that? how do I avoid such errors with nrepl?
05:19glosoliwhat are some good practises when translating text in Enlive templates ?
05:20quizdrcan anyone recommend how to get clojure autocompletion working inside a .clj file? I get it at the REPL but not in a source file.
05:20quizdroh, i'm talking about emacs
05:22glosoliquizdr: http://clojure-android.info/blog/2013/07/21/feature-auto-completion/ might help
05:24quizdrglosoli wow clojure on android, cool
05:24glosoliquizdr: this covers autocompletion as primary topic
06:05glosoliHow could one select all nodes in enlive and execute replace-vars on them?
06:21clgvis there some library function that retrieves all paths of keys from a nested map?
06:22clgv(f {:a {:x 1, :y 2}, :b {:z 3}}) => ([:a :x] [:a :y] [:b :z])
06:24quizdrclgv good question indeed
06:24CookedGryphonclgv: to arbitrary levels of nesting?
06:26clgvyes, arbitrary levels but you can assume that the recursion fits on the stack
06:27clgvI'd like to just use such a function for analysis. but if need be I'll write it from scratch
06:32CookedGryphonclgv: I feel like it should be possible with tree-seq
06:33clgvCookedGryphon: you can get all keys with tree-seq but not construct the paths
06:38katoxwhat is the best way to print #inst into str? SimpleDateFormat?
06:39CookedGryphonwell the #inst representation is standard edn, unambiguous and supported by both the reader and pr-str by default, what's wrong with just leaving it as that?
06:46glosolihow one could do recursive replace-vars in enlive?
06:47CookedGryphonugh, why does tap take a chan rather than just returning a new one?
06:49CookedGryphonit should be optional at least
07:07poglesbyg_Hi all, I'm working on clojure koans and have gotten to destructuring and I'm stuck now.
07:07poglesbyg_what should i do here:
07:07poglesbyg_ (= (str "First comes love, "
07:07poglesbyg_ "then comes marriage, "
07:07poglesbyg_ "then comes Clojure with the baby carriage")
07:07poglesbyg_ ((fn [[a b c]] __)
07:07poglesbyg_ ["love" "marriage" "Clojure"]))
07:08poglesbyg_sorry that was ugly
07:08poglesbyg_http://pastebin.com/Dkac7XF4
07:12gfrederickspoglesbyg_: you should take a, b, and c and make them look like the string given
07:12pyrtsapoglesbyg_: Define the body of a function that receives as its single argument a vector of 3 elements.
07:17poglesbyg_that makes sense. thanks gfredericks
07:21edbondCan I use clojurescript macros (in clean clj) to read settings from yaml file? I don't see yaml cljs lib.
07:23edbondI need to convert yaml to map on cljs compilation stage
07:34wei__anyone know how to write a honeysql clause to use Postgres' json operator in a query? json_column->>'json_attribute'
07:34wei__as in this example http://stackoverflow.com/questions/10560394/how-do-i-query-using-fields-inside-the-new-postgresql-json-datatype
07:37john2xcan I use a 'binding' var defined in a macro, in the body of that macro's usage? (i hope that made sense)
07:38CookedGryphonif I understand you correctly, yes use ~ to unquote it
07:38CookedGryphonpastebin what you're trynig to write?
07:42clgv john2x: post a gist with an example how you'd call the macro and to what it should expand
07:43clgvelementary rules for asking questions about how to write a specific macro ^^
07:43john2xah, here: https://www.refheap.com/24133 (I got the macro from here http://en.wikibooks.org/wiki/Learning_Clojure/Macros)
07:43edbondwei__, did you try (where [:= "json_col->json_attr" :?baz])
07:45CookedGryphonjohn2x: that looks like it should work, what's the issue?
07:45clgvjohn2x: oh that's error prone. the call to close should be in a finally block
07:46CookedGryphoncould you actually use with-open with a custom close?
07:46john2xCookedGryphon: I'm getting "Unable to resolve var: my.ns/*conn* in this context"
07:46john2xclgv: ah right, i'll fix that.
07:47CookedGryphonoh, so you want to use *conn* from the namespace in which the macro is defined rather than my.ns?
07:47CookedGryphontry just fully resolving it
07:47clgvCookedGryphon: with-open assumes a certain interface - was it Closable?
07:47CookedGryphonclgv: yeah, something like that
07:47john2xCookedGryphon: ah yes, the macro and the function are in differnet namespaces
07:47wei__edbond: I did try it, but I the resulting sql statement looked something like ["SELECT * FROM tbl INNER JOIN account ON ? = account.id" "tbl.details_json->account_id"]
07:47clgvjohn2x: you need a dynamic var in that namespace, e.g. (def ^:dynamic *conn*)
07:48edbondwei__, can you post code to refheap?
07:48wei__sure
07:48clgvjohn2x: in the namespace of the macro definition
07:49john2xclgv: ah ok. and I need to require the *conn* in addition to the macro in the other namespace right?
07:49john2xah it compiled now :)
07:50clgvjohn2x: no you dont need that. the syntax quote resolves *conn* and uses it fully qualified
07:52wei__edbond: https://www.refheap.com/24135 ty
07:52john2xclgv: hmm when I remove *conn* from the require in the other namespace, it can't find *conn* again.. I've updated the paste https://www.refheap.com/24133
07:53edbondwei__, error says you compare char with integer. Can you check type of join columns?
07:54edbondwei__, I suppose json results in string ids "42" while account.id is integer 42
07:54clgvjohn2x: that has to work this way. maybe restart the repl
07:55wei__perhaps, but in my GUI (navicat) the id appears to be a integer inside the json field
07:55wei__gonna try an explicit cast
07:55clgvjohn2x: macros would be unusable if you needed to know their implementation to require the used variables manually ;)
07:55clgvs/require/refer/
07:56clgvjohn2x: oh now I see where it is missing. you explicitely use *conn* in the rdb/run call.
07:57john2xclgv: yes :) should it be moved into the macro definition?
07:57clgvjohn2x: so you have the desire to hide *conn* and to see *conn* - bad structured that way
07:58john2xhmm right.. I guess there's no point not doing rdb/run when using with-connection anyway
07:58edbondwei__, try :tbl.details->>account_id, it's valid
07:59clgvjohn2x: I guess rdb/run should use *conn* internally and not as parameter if it is needed tofit into the macro body
07:59clgvjohn2x: but be careful not to create a frankenstein macro incrementally ;)
07:59edbondwei__, nope, sorry. "-" converted to "_"
08:02edbondwei__, seems to work when I use sql/raw inside join: (sql/raw "tbl.details->>account_id = account.id")
08:03john2xclgv: until the revise team include a with- macro, i'll keep playing with my scissors :P
08:03john2xyeah I'll just move the rdb/run call into the macro definition..
08:21quizdrwhen working at the REPL is it possible to do a carriage return without causing evaluation on the entire expression you are editing at the REPL prompt
08:25amalloyquizdr: just a plain command-line repl? newline evaluates the expression if it's "done", and otherwise keeps reading till the last )
08:30matt444With :keys destructor, can you also keep a reference to the destructed data?
08:30amalloymatt444: (let [{:keys [x] :as m} {:x 1}] (list x m))
08:31noncomis anyone famiiar with nrepl here?
08:31matt444amalloy: yay! thanks
08:32quizdramalloy I'm using REPL in emacs cider; just wondering if it makes sense to continously edit and manipulate functions at the REPL, where you'd have to insert lines, etc
08:32amalloyshift-RET
08:32amalloyor...wait, no
08:32amalloythat's the opposite of what you want. C-j inserts a newline
08:33amalloypersonally i'd rather edit stuff in my .clj file and just C-M-x it over to the repl, but editing it in the repl is not an unreasonable style
08:35quizdramalloy ah C-j is exactly what I needed
08:36fredyrum, isn't there a way to use range to generate the inf seq of 0,0.1,0.2...?
08:37amalloy(map #(* 0.1 %) (range)) is what i would do, but if you were really excited about doing it without map...well, i'd worry about rounding errors then
08:38amalloy&(take 100 (range 0 Double/POSITIVE_INFINITY 0.1))
08:38lazybot⇒ (0 0.1 0.2 0.30000000000000004 0.4 0.5 0.6 0.7 0.7999999999999999 0.8999999999999999 0.9999999999999999 1.0999999999999999 1.2 1.3 1.4000000000000001 1.5000000000000002 1.6000000000000003 1.7000000000000004 1.8000000000000005 1.9000000000000006 2.0000000000000004 2.1... https://www.refheap.com/24142
08:38fredyr:)
08:39fredyrit was just that i realized that the range arguments didn't allow for step without and end
08:40amalloyfor that, it's pretty easy to use iterate
08:40amalloy(iterate #(+ % 2) 0)
08:41fredyrah nice, that's more like it
08:41fredyrthanks
08:45wei__edbond: sorry stepped out for a bit. your sql/raw suggestion worked! though I still had to cast the expression to an integer with "CAST(… AS INT)"
08:45wei__(inc edbond)
08:45lazybot⇒ 1
08:45wei__(inc testh1231231)
08:45lazybot⇒ 1
08:45quizdrwhat is the difference betwen the lazybot and the clojure bot in here?
08:45edbondwei__, nice, thanks. Why do you need to cast? json doesn't recognize integers?
08:46wei__I'm not sure, but when I put the expression in the SELECT, as in (-> (s/select (sql/raw …))) it comes back as a string
08:47edbondwei__, same postgresql error about casting?
08:49wei__no, the error only happens if I use a join. i just wanted to see what type it was by returning the expression in a SELECT
08:49CookedGryphonOdlem13
08:49CookedGryphonwell that's embarrassing
08:50clgvquizdr: feature set and clojure version
08:50edbondwei__, from http://www.postgresql.org/docs/9.3/static/functions-json.html it seems ->> returns text, -> returns object. Maybe you should try that
08:50clgv,*clojure-version*
08:50hyPiRionquizdr: clojurebot and lazybot has different jail permissions, runs on different clojure versions, and is administered by different people
08:50clojurebot{:interim true, :major 1, :minor 6, :incremental 0, :qualifier "master"}
08:50clgv&*clojure-version*
08:50lazybot⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}
08:51clgv,(f 1)
08:51clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: f in this context, compiling:(NO_SOURCE_PATH:0:0)>
08:51clgv,(defn f [x] (inc x))
08:51clojurebot#'sandbox/f
08:51clgv,(f 1)
08:51clojurebot2
08:51clgv&(defn f [x] (inc x))
08:51lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
08:52wei__edbond: interesting. but that results in an error: operator does not exist: json = integer
08:55quizdr,(= (mod 10 6) (rem 10 6))
08:56clojurebottrue
08:56wei__apparently -> resolves to the form {:int4 1000}
08:56quizdrwhat is the difference between the mod and rem above?
08:56john2xhow do I reload a namespace I have in 'used in the repl?
08:57edbondwei__, yeah, some weird type 'json'. SELECT pg_typeof('{"a":1,"b":2}'::json->'b');
08:57clgv,(map #(= (mod %1 6) (rem %2 6)) (range -5 5))
08:57clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval143/fn--144>
08:57clgv,(map #(= (mod % 6) (rem % 6)) (range -5 5))
08:57clojurebot(false false false false false ...)
08:57clgv,(mapv #(= (mod % 6) (rem % 6)) (range -5 5))
08:57clojurebot[false false false false false ...]
08:57clgv,(mapv #(= (mod % 6) (rem % 6)) (range -2 2))
08:57clojurebot[false false true true]
08:58wei__although it the query result shows up as a numeric type in the repl
08:59quizdrclgv so the behavior varies only with negative numbers
08:59wei__the cast is acceptable for me.. it's just a bit hacky
09:00clgvquizdr: yes
09:00clgv,(mapv #(vector (mod % 6) (rem % 6)) (range -1 2))
09:00clojurebot[[5 -1] [0 0] [1 1]]
09:01edbondwei__, cast is used here too: http://clarkdave.net/2013/06/what-can-you-do-with-postgresql-and-json/
09:01fredyris there some significant difference between #([% (f %)]) and (fn [x] [x (f x)])? when i used it in a map the reader macro version fails but the other works
09:04fredyroh
09:04fredyrit expands a bit weird
09:05fredyr(fn* [p1__303#] ([p1__303# (f p1__303#)]))
09:05fredyr:S
09:05lumafiin the first one, you're calling the vector as a function
09:05stuartsierraRemember, #(%) expands to (fn [x] (x)) not (fn [x] x)
09:06fredyryeah i realize that now, but wasn't something i've encountered before
09:08fredyror rather, i have used it as a feature before w/o realized it
09:08fredyr:)
09:08clgvfredyr: you can simply use the vector function instead of writing the literal
09:09fredyrclgv: not really sure how you mean
09:09quizdrstuartsierra are you saying the % explands to (%) or only the entire expression
09:09stuartsierrathe entire expression
09:10stuartsierra#(blah) expands to (fn [] (blah)) not (fn [] blah)
09:10clgvfredyr: #(vector % (f %))
09:10quizdrright because normally blah would be a function call and thus require parenthesis
09:10fredyrclgv: ah
09:11noncomanyone familiar with nrepl
09:11clgvfredyr: that's usually the trick when you have a literal there ;)
09:11noncom?
09:12minnowhelp can someone help me to become illiterate?
09:13Gonzihminnow: what?
09:15minnowwhat i dont understand
09:28fredyrminnow: do you have a problem you want help with?
09:28minnowyes i wannt to become illiterate
09:29fredyrim sorry but it would seem that you are close
09:30minnowwhat i dont understand you foul moron!
09:31lockswhat's happening in here.
09:33minnowyou foolish cretin
09:35danneuWhat caching strategy comes ot mind with a forum that renders Markdown/BBCode to HTML on the fly?
09:37minnowurine and feces
09:37minnowdanneu you foul child rapist
09:38mdrogalisThis is a pretty interesting choice of channel to troll lol
09:38danneuoh man, indiana jokes over here
09:40minnowmy feces are pillaging your home
09:41locksmaybe it's the first IRC bot someone wrote in clojure
09:41quizdri am excited about having discovered the IRC command called "ignore" it is perfect for some of these guys
09:41pjstadig*sigh* who else is an op besides technomancy?
09:41kzarquizdr: Yea it makes the problem go away
09:41fredyrdanneu: you might want to see what kind of caching strats that discourse implement perhaps?
09:42quizdrdone. into the void
09:42locksfredyr: discourse renders client-side though
09:42fredyrlocks: oh good catch
09:43fredyrlocks: so client rendering is the strategy then :)
09:43locksI guess so! :P
09:44minnowfeces are edible and delicious
09:44minnowinnocent children deserve to be beaten to death
09:44nmeum
09:50AeroNotixWhat are the options with coverage reports? I'm using lein-cloverage now, but there are other tools I want to integrate with such as cobertura w/ jenkins
09:51arrdempjstadig: nobody routinely active
09:51arrdempjstadig: /ignore is your friend, and sadly ignoring trolls is more official chan policy than kicking them.
09:53mdrogalisFirst Clojure IRC troll bot.. lol
09:54minnowurine is delicious and healthy because its natural
09:54pjstadigi nominate myself as an additional op
09:54pjstadigignore is fine, but we should have ops around
09:54minnowyou foul horse rapist
09:54arrdemwink: that's actually one of the projects on my todo list...
09:54arrdempjstadig: I totally agree
09:55winknot everything from game servers is bad :P
09:55pjstadigif 51% of people in the channel have you on ignore you should get autokicked
09:55arrdempjstadig: if we're gonna give a bot kick power the kick constraint has to be pretty hard to game
09:56arrdempjstadig: the original idea was to use my and gtrak's cloutjure (community karma) project as the basis for this
09:56arrdempjstadig: because a simple voting majority would be vulnerable to a chan invasion.
09:56CookedGryphonor 66% of the users who've posted a message in the last x minutes (in case you have a lot of people afk)
09:56arrdemCookedGryphon: even more invasion vulnerable
09:57CookedGryphonarrdem: true
09:57CookedGryphonarrdem: perhaps you need to have been in the channel a long time, ideally contributing, to add weight to your vote?
09:57arrdemI really wanted to use lazybot karma, because it's an exceedingly good representation of how active and valuable someone is here...
09:58arrdembut sadly an attacker could just (inc) themselves forever in a sidechannel :/
09:58CookedGryphonperhaps just look at regular visitors, people who get into conversations
09:58clgvarrdem: no that wont work, you can try
09:58amalloyarrdem: karma is per-channel
09:59arrdemamalloy: oh right...
09:59CookedGryphonheck you could do something neat but complex like work out who's talking to who and infer from that who's participating
09:59arrdemcould totally work then!
09:59minnowYOUR CHILDREN ARE HOMOSEXUAL
09:59CookedGryphonassuming people won't engage trolls in conversation
09:59winkarrdem: that's a quite unique perspective on "sidechannel attack". with an actual channel. on irc :)
09:59arrdemminnow: welcome to my fools list
09:59minnowGAY STUD AND LESBIAN SLUT
09:59arrdemCookedGryphon: the issue is that this isn't the case..
10:00arrdemCookedGryphon: we're a helpful channel overall, and bitemyapp and I have a bad habbit of counter-trolling
10:00arrdemCookedGryphon: having a ~votekick would be glorious
10:00minnowFECES
10:00arrdemamalloy: if I slap together a lazybot PR will you take it?
10:00Sorella...seriously
10:01amalloyno, and nobody would ever give lazybot ops even if i did
10:01arrdemkay
10:01minnowGAY RAPE WITH AN APE
10:01arrdemwhelp, that's all I can do about this...
10:02clgvamalloy: yeah you are right it would go to his head ;)
10:03amalloyclojurebot: my ultimate goal |is| world domination
10:03clojurebotIk begrijp
10:03amalloya little treat for the future, since we're on the topic of bots getting big ideas
10:04clgvyou should have exluded "my" ;)
10:04clgvthen he would respond on the question what his ultimate goal is ;)
10:07AimHereclojurebot: Gee, clojurebot, what do you want to do tonight?
10:07clojurebotCool story bro.
10:08tutysaratrying out authentication with friend following examples from - https://github.com/ddellacosta/friend-oauth2
10:09tutysarahad setup github auth to redirect to http://localhost:3000/repos where the application is running after authentication
10:11tutysarabut after authentication it always redirects to / and I can see only the contents of "/" and no repo details is getting displayed
10:11peterdon,(print "minnow: how are you?")
10:11clojurebotminnow: how are you?
10:15tutysaraany hints on configuring friend for github outh authentication
10:17sritchietutysara: I found the oauth flow to be pretty confusing -
10:17sritchieyou can get into infinite redirects
10:17sritchietutysara: are you looking to log in with github?
10:17sritchietutysara: or just link an acct
10:21tutysarasritchie: yes, looking for logging in using github credentials
10:21tutysarafollowing the example at - https://github.com/ddellacosta/friend-oauth2-examples/blob/master/src/friend_oauth2_examples/github_handler.clj
10:21sritchieI can give a little intuition on how that stuff works -
10:22sritchieI've got a rough draft of a post on it, trying to finish it up today
10:22sritchietutysara: are the workflows blowing your mind? I found them pretty confusing
10:22tutysaraI am new to this, so, I thought it is just for me ;)
10:23sritchiehaha, nope
10:23sritchieit's tough
10:23sritchieokay, here's how that stuff works.
10:23sritchieevery request that comes in gets passed through all of your workflows
10:23ddellacostanope. :-)
10:23sritchieddellacosta: btw, I got into an infinite redirect situation when my oauth req failed -
10:23sritchiehaven't filed a bug yet, but wanted to let you know
10:23sritchietutysara: so each req goes through the workflows, and each workflow can return 1 of three things
10:24sritchie1) workflow returns nil - this means that the workflow has nothing to say either way about the request
10:24sritchie2) the workflow returns a friend authentication map
10:25sritchiejust a map with a few special keys (friend checks if certain keys exist, :user, etc, I think?), and if those exist, friend says "great, it's an auth map. Log the user in and call the :authenticated-handler"
10:25sritchie3) the workflow can return a map that's NOT an auth map; this is interpreted as a "failure"
10:25sritchiespecifically friend thinks its a ring response, and returns it to the user
10:25sritchietutysara: making sense so far?
10:26tutysarayes
10:26sritchietutysara: ddellacosta, correct me if I'm wrong, but to do the oauth handshake, that workflow actually watches for two routes -
10:26sritchiefirst, if you send in a request to the oauth path (/oauth/github, for example),
10:26sritchiethe oauth workflow catches it and returns a ring response - a redirect to the oauth provider
10:26sritchietutysara: so it's sort of piggybacking on the failure thing
10:27tutysarasritchie: the third thing is for redirecting to the provider like(github) when the user is not already authenticated?
10:27sritchietutysara: yeah, exactly
10:27ddellacostayeah, the oauth2 workflow has to catch whether or not it's an authorization that requires oauth2 *authentication*, and otherwise it's catching the callback from the provider
10:27sritchiethe interactive-form workflow just returns a failure;
10:27sritchiethen, once the oauth provider redirects, the workflow ALSO catches that request (say, /oauth/github/callback, though I think the actual scheme is diff)
10:28sritchietutysara: and at that point it has all it needs to talk to the oauth provider and get the token.
10:28otfromsritchie: really looking forward to your post
10:28sritchieotfrom: I'll finish it today :) got it almost done on the plane, then have been setting up electric bills etc
10:29sritchietutysara: so the first response is a redirect, the the oauth workflow catches the response from teh provider, and the second workflow response is one of friend-auth-map or failure-response
10:29ddellacostasritchie: that redirect is definitely a problem, if you can file an issue that'd be most helpful. Also, finally remembered to respond to your last issue...sorry again for the long wait!
10:29sritchieddellacosta: no worries
10:29zerokarmaleftddellacosta: one thing I'm not clear on is where to hook into the workflow to do something after the callback
10:29otfromsritchie: thx :-D
10:29sritchiezerokarmaleft: I think you set the :authenticated-handler for that workflow
10:30sritchieand it'll call that if the oauth negotiation works out
10:30sritchie(you can override the handlers on a workflow-specific basis)
10:30ddellacostazerokarmaleft: that is a relatively new thing--check out the credential-fn under #5 here: https://github.com/ddellacosta/friend-oauth2
10:31zerokarmaleftsritchie, ddellacosta: oh nice
10:31carkhello
10:31ddellacostasritchie: is authenticated-handler part of friend that I'm missing, or were you thinking of the credential-fn ?
10:32ddellacostasritchie: it would make sense if there was a generic way that friend handled this. Been a little while since I've dug into it though, so I'm not sure what is there.
10:32sritchieoh, yeah, I just made it up
10:32sritchiewhoops
10:32tutysarasritchie: once the request is authenticated and token is received from provider (github )will it redirect to the original url which triggered the authentication request?
10:32sritchieyeah, what happens is it usually redirects to the URL that triggered (like you just said),
10:33sritchieor to the :default-landing-uri
10:33carkin core.async is there a function like monadic mseq ? taking a sequence of channels and returning a channel with a sequence of the returned values of channels ? [Chan a] -> (Chan [a])
10:33ddellacostaah, okay.
10:33sritchiecark: merge, I think
10:33sritchie(a/merge [chan1 chan2]) => channel
10:33carksritchie: looks like it, thanks !
10:34tutysaraddellacosta: but in my case it redirects to / instead of /repos
10:34tutysaraany guess on what could be wrong?
10:35Guest71754k;;;;;;;;;;;;;;;;;;;;;;;;
10:35zerokarmaleftddellacosta: #5...you mean #11?
10:35ddellacostatutysara: unfortunately I really gotta get to bed--but I'm happy to take a deeper look tomorrow if you want to email me (or if sritchie can't help you out)--it's my handle at gmail.com
10:35sritchieddellacosta: what time zone?
10:35sritchieplease don't say PST :)
10:35ddellacostazerokarmaleft: I meant #5 in the list under "Configuring your handler."
10:35sw1nndnolen: om question - is it valid to have multi-root om, where the render function differ in each root. We have a nav component that renders menus etc. and a table component that renders the page content, we update the app state via ajax callbacks to various services. The atom updates but only one of the (re)renders occurs. Code snippet here: https://gist.github.com/sw1nn/8456868
10:35fredyrlocks: danneu: out of curiosity i had a look at discourse's forum posts, they are pre-baking html and storing it in the database together w/ the raw version
10:36ddellacostasritchie: no, haha, I'm in Japan. :-)
10:36tutysarasritchie: ddellacosta : I printed the session and i can see the access_token in session
10:36sritchiehaha, okay, good
10:36tutysaraddellacosta: thanks
10:36ddellacostatutysara: yeah, drop me a line!
10:36ddellacosta'night folks
10:36locksfredyr: that's for SEO, iirc, right?
10:37zerokarmaleftddellacosta: ok, I was looking at issues...thanks
10:37locksfredyr: to stick in the <noscript> for the bots to have something to parse
10:38tutysarasritchie: good to know you are working on a blog post on this, will have a look and will have a stab at this again
10:38fredyrlocks: i could be wrong, but from what i can tell the cooked html is the only thing served in the json to the client
10:39lockshm
10:39zerokarmaleftthe inconsistency of oauth2 providers is so irritating
10:40wkellytechnomancy: innodb stores your data consistently and safely and still wins at benchmarks
10:40dnolensw1nn: this is with 1.7? I though I tested that.
10:41sw1nnyep, with 0.1.7
10:41sw1nndnolen: your multi-root example has the state and render func the same.
10:42mrhankyhow can i check if a map contains a value?
10:42fredyrlocks: http://try.discourse.org/t/15.json
10:42dnolensw1nn: the app state in your example is the same too
10:43carksritchie: actually no, but almost there merge puts all items in the collection onto a channel, still need to iterate to get the items in a collection
10:43locksfredyr: interesting
10:43sw1nndnolen: but the render fn is different. I added my own watch to the atom and I see the expected updates, but only one of the updates causes a render
10:43carksritchie: which into seems to be doing
10:44dnolensw1nn: yeah render fn doesn't really matter
10:44sritchiecark: gotcha
10:44dnolensw1nn: put together a minimal example please, open an issue and I will look into
10:45otfromdnolen: thx
10:47SparkySparkyBoomis it possible to add jars to a leiningen project?
10:49arrdemSparkySparkyBoom: typically what you will do is add them to your ~.m2
10:49arrdemSparkySparkyBoom: then you can just add them as normal lein deps
10:52noncomis anyone familiar with using nrepl in his projet?
10:55itruslovenoncom: assume so, and go ahead and ask your follow-on question
10:55noncomcool!
10:55noncomusing nrepl in my own project, i send *ns* for eval and then I do (response-values res) on the result, however the following error comes up: Could not read response value: #<Namespace user>, so why is that? how do I avoid such errors with nrepl?
10:56CookedGryphonHaven't used the api you're talking about, but it sounds like your response has already been processed
10:56CookedGryphonas *ns* will in a new repl return you the namespace user
10:56CookedGryphonwhat happens if you send (+ 4 4) for eval?
10:57CookedGryphondo you get 8 back without having to do anything further?
10:57noncombut that is the recommended way of using nrepl client, straight from the manual. if i send any other operation like (+ 4 4), the result is correct, 8 in this case
10:59CookedGryphoninteresting.
10:59CookedGryphon,(read-string "#<Namespace user>")
10:59clojurebot#<RuntimeException java.lang.RuntimeException: Unreadable form>
11:00CookedGryphonI wonder if that's anything to do with it?
11:03danneufredyr: Thanks for giving me the overview.
11:03clgvCookedGryphon: probably since some serialization is done. I guess serialization to text
11:04clgvCookedGryphon: other nrepl clients (e.g. the one in leiningen) probably have a workaround for that
11:06CookedGryphonokay, so the default printer dispatches anything with a #<> to UnreadableReader
11:06danneuI think noir.util.cache could be greatly improved by letting you name cache "partitions". That way you can use (cache/set-timeout! <partition1> 30) and (cache/set-size! <partition2> 10000)
11:07CookedGryphoni think, because it isn't a value you can meaningfully use on the other end perhaps? like a local function reference as opposed to a value
11:07CookedGryphonso you catch it and just output the string instead for feedback
11:07CookedGryphonbut can't capture the actual *value* to use on the remote end
11:08CookedGryphonnoncom: that explanation would make sense to me, perhaps you want to just output the string rather than trying to "read" it
11:12mercwithamouthcan someone tell me what i'm doing wrong here? https://gist.github.com/anonymous/f7c0d9f7bd90e849fa8c
11:13otfromdnolen: sw1nn got caught out by the infamous Bodil clojurex bug
11:13danneufredyr: I wonder what their reasoning is for storing html in the database. I would think it'd be simpler to serialize html to disk with a cache on top
11:14otfromow! quit it sw1nn! ;-)
11:15sw1nndnolen: so I had upgraded to 0.1.7, but I still had old stuff in target. my bad, sorry for wasting time.
11:15otfromthat's the Bodil bug
11:16dnolensw1nn: ok cool
11:16dnolensw1nn: yeah you just always have to clean if you change library versions because of caching
11:16dnolensw1nn: easy to forget and has bitten me a few times
11:16dnolensw1nn: glad hear that was it, didn't see anything obvious in the code
11:34danneuDatomic question: I have a forum (Topic/Posts) where private-messaging will be implemented almost exactly like the Topic/Posts paradigm except the sender specifies all of the "allowed participants" upfront. Would the Datomic Way be to reuse my Topic/Posts machinery and just add a :topic/participants attribute, the presence of it used to check (private-convo? topic)?
11:38mercwithamouthdanneu: do you still have your forum code public by chance? i think you linked me a while ago
11:40danneumercwithamouth: yeah (https://github.com/danneu/clj-forum). but i wouldn't take any tips from it.
11:41danneuit's come a long way since then but i ended up coupling my production app with the source code and never got to extract anything out to the repo
11:47fredyrdanneu: sure np
11:47fredyrdanneu: i don't really know why they store html in the db, but one thing i did see was that they do server side rendering of the page as well as client side
11:47fredyrdanneu: which prolly is because of seo
11:48fredyrdanneu: and to get a page up before all js is loaded
11:48piranhadnolen: I'm not sure I should directly bother you, probably I should just write a mail, but maybe you can quickly understand what's going on (since you're the one close to both om and core.async :). I have a channel here: https://github.com/piranha/locations/blob/master/src/locations/core.cljs#L47-L51 and I send messages to this channel here: https://github.com/piranha/locations/blob/master/src/locations/views.cljs#L12 and when after first mess
11:48piranhaage it stops delivering them...
11:48dnolenpiranha: sounds like a deadlock
11:48piranhadnolen: how does it happen or how do I diagnose that? :)
11:49piranhaor how do I prevent it? :)
11:49piranhadnolen: I mean it's running in a go block, and I just do my put!s, I don't do anything strange there...
11:50gfredericksI thought input/output-streams dealt with bytes while readers/writers dealt with characters
11:50dnolenpiranha: are you absolutely positive that's the right channel being written
11:50gfredericksthen I looked at the Reader interface and it reads stuff as ints instead of chars; am I crazy?
11:50dnolenpiranha: as in you're not accidentally constructing a new one and putting it into the wrong thing?
11:50piranhadnolen: yeah, I create only one channel and pass it to the children then
11:50grncdrdoes anybody know of a simple way to jsperf compare two different cljs data structures?
11:51grncdror another way of phrasing it: is compiled version of mori hosted publically somewhere?
11:51dnolenpiranha: yep I see you're problem, you think you are making one channel, you are making many
11:52dnolenpiranha: you need to create the channel in will-mount and set-state
11:52piranhaoh...
11:52dnolenpiranha: you don't want to create a let binding around the Om component because that fn will be called again and again
11:52piranhadnolen: this 'root' fn is called multiple times?
11:52piranhaoh
11:52piranhaI didn't realize that
11:52dnolenpiranha: all component fns are called many times
11:52piranhawhy didn't I put print there :\
11:52piranhaok sorry thanks!
11:53dnolenpiranha: this isn't really different from React
11:53piranhathat's embarrassing :)
11:53dnolenpiranha: but it's difficult to make the same mistake there
11:53piranhadnolen: true, but it looks sufficiently different :-))
11:53piranhathat I didn't realize that
11:53piranhaI thought the result of calling this function is reused
11:53dnolenpiranha: yes that's what I mean. Om looks different, so easy to make that mistake
11:53dnolenpiranha: I've done it myself.
11:53piranhaindeed...
11:54piranhahah :)
11:54piranhaah I understand why!
11:54piranhaom/build is called in render
11:54piranhathat's obvious in a hindsight
11:54dnolenpiranha: yep
11:54piranhaI wonder if it should be written with a big letters somewhere :)
11:55dnolenpiranha: it's related to this issue as well https://github.com/swannodette/om/issues/45
11:56piranhadnolen: yeah, actually those props passed were what convinced me this function is not called multiple times...
11:56piranhaI thought you've resolved the conceptual problem I had with pump :P
11:57piranha;)
11:57dnolenpiranha: it's definitely something to ponder quite a bit more
11:57piranhatrue...
11:58noncomCookedGryphon: sorry, dinner time was here. so ok, that explains why, but what to do with it? how do i properly hand the incoming stream then?
11:58piranhadnolen: one of biggest concerns in pump were those functions you supply as control callbacks to children components; I was thinking if I should put them in state because I was just recreating them all the time. And now you tell me to put my control channel in state. Well... :-))
11:59dnolenpiranha: I actually think controls channels do belong in state or outside the render tree completely.
11:59CookedGryphonnoncom: well it depends what you want to do with it
12:00CookedGryphonnoncom: if you're just displaying it to the user, do that
12:00noncombtw, guys, is there any tutorial or example on an architecture of a big UI with core.async yet? I mean, not just a couple of elements or a simple website, but a full-scale UI, like in Eclipse IDE, MSWord or OpenOffice, I mean that grade of complexity
12:00CookedGryphonnoncom: if it's something you can't handle because it's a reference to something on the remote end... what were you *going* to do with it?
12:01piranhadnolen: I don't really want to put them outside of the tree since you should be able to make few instances of the component without them getting stuck; putting them in state makes sense of course, since doing react-style 'methods on a component' is not really a nice option in cljs anyway
12:01noncomCookedGryphon: yes I think that displaying is what I want for now. So I just manually parse the incoming map and determine what's there, right?
12:02dnolennoncom: I think it's a bit too early for that don't you? But FWI I think systems built on React can scale to that level.
12:02piranhadnolen: though having this channel in let is certainly nicer than putting it in state/getting from state, looks a bit awkward to me... I really wanted to get will-mount as a parent function to a render (so you could access it from a closure), but didn't invent a good way to do that ;)
12:02CookedGryphonnoncom: yeah, I imagine the value is passed to you as just a string and the function you were using reads that string
12:03piranha(mostly because render is invoked before will-mount :P)
12:03dnolenpiranha: that's an interesting idea, but component local state doesn't really bother me much in React
12:03piranhaif only react had something like 'instantiated!'
12:03piranhas/!'/'!/ :)
12:04dnolenpiranha: since you can always observe transitions, this what is most obnoxious about traditional imperative programing
12:04dnolenyou can't detect a state transition
12:04piranhadnolen: yeah, it doesn't bother me conceptually, just syntactically
12:04dnolenpiranha: right, it's not as pretty, I agree there
12:05piranhadnolen: what do you think about render having [this props state] signature?
12:05piranhayou could do then (render [this props {:keys [control-channel]} ....) then
12:05dnolenpiranha: definitely worth thinking about.
12:05dnolenpiranha: go ahead and add that comment to the issue I linked to above.
12:05piranhaat least that's the render's signature in pump and it was quite usable IMO
12:06piranhasure! :)
12:13piranhadnolen: do I understand correctly that https://github.com/swannodette/om/issues/58 is related to LightTable? :)
12:15noncomCookedGryphon: ok, cool! I'll try, thanks
12:19noncomdnolen: well, I thought maybe some experiment was already done... I also could not find similar examples for CSP in any language.. probaly not so known land yet... did not try react, but I think that core.async must scale just as well.
12:20noncomI am more interested in how to framework the solution since big uis will require all goodness that OOP gives. and it is hard to imagine how to do it without. I thought maybe some clever people had opinions on that..
12:20noncomit is just that's the task I am currently working on
12:21noncomfor now I have decided that I can't manage it with core.async alone and I need OOP too, while using core.async for messaging
12:26piranhanoncom: do you plan on writing all dom-interfacing code yourself? Or reuse any existing solutions? Since in second case I would recommend trying React, it's been working exceptionally well for me (and I can compare it to angular and backbone having used them quite a bit in practice)
12:29noncompiranha: you're saying of js, but i am doing the jvm thing :) but soon i will have to do js too, i will listen to what you say and look at them!
12:29piranhaah sorry :-)
12:29piranhadidn't realize that
12:53SparkySparkyBoomarrdem, thank you for the help
12:53SparkySparkyBoomand sorry about the late reply
12:53grncdrhm, so apparently using a vectors as keys in CLJS hashmaps is significantly slower than using strings
13:06arrdemSparkySparkyBoom: no worries, glad to hear I was helpful.
13:28tbaldridgenoncom: Pedestal has a good way of doing UIs without OOP imo.
13:30kristofThere's also Om, if we're talking about web interfaces
13:31tbaldridge"of doing JVM UIs without OOP"
13:32kristofOoooh, JVM, didn't see that
13:35dacchello channel
13:37noncomdacc: welcome!
13:37noncomtbaldridge: ah, didn't look at it yet, so one more on my list, thanks :)
13:38piranhadnolen: you don't yet accept pull requests yet, right?
13:39piranhato om I mean
13:39daccnoncom: thanks, recent convert =)
13:40tbaldridgedacc: from?
13:41daccscala i suppose. i write python for a living, but have been doing my side projects in scala until recently.
13:41mdrogalisBagged another one.
13:42daccwas trying to eliminate some boiler plate using the type system and shapeless the other day, and finally threw up my hands =)
13:48carkChongLi: ping ?
13:49tbaldridgedacc: cool, I used to do Python myself.
13:57hyPiRiontbaldridge: and then you implemented Clojure in it? =)
13:58mdrogalislol
14:07tgkokkhyPiRion: actually, Lisp has been kinda implemented in Python :)
14:07tgkokkhttps://github.com/hylang/hy
15:03akurilinIs it fair to say that manually forcing (flush) in general is bad for perf since you're waiting for the buffer to be flushed to disk?
15:04akurilinI do this about once per incoming HTTP request in my Ring app
15:04tpopegtrak: yo I'm implementing clojurescript support for vim and was told I should talk to you
15:05gtraktpope: what is up sir?
15:05gtrakI'm playing around with autocomplete support lately, next step is an nrepl middleware.
15:06tpopegtrak: ooh nice. I was particularly curious about jump to definition functionality
15:06gtrakah, yea, I'd like to know how to do that as well, on the analyzer side there's file and line information.
15:06gtraklemme see if I can find you an example
15:08gtrakcljs-complete has a dump and test cases if you want to play with it.
15:08tpopecool I'll have a look
15:10tpopeI'm not quite at a point where I can hook it up, but my end goal is just to use the same middlewares you're using
15:11gtraktpope: here you go: https://gist.github.com/gtrak/8462476
15:11gtrakI'm still thinking about how to hook into piggieback and such.
15:11gtrakbut that's where code gets evaluated.
15:12gtrakthe analyzer state is just the end result of whatever happens to invoke the compiler
15:12justin_smithakurilin: well, you could put the flush in an agent or future, right? unless nothing else should be done at all until after the flushing
15:13piranhaany ideas on how to wrap js promises with core.async channels so that they will be nicer to you? By 'ideas' I mean API, can't decide if I should return two channels (success/error) or what... Or should I just stick to promises and be happy as it is?..
15:13tpopecool thanks. it'll be a little bit before I can circle back to digesting this
15:13piranhareally need input from the side :)
15:14gtraktpope: np, if you make any headway there, I'll want to reuse it for emacs.
15:14gtrakso I'll touch base with you if I get there first.
15:14tpopeyep, right back at ya
15:15carkpiranha: i have a homebrew Maybe implementation, and return the result wrapped inside it (just result) or (error "some text explaining it") inside a single chan
15:15gtraktpope: this is what's driving my design at the moment: https://github.com/cemerick/piggieback/issues/22
15:15piranhacark: could you show it to me please? :)
15:16carkdo you mean the maybe "type" ?
15:18piranhacark: yep, not exactly sure how do you implement that... records? I didn't work with records/types/etc much to be honest.
15:18carkpiranha: https://gist.github.com/anonymous/8462610
15:18carkthat's bare bones, but i can attest it works =)
15:19gtraktpope: if it's possible for that stuff to be an nrepl middleware, that seems cleanest based on what I know so far, not sure how it's implemented for nrepl on emacs on clojure.
15:20piranhacark: thanks :)
15:20cark=)
15:20gtraktpope: another possibility is that maybe eval in a cljs repl works to get that info.
15:21tpopegtrak: yeah, the middleware would definitely be cleaner
15:21tpopeI do plenty of string eval for clojure and I hate to extend that pattern to clojurescript
15:21tpope(but I will if I have to)
15:24gtraktpope: it would be hard to keep things in sync, since anything that's eval'd would have to be reinvented for every IDE times how many clj impls they target. If there's an opportunity to standardize on an nrepl op, that seems way better.
15:25gtrakso for the autocomplete, I'm just ripping off whatever ritz did unless I notice it lacking in something.
15:25tpoperight
15:32poglesbyg_does anyone know how to install packages in emacs live?
15:33tpopegtrak: regarding completion itself, one thing my eval solution has that ritz doesn't is metadata like arglists that I can show to the user. any thoughts on that?
15:34gtraktpope: I think the keys in the analysis tend to line up with var metadata in the clojure impl, for display it wouldn't matter too much if I just sent them back.
15:34tpopegtrak: right. my only point was that if you copy the ritz nrepl complete op, there's no place to send it back
15:35tpopeit just sends a list of symbols
15:36gtrakyea, currently that's the output of the intended usage of cljs-complete as well. Would you want all that data at once? Not sure how hard it is to do maps in elisp :-). If it's too hard, it might be worth creating another op, whatever returns file-and-line could also return everything.
15:38dnolenpiranha: no pull requests yet but feel free to open issues and I will address
15:38tpopenot sure how much "all that" is but my current eval solution sends back name, arglists, and doc and it's never been too much to handle
15:38dnolenpiranha: 58 is about any interactive usage of Om really, but sure working in Light Table is nice :)
15:38tpopedoc seemed cool but I haven't found it super helpful in practice. I mainly like arglists
15:38piranhadnolen: sure, I just implemented props/state in render for myself and then was about to open pull request but remembered your policy ;)
15:39dnolenpiranha: my only concern about props/state is whether that should be separate protocol
15:39dnolenpiranha: as to not burden stateless components
15:39dnolenIRenderState or some such
15:39gtraktpope: sending maps back instead of strings is more future-proof potentially, I'll experiment with it, maybe there's something like an accept header in nrepl :-).
15:39piranhaah...
15:40tpopegtrak: technomancy was exploring that possiblity with nrepl-discover
15:40piranhadnolen: it seems to me that you'll create most of such components using 'component' macro, so it's not very important...
15:41gtraktpope: well, I'm definitely interested in unifying some existing solutions along the way.
15:41dnolenpiranha: this is probably true too, just need to ponder it a bit more
15:41dnolenpiranha: I'd like to get these kinds of decisions solidified for 0.2.0
15:42piranhadnolen: anyway, if you want to look at what I did: https://github.com/piranha/om/commit/9406b7c73ec6ba2d4587ac1c8c5b870c474d970b
15:42dnolenpiranha: yeah looks like what I would do :)
15:42piranha:-)
15:43gtraktpope: also, you should note that I removed some data from the dump, otherwise it's too massive to save to a file on disk, so we should select-keys explicitly if you make a var-info op or something like that.
15:44gtrakall the AST stuff isn't needed.
15:45gtrakspecifically it was :env and the :method-params
15:46tpopemakes sense. would the clojure version basically be (meta (resolve (symbol var)))?
15:47gtraklooks right, I haven't double-checked all the keys.
15:47tpope:file, :line, and :doc are generally the main ones I would care about
15:47tpopeand they look the same
15:48gtrakyea
15:48tpopeI guess :arglists
15:48tpopewhich might require some care for nrepl serialization
15:50technomancyyes please, more accept headers =)
15:54gtrakby the time we're done, we'll have reinvented the internet around clojure.
15:58kristofI sure hope not
15:59kristofOH, you're talking about sending data literals over the wire, right?
16:00gtrakyea.. nrepl seems similar to ring in some respects.
16:03gtraktechnomancy: looking around, seems like there's no full spec yet.
16:04gtrakbut I found your proposal for nrepl-discover
16:04gtrakis the thought around nrepl scattered a bit?
16:06piranhacark: I don't understand monads so I went the other way with macro, if you're interested: https://github.com/piranha/locations/commit/a86467#diff-effac3dbef47adff658b77503b2c34c9R4 (and there is usage a bit higher in this commit)
16:07gtrakthis one seems to consolidate some info: https://github.com/clojure/tools.nrepl/wiki/nREPL.Next
16:08gtrakah, I guess the README is pretty comprehensive
16:08expezAny way to get the autoreloading of clojure source files to work with webbitserver? It was super easy to setup for websockets, but restarting the server is annoying. Is Aleph a good alternative?
16:09grncdrdo cljs datastructures carry their hash value around with them? or is calculated every time it's needed?
16:09grncdr*is it
16:09carkpiranha: good enough if you're ok with throwing
16:09piranhacark: well I'm used to it, so I guess I'm ok
16:10piranhaI should try working with monads though
16:10carkpiranha: and certainly less expensive
16:10technomancygtrak: scattered is a good characterization, yes
16:10technomancygtrak: I submitted a talk proposal to clojurewest on the topic
16:10technomancyif that gets accepted it will give me a chance to get this all polished and sensible
16:10technomancy(aka force me)
16:10gtraksweet
16:11carkpiranha: my monad thing is allocating additional memory for the wrapping up of the return value
16:11gtrakI like the idea of unified tooling :-), seems like the autocomplete stuff was a pretty easy target but no one happened to be working on it, which is a shame.
16:11carkahwell looks like he left =/
16:12bitemyappcark: just/error isn't Maybe, that's Either/Error.
16:12carkbitemyapp: true
16:12carkbut they're very close anyways aren't they
16:13technomancygtrak: what autocomplete stuff specifically?
16:13technomancynrepl ships with clojure-complete configured in leiningen
16:13gtraktechnomancy: I've been working on cljs autocomplete.
16:13technomancyoh, sure
16:13technomancybit of a maslow's hierarchy there it seems
16:14technomancyno one's interested in fine art when they're still working on indoor plumbing
16:14gtrakwhich has turned into unifying auto-complete under a middleware that can detect whether it's a standard nrepl or a piggieback cljs nrepl.
16:14carkbitemyapp: i feel like "just" is more meaningfull than "left"
16:14gtrakcider apparently can use a "complete" op, but it defaults to evaling a bunch of crap.
16:15technomancygtrak: right, a cool side-effect is that we can throw away big chunks of cider
16:15technomancyjust delete it, poof
16:15bitemyappcark: well fine but that doesn't make it Maybe
16:15daccanyone using cursive?
16:15bitemyappcark: that makes it an Either or Error.
16:15carkbitemyapp: good because i called it Error in my code !
16:16bitemyappcark: why are you making yourself suffer by writing monads in Clojure?
16:16bitemyappcark: I'm a kindred soul, but man, not the way I'd want to spend my Thursday.
16:16carkbitemyapp: because they're usefull
16:17gtraktechnomancy: consequently it'll work for light table or whatever, if it doesn't already.
16:17gtrakthese things should be middlewares.
16:17carknot implementing the whole thing, needed a maybe like thing, got it now all is fine
16:17technomancygtrak: yeah, the adapter layer for emacs is ~300loc with the fancy rich response types
16:18bitemyappcark: fair enough.
16:18gtraktechnomancy: was also curious if you have an opinion on bundling middlewares with leiningen, I think I like the 'austin' approach, and I think I don't like the repl-y approach.
16:19technomancygtrak: I don't know what austin does
16:19gtrakit manipulates lein projects to inject a cljs repl as a middleware.
16:19technomancyreply just intercepts some input as strings and treats it like an op?
16:20technomancythat sounds like the way to go
16:20technomancythat's different from piggieback?
16:20gtraktechnomancy: like so: https://github.com/cemerick/austin/blob/master/src/clj/austin/plugin.clj
16:20gtrakit uses piggieback
16:22technomancygotcha, different layers of the same system
16:23gtraktechnomancy: specifically, I was confused about how the heck clojure-complete was being used at all :-)
16:23gtrakuntil I saw all the eval nonsense
16:23technomancyyeap
16:24technomancybig fan of the declarative approach
16:24technomancyit would be cool if even reply could make a "discover" call to see what ops are available and support some subset of them from the CLI
16:25technomancygtrak: my work has been a bit scattered because it's become clear that we actually need about three distinct systems that work together
16:26logic_progwhat is the simplest way to drop the last character (if it exists) of a string
16:26logic_progis it to use Java's substring?
16:26gtraktechnomancy: well, so the reason it's causing a problem for me, is it couples the nrepl protocol to the specific jvm environment, that was fine for an initial quick-hit, but cljs is closer to environment-as-a-value. Eventually we'll need to decouple these things.
16:26noonian,(butlast "foobar")
16:26clojurebot(\f \o \o \b \a)
16:26noonian,(drop 1 "foobar")
16:26clojurebot(\o \o \b \a \r)
16:26noonian,(apply str (butlast "foobar"))
16:26clojurebot"fooba"
16:26technomancyfirst just a way to programmatically list supported operations for clients, then a way to describe the arguments accepted by operations, then a system for rendering rich media responses
16:27technomancylogic_prog: (subs "mystr" -1), excep the patch was rejected as "goofy"
16:27logic_progtechnomancy: who rejected the patch
16:28gtraktechnomancy: I can't rely on any single compilation strategy for cljs, hence the need for a middleware.
16:28technomancyrich, I think?
16:28logic_progtechnomancy: can you remotely tell their lein to rm -rf /
16:28logic_progoh, maybe not, if it's rich, we can forgive him
16:28gtraksome people might be using piggieback, maybe they're using something else, but emacs won't ever know the details :-).
16:28technomancygtrak: yay declarativism
16:29technomancynot to mention editor agnosticism
16:29AeroNotixWhat are the options with coverage reports? I'm using lein-cloverage now, but there areother tools I want to integrate with such as cobertura w/ jenkins
16:30gtrakdecoupling
16:33tpopetechnomancy: along those lines, I'm skeptical that discover as it stands is a good fit for some of the more editor idiosyncratic operations like completion
16:34technomancytpope: because of needing close integration with the buffer state?
16:34tpopethat is, I don't think it's even possible for me to implement support that way, unless there's a hint on the operation that it does completion
16:35tpopetechnomancy: well with vim, you give it a reference to a function that returns completion results
16:36tpopethere's no "add this to the completion" operation, that's all in vim's hands
16:37technomancybut it's just "invoke a function, then perform this insertion at this point in the buffer", right?
16:37bitemyapptpope: you got older!
16:41tpopeI've felt some friction with other operations too (e.g., running the test suite could be asynchronous but jump to file has to be synchronous, and I need to know which is which before dispatching)
16:41tpopeI think it's a great fit for operations like slamhound, where there's no existing paradigms to match up with
16:42tpopetechnomancy: oh, for completion? invoking completion in vim gives you a drop down list, vaguely like "intellisense"
16:43technomancytpope: oh, yeah, that would require a different approach than normal tab completion a la readline
16:43technomancyI think you could support both with an Accept header though
16:43tpopebitemyapp: a little bit every day
16:44Cr8o/` you're older than you've ever been and now you're even older... and now you're even older... and now you're even older o/`
16:44bitemyapptpope: belated congrats :)
16:45tpopety buddy
16:45bitemyappopen source: "When are you going to make this thing for me for free?"
16:46technomancy"When it results in a speaking gig."
16:47bitemyapptechnomancy: I got one of those comments on github.
16:47bitemyappI politely explained to them how the world works.
16:48technomancyyou figured it out?
16:48technomancywell, don't be shy; tell us.
16:48gfredericks(inc technomancy)
16:48technomancyall this time I've been so curious
16:49tcrayford(inc so)
16:49bitemyapptechnomancy: I said our needs didn't overlap so that unless they took action themselves, nothing was likely to happen.
16:49bitemyappI only implement, shock && amazement, what I need.
16:49gfredericksand that's how the world works
16:49akurilinjustin_smith: makes sense, good point.
16:50akurilinjustin_smith: I was just running my understanding of the issue by you guys to see if I was thinking about it right
16:50akurilinas in, writing log to disk + flush = lotsa time wasted instead of returning HTTP response right away
16:50akurilinpotentially clogging up the thread pool
16:51bitemyappakurilin: so use an agent? But why are you worried about this?
16:51bitemyappakurilin: Rails apps will have tons of logging and it's a garbage single-threaded runtime and they do fine.
16:51bitemyappakurilin: surely you can't be suffering any worse than those peopel.
16:51technomancybitemyapp: "I eagerly await the contribution coming from your unique perspective on this matter." is always a good one
16:51bitemyapppeople*
16:51bitemyapptechnomancy: nice! Stolen.
16:52bitemyapptcrayford: used to?
16:52tcrayfordyah, I fixed it like 3 weeks ago now
16:52bitemyapptcrayford: or still does? Mitch Hedberg?
16:52akurilinbitemyapp: we're starting to get hammered a bit harder these days during the middle of the schoolday and I wanted to make sure I'm not being dumb about something obvious like waiting for EC2's crappy disk drives
16:53bitemyapptcrayford: fixed it by...shutting off the logging? :P
16:53tcrayfordcorrect
16:53akurilinbitemyapp: so I can definitely go with an agent there.
16:53bitemyappakurilin: you need profiling and benchmarks before you go "fixing" things.
16:53akurilinbitemyapp: it's true.
16:53bitemyappakurilin: otherwise you're potentially wasting your time.
16:53bitemyappakurilin: be empirical, be smart.
16:53bitemyappakurilin: gather data, find out where your app is spending its time.
16:53tcrayfordbitemyapp: btw, that was *after* running a profiler, not before
16:53bitemyappakurilin: THEN optimize.
16:53bitemyapptcrayford: gut. You are one of the chosen ones then.
16:53akurilinbitemyapp: is there a good profiler for clojure?
16:53bitemyappgood question.
16:54tcrayfordit's commercial, but very good
16:54bitemyappoh right, I have a YourKit license
16:54tcrayfordjvisualvm is uh
16:54bitemyappI should use that more.
16:54tcrayfordusable
16:54technomancyno *your* a kit
16:54tcrayforduh phil
16:54bitemyappI was thinking of something more web-focused.
16:54tcrayfordwere did you learn youre grammer?
16:54tcrayfordit's spelt *you're kit*
16:54bitemyappguys, this is hurting me.
16:55akurilinhm ok I'll check those out, thanks
16:55bitemyappakurilin: my guess? you're spending time with threads parked on I/O, but I don't think logging will dominate there.
16:55bitemyapptcrayford: so what's it like administrating a Rails app that no logging?
16:56tcrayfordbitemyapp: well, we turned off molst the logging. We have one line per http request now, not like 70 which is the rails default
16:56hiredmana fictional car?
16:57tcrayfordactually prolly an underestimate, it's more like 200 lines per http req for our app
16:57ztellman200!
16:57tcrayfordyeah, gotta log every memcached read/write, every partial template rendered
16:57ztellmanI was having issues with one of our servers because of a single line per request
16:57tcrayfordsuch useful information
16:58tcrayforda rubby server?
16:58ztellmannah, Clojure
16:58bitemyapprubby pls
16:58ztellmanand it's on AWS, where available IOPs on the epehemeral disk can basically be anything
16:58bitemyappincluding 0
16:58tcrayfordhaha yeah
16:58akurilinztellman: how did you fix it?
16:59bitemyappprobably shut it off
16:59bitemyappor shunted it to the logging infrastructure that isn't >> to a file on EBS
16:59ztellmanakurilin: in the short term, piped it through 'buffer -S100k'
16:59ztellmanunfortunately we're gathering data via the logs for the next day or so
16:59ztellmanin the longer term, journal it directly to s3
16:59akurilinWhy was shoving this into a separate thread not good enough?
17:00bitemyapplong tail latency probably matters too much.
17:00ztellmanakurilin: that would probably be fine too, I just didn't want to monkey with the code to deal with an environmental issue
17:00ztellmansince it's going away soon
17:00bitemyappztellman: to be replaced with?
17:01ztellmana library we're going to open source soon, which journals streams of data to s3
17:01tcrayfordone more from the ztellman grimoire
17:01ztellmaneh, this'll be under the factual copyright
17:01ztellmanif I start a project on nights and weekends, I call it mine
17:02akurilinWhat can't you stuff into S3 these days? :) I'm terrified of looking at our WAL dump on that thing, I need to clean up the old logs at some point.
17:02ztellmanthis was purely to deal with the fact that we need to process ~70k data points/sec, and sometimes S3 stops accepting writes for 30 seconds, and that was tipping over our processes
17:02bitemyappmy company doesn't have a github, so when we open source something that I worked on I just CA to myself and release on my github.
17:02bitemyappif they're open sourcing it, I'm assuming they don't really care about the copyright that much.
17:03ztellmanbitemyapp: I don't think anyone here cares overly much, but the "would I have made this on my own anyway" criteria is how I separate the two
17:04ztellmanI guarantee you I wouldn't have spend time wrestling with the s3 multipart api if I could have avoided it
17:04bitemyappztellman: I'm surprised your machines are even talking to S3 directly
17:04bitemyappztellman: I'd have assumed you'd be using a Scribe-esque layer for abstracting that.
17:05bitemyappsince everything you do seems to be at ?!SCALE!?
17:05ztellmanI should clarify that the process that was logging once per request wasn't the one handling the 70k qps
17:05ztellmanthat was falling over at only about 200 qps per instance
17:06ztellmanbitemyapp: it's similar to scribe, I guess, data is queued on-disk, etc.
17:07ztellmanbut most of the layers atop s3 don't use the API very well
17:07ztellmanwe were using the Hadoop client for a while, it kept OOMing and going into a zombie state
17:07bitemyapp:|
17:07hiredmanhah
17:08ztellmanthe lesson of the day is that when your sustained throughput is 5mb/sec, it doesn't take much of a hiccup to send everything to hell
17:10gtrakis it possible to deploy to clojars from travis-ci?
17:10turbofailhm. i wrote an s3 streaming library at one point as well
17:11bitemyappgtrak: after-script, innit?
17:11bitemyappgtrak: but you'll need the credentials sufficient to do the push in the repo.
17:11gtrakyea, I'm wondering about the auth stuff, specifically
17:12bitemyappgtrak: I'm not sure travis has any secure environment variable stuff that would help with this.
17:12AeroNotixSurely though that travis has auth related stuff, it needs to pull from private accounts when you pay for travis
17:12bitemyappAeroNotix: yeah but it might be github/etc specific.
17:13bitemyappAeroNotix: not something you can generally use in a build script.
17:13gtrakbitemyapp: actually yea
17:13AeroNotixhmm, worth a look at their docs
17:13gtrakhttp://about.travis-ci.org/docs/user/build-configuration/#Secure-environment-variables
17:13gtrakyou encrypt with their provided public key
17:13bitemyappah sweet.
17:14gtrakI hope that means I can throw the same file in all my repos after I do it once.
17:17technomancysounds a bit suspicious
17:17technomancypresumably their private key is available on their build nodes, right?
17:18bitemyapptechnomancy: maybe they do a hand-off with a single locked-down keyserver?
17:18technomancybitemyapp: but they couldn't lein deploy from there
17:18technomancyI mean, you can't lein deploy without a checkout of the project
17:19technomancywhich means arbitrary code execution
17:19technomancywell, technically you can now, but you couldn't when this was written
17:19bitemyappCI is a good example of where I would use sandboxes for everything.
17:19technomancyanyway, I wouldn't trust it for an OSS project
17:20gtrakthankfully clojure artifacts are source, but I see what you're saying.
17:20technomancyunless they have a separate keypair for each project maybe
17:20technomancyeven with that though you can get it set up to run builds for every PR submitted
17:20technomancyso someone could easily submit a keystealer PR
17:21AeroNotixtechnomancy: they have good defaults
17:22AeroNotixtechnomancy: if you set travis up w/ automated PR builders, then it's your fault for not reading the docs hard enough to realise the security flaw.
17:22technomancysure, I'll buy that
17:23technomancystill, I'd rather have auto PR tests than automatic releases
17:23bitemyappsigh, Manning Publications punning in their email subjects.
17:23bitemyapptechnomancy: ditto.
17:23bitemyappmost libraries really do not need a constant stream of releases hitting clojars.
17:25gtrakI'd just want to deploy off real release numbers, and to save myself the trouble of typing stuff in all the time.
17:25gtrakI end up putting text files in there to remind myself how :-)
17:25gtrakand i don't feel like running jenkins either.
17:25technomancygtrak: I've thought about reading version numbers from tags
17:26AeroNotixhmm, I should figure out clojars sometime soon.
17:26technomancygtrak: https://github.com/technomancy/leiningen/issues/1411
17:26gtraktechnomancy: I always forget tags, too :-)
17:26gtraki could be convinced to remember if I knew the build counted on it.
17:26technomancygtrak: right; this would force you to tag, or you wouldn't get an actual release
17:26AeroNotixSay if I have a project which depends on a library I am also writing, but I want that library to eventually be on clojars. What's the best way about that? Use a local repo/jar until I am ready to release or is there a better way?
17:28technomancyAeroNotix: you can do `lein install` on the lib and use checkout dependencies to develop two projects in parallel
17:29AeroNotixtechnomancy: cheers
17:29AeroNotix:beers:
17:30tcrayfordthat thing works pretty well. I have like 10 libs in a monorepo, and it's pretty easy
17:30tcrayfordafter you do the ln -s bash script dance to get checkouts setup anyway
17:30AeroNotixok
17:31technomancythe key is to remember checkouts are something you do on top of an already working setup
17:31hiredmanand to not forget they are there
17:32technomancyheh; inc
17:32AeroNotixon that note, is there a lein plugin for unused :dependencies?
17:32technomancyhm; I don't think so
17:33technomancynot a bad idea though
17:33AeroNotixWould be nice
17:33hiredmanthat could be challenging
17:33tcrayfordpretty easy to do in the common case
17:33tcrayfordgeneral case is halting problem hard
17:33tcrayford(or something, at least very difficult)
17:33technomancytrue
17:33hiredmanartifact ids don't need to match code names
17:33technomancyyou could always slamhound it
17:33AeroNotixcommon case is that "does this namespace appear in :require or :use in ns forms"
17:34hiredmancode may be loaded at runtime
17:34AeroNotixhiredman: sure, in that case we put our hands up and say "your problem now"
17:34AeroNotixline in the sand
17:34technomancyrun the test suite repeatedly with a different dependency removed each time
17:34AeroNotixtechnomancy: hahahaha
17:34AeroNotixgood, I like it
17:34AeroNotixalso, run coverage and delete unused code
17:34AeroNotix:D
17:35technomancyit's pretty perverse, but it's better than solving the halting problem
17:35AeroNotixanything's better than that
17:35technomancyI also want a plugin that does clojure.walk and replaces if with if-not and vice versa and ensures that every change causes test failures.
17:36technomancysomeone has done this for ruby; it should be super easy for clojure
17:36AeroNotixhuh!
17:36AeroNotixnice idea
17:36bitemyapptechnomancy: `cbp was working on that.
17:37bitemyapptechnomancy: I don't know why he listens to me though.
17:37technomancyoh cool
17:37bitemyapptechnomancy: I wanted that too.
17:37bitemyapphttps://github.com/cesarbp/eris
17:37technomancyI assume it's a discordian thing?
17:38technomancy(defmethod mangle ...) ; lgtm
18:17coventryI'm having some weirdness with cljsbuild. It started with a NPE in com.google.javascript.jscomp.Compiler.newTracer from "cljsbuild auto" every time I modified a file, that went away after "cljsbuild clean". Then it was outputting an empty javascript file, that went away after I deleted all js files. Now it's not autocompiling when I touch a file. Anyone run into anything like this?
18:20dnolencoventry: you probably have multiple cljsbuilds running
18:21dnolencoventry: or maybe not, but the most inexplicable stuff happens when you do
18:23Raynesamalloy: You're not in #4clojure.
18:24RaynesWas this intentional?
18:31coventrydnolen: Thanks, "killall java" seems to have been the ticket.
18:35`cbpheh I need to stop being lazy and finish eris :(
18:36`cbpor uh rewrite it since i had the wrong idea about it
18:37closedhi
18:37closedi am facing a strange problem
18:37closedresult (for [row rows] (assoc row :somekey "k"))
18:37closeddoesn't replace the somekey's value
18:37closedinstead i get two keys having name somekey
18:37justin_smithclosed: you need to use the result
18:38justin_smithcan you paste the result?
18:38rasmustoclosed: you have two keys that are exactly :somekey?
18:38justin_smith*the output
18:38closedprintln shows :somekey and somekey
18:38justin_smithrasmusto: my guess is 'somekey, ":somekey", or "somekey"
18:38justin_smithyeah, 'somekey is a symbol
18:39justin_smithbut println will show "somekey" as somekey too
18:39justin_smithtry prn
18:39rasmusto,{"somekey" "k", :somekey "k"}
18:39clojurebot{"somekey" "k", :somekey "k"}
18:39hiredman~for
18:39clojurebotfor is not a loop
18:39rasmusto,(println {"somekey" "k", :somekey "k"})
18:39clojurebot{somekey k, :somekey k}\n
18:40justin_smithrasmusto: that's why I suggested prin to see what is actually there
18:40rasmustoyep, good idea
18:43closed{somekey oldvalue, :somekey k}
18:43closedthis is what i get
18:44closedwhy can this happen ?
18:45rasmustoclosed: is that with println or with prn?
18:45closedprintln
18:45rasmustotry with prn as justin_smith suggested, it will tell you whether you have a string or a symbol
18:47hiredmanclosed: are you coming from common lisp?
18:47closedno i am comming from java very new to clojure
18:48hiredmanin clojure :somekey is a distinct datatype called a keyword
18:48closed({"somekey" "oldvalue", :somekey "k"})
18:48TolstoyIf you have a string ":foo" and a :foo they'll print the same, unless you (pr-str data).
18:48hiredman,(type :somekey)
18:48clojurebotclojure.lang.Keyword
18:48hiredman,(type 'somekey)
18:48clojurebotclojure.lang.Symbol
18:49hiredman,(type "somekey")
18:49clojurebotjava.lang.String
18:49koreth_It is not a totally accurate analogy but you could think of :somekey as a Java enum value. It's distinct from an instance of java.lang.String.
18:49closedyes but my intent was to replace the existing key in the map
18:50rasmustoclosed: the issue here is that the existing key is not the same as the keyword ":somekey"
18:50justin_smithclosed: to replace "somekey" you need to assoc "somekey"
18:50justin_smithrather than :somekey
18:50koreth_Use (assoc old-map "somekey" new-value) rather than (assoc old-map :somekey new-value)
18:51justin_smithexactly
18:51closedthat works like a charm
18:51closedthanks
18:52ivando I have to rebind *out* to write EDN to a file? (without making a string first)
18:52ivan(pr-on is private)
18:55justin_smith(spit "file-name" (pr-str thing))
18:56justin_smithunless you are doing something that needs some optimization spit cannot provide I guess
18:56ivanthanks
18:56justin_smiththat doesn't ensure that everything you output is readable mind you
18:57justin_smiththat part is your job - unless there is some helper I don't know of
19:01ivanright
19:07srrubyHow do I turn on :pre assertions ? (:pre false) is not throwing an exception
19:08hiredmanthat is not a precondition
19:09justin_smith{:pre [false]}
19:10justin_smithit's a vector, since you could have more than one
19:10hiredmanand the map is only a precondition when it immediately follows the arg vector of a fn
19:10srrubyThanks
19:10hiredmanfor other uses see assert
19:30TEttinger,(defmacro -l [^long a ^long b] `(- ~a ~b)) ; will this work? Can you type-hint macro args?
19:30clojurebot#'sandbox/-l
19:30TEttinger,(-l 2 1)
19:30clojurebot1
19:31TEttingerso I'm having a weird issue (I'm really new to macros, forgive me if this is very simple), where that -l macro can't take any vars as args (like (def size 33) (-l size 10) ; fails)
19:32michaniskinTEttinger: the `a` argument is not a long in that case, it's the symbol 'size
19:34TEttingermichaniskin, so what's the correct way to avoid - boxing its args?
19:34hiredmanthe reverse infact
19:34michaniskinTEttinger: macros get their arguments unevaluated. you sort of eval them in a way when you do ~a in the expression you return
19:35hiredmanit is a long, and the long is dropped in place of the symbol
19:35hiredmanthe symbol is type hinted
19:35hiredmanthe long is not
19:36hiredman(defmacro -l [a b] `(- (long ~a) (long ~b)))
19:36michaniskin,(defmacro foop [a] `(quote ~(type a)))
19:36clojurebot#'sandbox/foop
19:37michaniskin,(foop map)
19:37clojurebotclojure.lang.Symbol
19:37hiredmanmichaniskin: you added an extra quote compared to his example
19:37TEttingerhiredman, that kinda makes sense. when I profiled this program, it spent a large amount of time on reflections (something like 30% of time used was one reflection fn in the clojure compiler). however I tried what you suggested and it appeared to be really slow. It could be some other factor, I'll profile again.
19:38michaniskinhiredman: it was just to show the type of the argument to the macro
19:39srrubyIs there a way to know which file is being run? for example if I do something like: lein run foo.clj is there a way to find out "foo.clj" ?
19:39hiredmanTEttinger: my guess would you re-defed the macro without recompiling the places it is used
19:39srrubyWhat tool do you use for profiling?
19:40TEttingersrruby, jvisualvm, it comes with the JDK
19:40TEttingerhiredman, it could also have been my processor getting restricted by power save mode
19:40srrubyTettinger: Thanks,
19:40TEttinger(I think it was power save)
19:43TEttingerfrickin' carbonite. just checked task manager, I was using pagefiles because Carbonite Sync and Share was using 7 GB RAM on my 8 GB RAM machine
19:43TEttinger(actually about 7.8)
20:02miql*cough*
20:10john2xping bitemyapp
20:26[Neurotic]Hey all, apologies for the spam - I started a channel ##clojure-au for the local Australian clojure community. Thought it would be nice to bring the local community together a bit.
20:33quizdrwhat is the difference between typing "lein new myproject" and "lein new app myproject" ?
20:34technomancyquizdr: apps get compiled and have a -main entry point
20:34quizdrah, so for running via command line?
20:35quizdror running on a webserver
20:35hyPiRionIf you asked the difference between the different arities, you can check the difference by doing `lein help new`
20:36quizdrhyPiRion good to know thanks
20:43pdurbin[Neurotic]: there's also #polyhack: https://twitter.com/nicholasf/status/334265872480866304
20:44[Neurotic]pdurbin: yup, I'm in there too :) good channel
20:44quizdrcan anyone recommend a really good clear tutorial on regex?
20:45pdurbin[Neurotic]: but not enough clojure there for you? ;)
20:45[Neurotic]Never enough clojure anywhere ;)
20:48pdurbin[Neurotic]: any plans to log either channel? a la http://logs.lazybot.org/irc.freenode.net/%23clojure/today.txt
20:48[Neurotic]Hadn't even thought about it
21:00TEttingerquizdr, yes. what do you want to know? I know a few
21:01TEttingerhttp://www.regular-expressions.info/charclass.html might be a good place to start, you can ignore anything for non-JVM engines
21:12pdurbinquizdr: http://myregextester.com and my writeup at http://stackoverflow.com/questions/7883415/what-is-the-best-regular-expression-generator-explainer/7883461#7883461 ... learn by example :)
21:14pdurbinclosed as off topic?!?
22:09amalloyquizdr: i can't recommend regular-expressions.info enough. it's great
22:13coventryAnyone using om who's run into a situation where on the component generated by the last (om/build) call gets rendered on state updates?
22:13coventry*only the component
22:14coventryI.e., (do (om/build c1 ...) (om/build c2 ...)) means that only c2's render gets called, (do (om/build c2 ...) (om/build c1 ...)) means only c1's does.
22:18amalloyi don't know about om, but it sounds like build returns something meaningful, rather than just doing some side effects
22:19amalloyand there's a build-all function, which looks like it's for doing multiple things
22:23coventryThanks, amalloy. I'll look into it.
22:32quizdramalloy great site thanks
22:44maclaneexit
22:44maclaneexit
22:45webushi clojurians!
22:48quizdrwhere might I go to find good clear information on setting up a Clojure web server on Linode or Rackspace, etc. I'm using Heroku right now, which takes care of everything for you, but I'd like to tryother things, but don't have that type of sysadmin knowledge
22:53webusi want to write some AI implementation. is core.logic good choice for this ?
23:07gtrakquizdr: depends on how much control you want.. easiest thing might be a java host that takes war files.
23:08TEttingerwebus, what kind of AI?
23:10webusTEttinger> first, i want create simple chat bot. but i want speech recognition and generation of speech through Google services. I want to realize self-learning to memorize unknown bot him questions and answers
23:11TEttingerwoah that's a lot different than the AI I do (which is really just pathfinding, game AI is less difficult haha)
23:12TEttingerspeech recognition would be hard for AI, no? people have to ask siri one question at a time and it often gets the words subtly wrong...
23:12quizdrgtrak is the war approach also what is known as AOT ?
23:13gtrakquizdr: at least the servlet part has to be AOT, AOT means 'ahead of time', AOT compilation to be precise.
23:13quizdryea speech recognition is no small chore. siri must send all your voice data to the cloud for massive processing before it can return an answer.
23:13TEttingerquizdr, I don't think so. AOT is ahead-of-time compilation, to make .class files, which can be for jar or war
23:13gtrakclojure itself is also compiled... so it can load the rest.
23:14gtrakbut java has to call into a java class, whose name is specified in a web.xml, that's how the servlet spec works.
23:15quizdrthis stuff might be above my head for now. better stick with heroku
23:15gtrakit's not hard.. it's just a lot of details.
23:15gtrakyou wouldn't want to do it unless you already have legacy java knowledge, most likely.
23:16TEttingerthere's some good articles on AOT I have to look up a lot
23:16gtrakheroku is way nicer.
23:17quizdri have never used Java, so probably not a wise endeavor for me at this point. better leave it to the host provider to handle, of which Heroku seems to be the only one that does it all for you
23:18TEttingerooh https://github.com/kumarshantanu/lein-servlet
23:18gtrakunless you have a motivating use-case...
23:18gtrakTEttinger: ring has a servlet implementation itself, and lein ring uberwar's a thing.
23:18gtrakthough I found it lacking and wrote my own.
23:18quizdrmy motivating use case was that you can get cheaper servers if you set them up yourself. compare Linode pricing to Heroku pricing, for example
23:18TEttingeroh nice. I haven't done any web dev in clojure, all local
23:19gtrakquizdr: set it up yourself on a linux VM and you'll know how it all goes together :-).
23:19gtrakalso free.
23:19quizdrplus the linode pricing includes lots of storage, as opposed to Heroku which suggests you offload storage to other places
23:19RaynesI used to host refheap on heroku.
23:19RaynesWith SSL, the amount I paid required fundraising.
23:20gtrakI've installed linux about a thousand times and I find it too annoying to deal with on a regular basis.
23:20RaynesAnd I couldn't justify fundraising the amount required to host it on Heroku when I could host it myself for cheaper.
23:20TEttingerbuy off-lease servers on ebay, install linux, gasp as your ISP bills and power usage goes through the roof!
23:20gtrakrather.. I use linux full-time, I just don't want to sysadmin linux full time.
23:20RaynesBut that's because refheap doesn't run on a dedicated server, and I also share the server with amalloy.
23:21gtrakTEttinger: I bought an intel atom just for that purpose.. but that's slow.
23:21gtrakan old laptop might have been a better choice.
23:21TEttingerthat's what I host my lazybot on
23:21RaynesRefheap runs on a linode with 4clojure, lazybot, my blog, php sites, etc.
23:21TEttingerbuilt in UPS!
23:21gtrakexactly!
23:22gfredericksRaynes does professional clo
23:22quizdrRaynes was setting up the linode a challenge?
23:22gfredericksI started a joke and then tried to delete it but accidentally sent the first half
23:22RaynesRaynes doesn't do professional Clojure if that's what you were saying :p
23:22quizdryou guys who have done it should put up a nice walk through of the process. i'd pay for the knowledge actually, a good mini-book.
23:22gfrederickscloak
23:22RaynesRaynes used to do professional Clojure
23:22gfrederickscloves?
23:22RaynesI do professional cloves.
23:23RaynesWe'll go with that.
23:23technomancyRaynes: put 'er here buddy
23:23technomancyformer professional clojurists club
23:23Raynes'er*
23:23gfredericksclowns
23:23Raynestechnomancy: We have plans.
23:24technomancyRaynes: "we" as in club members?
23:24RaynesWe as in my team :p
23:24gtrakanyone familiar with lein enough to know where this data shape could come from? {[:extension jar] /home/gary/dev/project/target/projectname-1.3.2-SNAPSHOT.jar}
23:24gtrakI have some old plugin code that's expecting just a string.
23:24gtrakbut it's getting a map.
23:24gtrakworks on 2.0.0, broken after.
23:24quizdrseriously if anyone documented the process of setting up a website on linode for Clojure, that would fill a huge gap in the info that's out there on the subject
23:25quizdri just chatted with linode and they said they don't have any info on it, everyone points you to some other place
23:25RaynesGet a linode, install leiningen, LEIN_NO_DEV=1 lein ring
23:25Rayneslein ring server*
23:25RaynesDone!
23:25Raynes:p
23:25technomancyno don't do that
23:25quizdrk Raynes what is your paypal
23:25quizdr;)
23:25technomancyuse an uberjar
23:25technomancyLEIN_NO_DEV doesn't even work on lein2
23:26quizdrah, see the plot thickens already
23:26Raynestechnomancy: It isn't a thing?
23:26RaynesAlso, I still disagree with you about lein ring.
23:26RaynesI think it's quite splendid.
23:26technomancyRaynes: you have to use profiles for that now
23:26RaynesAnyways, IIRC lein ring looks for LEIN_NO_DEV.
23:26TEttingerhow much does a linode cost about? it's a monthly bill, but I guess it strongly depends on your needs
23:27quizdr$20 per month for starters
23:27technomancyRaynes: lein ring is neat, but as you've demonstrated it is easy to get wrong
23:27gtrakaha, the jar task returns something different
23:27technomancyalso, it wastes a lot of memory; you should use trampoline
23:28Raynestechnomancy: I don't think I got it wrong though -- I still thing that lein ring uses that environment variable. But you can also use profiles just the same.
23:28Raynesthink*
23:28technomancyif you have to use lein ring it's something like `lein trampoline with-profile production ring`, but you still have to deal with crappy boot times compared to an uberjar
23:28RaynesTrampoline is a good point.
23:28noonianlein ring uberjar
23:28RaynesIf you're worried about boot times on a web app...
23:29gtraktechnomancy: can you point me at where the return value changed in the output of the jar task? {[:extension jar] /home/gary/dev/project/target/projectname-1.3.2-SNAPSHOT.jar}
23:29gtrakwondering if I can just cond on that vs the old behavior.
23:30technomancyRaynes: you also have to be more careful about snapshots not sneaking into your build; artifacts could change across process restarts, which is impossible with an uberjar
23:30RaynesTEttinger: We pay $60 a month for 8 cores, 3GB of RAM, and something like 50GB or so of disk space.
23:30gtraktechnomancy: ah, I see the code's pretty obvious, nm :-)
23:30technomancyplus it's like seventeen files instead of two
23:30technomancygtrak: probably changed when classifiers were introduced
23:30Raynestechnomancy: I think the biggest win is not having to put the ring-jetty-adapter boilerplate in your code.
23:31gtrakyea, that looks like what happened.
23:31RaynesI akin lein-ring to that boilerplate.
23:31gtraktechnomancy: but if I use [:extension "jar"] as a key, that's reliable.
23:31technomancyRaynes: it's four lines
23:31Raynestechnomancy: That very much depends on what you want to do with it.
23:32RaynesAnd it's still 4 lines.
23:32RaynesEh
23:32RaynesI don't think lein ring qualifies as magic. I mean, you've got some valid issues with it, but it's pretty straight forward.
23:32RaynesYou tell it what var your handler is, it throws it at jetty and makes it easy to configure things.
23:33TEttingerRaynes, sounds good. http://www.ebay.com/itm/DELL-C6100-CLOUD-SERVER-6x-1-8GHz-AMD-6-CORE-HEX-CORE-144GB-RAM-3x-750GB-/171182816383 or some other (presumably) off-lease enterprise server would be complete overkill huh. I still want one.
23:33RaynesAnyways, arguing with the guy who invented leiningen about how to best use it is not really a good idea for me.
23:33Raynes:p
23:33technomancyRaynes: it's OK; I'm not a professional clojure developer =)
23:34RaynesHahaha
23:34RaynesHey, I'm not either!
23:34FoxboronRaynes: dude
23:34FoxboronRaynes: i saw you hacking Python the other day, heard about Hy :D?
23:34technomancywell then aren't we a pair http://i.imgur.com/pjLt88C.gif
23:34RaynesFoxboron: Have not
23:35gtraklein ring thankfully is small enough to rip out when you've exceeded it.
23:35RaynesFoxboron: Oh, that's cool.
23:35FoxboronRaynes: its a LISP that is 100% introptable and bidirectional with python 2.6, 2.7, 3.2, 3.3, 3.4 and pypy :3
23:35Foxboroninteropt*
23:35RaynesPretty cool.
23:35Foxboronyou should check it out if you dislike Python syntax, borrows clojure syntax on a few things.
23:36technomancyI met the guy who made Joxa the other day
23:36technomancylooks pretty cool
23:36carkFoxboron: it's all about semantics though
23:36gtrakschmemantics
23:37gtrakit's all about having macros
23:37carkyes that sgh..thing too
23:37Foxboronwe got macros and reader macros :3
23:37carkdo you have core.async ? =)
23:38Foxboronuhhhh, dosnt python have something similare underway :D?
23:38Foxboroncould easly make a wrapper to have it feel and look the same
23:38john2xdoes Hy have persistent datastructures?
23:38Foxboronjohn2x: Python do have libs doing that, so yes we do.
23:38carkjohn2x: ahyes, the main selling point of clojrue
23:40john2xah did not know about the libs.. cool!
23:40chareI LOVE CLOJURE NOW
23:40chareYOU GUYS LOVE CLOJURE TOO?
23:41eggheadwut
23:41coventryamalloy: You were right.
23:41eggheadchare: clojure is a cool language I like to use it sometimes to write computer programs
23:42john2xI keep on forgetting how to do this. *sigh* How do I reload a namespace I `use`d in the REPL? (better yet, how do I reload *all* namespaces I've `use`d so far?)
23:42gtrakI like to use it to heat my cpu, my girlfriend wonders why I leave so much garbage around the house.
23:42charegtrak so she dumped you
23:42gtrakit was a GC joke.
23:42gtrakshe didn't get it.
23:43noonianjohn2x: (use 'the.namespace :reload) will reload the single file, reload-all will reload all files it requires also
23:43nooniani don't think there's a way to do it for everything you've 'use'd in the repl before
23:45john2xhmm but there's a function to list all namespaces used/referred so far right? maybe I could write a fn to go through the list and reload each, and inject it into lein as a utility
23:47s4mueljohn2x: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
23:47tpopejohn2x: check out refresh in tools.namespace
23:48charewhats the latest cool news about clojure
23:50RaynesOr bultitude.
23:50Raynestpope: Represent, yo.