#clojure logs

2013-11-12

00:01akurilinUnrelated: what's the most idiomatic way of configuring a library in Clojure with some state? For example, you have a library which wraps an API that needs a key, and you want to set it once at init. Is an atom in the library's ns to contain that state a bad idea?
00:01akurilinand a call (set-library-key! "foo")
00:02swarthyi use a let over lambda for that, func that takes in the api stuff and sets a local that returns a new function
00:02swarthywith that state encapsulated
00:02swarthynot sure how idiomatic that is
00:03justin_smithswarthy: the lispy version of a factory :)
00:04justin_smithakurilin: we use a config function that loads an edn file based on current running environment, and then execute with config bound to that value lexically
00:04swarthyjustin_smith: I guess so
00:05justin_smiththat way, if I need to connect to the staging and prod dbs from dev, I can make a pair of macros in the repl that execute in the context of each of those configs when doing db queries
00:05justin_smithso I am not stuck having to run a repl for each env, or restart my repl in order to switch env
00:05akurilinthat's fancy!
00:05justin_smiththe main repl I use is launched from ring inside the :init function, inside the context of my current environment's default config
00:05justin_smithwhich is usually enough :)
00:06bitemyappakurilin: I was saying something about AOP
00:06bitemyappakurilin: emphasis on the P
00:06justin_smiththe macro is just (defmacro in-staging [& body] `(with-app-config staging-config ~@body))
00:07bitemyappakurilin: I linked you the damn articles too
00:07bitemyapp`cbp: I'm back.
00:07bitemyapp`cbp: READY TO ROCK SOME NOOBS?! hue hue hue hue
00:07bitemyappakurilin: swarthy's suggestion of let over lambda is the closure pattern I was talking about yo.
00:07bitemyappakurilin: that is mad-idiomatic for Clojure. Do it!
00:10bitemyappswarthy: totally idiomatic. be proud.
00:11swarthybitemyapp: I can't tell if this is real or sarcasm. lol
00:12bitemyappswarthy: mad sincere. I'm serious. closures, let over lambda, etc etc are allllll gooood.
00:12bitemyappswarthy: I wish people would use the nice functional patterns from Common Lisp more
00:12bitemyappand less of the Ruby-esque monkeypatch bullshit.
00:13justin_smiththe hilarious thing is ruby people think they are emulating lisp when doing that stuff
00:14swarthybitemyapp: ahah, thanks!
00:14bitemyappswarthy: it's actually a semi-hobby of mine to hammer out safe, clean, functional ways to do encapsulation, DI, and the like.
00:15bitemyappespecially ways that don't rely on globals, are async-safe/thread-reentrant, etc.
00:23justin_smithhow about multi-config re-entrant
00:24bitemyappjustin_smith: are you mocking me?
00:24justin_smithnope
00:24justin_smiththat one is my priority (being able to have multiple configs for my app running at once)
00:24bitemyappjustin_smith: multi-config I'm down with, ditto re-entrant, but you're going to need to help me with the peanut butter and chocolate thing you're doing
00:24bitemyappjustin_smith: ohhh! yeah I do that all the time.
00:24justin_smithie. talk to staging and prod dbs at the same time
00:25bitemyappjustin_smith: my @work project has that.
00:25bitemyappjustin_smith: you can just fire off instances of the service with an arbitrary config (environ first, then gets overridden by closures), the instantiation returns its own shutdown function.
00:25bitemyappjustin_smith: you stash the running instance shutdown fns in an atom.
00:25justin_smithdo you have a good way to do that for multiple libs sharing a config, without using a special var? we have a special var macro that is working nice, but if we could avoid using that...
00:26bitemyappjustin_smith: environ + closures. To be more helpful I'd need to know what you mean
00:26bitemyappjustin_smith: if my guess is right, your problem is that the data is a global in the library
00:26bitemyappjustin_smith: I avoid that and just DI the data dependency with a closure to the library and get constructed fns with the config provided.
00:26justin_smithhmm, I thought environ used a file to put your app in a specific config, so it prevented multi side-by-side configs
00:26bitemyappor just directly provide in a vanilla fashion as arguments.
00:26bitemyappjustin_smith: naw, it's an onion man.
00:27bitemyappenviron is outer layer, closures and arguments are the inner layer.
00:27justin_smithbitemyapp: no, no longer aglobal we moved it out of that, and now each of our libs refer up to the var which gets special bound
00:27bitemyappyes, environ is global and all that, but it just provides the global defaults, it has lower precedence than your closures/arguments at all time.
00:27justin_smithI guess the other option is to spawn a clojure let over lamabda for each libs functions?
00:27bitemyappjustin_smith: yeah, that could work, I'd do it with closures/arguments instead, but that seems viable.
00:28bitemyappjustin_smith: well I used to do that in JavaScript all the damn time.
00:28bitemyappjustin_smith: the top level module of my JavaScript would have a lexical closure around the entire library. that sort of thing.
00:28bitemyappthat or just make the dependency explicit as an argument.
00:28bitemyappnuthin' stoppin' ya.
00:28justin_smithright
00:28technomancybitemyapp: are you talking about functors again
00:28justin_smiththe tricky thing is the chaining, when a lib gets used multiple places you then have to pass it in explicitly everywhere
00:29bitemyapptechnomancy: actually no, but what we're talking about could be modeled as a comonad.
00:29justin_smithinstead of just refering to a function in its ns
00:29bitemyapptechnomancy: so if you'd like to make this about functors...I can make it happen cap'n.
00:29technomancyI just thought I saw parameterized namespaces floating by
00:29justin_smithbitemyapp: ideally, config could be an ml module that is specialized with your app settings :)
00:30justin_smithyeah, clojure needs paramaterized namespaces
00:30bitemyappjustin_smith: well, I typically pull all the closed over fns into a core/main namespace of some kind
00:30bitemyappjustin_smith: but you've inspired me to think about an ns+ or some kind of wrapper thingy to do what you're talking about.
00:30justin_smithbitemyapp: and how do you export them?
00:31technomancybitemyapp: btw: doesn't work yet but http://p.hagelb.org/edgestow.ml.html
00:31justin_smithI bet we could make ml style modules work in clojure
00:31bitemyappjustin_smith: depends on how many there are and how much variance there is in the data provided, because I'm kind counterbalancing how much repetition I want to tolerate. Sometimes a vector, sometimes a map.
00:31bitemyappjustin_smith: well that's what I'm saying, I think it could be done.
00:32justin_smithtechnomancy: woah, the default ocaml highlighting in emacs? I recognize those goldenrod lets anywhere
00:32technomancyjustin_smith: zenburn+tuareg
00:33justin_smiththat's the name I was forgetting
00:33justin_smithtuareg
00:34bitemyappML modules are a good example of what happens when you work with a set of well-designed constraints
00:35justin_smithbitemyapp: so I think the general outline of it could be an ns with defns that each wrap a let-over-lambda generator with a config arg - and the one arg that all of them get when you realize the module is the ns you are generating
00:35bitemyapptechnomancy: the haskell alternative: http://learnyouahaskell.com/functors-applicative-functors-and-monoids
00:35justin_smithso from a app-module ns, I can generate my-app.prod, my-app.staging, etc. as needed
00:36justin_smithso when you call those generators, they create and fill the config specialized ns
00:36bitemyappjustin_smith: which is pretty easy to reason about and see why it'd be helpful, but I think applicative functors are a more powerful and general way forward with that whole problem class.
00:36bitemyappjustin_smith: do you know Haskell?
00:36justin_smithbitemyapp: barely, more familiar with ocaml
00:36bitemyappjustin_smith: okay yeah, you'll want to grok applicatives and functors.
00:37bitemyappjustin_smith: the rabbit hole goes much deeper in Haskell, it's a great time.
00:37bitemyappjustin_smith: I'm one of those fluokitten nuts.
00:37bitemyappjustin_smith: https://github.com/uncomplicate/fluokitten
00:37justin_smithyeah, I take a taste every once in a while, it starts to make a little more sense each time
00:37bitemyappjustin_smith: it's like acclimating to the water temperature in the ocean, just dive in yo.
00:38justin_smithheh, maybe if I get some time off work
00:38bitemyappjustin_smith: I recommend http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way/
00:39justin_smithI love learning and try to do it often, but this kind of thing takes up a limited reserve. Right now I am focusing on packing (subproblem quad-trees for marking a space at the moment)
00:39justin_smithbitemyapp: I've seen that one, like the title
00:39bitemyappjustin_smith: well, it's more information dense and useful than LYAH/RWH
00:40bitemyappLYAH/RWH are too little butter on too much toast.
00:40bitemyappHTHW is proper awesome. you only read the important bits that lead to grokful awesomeness.
00:45jared314with lein-cljsbuild, is there a setting to stop it from including cljs.core?
01:03coventrytechnomancy: Do you know why, if I put a println in nrepl.discover/wrap-discover's anon fn (and inside its push-thread-bindings), I don't see the output in the repl, but I do see output from println's in the fns it calls such as nrepl-op?
01:11muhoosorry if i've asked this before, but what does (let [{[foo] :bar} x] ...) do? it's a weird pattern, i'm used to seeing (let [{:keys [foo] :as bar} x] ..) but never seen the former before
01:11jared314muhoo: it looks like nested destructuring
01:12muhooyou can nest destructures?
01:12noidimuhoo, I think you asked this two days ago or so and I answered :)
01:12muhoonoidi: auugh, memory agai
01:13muhoosorry
01:13muhooi didn't see the answer though.
01:14jared314muhoo: http://logs.lazybot.org/irc.freenode.net/%23clojure/2013-11-10.txt
01:14noidi(let [{foo :bar}]) assigns the value under the key :bar to name foo. (let [[foo] [1 2 3]]) takes the first item in the list and assigns it to foo
01:14bitemyapp,((fn [[[x]]] (println x)) [[1]])
01:14clojurebot1\n
01:14bitemyappmuhoo: ^^
01:14noidithat's just putting the two together and assigning the first item in the list under the key :bar to foo
01:14brainproxyclojurescript compiler has started telling me "no such namespace at line..."; i've looked over every line of code, my git diffs and for the life of me can't figure out what it's complaining about; is there a way to get more info about the error?
01:15brainproxyi'm using `lein cljsbuild once ...`
01:16brainproxyto make it even more frustrating, despite the warning, the output of the build passes all the tests and I'm not getting any errors in my browser console
01:17muhoojared314: thanks
01:17bitemyappbrainproxy: lein clean?
01:17jared314brainproxy: i assume you have run a lein cljsbuild clean?
01:21sm0kewhy isnt there a let-while in clojure?
01:22brainproxybitemyapp jared314: yep, made sure to do clean
01:23jared314sm0ke: what about doing a for?
01:24jared314sm0ke: for has a :when option
01:24sm0kejared314: isnt "for" for list comprehension stuff
01:24muhoo nice: {{:keys [bar baz]} :params} :as request}
01:24muhoosaves a let line in a ring handler
01:25bitemyappmuhoo: dude, this is Clojure. of course it works. :)
01:25jared314sm0ke: what did you want to do with your let-while?
01:25sm0kei would like to wait over a core.async channel
01:25sm0kein a while loop until channel closes and returns null on <!
01:26jared314sm0ke: in a go block?
01:26sm0keyea
01:26sm0keor a (thread) with >!!
01:26sm0kei mean <!!
01:27sm0kehmm i seem to have a metal blockade from time to time
01:27sm0kemay be i am losing brain cells due to radiation
01:29bitemyappsm0ke: fly a lot?
01:29muhoobitemyapp: actually, the above does not work
01:29justin_smithsm0ke: how would this be different from (loop ...)
01:29bitemyappmuhoo: oh, :(
01:29jared314sm0ke: loop recur would do it
01:29muhoothe :as appears to not be happy, but the destructuring works without the :as
01:31sm0keyeaaa
01:31sm0kebut it seems like loop [a (<! c)] whould not terminate by itself
01:31sm0kedoes loop checks for truthly values?
01:32jared314not that I know of, you would need a check in the loop
01:32sm0kei would have to do a (nil? a)
01:32sm0keyes
01:32justin_smith,(let [{{:keys [bar baz]} :params :as request} {:params {:bar 0 :baz 1}}] [bar baz (+ bar baz)]) ; muhoo
01:32clojurebot[0 1 1]
01:33sm0keisnt that unnecessary
01:33sm0keif i had a let while
01:33sm0keyou see the point?
01:34jared314almost, it sounds like you want to avoid an if
01:34justin_smithmuhoo: see above, you just had :params on the wrong side of the }
01:34rs0question about the command line: lein spec -a is awesome, but i'd find it a bit easier to read the output if it cleared the screen each time before running the tests and displaying output. is there any way to do this?
01:34sm0kejared314: isnt clojure all about simplicity?
01:35sm0kei may be too lazy also
01:35jared314sm0ke: i remember a Rich talk about that word
01:35jared314sm0ke: i think he defined it
01:35justin_smithsm0ke: this is clojure, you can write let-while :)
01:35muhoonow, this works https://www.refheap.com/20757
01:35sm0keyes :(
01:35sm0kei dont yet know macros
01:35justin_smithno you have a reason to learn
01:35muhoodestructuring ftw
01:36justin_smith*now
01:36muhooif you're lazy, then (doall sm0ke)
01:36sm0kejustin_smith: you are right
01:37bitemyapp`cbp: that was intense and awesome.
01:38muhooactually if (doall) worked in real life, i'd have no problems.
01:38`cbpbitemyapp: :D
01:40bitemyapp`cbp: you and that bane did a great fucking job
01:40bitemyappthe cc was critical
01:41jared314does a cljs build always include cljs.core?
01:42muhoojustin_smith: ah, i didn't realize you can have stuff after the :params
01:42justin_smith:as name always goes last
01:42justin_smithafter the individual sub bindings
01:44RaynesAs God intended.
01:44justin_smithOT: how do I make the sound system on an ubuntu headless server initialize without a user GUI login happening?
01:44justin_smithnever mind, off to #ubuntu
01:46bitemyappjustin_smith: http://askubuntu.com/questions/211039/getting-system-to-boot-in-headless-mode-set-up-without-display-problems
01:47justin_smithbitemyapp: it boots, but no audio devices get initialized
01:47justin_smithif I do the gui login, bam, audio devices
01:47bitemyappjustin_smith: that's a different question. ask the right question >:|
01:48bitemyappjustin_smith: http://raspberrypi.stackexchange.com/questions/3632/running-headless-how-do-i-create-a-boot-sound
01:48justin_smithI asked how to make the sound system on a headless server work without gui login
01:48justin_smithI was very precise
01:48bitemyappjustin_smith: also, sudo service pulseaudio start
01:48justin_smithI did that
01:48bitemyappjustin_smith: check the other link then
01:48justin_smithpacmd list_sinks shows nothing before the gui login
01:50justin_smithok, second link looks right so far, thanks
01:51justin_smithbitemyapp: all that second link does is call aplay
01:51justin_smithit does not initialize audio devices
01:51justin_smithI don't want a startup sound, I want to run 16 channels of audio into a fingerprinter daemon :)
01:52justin_smithbitemyapp: though, you are still more helpful so far than #ubuntu has been
01:52justin_smithlol
01:52justin_smithI think the real solution is to use debian or something, the boxes owners wanted ubuntu
01:53bitemyappjustin_smith: in a more truthful world, #ubuntu would be ##cuntsville
01:53bitemyappbut with two ##'s, because it's not Official.
01:53lazybot⇒ s
01:53bitemyapplazybot: shut it.
01:53bitemyappI haven't had a good experience in #ubuntu since 2005.
01:53sm0ke can a core.async channel have multiple consumers?
01:53bitemyappsm0ke: 'course.
01:54sm0kewhat is the message policy?
01:54sm0kei mean does everyone gets same message
01:54bitemyappsm0ke: it's a programming language, the policy is whatever you make it.
01:54sm0keor only one of them?
01:54bitemyappsm0ke: you want repeat propagation, then do that. if you want sharding, then do that.
01:54sm0kehow?
01:54clojurebotwith style and grace
01:55bitemyapp^^ that.
01:55sm0ke:)
01:55bitemyappsm0ke: why not take a wild guess, and see what happens?
01:55swarthysm0ke have you written any Go, the language that stuff is based on?
01:55bitemyappjustin_smith: kindly explain to me how sudo service pulseaudio start doesn't work?
01:55bitemyappswarthy: don't talk about that language in here.
01:55bitemyappmy liver starts oozing bile whenever I hear about it.
01:55bitemyappthen the fangs come out, then people start screaming.
01:55swarthybitemyapp: ahah why?
01:56sm0keno..i have used actors in akka though
01:56sm0kebut thats more explicit you have routers
01:56bitemyappswarthy: Go sets programming back to about the ~80s.
01:56bitemyappmaybe the 90s.
01:56justin_smithbitemyapp: it starts, and sees no sound devices
01:56sm0kean a pool of actors
01:56justin_smithafter GUI login, all sound devices are visible
01:56justin_smithsome initializing is waiting for the login
01:56justin_smithI don't get it
01:56bitemyappjustin_smith: toss me an error message.
01:56justin_smithjuked@juked-maudio:~$ aplay -l
01:56justin_smithaplay: device_list:268: no soundcards found...
01:56justin_smith
01:56justin_smiththat's it
01:57justin_smiththe whole thing
01:57bitemyappjustin_smith: that's after starting pulseaudio?
01:57justin_smithyes
01:58jared314with autospawn?
01:58bitemyappjustin_smith: lspci plz
01:58justin_smithnow, after login I get http://sprunge.us/eNjV
01:58justin_smith
01:58bitemyappjustin_smith: alsamixer + F6 plz
01:58justin_smithbitemyapp: same message from alsamixer
01:58justin_smithrefuses to launch, claims no cards found
01:58bitemyappjustin_smith: try speaker-test
01:59justin_smithok, have to reboot I think, I logged in and now devices are visible
01:59bitemyappjustin_smith: well do that then
02:01justin_smithas soon as I log out, speaker test hangs and no sound cards are visible
02:01justin_smith(gui log out, ssh logged in)
02:01bitemyappjustin_smith: aplay -l?
02:01justin_smithonce again, no soundcards found
02:02justin_smithsame message from alsamixer
02:02ambrosebs60 minutes left :) http://www.indiegogo.com/projects/typed-clojure/x/4545030
02:02bitemyappjustin_smith: ubuntu 13.04 or 13.10?
02:03justin_smithwell, more precisely, cannot open mixer: No such file or directory
02:03justin_smithLinux juked-maudio 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 07:38:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
02:03bitemyappjustin_smith: with sudo?
02:03justin_smiththat was it
02:03justin_smithd'oh
02:03justin_smithof course
02:04bitemyappjustin_smith: I'm a fucking pro.
02:04justin_smiththanks!
02:04bitemyappjustin_smith: I was one of those rare souls to get Linux wireless working in the bad old days.
02:04justin_smithheh
02:04bitemyappI have the limitless patience and hatred necessary to get such things.
02:04bitemyappAlso useful for: suicidal assassination missions.
02:04justin_smithwell, hat's off, this thing was driving me crazy, and that solved it
02:05bitemyappand people wonder why I use a mac in addition to my thinkpad...
02:06justin_smithI have a mac that my company bought me, sitting on my desk on work
02:06andyfingerhutambrosebs: Thanks for the reminder, and the work on typed Clojure
02:06justin_smithit was last turned on 3 weeks ago
02:06justin_smithmacbook pro
02:06ambrosebsandyfingerhut: thanks!
02:07bitemyappjustin_smith: I prefer Linux for the package management and XMonad, but having a mac as a fallback doesn't hurt...
02:07justin_smithbitemyapp: now that you've helped me once, beware, I may be coming to you asking for geometry / space partitioning / packing algorithm help
02:09bitemyappjustin_smith: algorithms are probably my weakest point, but you know, why not? maybe I'll learn something.
02:09justin_smithit'll need to be another day
02:10bitemyappsure.
02:12justin_smithgood night
02:13bitemyappjustin_smith: night night
02:39ambrosebsfinal call! 20m left! http://www.indiegogo.com/projects/typed-clojure/x/4545030
03:22brainproxycongrats, ambrosebs!
03:22ambrosebsbrainproxy: thanks!
03:43bitemyappambrosebs: grats :)
03:44ambrosebsbitemyapp: thx :)
06:22noncomin order to organize a proper bi-directional communnication with core.async, do I have to create 2 channels? one for direction A->B and the other - for B->A, is this idiomatic?
08:38mattreplIf any NoVA residents outside the beltway want to carpool to Clojure/conj, get in touch
08:41john2xfor those who hate parentheses https://github.com/one-more-minute/chiara
08:44tbaldrid_noncom: yes, you need two channels, and there's several ways to do this, but the way you mentioned is fine
08:49noncomtbaldrid: cool! thanks!
09:00TimMcambrosebs: Why did I only hear about the campaign just now?
09:03llasramTimMc: A tragic failure on the part of the community. Although I'm really not sure how you missed it :-)
09:04ambrosebsTimMc: :)
09:06pjstadigmattrepl: cool, you'll be at the conj?
09:06pjstadigmattrepl: i'm driving up tonight and going to the scheme workshop tomorrow
09:07ambrosebsman I wish so badly I was going to scheme workshop
09:07mattreplpjstadig: yep! nice. let me know if you need a place to crash.
09:07TimMcOf course, if I subscribed to the ML, I'd hear about more of these things.
09:08pjstadigambrosebs: are you going at least be at the conj?
09:08ambrosebspjstadig: no
09:08pjstadigambrosebs: oh :(
09:09ambrosebsI think I've had my share of Clojure-related success this year. Next year!
09:10pjstadigambrosebs: hehe, yeah you've had a good year :)
09:10ambrosebsI actually submitted a talk but it was rejected
09:11ambrosebsMight have been able to attend, but I decided to only crowdfund one thing at a time ;)
09:19seangroveIdead #4298: DoS attack the ml via questions re: licenses.
09:31noncomif i want to subscribe a channel to several topics within core.async, do i have to do the corresponding amount of (sub)s ?
09:37tbaldrid_noncom: yes
09:39rstandywhat book would the clojure community would suggest to a CL guy coming from CL+Emacs+SLIME
09:39rstandy?
09:44pjstadigrstandy: maybe "Joy of Clojure"?
09:44pjstadigthere aren't a ton of clojure books, nor is any of them targeted specifically at CLers
09:44pjstadigbut that one is generally considered a good "second" book for someone who knows clojure/lisp
09:56rstandypjstadig: thanks for your suggestion!
09:56rstandyanother question: are cidar ritz modes compatibles?
10:01noncomtbaldrid: i am making a gui which consists of a hierarchy of elements (much like swing or any other), and am coming to a design where each element must have 2 messaging cycles: 1) the channel-out & channel-in which go outwards the element, to the upper layers of hierarchy and 2) the channel-out and channel-in which go "inside" the element, to the lower layers of hierarchy.
10:01noncomis that ok or am i overcomplicating?
10:03dnolentbaldrid_: it may be possible that go blocks need more help from the CLJS compiler - currently we only use vars to generate source map information
10:04carkddnolen : oh you're there, let me take the chance to Thank you for your very quick fix from cljs 2024 to 2030
10:06tbaldrid_dnolen: yeah, I figured I'm missing something like that.
10:06dnolentbaldrid_: I think this also why setting breakpoints at times is a bit finicky
10:07tbaldrid_noncom: I tried something like that, and was pretty happy with it. A pub for events coming out of a widget, and a pub for events going in.
10:07noncomnice!
10:07tbaldrid_dnolen: yeah, the meta-fix branch seems to have metadata on all call forms, but not perhaps on all vars.
10:07dnolentbaldrid_: yeah we definitely need that information on vars
10:08dnolentbaldrid_: source mapping was really bad until the tools.reader started providing line/col info on symbols
10:08tbaldrid_dnolen: what would be cool would be if line/col info defaulted to the most recently executed form. So it'd be nice if this worked: ^{:line 42} (= 1 (+ x y))
10:09tbaldrid_dnolen: it'd be nice if line 42 applied to both the inner and outer forms.
10:09dnolentbaldrid_: as far as I know this is true for tools.reader
10:10dnolentbaldrid_: and every symbol there will have that :line information + :column
10:13tbaldrid_dnolen: I'm seeing that, in my debug output. Every var that originates from the source has metadata, but new code generated by the macro (state transition code) does not have metadata on the symbols.
10:13dnolentbaldrid_: so if you splice in the symbol it loses it's metadata?
10:14dnolentbaldrid_: that doesn't make sense to me as :tag etc. works just fine etc.
10:17tbaldrid_no, that is fine. but much of the core.async blocks is auto generated code. So things like state transitions, new state creation, etc, are generated without any metadata.
10:47tbaldrid_dnolen: so I move metadata to vars, updated to the latest version of cljsbuild and source maps work much better, I'll commit changes later today when I have the time
10:47tbaldrid_dnolen: I have about 50% source map coverage in the core.async tests now.
10:51dnolentbaldrid_: excellent!
10:54dnolentbaldrid_: I'll try your changes plus tweaking how we generate source map info in cljs.compiler to see if we can get better coverage
11:01seangroveGoodness, it's been such a long time since I got to play with SOAP, I can't even remember why I would avoid it now...
11:03nDuffseangrove: Heh. The available Python bindings to SOAP are pretty much universally awful; it's not as amenable to dynamic use (as opposed to ahead-of-time code generation) as one might want.
11:03nDuffseangrove: ...but beyond that? *shrug*. Been a long time for me too.
11:05jared314seangrove: SOAP, some good ideas drowning in a sea of incompatible vendors and XML formats
11:09seangroveclojure.data.xml still the way to go for xml in clojure?
11:21amoehello, I'm looking for a clojure book that has good exercises (with answers). can anyone recommend one? I am new to clojure but experienced with java and lisp.
11:21seangroveHonestly I blame technomancy for all of Salesforce's convoluted APIs and documentation
11:21swarthyamoe: not a book but 4clojure.com is what you're looking for in terms of exercises
11:22hyPiRionamoe: while not a book, 4clojure.com is a good webpage for exercises
11:22hyPiRionah, swarthy beat me to it
11:22swarthyhyPiRion: lol, but now we have made it sound authoritative!
11:22seangroveHe works at a company that is at least vaguely associated with them, and he also made lein, which is clearly a beautiful piece of work meant as penance
11:22indigoHahah
11:22hyPiRion~4clojure
11:23clojurebotTitim gan éirí ort.
11:23hyPiRionclojurebot: 4clojure is the place to go for Clojure exercises
11:23clojurebotc'est bon!
11:23joegalloseangrove: causality violation. he wrote leiningen before he worked for salesforce/heroku
11:23hyPiRion~4clojure
11:23clojurebot4clojure is the place to go for Clojure exercises
11:23hyPiRionthere we go, now we are 3
11:24amoethanks swarthy, hyPiRion
11:24swarthylol
11:24swarthyamoe: there are great books too. Clojure Programming, Programming in Clojure, Web Development in Clojure, etc.
11:24swarthyamoe: just check Pragmatic Programmers and O'Reilly for the Clojure books. They are all current sold by one of those two I believe.
11:24danneuTyped-clojure is huge when you have a lot of java interop (crypto, in my case). Can't imagine writing this without it.
11:25danneuI've been playing with it
11:26seangrovejoegallo: I can probably work around that in my desire to assign a face to this formless mishmash of docs and code
11:26llasramdanneu: If you just want something informing you of Java type mismatches, turning on reflection warnings does enough for me
11:28danneullasram: it's mostly for my mental model. is this an ECParameterSpec, ECCurveParameters, ECCurve, etc
11:28danneui don't know how else to handle that beyond marking up my code with layman's typed-clojure anyways
11:29llasramWell, that's about what regular core Clojure JVM type hints amount to
11:29llasram(fn ^ReturnType [^ArgumentType arg] ...)
11:30jcromartiehey, does anybody have an extra room for the Conj?
11:30jcromartienot necessarily *a* room but any kind of room
11:30danneullasram: yeah, but i've found that those make the codebase hard to read, especially since ^Annotations are purely just for me while i'm writing it
11:31llasramdanneu: Fair enough, if that's your situation. But if you're doing Java interop and your code is performance sensitive, then they're not just for while writing it -- without them every Java method call will devolve to reflection
11:32danneuright, i'd add them once the namespace is farther along
11:32danneui dont start out solving reflection problems
11:33danneumaybe i just need to try a new color theme
11:37ambrosebsfwiw Typed Clojure will complain loudly if it finds reflection
11:37ambrosebsie. it's a type error
11:37llasramAh, cool
11:38ambrosebsalso type syntax is more expressive than type hints
11:38ambrosebsI find it useful to completely separate the two things
11:39ambrosebsIMO type hints aren't the best documentation
11:40ambrosebsdanneu: is your annotated code open source?
11:42danneuambrosebs: it will be. i will try to get feedback when i release it since i'm new to typed-anything
11:43ambrosebsdanneu: great. I'm just interested in how you use interop with core.typed
11:48danneui have naive/modest needs and just use it on this first-pass to remove all my type-related comments
11:51danneuambrosebs: can you point to any example projects i can check out?
11:52ambrosebsdanneu: https://github.com/typedclojure/core.typed-example
11:54ambrosebsdanneu: https://github.com/kshramt/sicp
11:54danneugreat, thanks
11:54ambrosebsnot much else that I'm aware of, except for internal annotations in core.typed itself
11:55ambrosebs(there's lots in core.typed)
12:02meingbgI'm looking for a framework/language/utility/setup for a web application that would allow automatic updates to propagate from UI all the way to db and to other UI elements affected. I don't know where to begin.
12:02seangrovemeingbg: Well, pedestal might be a fit, but it's a biiiig leap for most people from what they're used to
12:03seangroveYou're asking for quite a bit in that small paragraph, expect it to take some work to udnerstand the different approaches
12:07bjaanyone here use lein-droid?
12:08bjaI was hoping to figure out a way to force a UI redraw without navigating to other open apps
12:08Morgawrsmall question, I have a function that needs to test on the data type passed as a parameter, I want to know if the second argument is a list/vector or something else. Either list or vector is fine but seq? returns false for a vector
12:08Morgawrwhat should I use to test for both vector/list?
12:08S11001001Morgawr: sequential??
12:08lazybotS11001001: Definitely not.
12:08justin_smithbja: what is the ui toolkit? most have an explicit repaint message you can send to elements, that will propagate to their children
12:08S11001001lazybot: you like
12:09S11001001s,k,,
12:09MorgawrS11001001: thanks! that's exactly what I needed
12:09justin_smithbja: for example in seesaw it is (repaint target)
12:09Morgawrwhat's the difference between ISeq and Sequential interface?
12:09bjajustin_smith, it's neko. I'll check for something similar
12:10S11001001Morgawr: well, I'd start with `seq' doing nothing to non-empty ISeqs
12:10S11001001maybe
12:10S11001001,(let [x '(42)] (identical? x (seq x)))
12:10clojurebottrue
12:10S11001001,(let [x '[42]] (identical? x (seq x)))
12:10clojurebotfalse
12:10S11001001,(let [x '()] (identical? x (seq x)))
12:10clojurebotfalse
12:11sritchiecemerick: saw the new oauth2 workflow!
12:11sritchiegreat stuff
12:11S11001001Morgawr: that's not to say that sequential circumscribes the domain of `seq'; for that, you need seqable? from core.incubator
12:11S11001001or wherever it is now
12:11MorgawrI see
12:12cemericksritchie: that's ddellacosta :-)
12:12MorgawrS11001001: thanks
12:12justin_smithbja: I see neko.listeners.vier/on-layout-change - something you register there should get called when the window is created if it is anything like other toolkits
12:12sritchiehad to shout out to someone :)
12:12sritchieso, the oauth2 workflow looks like it's for authenticating with third party oauth services -
12:13justin_smiths/vier/view
12:13sritchiecemerick: I'm trying to absorb as much as I can about how to authenticate my REST API, now that it's come time for an iPhone app
12:14sritchiecemerick: is oauth2 too crazy to use for auth between different clients that I control? (web and iOS). trying to set up best practices for an API down the road
12:14justin_smithsritchie: doesn't oauth implicitly use a third party for auth? I thought that was pretty much the point of oauth
12:15sritchiejustin_smith: haha, that's my question - do github or facebook use their own oauth endpoint for login?
12:15sritchieor do they have a separate security scheme for apps that they control
12:17cemericksritchie: oauth is generally only used to distribute authority to third parties. I'd be really surprised if anyone used it internally.
12:17cemerickopenid has quite a presence w.r.t. single sign-on within an org (e.g. amazon!), but oauth doesn't make a lot of sense there
12:18sritchiecemerick: so oauth is not the way to go for, say, offering up a JSON api for a user's own data
12:19noncomcan be a publicated channel in core async used as a simple (non-publicated) channel, along with its publications? in other words, will it be possible to read/write from/to it like it is a normal channel?
12:20cemericksritchie: I don't *think* so. They already have an easy way to get authorized (form login?), so you just point them at the corresponding URL.
12:20sritchiecemerick: so stick everything behind SSL, and go with basic auth
12:20cemerickyeah, that'd work too
12:21cemerickI try to stay away from oauth as much as possible
12:23indigocemerick: Oauth isn't too bad
12:23justin_smithmy impression is oauth is for a) when you want a user to give your app access to their credentials with a third party b) when you want a user to authenticate based on a third party's scheme (to avoid creating extra accounts, convenience for the end user)
12:27indigojustin_smith: Or when you're making an API
12:28justin_smithwell, implicitly you are providing some service, likely an api, that requires said authentication to ensure the wrong people don't get the wrong data
12:29justin_smithor some other resource like CPU power or disk space
12:32cemerickindigo: I think you'll find that to be a pretty lonely assessment :-)
12:34augustlare there any logging systems where I can log both the reuqest and the response and somehow link the two?
12:34augustlwith traditional file logging, the only thing I can think of is to give each req/res a uuid and put that in the logs
12:34mikerodso does calling `vec` on something lazy cause it to be eagerly evaluated?
12:34TimMcjustin_smith: OAuth2 permits a user to consent to deputizing a software agent to see and/or modify their data.
12:35justin_smithTimMc: yes, like I said in case a, you want a user to let you use their data, and oauth2 provides a handy way for them to revoke you that access without changing their password or whatever
12:35sritchieTimMc: do you know if anyone's using oauth for their own login?
12:35tbaldrid_mikerod: yes, vectors are not lazy so calling vec on a lazy seq will force evaluation
12:35sritchielike, for their own iOS app?
12:35TimMcjustin_smith: Authentication with OAuth2 is tricky and disrecommended; authorization is the idea.
12:35mikerodtbaldrid_: that was what I was thinking
12:35meingbgseangrove: Thanks for the hint.
12:35mikerodWhy is there a class called clojure.lang.LazilyPersistentVector ?
12:36mikerodthe lazy + vector words sound contradicting
12:36TimMcsritchie: I am completely unfamiliar with mobile ecosystems.
12:36TimMcmikerod: It doesn't make a vector until you start modifying it.
12:36technomancymikerod: the value isn't lazy; the persistence is
12:36indigocemerick: Haha, I guess
12:40justin_smithTimMc: interesting, I see it used for authentication a lot, and have had clients ask for it just for authentication, not needing any authorization
12:40mikerodtechnomancy: TimMc Hmmm, I'm working on understanding those answers :)
12:41TimMcSorry, that was a very sloppy answer.
12:42TimMcmikerod: Or rather, it gives you backa PersistentVector that has all the items just sitting in an array, and further conjing may structure that array into a 32-way tree.
12:43TimMcIt looks like if you give it 32 or more items there's nothing lazy about it: https://github.com/clojure/clojure/blob/clojure-1.5.1/src/jvm/clojure/lang/LazilyPersistentVector.java
12:44mikerodTimMc: Ah, that makes sense to me. Possibly "lazily persistent"
12:45TimMc&(let [backing (into-array (cons 5 (repeat 20 nil))), v (clojure.lang.LazilyPersistentVector/createOwning backing)] (aset backing 0 7) v)
12:45lazybot⇒ [7 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]
12:45TimMc&(let [backing (into-array (cons 5 (repeat 50 nil))), v (clojure.lang.LazilyPersistentVector/createOwning backing)] (aset backing 0 7) v)
12:45lazybot⇒ [5 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]
12:46TimMcSee how when I gave it the larger array, modifying the initial array no longer allows me to mutate the vector?
12:49mikerodYes, that is interesting
12:49mikerodSort of unexpected, that there is a "window" where the backing array can continue to mutate the "persistent" vector
12:50TimMcYeah. :-(
12:50mikerodGood to know at least, hah
12:56technomancydo you get those kinds of vectors from any surprising places, or do you have to create them specifically?
12:58TimMcclojure.core creates some, as does clojure.string and some .java files
12:58TimMcRT, EdnReader, LispReader, AMapEntry
12:58technomancyhuh
12:59danneuHow do you fully-qualify a Java instance method or a constructor?
13:00technomancywhat would it mean to qualify an instance method?
13:00jcromartiedanneu: just use the full package.class name
13:00jcromartieor import it
13:00TimMc&(let [backing (into-array (cons 5 (repeat 20 nil))), v (vec backing)] (aset backing 0 7) v)
13:00lazybot⇒ [7 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]
13:00TimMctechnomancy: vec, of course...
13:02TimMcclojure.string uses safe array input
13:03TimMcRT/vector is another entry point
13:06arrdemofftopic: anyone know a good writeup on getting emacs set up for scala?
13:09noncomanyone familiar with cor.async here?
13:10nDuff~anyone
13:10clojurebotanyone is anybody
13:10TimMcclojurebot: forget anyone |is| anybody
13:10clojurebotI forgot that anyone is anybody
13:10TimMcclojurebot: forget anybody |is| anyone
13:10clojurebotI forgot that anybody is anyone
13:10TimMcI hate that inference engine.
13:10arrdem~inventory
13:11clojurebotI am carrying 0) a poorly-calibrated inference engine, currently leaking 1) a well-worn copy of clojure 1.2 tucked deep away inside a classloader 2) the last shreds of what was once my sanity
13:11rkneufeldarrdem: I've been using scala-mode and it seems to work pretty well.
13:11arrdemat least it's labeled as leaking...
13:11mdrogalisnoncom: What's up?
13:11arrdemrkneufeld: just core scala-mode? what's setup with sbt like? (complete scala nub)
13:12nDuffnoncom: "anyone familiar" is not a very useful question, because folks can't know how familiar they need to be to answer your _real_ question
13:12noncomsee this refheap: https://www.refheap.com/20774 i expected the output to be at least to some degree predictable, however, it looks like it is completely random..
13:12nDuffnoncom: ...so just ask the real question.
13:12rkneufeldarrdem: I make pretty heavy use of tmux, so I do everything apart from editing there.
13:12mdrogalisAh, sorry. I'm not familiar with the pub/sub stuff.
13:13arrdemrkneufeld: ok. so you aren't trying to use any sort of compiler/repl embedding in emacs.
13:13rkneufeldarrdem: I am not. Is there one people commonly use?
13:13arrdemrkneufeld: idk, I can't seem to find one :/
13:14noncomso my question is: how does that happen? why soring on topic does not work? why it pushes things to wrong reads?
13:14bitemyapparrdem: I use scala-mode2 + ensime.
13:14arrdembitemyapp: yeah ensime looks like what I need to get running...
13:14arrdemrkneufeld: http://aemoncannon.github.io/ensime/ is the closest thing it seems
13:14rkneufeldbitemyapp: thanks
13:14bitemyapparrdem: https://github.com/hvesalai/scala-mode2
13:14bitemyapprkneufeld: for what?
13:15bitemyapparrdem: you want scala-mode2 and ensime. trust me.
13:15bitemyapparrdem: also: https://github.com/hvesalai/scala-mode2/issues/58
13:15rkneufeldbitemyapp: Didn't know about scala-mode*2*
13:15bitemyapprkneufeld: yeah it's great.
13:15bitemyappI poked the owner to upload it to marmalade, looks like Nic Ferrier is going to do it for him :)
13:16arrdembitemyapp: is the top of tree ensime working for you? I can't seem to get the ensime server started.
13:18TimMchiredman: I think "anybody" and "anyone" have both been defined as "Just a heads up...", so the inference engine periodically says "anyone is anybody". Does that sound right?
13:19noncomsorry there was a little typo in one of the messages i am sending (a instead of b), i fixed it here: https://www.refheap.com/20775 however, that does not really change much. things become even more stranger where you can see that even the amonut of returned results can differ! (see run #4)
13:22augustlare there any logging libraries out there with levels and different appenders (memory, stdout, file, .... ?) but where I can create different instances? I want a separate req/rep log, a separate log file for elasticsearch/indexing operations, etc. I found https://github.com/ptaoussanis/timbre but there's only one single global instance it seems
13:24arrdembitemyapp: cheers. ensime online :D
13:24noncomso i cannot invent reasoning for what is happening there. to me it seems wrong. how do i predict outcomes on an even larger scales? if there is some logic behind that, maybe someone can explain, because there is nothing about that in the docs or examples... maybe i'm missing something..
13:25noidiaugustl, how about using https://github.com/clojure/tools.logging with e.g. SLF4J?
13:27augustlnoncom: hmm yeah just realized you can specify per-namespace appenders in the slf4j config files
13:28noncomaugustl: been thinking of noidi, i guess
13:29noncomnDuff: do you have an idea on why do :a messages get to go sometimes to ch1 and sometimes to ch2?
13:33nDuffnoncom: you're making it non-deterministic by reading from ch1.
13:33nDuffnoncom: if you stopped reading from it, I'd expect everything to go to ch2.
13:35noncomso i cannot use ch1 as a channel if it has subscriptions because it ruins subscriptions... but then :c messages get lost? how do i then collect all messages BUT those which have a specific topic?
13:36noncomin other words, how do i collect all the messages which do not have an assigned known topic?
13:37bitemyapparrdem: very good.
13:37nDuffnoncom: I don't know that the feature you're asking for existed in any pub/sub framework I've used in the past. (Don't know that it didn't, but it's not something I remember).
13:37noncomi see..
13:38noncomwell.. does it seem unnatural or a bad design?
13:39nDuffnoncom: *shrug*. You might ask if a patch adding a :else (or such) would be accepted.
13:40noncomok, we'll see... thanks!
13:41nDuff(because https://github.com/clojure/core.async/blob/76317035d386ce2a1d98c2c349da9b898b480c55/src/main/clojure/clojure/core/async.clj#L807 pretty clearly doesn't support that feature at present).
13:42noncomyeah, looks so..
13:42noncomeven specified explicitly (to some extent)
13:51tbaldrid_dnolen: pushed latest changes to meta-fixes on core.async. I think better CLJS support would help quite a bit.
13:52dnolentbaldrid_: excellent - will poke around likely tomorrow on train to Conj
13:52tbaldrid_dnolen: cool
13:54justin_smithin the spirit of Let Over Lambda, someone should implement a Request Over Functor Lambda Mondad Aspect Object
13:56mdrogalisYou can have a laugh at my expense, justin_smith. I typed it out in acronym form and *then* realized it.
13:57hiredman /win 15
13:58justin_smithI am sure there is something actually useful that we could pigeonhole into that acronym
14:01bitemyappjustin_smith: is that a challenge?
14:01mdrogalisThe Datomic Inference Console Kit.
14:02hyPiRionmdrogalis: oh dear
14:02justin_smithbitemyapp: probably something along the lines of what we were talking about the other night regarding parameterized modules
14:03mdrogalishyPiRion: I'm really not cut out for marketing.
14:04hyPiRionThat's like the discussion we had here, where cond-> was about to be named cont->, but uh, pronunciation risks
14:04SegabyteAimHere, you are even here.
14:04SegabyteWhy are you everywhere.
14:05mdrogalishyPiRion: Yeah, everytime I used to see a variable named "cont" I'd just shake my head.
14:05mdrogalis~cont
14:05clojurebotPardon?
14:06mdrogalisYeah, I think we'll just let that one rest in peace.
14:06bitemyappjustin_smith: not really. Applicative functors can solve the same problem plus a bunch of others and they're pretty simple.
14:07bitemyappthere's a lot of ways you can skin that cat without overcomplicating your compiler.
14:08patchworkLet's leave the cats alone. They are better with skin
14:08patchworkFurrier
14:10justin_smithbitemyapp: how did I know googling for that was going to take me to a page of haskell docs?
14:14bitemyappjustin_smith: so read the Haskell docs.
14:14justin_smithyeah, just saying :)
14:19eggheadwhat's the best way to concat a bunch of files into a target file?
14:19bitemyappjustin_smith: not my fault Haskellers are the main ones pushing things forward.
14:19bitemyappjustin_smith: I try to get Clojure people on board with Fluokitten :)
14:19eggheadif I use 'spit' repeatedly does that mean I have to read all the contents into memory before writing?
14:19technomancyegghead: c.j.io/copy into a single inputstream I guess?
14:19justin_smithegghead: spit has an append option
14:20bitemyappegghead: (spit "yo-file-yo" ya-data :append true)
14:21justin_smithegghead: http://sprunge.us/WLFW?clojure
14:21justin_smith
14:21bitemyappjustin_smith: do you have emacs integration for that?
14:22justin_smithbitemyapp: I use a shell script, it sucks up selection, pastes it, puts the url in selection
14:22justin_smith(x11 selection that is)
14:22eggheadjustin_smith: ya but I don't want to read all the files into memory before writing them out
14:22justin_smithso, it's just copy text, run script, paste url
14:23justin_smithegghead: then do it with clojure.java.io/copy as technomancy was suggesting
14:23bitemyappjustin_smith: yeah refheap.el works nicely: https://www.refheap.com/20781
14:23bitemyappespecially given how ridic lazy I am
14:23eggheadso a bunch of (copy input-file (writer my-output-file)) ?
14:24justin_smithbitemyapp: nice, I didn't know that existed
14:27bitemyappjustin_smith: refheap.el has a paste region and paste buffer
14:27bitemyappso REPL pastes are practical.
14:27justin_smithI se that
14:27justin_smith*see
14:28mpwdIs anybody using Storm? I am trying to figure out how to setMaxSpoutPending on a topology
14:28mpwdUsing the clojure DSL
14:28justin_smithbitemyapp: well, with my sprclj script I can paste from a repl in emacs, or a repl in a terminal, etc. it only relies on something being copied, not being in emacs. Though realistically I am usually in emacs
14:28seangrovempwd: There's also a storm users' channel in case no one here knows
14:28seangrove#storm-user, that is
14:29mdrogalishyPiRion: The Clojure Object Coordination Kernel
14:29justin_smithbitemyapp: http://sprunge.us/JRcg
14:29justin_smith
14:29mdrogalisI'm available for all marketing positions in the US.
14:30bitemyappjustin_smith: fuck monkey? really?
14:30justin_smiththe machine is a system76 bonobo
14:30justin_smithit was the logical hostname
14:30bitemyappjesus christ lol
14:31marcoHow do I close an issue on JIRA? I can't seem to figure it out
14:38lpvb"Use good names, and don't be afraid to collide with names in other namespaces. That's what the flexible namespace support is there for."
14:38lpvbwhat does it mean by flexible namespace support
14:38lpvbif you have two different libraries in leiningen of the same name (different github projects) what do you do?
14:38bitemyapp(require '[muh.fuckin.namespace :as muhfucka])
14:39bitemyapp(muhfucka/look-at-this-shit :aint :it :awesome?)
14:39lpvbbut there are two muh.fuckin.namespace
14:39bitemyapplpvb: different ns collision.
14:39bitemyappthey're talking about look-at-this-shit
14:39bitemyappnot the namespace itself
14:39bitemyappif your actual namespace collides, you're a fucking moron.
14:40bitemyapplpvb: https://github.com/bitemyapp/brambling/blob/master/src/brambling/moves/ya/bits/migrate.clj#L1
14:40bitemyapplpvb: collide with that and you deserve what you get.
14:40bitemyappthe point is to keep the NAMES inside of the namespace brief but descriptive.
14:41justin_smithand the namespace name resolves collision issues
14:42lpvbwhat if someone else makes a library called seesaw
14:42justin_smiththen make other.seesaw
14:42lpvbthere'd be two namespace seesaw.core
14:42lpvbhow?
14:42clojurebotwith style and grace
14:42technomancylpvb: then they'll get lynched if they ever come within 100m of a conj
14:43technomancylpvb: if someone else makes a lib called seesaw then they're either a troll or they don't know what they're doing. no one would use it.
14:43lpvbokay, that's what I was looking for, the convention is just to avoid namespace conflicts
14:44llasramSome people do use Java-style namespaces, where the first components are the reverse-label form of a domain they own
14:44llasramIt's not that common though
14:47bitemyapplpvb: they'll get lynched and then burnt.
15:02TimMcmdrogalis: I still use "cnt" as a for-loop limit value, but I worry about one day pronouncing it phonetically instead of as "count".
15:03TimMcI should probably use lim or max instead.
15:03mdrogalisTimMc: Just do yourself a favor and don't do it :P
15:03mdrogalisI use 'k' when I feel mathy.
15:03TimMcOh, but what if I'm building up a count of something?
15:03TimMchow-many is long
15:04justin_smithk
15:04TimMcHrm. K.
15:04justin_smithor idx
15:04justin_smithif the count is a position, idx is good
15:04justin_smithor even i or index
15:05TimMc"tally"
15:05justin_smithsum
15:05llasramTimMc: So fancy!
15:05justin_smithno, sum assumes quantities
15:06justin_smitharity ?
15:07llasramWow, cider does not like it when you visit namespaces containing functions w/ the same names as certain clojure.core function
15:07S11001001TimMc: use de Bruijn indices instead of named bindings and it'll never be a problem :)
15:08TimMcyes, yesssss...
15:09mdrogalisTimMc: It's a fun thought experiment to substitute in other variables that are only one letter shy of a swear word.
15:09TimMcbut make sure to skip indexes 4 and 13 because those are considered unlucky numbers in some countries
15:09muhoowhat do you guys use for testing db-backed web app with dummy data? i've got my datomic connection in an atom. there's code in a few places that pulls the connection out of there, and startup code that populates it. i'd like to be able to run tests in the repl without stomping on ther "real" db. is this a with-redefs? or change the way of managing that state somehow?
15:10muhooseems like there a bunch of ways to do it. i'm curious what best practices is.
15:10bitemyappmuhoo: environment variables yo.
15:10clojurebotHuh?
15:10bitemyappmuhoo: I create test databases using in memory instance (default and test config) but production/dev have different configs.
15:11justin_smithI'd create a test specific db config, and wipe the db and initialize it as a pre-action
15:11bitemyappI do something like that, but it's a bit nicer because I don't really have to be test specific, ephemeral and loaded from fixtures is the default.
15:12bitemyapppermanence is the "unusual" case and is configured for in prod/dev
15:12justin_smithmuhoo: or, with bigger stuff, in practice I have an "undo" for everything the test does, a test specific db, and then I recreate the test db from a script if my unit tests totally hose it, otherwise they clean up after themselves
15:12justin_smithusing pre/post test actions in the test ns
15:12muhooi do use environs, and there are different configs with different db setup strings. i'm curious how to have two db's going at once, one real db which the main server accesses, and a second in-mmeory for test, but this global atom is getting in my way
15:13justin_smithmuhoo: you just said it yourself, global atoms are the problem
15:13muhooalso, it' datomic so there's no undo. but it's trivial to create an in-memory dummy db
15:13justin_smithyou need re-entrant config
15:13muhoojustin_smith: that sounds interesting
15:13justin_smithbitemyapp will talk your ear off about it if you show an interest :)
15:14muhooa function instead of an atom.
15:14muhooand it can pull from wherever based on evironment vars
15:14justin_smithright
15:14bitemyappyeah, reproducible, clean code is a bit of a thing for me.
15:14bitemyappalso, composable configuration.
15:15muhooin a web app, the db handle is the one bit of global state i can't seem to shake, along with session store.
15:15cemerickdnolen: If I have a codebase that compiles without warnings, tests well under :simple (for example), but fails under :advanced with e.g. "TypeError: 'undefined' is not a function (evaluating 'Hh.n()')", is that a reasonable point at which to think I'm hitting a GClosure bug?
15:15justin_smithmuhoo: my groundhog lib records and replays requests, including any cookie based session state
15:15justin_smithmuhoo: dbs are the real gotcha, yeah
15:16muhoojustin_smith: right,, i saw that, that'll be useful
15:16dnolencemerick: seems weird, turn on source maps ;)
15:16bitemyappdatomic makes it easier than usual to do a good job with this stuff, the in memory databases are magical for testing.
15:16cemerickdnolen: Yeah, I did, but will need to read up on them. Was expecting a human-readable output. :-)
15:16justin_smithwith sql there is also h2, which has an in-memory variant that is easy to use
15:16muhoobitemyapp: it is! i'm using it ina few places. but i want to test the api from the http side, and that means a dummy server
15:16justin_smithbut then you may need an h2 specific adapter, which may not be worth your time
15:17bitemyappmuhoo: no it doesn't.
15:17bitemyappmuhoo: when I need to test my API, I do one of a few things:
15:17bitemyapp1. I start my HTTP server as a "resource fixture" in my test, then test it accordingly
15:17dnolencemerick: that bug could crop up for a number of reasons are you on 2030?
15:17muhoobitemyapp: right, that's what i mean bya dummy server
15:17bitemyapp2. or I simply have an "identity" export content type for my API and call them like clojure functions.
15:18bitemyappmuhoo: it's not a dummy server, that implies mocking.
15:18bitemyappmuhoo: there's no mocking, it's the actual service running.
15:18muhooDON'T MOCK ME MAAAAAN
15:18muhoook no mocking, this'll be a polite test.
15:19dnolencemerick: :source-map "foo.js.map" and you should be able to see what went wrong as long as :output-dir is set to something readable by your web setup.
15:19dnolencemerick: there are some issues still around relative paths.
15:19dnolenwhich actually reminds me
15:19cemerickdnolen: same problem on builds from 2014 - 2036
15:20cemerickdnolen: This is automated simple-check testing, don't have anything wired up to a web frontend at the moment :-/
15:20muhoobitemyapp: good call, could just issue ring requests.
15:21justin_smithmuhoo: if you need the request to have a valid body, there are some useful functions in groundhog for creating it out of ascii or a byte stream
15:21gf3dnolen: You recently tweeted about a new core.async article that your either wrote or enjoyed, I can't seem to find the link though, do you still remember it?
15:21dnolenCLJS users, I thinking that :source-map and :output-dir will always specifying something relative to it :output-to.
15:21muhoojustin_smith: i ould try that too, thanks.
15:22dnolenthis doesn't seem problematic to me as :output-dir is about caching and :source-maps don't matter outside dev
15:22hiredmanthe lack of a simple check session/unsession for the conj makes me sad
15:22bitemyappmuhoo: precisely, I just make fake ring requests and ask it to export the literal data structure back
15:22dnolencemerick: then make dummy index.html file and include your output js, source maps will magically work
15:22hiredmanI want someone to tell me how to use it
15:22bitemyappmuhoo: there are alternative exporters for JSON and templates, but there's always an "identity" export so I can just get data :0
15:22bitemyapper, :)
15:22hiredmanbecuase I haven't even looked at the readme
15:23dnolencemerick: see core.async for a simple example
15:23cemerickdnolen: oh, it doesn't require browser-repl shenanigans?
15:23dnolencemerick: absolutely not
15:23muhoobitemyapp: i'd have no problem getting json back and then cheshire decoding it again in order to (is (= it
15:23bitemyappmuhoo: always provide an identity export. it's nice.
15:23dnolencemerick: Chrome & WebKit Nightly allow source maps even if you're looking at an index.html with file:// protocol
15:23cemerickdnolen: ah, cool, thanks, will try. Will need to read up. Been ignoring source maps like you avoid REPL stuffs. ;-D
15:24bitemyappmuhoo: sure, test the JSON export if you want, but always provide an identity export.
15:24bitemyappit lowers the friction substantially.
15:25muhooduly noted
15:32mdrogalisSpent *most* of the day coming up with lewd Clojure acronyms. Thanks, whoever started this. D:
15:32justin_smithany time!
15:33mdrogalisIT WAS YOU D:
15:33justin_smithI was more doing "bad lulzy acronyms" rather than lewdness really
15:33justin_smithit emerged as a behavior of the complex system we call our channel
15:34mdrogalisCue musical.
15:35muhoolol is a very overloaded acronym. land of lisp, let over lambda, gee that was funny, league of legends, etc
15:36muhoolisp on lines, also for the CL folks
15:37AimHereThe UK Prime Minister thought it was 'Lots of Love' when tabloid journalists used it when texting him
15:39`cbpon http-kit websockets, the toString of a channel includes the ip of the client but sometimes the ip is NULL. Anyone know why that might be?
15:50cemerickdnolen: is there a 'go to original symbol' or something in the sources tab once the source map has been loaded
15:56TimMccemerick: I think you have to enable source mapping as an option.
15:57TimMc(Never done it myself; I just recall reading this somewhere.)
15:57cemerickTimMc: Yeah, it's on; I see all the original .cljs sources in Chrome, etc., just haven't found any "go to original/go to outputted symbol" commands, etc.
15:58cemerickThey may not be in Chrome; that's just what I happen to need at the moment, and I see there are some demos of that functionality on some source maps tutorial pages...
16:05egosumdoes anyone know of databases that behave similarly to datomic? Or dbs which can be queried in a way similar to e.g. unification? E.g. with dataomic type querying, but forget the deductive part of the DB?
16:12technomancyhiredman: there was a simplecheck unsession at strangeloop; standing room only
16:13hiredmantechnomancy: ah, and here I can't even remember what unsessions(if any?) I did
16:14hiredmanpoor life choices
16:24jared314is there a lein plugin for running post-build bash scripts?
16:24technomancyjared314: there's a lein-shell, yeah
16:25reiddraperhiredman: yeah, unfortunately I can't make it to the conj, but maybe I can make an intro screencast or something
16:25jared314technomancy: that works, thanks
16:26muhoocemerick: i'm looking forward to the day when source mapped staktraces are available in nrepl and nrepl.el
16:26dnolencemerick: if you have an exception in the JS console you can jump to it
16:26dnolencemerick: same for console.logs
16:26danneuHow come you can't (.length (byte-array 5)) ?
16:27cemerickdnolen: yeah, it only jumps to the generated js
16:28hiredmanreiddraper: ah, maybe I'll make the right choice unsession wise at another conference sometime
16:28dnolencemerick: you might need to refresh, otherwise something messed up
16:29dnolencemerick: I tried to fix most causes of this but likely you need a: lein cljsbuild clean + once
16:29reiddraperhiredman: heh, that works too
16:29cemerickdnolen: did that, but will try again
16:29dnolencemerick: also Chrome some times caches the the source map file and you might need to restart?
16:30dnolencemerick: that said, there may be issues still for source maps and simple/advanced compiled code
16:30dnolencemerick: will be looking in to see if we can make it more accurate soon
16:30seangrovecemerick: Other thing to check is that the source map is available to your browser at the url it's trying to look it up by, same with the source - it all should be, but a good sanity check
16:30cemerickmuhoo: Perhaps. I'm generally OK reading generated JS, which is pretty decent when you're using :none/:whitespace/:simple (which is all that is available in the REPL anyway).
16:31dnolencemerick: oh yeah definitely double check that browser can find source map file
16:31cemerickseangrove: yeah, I'm seeing the .cljs sources, so the .map file is surely being loaded...
16:32seangrovecemerick: And the cljs sources also open up?
16:32dnolencemerick: one way to sanity check is try to try build core.async tests and open those in Chrome
16:32seangroveIf so, then you've got an interested bug ;)
16:34cemerickseangrove: yup. My suspicion is growing that I'm hitting a GClosure bug, so there's that. :-)
16:34hiredmanis anyone using tools.analyze? I seem to be getting an empty map instead of the tree for the last arg to a recur
16:34cemerickmuhoo: that said, I'm probably just coping. Better everything would be better :-)
16:34cemerickdnolen: noted
16:35dnolencemerick: so you don't get cljs line numbers if you add a console.log to your CLJS?
16:36cemerickdnolen: nope, all references are to foo.js
16:37dnolencemerick: seems unlikely - I would with WebKit Nightly and Chrome Canary
16:37dnolenwould check
16:45muhoofwiw, this was necessary in order to make slamhound work: export JVM_OPTS="-Xmx5g -XX:+CMSClassUnloadingEnabled -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=128M"
16:46muhoootherwise it OOMs permgenspace
16:49xeqicemerick: I can confirm working sourcemaps with cljs 2030, lein-cljsbuild 1.0.0-alpha2, austin 0.1.3 fwiw
16:49dnolencemerick: just tried core.async tests in Safari 7 source maps just work for me.
16:49cemerickdnolen: oh, I was never claiming they didn't work :-)
16:50cemerickI've found the area of the problem the old fashioned way, will investigate source maps properly when I'm not trying to bash out a top-of-mind problem
16:51dnolencemerick: sure, but was just trying to figure out what might be causing the issues - otherwise will miss a source map case that's likely to crop up again.
16:51gunsmuhoo: Is there a project that I could clone to test the OOM?
16:51cemerickhrm, ok
16:52cemerickdnolen: when I'm finished with this, I'll circle back to the current SHA and dig into sourcemaps
16:52dnolencemerick: thx
16:52muhooguns: not really. it's not an open source project. but it works fine with the incantations above
16:52muhooit's also a nice space heater too. 799% CPU.
16:53muhooguns: btw, the case that was causing the oom was lots and lots (like dozens) of unnecessary requires in the ns, which slamhound helpfully removed
16:54muhooi'd gotten into the habit of just copy/pasting massive require things rather than deal with the annoying class not found errors every time i tried to do anything. finally cleaning it up with slamhound
16:55gunsmuhoo: I've never seen the CMSClassUnloadingEnabled flag; if the problem is simply a lack of heap space, then shouldn't we just advise increasing the max heap?
16:55justin_smithguns: permgen != heap
16:55justin_smithyou can crash from no permgen with literally gigs of heap free
16:56muhoopermgen apparently is to do with classloader (i'm still largely jvm ignorant)
16:56gunsI see
16:56justin_smiththis is a big clojure problem, because clojure makes more classes than java typically would, so it stresses this part of the jvm design
16:56justin_smithpermgen is the memory for classes
16:56gunsand The standard Oracle/Sun VM look on the world is: Classes are forever. So once loaded, they stay in memory even if no one cares anymore. This usually is no problem since you don't have that many purely "setup" classes (= used once for setup and then never again). So even if they take up 1MB, who cares.
16:56gunsoops
16:57muhoospurious copy/paste, eh?
16:57gunsthat was from the stackoverflow page I was reading up on ÇMSClassUnloadingEnabled
16:57justin_smithso every top level let, every fn, etc. we get shitloads of classes in clojure
16:57muhooah, with lots of anonymous functions permgen will take a beating? interesting.
16:57justin_smithand many of them we are never going to use again (depending, of course, on coding style and whether you are using the repl)
16:58justin_smithmuhoo: lots of functions period, but anon ones are likely to get used once and thrown away and thus we make more of them
16:58TimMcguns: Complete with cedilla?
16:58justin_smithso yeah, I think the classunloading option should be in the default project.clj
16:58muhooso wait, if i've got a hof that generates a fn, returns a fn, all that gets dumped in permgenspace and not removed ever?
16:59muhoofor every call?
16:59justin_smithmuhoo: I think so - each fn is its own class
16:59ToxicFrogWait, what?!
16:59justin_smithit can be unloaded if you use that option mentioned above
16:59gunsTimMc: :) I have \eC mapped to Ç
17:00gunsjustin_smith: thank you for the insight
17:00justin_smith,(= (class (fn [])) (class (fn [])))
17:00clojurebotfalse
17:00justin_smithtwo new classes
17:00justin_smithboth live forever, by default
17:00muhoothat's... not good
17:00justin_smiththis bit me in the ass, HARD
17:01justin_smithit was crazymaking
17:01ToxicFrogjustin_smith: I would have expected that each fn definition is a class, but each closure of that function that gets actually returned is an instantiation of it
17:01ToxicFrogRather than an entirely new class that is not subject to collection
17:01ToxicFrogIf it's the latter, that's bonkers
17:01justin_smithToxicFrog: if the same fn is returned, it is the same class, but if you create the fn in a let (for binding locals) it is a new class
17:01Morgawrhow do I use when-let to retrieve the value of the test? I mean, I want to test when b != CONDITION but this gives me a true/false result that is bound to 'c', how do I get the value of b?
17:02hiredmanjustin_smith: no
17:02pjstadigreturning a clojure from a function does not mean you generate a class every time you call the function
17:02justin_smith,(let [lol (fn [] (fn []))] (= (lol) (lol))) ; hiredman
17:02clojurebotfalse
17:02justin_smitherr
17:03llasramJust a new instance
17:03ToxicFrogthat is to say, I could expect that if you did this: (def mkfn [x] (fn [] x)) (def foo (let [x (mkfn 1) y (mkfn 2) z (mkfn 3)] (+ (x) (y) (z)))) - you would get one class for mkfn$anonymous, and three instances of it bound to the x, y, and z locals that get collected later.
17:03hiredman,(let [lol (fn [] (fn []))] (= (class (lol)) (class (lol))))
17:03clojurebottrue
17:03justin_smith, (let [lol (fn [] (fn []))] (= (class (lol)) (class (lol))))
17:03clojurebottrue
17:03justin_smithyeah, you are right
17:03ToxicFrogOh thank god.
17:03hiredmanI know I am right
17:03`cbp:-o
17:03patchworkWell glad we cleared that up
17:03pjstadigif you 'eval at runtime, then you will generate new classes
17:03patchworkfor a second everyone was terrified
17:04llasramFor some uncommon usage of the word "everyone"
17:04`cbp~everyone
17:04clojurebotCool story bro.
17:04Morgawrokay I'll rephrase my question in a more sensible way. I want to avoid doing (let [a (function)] (when (not (= a 3)) (println a)))
17:04MorgawrI thought about using when-let
17:04muhoopatchwork: i was
17:04Morgawrbut I can't understand how to retrieve the value of (function) in a when-let
17:05patchwork*everyone who didn't actually know how clojure was implemented
17:05Morgawrobviously doing something like (when-let [a (not (= (function) 3))] (println a)) is going to print true
17:05pjstadigMorgawr: when-let doesn't work that way; it is for nil punning
17:05MorgawrI guess
17:06Morgawrso I need to take the long way around and use a let?
17:06pjstadigi'm not aware of any particularly elegant workarounds
17:07MorgawrI am doing this for error checking with OpenAL and it's bothersome because to check for errors I need to call alGetError() and test if it's all ok or not, but when I call that function it pops the value out of the error stack
17:07Morgawrso I need to save it somewhere, uff
17:07Morgawrbut yeah, I'll take the long route
17:08`cbpMorgawr: you could use cond-> i guess
17:08pjstadigyou might be able to use a macro or something, but i'm not sure i exactly understand the case your talking about
17:08`cbp(cond-> (not (= 4 3)) (println))
17:08`cbpwith a 4 after the cond-> :P
17:08muhoo~everyone is a Rorschach test
17:08clojurebotIk begrijp
17:09llasramMorgawr: If you've got a common pattern specific to your domain, you can turn it into an internal macro
17:09Morgawr`cbp: mmm... interesting
17:09Morgawrllasram: yeah
17:09`cbp,(cond-> 4 (not (= 4 3)) (println))
17:09clojurebot4\n
17:09Morgawr`cbp: the problem is that I need to test "4" inside the test
17:09Morgawrlike
17:10Morgawr(cond-> (function) (not (= ? NO_ERROR)) (println))
17:10Morgawrnow, what goes in the ?
17:10Morgawrthe result of (function) should go there
17:11`cbpoh
17:11MorgawrI could do as llasram said and make a macro for it
17:11Morgawrwhich makes sense
17:12justin_smith,(#(or (and (%2 %) %) %3) 3 even? 2) ; Morgawr - maybe something like this?
17:12clojurebot2
17:12Morgawrjustin_smith: okay, lemme process that
17:12justin_smitherm maybe that isn't what you want
17:12MorgawrI don't understand what that does D:
17:13justin_smithif 3 is even, 3, otherwise 2
17:13justin_smithbut really I should have made it call the third arg
17:13justin_smithbut really that is just an if, so never mind
17:13justin_smithwell an if-let
17:13Morgawrthe thing is, I don't have the "otherwise"
17:13Morgawrthe trick is, I know what the value is not
17:13Morgawrbut I don't know what the value is
17:14Morgawrbecause I test if the value is the same as "no error", if it's "no error" then all goes well
17:14Morgawrif it's not "no error" I need to retrieve that value and print it in an exception
17:14Morgawrso I know what happened
17:14MorgawrI mean, trivially I'd bind that value in a let and then test with when on that
17:14Morgawrbut this was to avoid using let + when
17:14justin_smith(fn if-error [value error? else] (if (error? value) (else) value))
17:14justin_smithmaybe?
17:14Morgawr(not a big deal, just thinking about keeping the code elegant)
17:15Morgawryes, that could work
17:15justin_smithyeah, I hear that
17:15MorgawrI can just do
17:16pjstadigyou could do a macro like (when-not-error [foo (function)] ...)
17:16Morgawr(fn throw-error [value test exception] (if (test value) (throw (Exception. exception)) value))
17:16Morgawrpjstadig: yeah
17:16justin_smithMorgawr: maybe you just want assert
17:17justin_smithor a modified assert, that returns the thing you are asserting
17:17Morgawryeah I could use assert instead of throw
17:19Morgawrokay, I think I'm going to use an assert, with a function like the one I wrote up there, thanks guys ;)
17:20swarthywhy would you avoid let + when?
17:20swarthyim simply curious
17:20Morgawrswarthy: because it's just two statements + indentation that makes it look more clunkier
17:21Morgawrno actual reason other than keeping the code easy to follow
17:23swarthyid love to see the old version and the new 'side by side' if that is possible. As a newcomer this kind of stuff is worth gold.
17:23Morgawrswarthy: sure, hang on
17:25swarthythanks
17:27Morgawrswarthy: https://www.refheap.com/20784 something like this
17:28Morgawr(there are probably even better ways but this is good enough for me cause I just have to call an external function, no big deal)
17:31swarthyMorgawr: cool thanks, checking it out now I appreciate it!
17:31Morgawryou're welcome ;)
17:32swarthywhat is the other code you are calling? audio stuff?
17:33Morgawrit's bindings to OpenAL stuff
17:33Morgawrfor a game engine
17:34swarthyoh cool! Are you using lwjgl?
17:34Jardawhat's the cleanest way to make an bytearray of a string?
17:34Morgawrswarthy: yeah, part of it
17:34augustlI have a logback.xml in dev-resources. Is there a way to add a logback.xml that overrides the one in dev-resources when running "lein test"?
17:35technomancyaugustl: test-resources/logback.xml should do it
17:35swarthythats cool. Do you find working with clojure\interop more enjoyable that just the more rote approach in plain java.
17:35swarthyi guess you must
17:35coventryMorgawr: There is a slight semantic difference between your two versions, because (assert) will only throw if *assert* is true.
17:35augustltechnomancy: doh :)
17:37Morgawrcoventry: that's the same, when will only work when the conditions is true (using when-not in the example because I'm testing for a disequality)
17:38Morgawr(assert x) and (when x (throw ...)) are the same thing, aren't they?
17:38justin_smithMorgawr: the difference is people turn assertions off in prod
17:38coventryMorgawr: No, I mean when the dynamic var "*assert*" is bound to nil, assert won't throw.
17:38TimMchiredman: So something like this could cause permgen exhaustion on clojurebot: (let [evil ((symbol "eval") (ns-publics 'clojure.core))] (dotimes [_ 50] (evil '(fn []))))
17:38Morgawroh
17:38coventry,(binding [*assert* nil] (assert false))
17:38clojurebot#<AssertionError java.lang.AssertionError: Assert failed: false>
17:38augustltechnomancy: doesn't seem to be the case. Not entirely sure that I'm doing it correctly since I'm a logback noob..
17:38coventryhuh.
17:38`cbpJarda: (.getBytes "foo")
17:38technomancyaugustl: maybe add :resource-paths to the :test profile? it's been a while
17:39augustltried adding a logback.xml with <root level="OFF">
17:39coventryI must be misunderstanding the code for assert.
17:39coventry~assert
17:39clojurebotGabh mo leithscéal?
17:39augustltechmnomancy: will try that
17:39coventry~def assert
17:39indigoFfff clojurebot
17:39Morgawrokay then I can just use a throw, same thing then ;)
17:39Morgawrthanks for letting me know
17:39indigoAlways bounces my Terminal when there is a /notice to the entire channel
17:40Morgawrshould probably be added in the docstring for assert though :|
17:40Morgawr,(doc assert)
17:40clojurebot"([x] [x message]); Evaluates expr and throws an exception if it does not evaluate to logical true."
17:40Morgawras it is now it's not immedite
17:40Morgawrimmediate*
17:40indigoTimMc: /notices the entire channel
17:40indigoWhich is pretty annoying behavior
17:41TimMcNo, I mean to your terminal.
17:41indigoTerminal bounces
17:41TimMcBounces?
17:41coventryMorgawr: No problem. Now I want to know how to get that example working, though. :-)
17:41TimMcLike... turns it off and on again?
17:41indigoA.k.a. makes a sound
17:41indigoAnd the Dock icon bounces
17:41TimMcOh, I see.
17:41Bronsacoventry: *assert* must be mount at compile-time
17:41Bronsabound*
17:41TimMcWhat client are you using? /notice is supposed to be a lower priority message.
17:41coventryBronsa: Ah, right. Thanks.
17:42indigoTimMc: irssi
17:42Morgawrcoventry: just use the same when-not statement :P but it's in its own function so it's not a problem anymore haha
17:42indigoReally? I thought /notice is a higher priority
17:42TimMcirssi must be configured differently on mac by default
17:42Bronsacoventry: that's the same reason why (binding [*unchecked-math* true] ..) won't do what you would expect
17:42indigoTimMc: It's irssi on CentOS
17:43indigoI guess I'll just remove notices from beep_msg_level
17:43indigoBut it seems to be there by default
17:43coventryBronsa: Yeah, I missed that the *assert* check isn't in a syntax quote.
17:46aaelonyleiningen.exec is nice, enabling command line scripting via clojure. I'd like now to accept user input but a link I found (http://www.beaconhill.com/blog/?p=283) usins clojure.tools.cli seems to suggest that a :gen-class and -main function are needed. Is this right? Is it possible to accept command line args and use lein exec together?
17:46hiredmanBronsa: is the best way to report a tools.analyzer.jvm issue in jira?
17:47gunsaaelony: Just call -main with *command-line-args*
17:47hiredmanI don't see a tools.analyzer.jvm in jira, so I guess tools.analyzer?
17:47Bronsahiredman: I guess that would be the recommended way
17:47Bronsahiredman: yeah
17:48aaelonyguns: thanks, I'll try that. Do I need a -main though? It would be nice to just have access to the args
17:48technomancyaaelony: use -main; it gets ugly otherwise
17:49aaelonytechnomancy: ok, thanks. will do :)
17:49aaelonythanks for the help on this
17:49gunsaaelony: I use lein-exec to generate my WM config if you'd like an example: https://raw.github.com/guns/haus/master/bin/openbox-configuration
17:49aaelonyguns: cool thanks!
17:49aaelonyawesome
17:51kwertiiDoes anyone have any stories about running an enterprise service bus or similar software (e.g. Apache Camel) primarily from Clojure? All of what I'm finding is heavily Java-oriented. Is there anything that's already been Clojurized?
17:51hiredmanhey!
17:51hiredmanI got #1
17:51hiredmanhttp://dev.clojure.org/jira/browse/TANAL-1
17:51bitemyappzomg haircuts are so relaxing.
17:53muhooway OT, but anyone know what this attempted sploit is? https://www.refheap.com/20786
17:53Bronsahiredman: thanks
17:54hiredmanBronsa: sure, it is great to have the analyzer stuff written and reusable
17:54technomancybitemyapp: hey, would you mind looking at this stupid monadic problem I'm having?
17:54bitemyapptechnomancy: wait, really?
17:55technomancybitemyapp: the ocaml github lib uses Lwt for its HTTP calls
17:56technomancybasically I'm binding to one call that lists milestones; that works fine. but when I try to bind inside that call to list issues for a given milestone, it never actually runs: https://github.com/technomancy/edgestow/blob/master/edgestow.ml#L27
17:57technomancythough I can't tell if it's just me misunderstanding monads or some stupid library-specific scheduler junk I'm not doing
17:57Bronsahiredman: I'm well aware they need tests btw, I'll be spending the next couple of days covering all the passes with tests, hopefully there will be no more of stupid bugs like this
17:57hiredmanBronsa: cool,
17:57bitemyappmuhoo: the hack showed up in some Chinese sysadmin's logs awhile back, I'm not sure what it is.
17:58TimMcindigo: https://tools.ietf.org/html/rfc1459#section-4.4.2 -- looks like NOTICE is intended for bot responses and similar
17:59JardaCaused by: java.lang.IllegalArgumentException: No implementation of method: :emit-instruction of protocol: #'cljs.core.async.impl.ioc-macros/IEmittableInstruction found for class: cljs.core.as
17:59Jardaync.impl.ioc_macros.Jmp
17:59bitemyapptechnomancy: the lack of a do-syntax in OCaml is really fucking you right now.
17:59Jardaanyone familiar with clojurescript error messages..
17:59indigoTimMc: That's fine, but a notice to a channel is a bit iffy
17:59TimMcWell, "recipient" in IRC-land can be either a user or a channel.
18:00bitemyapptechnomancy: you don't need the parens btw.
18:00indigoI've never seen a bot send a notice to an entire channel before ;P
18:00Jardaon that line where it points there is just (go
18:00technomancybitemyapp: bloody ML precedence rules; I basically just add parens till it compiles
18:00brehauttechnomancy: add $ !
18:01brehautwhich might be called <| in ocaml
18:01brehaut(it is in F#)
18:01technomancybrehaut: "INSERT COIN(S)"
18:01brehauthaha
18:01TimMcFor example, I sent this with /msg #clojure
18:01technomancybrehaut: yeah, ocaml has |>; it's basically ->>
18:01bitemyappugh, I never use monads in ML.
18:01technomancybrehaut: where do I need that?
18:02TimMcindigo: A channel is just a multicast group.
18:02brehauttechnomancy: anywhere were you would have fun (expression …)
18:02brehautwell fun (expression …)$ to go kinda regexpy
18:02mtp'target' technically
18:02mtpand you can also e.g. PRIVMSG #foo,bar,#baz :stuff
18:02mtp:)
18:02indigoTimMc: Well, I turned it off for notices, so :P
18:02technomancybrehaut: I don't have comp though, so I can't make my printf callback point-free if that's what you mean
18:03brehauttechnomancy: its not point free per se, its the pipe operator
18:03brehaut(it doesnt return a new function, just applies it)
18:03technomancybrehaut: I'm all for nicer expression of the callback, but at this point all I want is for the callback to actually run
18:03brehautfair
18:03brehautjust write it as lisp without macros then
18:03brehaut(and some weird bits)
18:04technomancybut monads
18:04meingbgJust stumbled over pedestal dataflow, and it looks beautiful: https://github.com/pedestal/app-tutorial/wiki/Derived-Values#dataflow-visualization Now, does anyone know how database or other persistence work?
18:04brehautIt's dangerous to go alone, take this abstract algebra
18:05rkneufeldmeingbg: we don't dictate anything about persistence atm
18:06bitemyapptechnomancy: is run Lwt_main.run in this case?
18:06bitemyappthis would be so much easier if it was just MVars :(
18:06technomancybitemyapp: only at the bottom; inside the make_* functions it's Github.Monad.run
18:07technomancywhich turns a Github.Monad.t into an Lwt.t
18:07brehauttheres a github monad‽
18:07brehautMLers
18:07technomancyit's a thing!
18:07technomancyhttps://github.com/avsm/ocaml-github
18:07bitemyapptechnomancy: okay, so ordinarily bind would get the thread and wait for it to terminate, then pass that to the function, but it looks to me like the bind is getting ucrried unless that's infix?
18:08meingbgrkneufeld: ok, so it's up to the application developer to implement persistence then? Is there any interface to that?
18:08bitemyappI am hobbled by incredibly lossy internet right now :|
18:08technomancybitemyapp: I believe it's infix; I can check with the non-punctuation bind to check though
18:09bitemyapptechnomancy: please? I can barely type in my IRC client right now.
18:09bitemyappI'm bringing up the github client's code right now...eventually.
18:09rkneufeldmeingbg: you are correct, it would be up to the dev. Where are you imagining persistence happening? At the rendering layer?
18:09nDuffmeingbg: Not sure what exactly you mean by "interface". I'd expect Datomic to be a very popular choice for folks using Pedestal.
18:10technomancyyeah... it wouldn't have compiled if it had been curried
18:10bitemyappmeingbg: the culture in Clojure is generally DIY
18:10nDuffmeingbg: ...see for instance http://pedestal.io/documentation/connecting-to-datomic/
18:10bitemyapptechnomancy: I would've thought so but it wasn't clear to me if the result of the (possible) currying was getting used in such a manner as to violate the type system.
18:10nDuffmeingbg: in general, though, tight coupling and opinionated frameworks are seen as Very Bad Things here.
18:10technomancybitemyapp: it's no big deal if there's nothing that stands out as obviously wrong; just wanted a sanity check to ensure I wasn't doing anything stupid
18:11nDuff(and, with a strictly-IMHO hat on, I'd argue that Pedestal could probably stand to be a little bit more effectively split out into separate concerns)
18:11technomancynDuff: it's not just you
18:12rkneufeldnDuff: spot on. We're working to that end.
18:12rkneufeldEsp. WRT app.
18:12bitemyapptechnomancy: is () the initial state?
18:14rkneufeldQuestion for people about Pedestal. If pedestal-app was *just* the dataflow declaration and integrated cleanly with lein-cljsbuild as a library-only, would people jump for joy?
18:15technomancybitemyapp: sorry; initial state of what? the github monad?
18:15technomancyI tacked it on the end of make_milestone because that function is called by List.iter, which is all about the side-effects
18:16bitemyapptechnomancy: https://github.com/avsm/ocaml-github/blob/master/lib/github.ml#L236-L239
18:16technomancynow that I say it out like that it makes me think I need to deal exclusively with values in the monadic parts and write to disk elsewhere
18:17bitemyapptechnomancy: you were trying to iterate outside of the monad?
18:17technomancybitemyapp: inside the Milestone one but outside the Issue one
18:17bitemyappwithout using a functor I'm not sure how that would work.
18:17bitemyappespecially since in this case it's a callback.
18:18bitemyapppresumably, anyway.
18:18bitemyapptechnomancy: are you matching the failure case so that you can see a log if it breaks?
18:18nDuffrkneufeld: I'd love to see the dataflow engine be easy to import and use (without unrelated dependencies) in contexts that aren't web applications at all, so, in short: Yes.
18:19technomancyok, so I'll see if I can just switch to gathering values and write out at the end
18:19rkneufeldnDuff: Cool, Brenton and I are considering neutering pedestal-app *hard* with the 0.3.0 release.
18:20TimMcTelnetmtp: Wow, doing this over telnet sucks
18:20mtphmm?
18:20bitemyappTimMcTelnet: well, yeah.
18:20mtpoh, using a direct socket to IRC does suck
18:21mtpthat's why we wrote clients :)
18:21bitemyappTimMcTelnet: especially because you have to keep PING'ing.
18:21bitemyapper, PONG'ing. whatever.
18:21TimMcTelnetBut I like that it's at least possible.
18:21bitemyappTimMcTelnet: even the unabomber could use telnet.
18:22bitemyappwith a telegraph.
18:24technomancyoh hey; I don't actually need two levels here; I can just request all issues and then sort them by milestone after the fact. derp.
18:25meingbgnDuff: Thanks for the link. I like the functional approach with loose coupling, and having the dataflow engine put it all together. That is what I came here looking for. But I would have imagined a framework supporting for example load and save functions on top of derive and transform, for inclusion in the dataflow. Am I missing some key point here?
18:25bitemyapptechnomancy: side-stepping or was grokhood achieved?
18:26technomancybitemyapp: total side-step
18:26meingbgrkneufeld: I would imagine the data model being saved to disk eventually.
18:40concuranybody in here good with incanter charts?
18:41technomancybitemyapp: I may have been a bit hasty assuming this github lib is suitable
18:41technomancydoesn't appear to support pagination =\
18:42hiredmantechnomancy: I have a profile X, is there someway to force lein to add checkouts to that profile?
18:42hiredmanlein with-profile X classpath doesn't include checkouts
18:43technomancyhiredman: huh... I remember taking a patch for this a while back
18:43bitemyapptechnomancy: sounds like it. :|
18:43bitemyapptechnomancy: it's just a JSON API, couldn't you use an HTTP client with Async?
18:44technomancyhiredman: you may have to specify :checkout-deps-shares [:source-paths] spelled all the way out
18:44technomancyhiredman: unless you actually want lein with-profile +X classpath?
18:45technomancybitemyapp: yeah, but the auto-generate-type-boilerplate-from-atd stuff looks intimidating
18:45hiredmanwhat is +X?
18:45technomancyhiredman: +profile-name means "add this profile to the set of active ones"
18:45technomancyinstead of "replace profile set with this"
18:46hiredmanok, that seems to do it
18:46technomancyjust speculating as to your intentions
18:46hiredmanI am fiddling with cheshire, and it has a benchmark profile, but the benchmark profile wasn't picking up checkouts
18:47hiredmanbut changing that to + seesm to have fixed it
18:47technomancyyeah, you probably want to add the benchmark profile, not use benchmark exclusively
18:47bitemyapptechnomancy: the equivalent thing in Haskell is just forkIO and MVar.
18:48hiredmanoh, foo, the checkout is there in classpath, but this is still erroring out, as if the checkouts weren't being loaded, I'll just fiddle with it some more I guess
18:50technomancybitemyapp: I'll just open an issue and pick this back up if it ever gets fixed upstream =)
18:51technomancythat way I'll be able to cut a lein release at the conj and not be distracted
18:51bitemyappoh right, the conj everybody will be at ;_;
18:57TimMcbitemyapp: You can still play along at home.
18:58TimMcIn past years there has been a little backchanneling on IRC.
19:03`cbpshould buy one of those telepresence robots
19:03bitemyapp`cbp: I know a salesguy at one of those companies.
19:04`cbpwith a discount!
19:04bitemyappI would pay for the ability to have a robot minion of mischief running around at the conj.
19:05justin_smithbitemyapp: http://bits.blogs.nytimes.com/2012/08/18/double-turns-the-ipad-into-a-telepresence-robot/?_r=0 one of these?
19:05WWWestHi!
19:05WWWestI'm trying to use the crypto module on node js
19:06ssutchwith core.match, can i match an array inside a map, eg {:rgba [r g b a]}
19:06bitemyappjustin_smith: yeah that's the company.
19:06WWWestbut closure complains on calling .final on the cipher
19:06justin_smithWWWest: this is clojure, not closure
19:07justin_smithunless this is a clojurescript issue?
19:07WWWestand it turns out that final is a javascript reserved keyword
19:07WWWestyeah it is
19:07justin_smithahh
19:07WWWestI'm using cljs, yes
19:07WWWestwhich feeds generated js to closure
19:07bitemyappomg that is confusing.
19:08WWWestis there a work around to being able to use the final method? I can't be the only one to have run into this..
19:14TimMcbitemyapp: We have one of those here. I really want to play with it.
19:19arrdembitemyapp: one of these days I swear I'm gonna pick up a Parrot drone and play with this... https://github.com/gigasquid/clj-drone
19:22justin_smithwould I rather have an ipad on a segway as a coworker, or a helicoptor...
19:22justin_smithhard questions
19:23TimMcjustin_smith: It's easier to barricade segways.
19:23justin_smithtrue
19:23Apage43psh, iPad + bigdog
19:24justin_smithnow that is how to telepresence
19:24Apage43no escape
19:24justin_smithmaybe an animatronic monster head instead of ipad
19:24Apage43if my telepresence robot can't chase down and tackle folks then why bother
19:27arrdemApage43: ... tackle? trample more like...
19:29baumaxgolf competition: split a string into space-delimited words, reverse the words, join the string, print it
19:29baumax(join with spaces)
19:30arrdem$karma baumax
19:30lazybotbaumax has karma 0.
19:30arrdembaumax: lisps suck for code golf. believe me I've tried.
19:34justin_smith,(->> "this is a test" (#(clojure.string/split % #" ")) (map reverse) (map #(apply str %)) (clojure.string/join " "))
19:34clojurebot"siht si a tset"
19:34justin_smithnot very golfy :(
19:35justin_smith,(->> "this is a test" (#(clojure.string/split % #" ")) (map (comp #(apply str %) reverse)) (clojure.string/join " "))
19:35clojurebot"siht si a tset"
19:35baumaxit is not so bad :).
19:35brehautarrdem: youz on 4clojure disagrees with you ;)
19:36justin_smiththe comp actually made it worse I think
19:36justin_smithof course using clojure.string would be natural, but not what you would do with clojurebot
19:36justin_smithyou never specified the input:
19:37justin_smith,"bob"
19:37clojurebot"bob"
19:37justin_smithvery concise
19:37arrdembrehaut: shrug. you won't get close to the evil things I've seen in Python and Perl over at codegolf.stackexchange.com with any Lisp dialect.
19:37patchworkHmm… posted a comment on the clojure google group almost an hour ago and it still hasn't shown up. Does that mean I am a spambot?
19:37arrdembrehaut: ymmv but I've always been a factor of 4 or more longer
19:38brehautarrdem: quasiquoting allows some truely astounding messes and requires appears to require a truely twisted mind
19:38patchworkWhat is the approval process, does it require human beings? weird
19:39hiredmanpatchwork: it depends, but my understanding is your first posting requires human approva
19:39hiredmanl
19:40patchworkhiredman: Ah, that would explain it
19:40patchworkI guess I have never posted anything before!
19:44arrdemanyone have a project idea kicking around based on a DSL?
19:46brehautwhy would you want to use a DSL rather than an API?
19:47technomancy"Metaprogramming in lisp is like chinese food in China; they just call it food"
19:47TimMc&(apply str (reverse "this is a test")) ;; baumax
19:47lazybot⇒ "tset a si siht"
19:47TimMcOh, sorry, wrong one.
19:48arrdembrehaut: school project, "do something cool using an embedded DSL" :/
19:48TimMc&(clojure.string/replace "this is a test" #"[^ ]+" #(apply str (reverse %)))
19:48lazybot⇒ "siht si a tset"
19:48brehautarrdem: write a program nominally in java
19:48TimMcThere we go.
19:48brehautcall into clojure.lang.RT in main
19:49arrdembrehaut: hahaha
19:51technomancyarrdem: a domain specific language you say? https://github.com/joegallo/brainfuck
19:51Morgawrif I deref a ref inside a dosync twice I am guaranteed to get the same value, right?
19:51Morgawrlike (if @myref (do-something @myref) nil)
19:51Morgawror something like that
19:52Morgawr(just an example)
19:52technomancyMorgawr: yeap
19:52Morgawralright
19:52Morgawrthanks
19:52Morgawrfirst time using refs
19:52lemonodorif i have a unit test that operates on a file, how do i represent the path to that file? e.g. i have test/mylib/foo_test.clj and test/mylib/foo.dat that the test operates on. in python i'd use __file__ to construct a path relative to the file containing the unit test code.
19:52arrdemtechnomancy: hahaha I did think of that... maybe something more interesting like malbolge..
19:52TimMcUnless you munge it in the transaction.
19:52TimMc&(let [r (ref 0)] (dosync [@r (alter r inc) @r]))
19:52lazybot⇒ [0 1 1]
19:52brehaut,(let [r (ref 1)] (dosync (let [a @r _ (commute r inc) b @r] (= a b))))
19:53clojurebotfalse
19:53justin_smithlemonodor: clojure.java.io/resource
19:53TimMcbrehaut: Poor man's sequencing.
19:53justin_smithlemonodor: that will expect a path relative to the classpath (which is generated from the resource and source paths in project.clj)
19:53TimMcMorgawr: ^
19:53brehautTimMc: huh, so it is.
19:53lemonodorok, i'll give that a try. thanks, justin_smith
19:54brehautTimMc: how long has dosync had that?
19:54TimMcbrehaut: Probably not guaranteed, though. :-P
19:54MorgawrTimMc: yeah, I was only worried about other threads fiddling with it
19:54Morgawrthanks
19:54TimMcOh, not a property of dosync, just vector evaluation.
19:54brehautTimMc: oh. lol!
19:54TimMc:-D
19:55brehautarrdem: more seriously: turtle graphics
19:55brehautarrdem: all the commands are 'DSL' (cough, functions)
19:55technomancylemonodor: wow, I think I read your blog way back when I was first getting into clojure
19:56brehautarrdem: you can then write another DSL ontop of turtle graphics DSL to draw L-Systems relatively easily
19:56TimMcClojure is a DSL for manipulating the JVM.
19:56justin_smithany executible that takes input is a DSL
19:56lemonodortechnomancy: now you get to see me ask dumb clojure questions :)
19:56technomancylemonodor: and I think I've been to the shipwreck in palos verdes on your blog
19:56justin_smithtechnomancy: lemonodor: yeah, back when I was hacking common lisp I would check that blog out religiously
19:57lemonodorha, that's awesome.
19:57justin_smithneato
19:57brehautjustin_smith: i think everyone here agrees that a DLS is a silly concept; but if arrdem needs to make one for a project, it probably helps to make on that looks like one to his markers
19:57arrdembrehaut: ooh... that could work... the issue with this assignment is that part of the implementation has to be a DSL. I can't just build an interpreter or an API and call it there, the final product has to be based on a DSL. Stacking a user-facing DSL atop an internal DSL would work...
19:58justin_smithjust formalize the semantics of any app, blammo, DSL
19:58arrdem(inc brehaut)
19:58lazybot⇒ 20
19:58arrdemjustin_smith: basically. I'm trying to get clarification on "configuration language" vs. DSL.
19:58WWWest pfff... I tried exporting the code using .final to an :externs js file, closure still complains
19:59brehautarrdem: the difference between configuration and code is indirection via a map ;)
19:59brehautfoo vs :foo
20:01bitemyapparrdem: just show them edn and see if it flies.
20:01justin_smithin all seriousness, there are some really good classic examples of dsls
20:02justin_smithcsound for audio programming
20:02justin_smithTeX
20:02bitemyapparrdem: make it out of S-Expressions.
20:02algalSo I am discovering the simple but delightful world of ad-hoc hierarchies with (derive ...) and friends. Quick question: can I pretty-print the whole hierarchy to, you know, see the hierarchy?
20:02arrdembitemyapp: yeah an inline EDN reader for Scala was one of my original ideas
20:02bitemyapparrdem: hark a DSL: https://github.com/bitemyapp/revise/#filter
20:03brehautseriously though: L-Systems
20:03brehautits fun, relatively small implementation surface area, and it can clearly fill the bill
20:04beppualgal: I did not know about derive until you mentioned it. What other functions work on these hierarchies?
20:04arrdemclojurebot: ping
20:04justin_smithalgal: check out clojure.reflect/reflect
20:04bitemyappbrehaut: fit the bill
20:04clojurebotPONG!
20:04justin_smithalgal: you could probably chain something up with that with not too much effort
20:04algalbeppu: isa? underive parents ancestors make-hierarchy etc..
20:04brehautbitemyapp: sorry, i typed on IRC. i'll run it past my editor next time
20:04hyPiRionalgal: you can do @#'clojure.core/global-hierarchy
20:04bitemyappbrehaut: <3
20:05justin_smith,(do (require 'clojure.reflect) (:bases (clojure.reflect/reflect 1)))
20:05clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.reflect>
20:05hyPiRionIt's a reason that the global hierarchy is private though, so the semantics may change
20:05beppualgal: this is an unexplored corner of clojure for me. interesting...
20:06lemonodorso typically data files for use by unit tests would be in dev-resources?
20:06technomancyhyPiRion: pshaw; how dare someone think they know better than me about their own code
20:06technomancylemonodor: yeah
20:06lemonodorok, thanks
20:07hyPiRiontechnomancy: huh, I think I lost you there
20:07hyPiRionoh nvm, I thought for some reason pshaw was a user
20:07technomancyhyPiRion: just mocking the crazy anti-private sentiment that is sometimes expressed here
20:07justin_smithalgal: never mind my above, that shows what something implements but not heirarchy
20:08hyPiRionyeah, I figured that out in hindsight
20:08algalbeppu: you should run over to ClojureAtlas and sign up. It's great for getting a quick overview of new things in the core language. http://nap.kn/d/kdBBWa
20:08bitemyapptype errors...type errors everywhere. Now I have to litter asserts all over my code. Thanks Obama.
20:09algalbeppu: a better link, which probably works with a trial: http://www.clojureatlas.com/org.clojure:clojure:1.4.0#concept/hierarchies
20:09beppualgal: I'll check it out. Thanks.
20:10WWWesteven if I declare it as a foreign lib... the fact that the js file is in resources shouldn't change anything right? I thought google closure would ignore foreign libs?
20:10bitemyapp"java.lang.NullPointerException: null" YEAH AWESOME
20:10bitemyappbecause we didn't solve this problem decades ago
20:10beppualgal: That's a crazy site. I was surprised by the animated graph that suddenly appeared on my screen.
20:11hyPiRionbitemyapp: lost the stack trace?
20:11algalbeppu: Yes, I love it. I just wish it had more info.
20:11bitemyapphttp://i.imgur.com/JRCxZh6.jpg
20:11bitemyapphyPiRion: it's not even about that.
20:12bitemyapphyPiRion: also the stack traces can be misleading if you don't have asserts and the nil lurks in wait until later in the program.
20:12brehautbitemyapp: its really simple. everything inherits from object. object is a union of Instance … | Null
20:12technomancystack trace tells you who tried to invoke a method on nil, not where the nil came from
20:12bitemyappbrehaut: hu hu hu.
20:12bitemyapptechnomancy: ^^ that.
20:13brehautbitemyapp: creating implicit unions is a popular OO past-time. see also exceptions
20:13hyPiRionbrehaut: not true, actually `null instanceof someclass` will always return false
20:13technomancydear tony hoare http://p.hagelb.org/pay.png
20:13technomancy(except that's not fair because he's actually sorry about it)
20:13TimMcThis is why we should have metadata on nils, so you can attach their line and column of origin.
20:13brehauthyPiRion: i cant help it if the implementation is broken :P
20:13technomancysorry tony hoare
20:13technomancyI didn't mean it
20:13technomancyTimMc: <3
20:14hyPiRion(alter-var-root #'nil ...)
20:15arrdem.... this I must try...
20:15ambrosebswhat the hell is going on here :)
20:15brehautwe should monkey patch nil's var so that its not actually a Var, but a thing that complains when you deref it
20:15technomancywhiny_nil is a thing in rubby
20:15TimMcambrosebs: We're fixing Clojure! :-D
20:15brehauthaha
20:16ambrosebshahaha
20:16arrdemhyPiRion: I'm laughing too hard to repl
20:16bitemyappambrosebs: I'm complaining about NPEs and hyPiRion is trying to help.
20:16bitemyapp"help"
20:16technomancyhttp://api.rubyonrails.org/v3.1.1/files/activesupport/lib/active_support/whiny_nil_rb.html
20:16Apage43i'm just sitting here having people confused at why i'm not thrilled to work in Go
20:17brehautambrosebs: you'd think nobody had heard of static analysis or something ;)
20:17hyPiRionbitemyapp: You're talking language design with the co-author of Swearjure, what do you expect?
20:17jared314brehaut: the new Javascripters haven't
20:17bitemyapphyPiRion: are there nils in Swearjure?
20:17technomancyApage43: because they got your hopes up that you'd be playing a board game I bet
20:17Apage43,({} {})
20:17clojurebotnil
20:17arrdemhyPiRion: okay. good. that doesn't work.
20:18brehautjared314: the authors of the language, or its users?
20:18hyPiRionarrdem: haha
20:18arrdemhyPiRion: I was really really worried for a minute
20:18jared314brehaut: users
20:18bitemyappApage43: god dammit.
20:18bitemyappIt's even a relatively brief construct.
20:18brehautjared314: well they can't be helped
20:18bitemyappso unfair ;_;
20:18technomancyApage43: leave it to google to have a namespace collision with what is literally the oldest extant product of human civilization
20:18Apage43I like how it's almost the horrified face smiley it should be
20:19TimMcbitemyapp: We still can't get e.g. 2.5 though.
20:19bitemyappby running this batch job at 5:20pm I may have stranded myself.
20:19bitemyappTimMc: integrals only?
20:19TimMcAnd rationals.
20:19bitemyappTimMc: all you need anyway.
20:19TimMcFreaking *rationals*, but no floats.
20:19TimMcFair. :-P
20:19hyPiRionTimMc: Swearjure is all rationality
20:20metellus,(/ (*) (+))
20:20clojurebot#<ArithmeticException java.lang.ArithmeticException: Divide by zero>
20:21bitemyapphg commit -m "fuck fucking fucky NPE fucking bullshit fuck. Batch loading seems to work?"
20:21beppu,(*)
20:21clojurebot1
20:22beppu^-- that doesn't seem right.
20:22brehautits the identity of multiplication
20:22TimMcIt's as right as right can be.
20:22arrdembeppu: multiplicitive identity. it's fine.
20:22justin_smithbeppu: it is the base case for reducing on a list of numbers by multiplying
20:22beppudid not know
20:22brehautits also epsilon for the monoid of multiplication
20:23bitemyapp,(apply * [])
20:23clojurebot1
20:23bitemyappKirinDave is consoling me on Twitter.
20:24bitemyapparrdem: I might keep my sanity. Also, DotA2?
20:24bitemyappddellacosta: you're going to be really mad about nils after you learn Haskell.
20:24arrdembitemyapp: still with the homework.
20:24bitemyapparrdem: way too hard working to be a programmer.
20:25ddellacostabitemyapp: good morning to you too, haha
20:25bitemyapparrdem: are you sure you're not a spy from some other STEM branch?
20:25bitemyappddellacosta: I've been raging about having to litter asserts in my code to find the origin of a nil that was causing an NPE.
20:25bitemyappddellacosta: good morning!
20:25arrdembitemyapp: dude... I gotta get this <cursing> calc out of the way to graduate. only one way to do it and it doesn't involve automation Q_Q
20:25technomancybitemyapp: why is kirindave no longer on freenode? =(
20:25justin_smiththe clojure web ecosystem I have been helping to develop (caribou) just got announced on the clojure mailing list finally
20:25ddellacostabitemyapp: I will have to get coffee then I will be prepared to talk about nils in Haskell. ;-)
20:26bitemyapptechnomancy: I asked him, but I got a non-answer.
20:26justin_smithpretty exciting (for some reason before this the repos were public but the main author did not want to "tell anyone about it")
20:26technomancybitemyapp: I guess he just launched or something
20:26bitemyapptechnomancy: well yeah, he's really busy at Level. he's also recruiting people that have a knack for Clojure.
20:27jared314i wish I had a knack for Clojure
20:27bitemyappjared314: are you in the bay area?
20:27jared314bitemyapp: nope
20:27bitemyappNuts.
20:29brehautknacks for clojure are more easily aquired by learning and practise than by wishing
20:29jared314brehaut: hoping isn't wishing
20:29bitemyapp~gentlemen
20:29clojurebotYou can't fight in here. This is the war room.
20:29sritchiecemerick: what's the best way to inject a "logged in successfully!" note into the flash,
20:29sritchiecemerick: after an interactive form auth with friend?
20:30sritchiecemerick: struggling to figure out how to do form validation around the signup flow
20:30arrdemjared314: just assume you do, we have technomancy to remind us that we're all wrong anyway.
20:30sritchiecemerick: do form validation (and potentially modify the flash), THEN pass my map in for authorization, then deal with further flash mods afterward
20:31technomancyarrdem: only if you use when for return values
20:31jared314is there an option in cljsbuild to not add cljs.core to the compiled output?
20:32arrdemtechnomancy: but it's OK because my c.c.t system is (Maybe AnyInteger) so a nil from when is fine :D
20:36ddellacostasritchie: are you trying to authenticate or authorize? I'm not sure why you would be doing validation on someone that isn't authenticated, unless it is a signup form or something (is it?).
20:36sritchieyes
20:36sritchieddellacosta: I mostly just want to add a "success!" method to the flash
20:36sritchieafter a successful login
20:36sritchiebut still take advantage of friend's redirecting
20:37ddellacostasritchie: ah, so the basic problem is passing that flash message around?
20:37sritchieddellacosta: yeah, that's really it -
20:37sritchieI use lib-noir,
20:37sritchieand I used to just set it in my post handler
20:37sritchiebut now I can't really figure out how to inject that post handler
20:38algalanyone going to the Clojure real-time machine learning talk in about an hour in SF ( http://www.meetup.com/The-Bay-Area-Clojure-User-Group/events/146268902/ )? Know a good place to grab food near the venue?
20:39sritchieddellacosta: trying to figure out some way to check the return value of my interactive-form workflow,
20:39sritchieand get in the loop there, somehow
20:39sritchieddellacosta: but it looks like with friend, I no longer need to think about POST requests to login
20:42sritchieddellacosta: I imagine this is sort of common, injecting flash messages like "you must be authorized to see this page. log in first."
20:42slpsys2 many SF meetups
20:44ddellacostasritchie: yeah, I don't have a good answer for you right now, but it depends on the workflow. Have you checked out the interactive-form workflow in the codebase?
20:44sritchiethat's what I'm using now
20:44ddellacostasritchie: sorry, I mean, have you dug into that workflow's code?
20:44sritchieI've been doing so
20:44sritchieand I can't really see how to get in the middle of it
20:44ddellacostasritchie: ah, okay--sorry I wasn't clear on that.
20:44sritchieto modify this flash
20:47ddellacostasritchie: and, are you writing a login-failure-handler yourself?
20:47sritchieyes
20:48sritchiehttps://gist.github.com/sritchie/7442190
20:48sritchieddellacosta: it works to do that
20:48sritchieto jam the flash in manually
20:51ddellacostasritchie: I mean, it's definitely worth seeing what cemerick thinks but I'm not sure there is a better answer than something like what you are doing, honestly. The interactive form built-in is pretty simple, and the intention with friend is that you'd extend it with your own more sophisticated workflows. The configuration mostly extends to adding to whatever configuration the workflow itself makes available--so if it isn't there...
20:51ddellacostaisn't there.
20:52ddellacostasritchie: so, all of that is to say, I think extending/re-writing the workflow itself--as you're doing--is probably the right one.
20:52sritchieI think I can wrap it and check the return value,
20:52ddellacostasritchie: sorry if that's not the answer you were looking for. :-(
20:52sritchieno worries :)
20:53sritchieand then switch based on that, and pass the result on through
20:53sritchielike auth does when deciding if a workflow succeeded or failed
20:53sritchieshould be clean
20:53sritchiethanks, ddellacosta !
20:53ddellacostasritchie: sure thing, hope something I said was helpful!
20:56xeqisritchie: friend's interactive form workflow doesn't include anyway to add something to the flash directly, but will include some query parameters on redirect
20:56xeqiI've just been checking for those as part of displaying a message
21:07coventryHow can I debug the reasons for "lein install" hanging?
21:08coventryWith "DEBUG=true" it hangs after reporting it's written the pom file.
21:10technomancycoventry: does `lein compile` hang too?
21:11technomancyit's almost always "doing something server-y at compile time"
21:12coventryYes it is. I'll look for something like that. Thanks.
21:32coventryI went through the project and commented out everything which is not a def, defn, deftest or ns form, and it's still hanging. Any other possibilities?
21:38amalloycoventry: one of your defs could easily be a problem
21:38amalloy(def foo (start-server)) is no better than (start-server)
21:39coventryamalloy: Yes, that occurred to me, but they're not in any obvious way.
21:39amalloyif i were writing a script to look for mistakes like this, it would look for every (def foo (anything-but-delay ...))
21:40amalloymostly false positives, of course, but i suspect it would be surprisingly effective
21:41coventryOh, that explains some of the strange uses of delay I've seen in other people's code. Hmm.
21:44coventrySo what counts as server-y? Is creating a namespace in a def server-y?
21:44amalloycoventry: anything side-effectful other than defining functions, basically
21:44amalloyis the code open-source?
21:45TimMcserver-y or app-y
21:46coventryamalloy: Yes, it's at https://github.com/coventry/troncle
21:46coventryIt's a bit of a mess at the moment, though.
21:46TimMctechnomancy: Oh, a follow-up on my "lein uberjar taking forever" thing -- it is indeed spending all of its time compiling.
21:46TimMcEach defn takes the better part of a second.
21:47coventryamalloy: I think the create-ns defs in core and core_test are candidates.
21:47bitemyappcoventry: don't do side-effecty things in defs.
21:47bitemyappcoventry: seriously, don't.
21:47amalloybitemyapp: i think we've covered that
21:47amalloycoventry: https://github.com/coventry/troncle/blob/master/src/troncle/traces.clj#L32 is a little suspicious - it shouldn't be a problem unless you send a function to it at compile time, but that it exists as a def makes me think you might do exactly that
21:48bitemyapp`cbp: around?
21:48`cbpbitemyapp: yeah
21:48coventryamalloy: No, trace-log is currently unused.
21:48bitemyappcoventry: https://www.refheap.com/20788
21:49bitemyapp`cbp: DotA2?
21:49`cbpbitemyapp: in 10min
21:49bitemyapp`cbp: deal.
21:50Apage43hm
21:50Apage43coventry: it doesn't hang for me
21:50amalloycoventry: nothing stands out to me. it all looks pretty innocuous, assuming you haven't done anything devious inside tools.reader
21:51amalloyand of course i have no idea what nrepl-discover does, so it could conceivably be the cause
21:51Apage43coventry: but, try thwacking Ctrl-\ while it's hung
21:51Apage43you'll get the stacks of running threads
21:51bitemyappApage43: it's time to plot.
21:52Apage43plot?
21:52amalloyscheme
21:52coventryApage43: What does C-\ do? It's not having any effect on "lein compile" for me.
21:53coventryamalloy: No, I ended up leaving tools.reader unmolested for now.
21:53Apage43coventry: sends SIGQUIT to the foreground process
21:53Apage43which should make JVMs print their stacks
21:53bitemyappTheme song: http://www.youtube.com/watch?v=Cb1gImYbEcM
21:56Apage43you can also use jstack to extricate a stackdump more forcibly
21:56Apage43jstack -F <process id>
21:57coventryHmm, well now lein compile is running to completion, and I'm not sure why. Time to start backing my changes out, I suppose.
22:01marcopolo`~/
22:01clojurebotCool story bro.
22:08arrdemsudo su
22:11amalloylazybot should say something snarky when you try to sudo here
22:11amalloyhop to it, Raynes
22:13Rayneshuh
22:13Rayneslazybot: kill
22:13lazybotKILL IT WITH FIRE!
22:13Raynesy u be so weird
22:13Raynesamalloy: Are you sure it should do something?
22:13Raynesls
22:13lazybotbin boot data etc home lib media opt root sbin src sys tmp
22:13RaynesEverything else is working.
22:13RaynesNo errors in the console.
22:13amalloyRaynes: no, i mean that would be a nice addition
22:14TimMc"should"
22:14amalloynot that i think it should already be doing that
22:14RaynesOh.
22:14RaynesWell shoot, I should stop fixing it then I suppose.
22:14TimMcNo, no, keep going.
22:14Raynes$loaded?
22:14Raynes$loaded
22:14lazybotRaynes: It is not the case that you don't not unhave insufficient privileges to do this.
22:14Raynes-.-
22:15Raynesamalloy: Which plugin was it that provides this functionality?
22:15amalloyRaynes: i think it's in utils or something? look for unix-jokes
22:15Raynesunix-jokes
22:15akurilinI find it amazing how the bot is such a community-driven work of passion.
22:16akurilinInfluenced by the personalities of some of the more vocal channel members.
22:16RaynesThis is gonna be an awesome addition amalloy.
22:21coventryI'm getting an NPE when I do "lein deploy clojars". Any suggestions on how to fix? https://www.refheap.com/20789
22:22cemerickdnolen: AFAIK, the problem in :advanced was repeated re-defs in a top-level (do). Is that to be expected, or should it be considered a bug?
22:23cemericks/AFAIK/AFAICT
22:23cemerickGetting a minimal failing example is going to be tricky, the code is the result of a somewhat-hairy macro.
22:24coventryAh, "lein upgrade" fixed it.
22:25Raynesakurilin: It's true, we do love our bots.
22:25RaynesBetween lazybot and clojurebot, pretty sure marriage proposals are in the future.
22:25bitemyappRaynes: never! Like Montague and Capulets, that lot.
22:29shaungilchristanyone using core.rrb-vector in cljs?
22:35muhoocoventry: have a look at deploy.clj on the line mentiomed, and see wtf it thought itwas doing?
22:36TimMcsudo su
22:36TimMcHmm, not yet.
22:40coventrymuhoo: Probably whatever fixed this failure fixed mine as well, it's what gave me the idea to upgrade: http://www.raynes.me/logs/irc.freenode.net/leiningen/2012-08-29.txt
22:45akurilinHas anybody figured out a sane pattern for dealing with static resources that one's web app depend on? Say I have a .json tree in my project with some content my app requires to run. At some point the number of these .json files grows considerably and I might need to start lazily fetching it at run-time from somewhere like S3.
22:46akurilinHowever if you decouple the app from the critical piece of data, your ability to debug things and the likelihood of not booting has just gotten much higher.
22:46swarthyOff topic question but you guys are smart and I like you: anyone know how to get the reading of power consumption at the CLI on linux?
22:46akurilin*ability to debug would go lower :)
22:46bitemyappswarthy: acpi?
22:46swarthyis that the command?
22:47bitemyappswarthy: sudo apt-cache search acpi
22:47swarthylol just did that
22:47swarthythanks, i'm going to check that out
22:48danneuakurilin: what are these files that are growing so considerably
22:50justin_smithakurilin: nginx can be put in front of your app, and told to serve out of your static dir
22:50swarthybitemyapp: I should note I am on a desktop, so acpi failed. Good suggestion though.
22:50justin_smithso during dev it is just the static ring handler, in production, nginx serves the file directly
22:50akurilindanneu, in my scenario, we have several big .csv lists math questions that we ask kids. I need this content within the app to generate worksheet pdfs, do some analytics etc
22:50bitemyappswarthy: kill-o-watt
22:50akurilindanneu, the web app is useless without the underlying content
22:51justin_smithakurilin: also, nginx or varnish (I recommend using both in front of an app) can be redirected to a separate server that also has that same asset directory structure (like s3)
22:52justin_smith*can be configured to redirect to
22:52bitemyappakurilin: I rsync static assets until a CDN is needed.
22:52bitemyapp+ nginx
22:53justin_smithbitemyapp: thanks again for the help with this audio server, I am | | this close to turning the two 8 input cards into 16 mono cards via the magic of dmix
22:53danneuso far it sounds like a roundabout way of describing what i use a database for
22:53akurilinThe one hassle of decoupling the data from the app is that now every time it boots (say you're running tests) you now have to potentially download 50 megs of content
22:54akurilinso I'd have to have a "test static dataset" in place to avoid the hassle
22:54justin_smithakurilin: the contents of the app directory are authoritative, anything else either mirrors it or is synced from it automatically
22:55akurilindanneu, it's true, but in our case static storage is necessary because we have non-developers working in Excel generating the content, and continuously migrating those csvs to a db somewhere is not worth the hassle right now.
22:55akurilinjustin_smith, so default to whatever's in the app folder, and if it's missing (say in production), then download it or something like that?
22:55justin_smithnginx or varnish is going to serve static assets a lot more efficiently than a db would
22:56danneuyeah but the json limitation is due to their nondev content genreation
22:56justin_smithakurilin: no, ship the static assets inside your uberjar, the app server unpacks it, nginx serves out of that dir
22:56justin_smithor syncs to the cdn out of it, if need be
22:56akurilinjustin_smith, well I do that now under resources/ and it works fine, except for the part where the .jar is starting to bloat up
22:57akurilinI just slurp from disk for now.
22:57akurilins/disk/jar/
22:57justin_smithso the jar does not get unpacked on the server?
22:57justin_smithwhat is your app container?
22:57justin_smithor are you just running ring via an uberjar
22:57danneuakurilin: you could send up git-diffs to the server and rebuild the jar on the server to deploy
22:57akurilinjustin_smith, not sure what that means. I just run it with java -jar from runit once it's on the web machine.
22:58justin_smithif you unzip the jar, you can then have nginx server static assets for you
22:58justin_smithmuch more lightweight
22:58justin_smithreduces load on your app
22:59akurilinjustin_smith, well yeah, actually not fetching those assets from S3, but placing them on the same machine even for testing makes things a lot simpler
22:59akurilinbehind nginx/varnish
22:59akurilinMy gripe was originally with having to fetch stuff from s3, but as you pointed out that's completely avoidable
22:59justin_smithone of these days I am going to write a ring middleware that abstracts over local / s3
23:00justin_smithI already have the logic working in an image resizer (caribou/lichen), but it should be a standalone functionality
23:00danneuthat sounds like a painful rubygem we used at my last job
23:00justin_smithheh
23:00justin_smithit works pretty nicely in caribou
23:02akurilinargh slowly everything turns into an integration test :)
23:02justin_smithI have it up in production for a few corporate brochure sites
23:04coventryIs there a canonical coordinate for clojure.walk2, these days? [com.stuartsierra/clojure.walk2 "0.1.0-SNAPSHOT"] seems to have gone walkabout.
23:05justin_smithcoventry: running lein search for it right now
23:06coventryjustin_smith: There is one on clojars, <https://clojars.org/caribou/clojure.walk2&gt;, but I don't know whether I should depend on it.
23:06justin_smithyeah, that I couldn't tell you
23:06coventryI was using the com.stuartsierra one because it was recommended in the walk2 readme.
23:10bitemyappcoventry: why use walk2 instead of walk?
23:10Bronsabitemyapp: protocol based, faster, works with records AFAIK
23:11justin_smithLOL
23:11justin_smiththat clojure.walk2 you found is my org's fork of it
23:11justin_smith(caribou)
23:11justin_smithcan't promise we updated recently, but I can check
23:12justin_smithI'll pull from upstream, and push a new jar if we are out of date
23:14bitemyappjustin_smith: oh you're the guys responsible for that.
23:15justin_smithOK, prismofeverything probably forked and pushed, but did not upload to caribou
23:15justin_smithyeah, I am just a lackey, patchwork is the main dev
23:15justin_smithI make client sites, he develops the lib
23:15justin_smithand I try to contribute to the lib between client work
23:18justin_smithand / or hanging out on this channel and learning about applicative functors and side work with an audio fingerprinting service etc.
23:23coventryThis damn lein NPE is back. It looks like it's a failure in the password read. I'd like to try to work around it by using gpg-agent, but it's not clear to me how I should set up profiles/project.clj to do this with clojars. Anyone got a relevant example they could share?
23:26coventryjustin_smith: Thanks, at least I know who to bug if it proves to be a problem. :-)
23:27justin_smithcoventry: n/p :)
23:32coventrybitemyapp: I picked it up for the reasons Bronsa mentioned. Those factors don't really matter for my purposes, but my code is cleaner that way due to an implementation detail in walk2, so I'd prefer to stick with it.
23:46coventrytechnomancy: Marmalade's version of nrepl-discover.el is out of date.
23:47coventryI'll just stick the latest version in troncle's git repository for now I guess.
23:54dnolenmuch more accurate source maps now in CLJS master https://github.com/clojure/clojurescript/compare/91b8b44ef8...604b2a457f
23:56tbaldridgednolen: nice! does it help much with core.async?
23:57dnolentbaldridge: I can set breakpoints on things in go blocks now which is a first
23:57dnolentbaldridge: but from what I can tell core.async needs to propagate line column information for the generated forms much more aggressively
23:58tbaldridgeyeah, I figured that'd be the case. What happens if an outer form has a line no, but the inner form doesn't? Is it inherited?
23:59dnolentbaldridge: well tools.readers give line info on every form
23:59dnolentbaldridge: line & col info