#clojure logs

2013-02-22

00:06Raynescallenbot: I don't think I actually have much unused css.
00:16frozenlockIs there a more idiomatic way to pretty print to a file? (spit "filename" (with-out-str (clojure.pprint/pprint some-data-to-export)))
00:31Raynesfrozenlock: Well, pprint prints to *out*, so bind *out* to a writer on the file.
00:32Raynesfrozenlock: http://docs.oracle.com/javase/1.4.2/docs/api/java/io/FileWriter.html
00:34Raynesfrozenlock: (binding [*out* (java.io.FileWriter. (java.io.File. "foo"))] (clojure.pprint/pprint "{:foo \"bar\"}"))
00:36amalloydon't forget .close or with-open
00:36RaynesWell, yeah.
00:36frozenlockRaynes: Interesting.
00:37frozenlockNot really shorter, but helpful to understand the principle. :)
00:37RaynesI imagine it would be more efficient as well.
00:37RaynesWith your version you're printing all of this to a string and then writing it to a file. With mine, you're just printing it to the file.
00:38blankstarehi, i'm trying to get my head around recursion and i've got a function that seems to be off by 1 (NullPointerException). Can anyone see where I'm screwing up? http://pastebin.com/9kMdz7Z3
00:38RaynesIf it's small data you're pretty printing it doesn't really matter though.
00:38Raynesprintln returns nil so you're calling nil.
00:39frozenlockRaynes: around 914 bytes :P
00:43Raynes(defn fire-x-times [x] (dotimes [n x] (println "fired" (inc n) "times")))
00:43blankstareah thx!
00:47Raynes(defn fire-x-times [x] (loop [x x n 1] (when (>= x n) (println "fired" n "times") (recur x (inc n))))) ; also works and would be preferable over a recursive solution.
00:48Raynes(defn fire-x-times ([x] (fire-x-times x 1)) ([x i] (when (>= x i) (println "fired" i "times") (recur x (inc i))))) ; and a recursive version.
00:48RaynesThat'll be a dollar per version.
00:59blankstarenice!
01:10amalloythat solves blankstare's immediate problem, but i think Raynes missed the more important point. in lisp, parentheses are (with exceptions to learn about later) not a grouping construct at all, but the mechanism for calling functions. to "group" two expressions, you need to use some other tool. in clojure, that's (do a b)
01:11RaynesThat's me, missing them points.
01:13blankstareLooks like good points.
01:16amalloynote, though, that since clojure is a functional language (and thus discourages side effects) you should need to use 'do pretty rarely
01:16blankstare@amalloy adding do to if's args solved my original function
01:17blankstareyeah. that might take a minute
01:27Raynescallenbot, bbloom: I ended up using helium css because it scans multiple pages and accumulates the data.
01:27RaynesTurns out there isn't a lot of cruft, but there was some that I've removed.
01:49Raynescallenbot: Changed the fault font to Menlo followed my Monaco followed by Deja Vu (and since I presume you use a mac, this doesn't effect you and keeps my Deja Vu loving Linux fans happy).
01:49RaynesAlso went with 10pt instead of the 11 you recommended. It felt too big to me. This might change, but I doubt it. I have a much worse DPI at work and if it looked too big on this macbook, I'd have probably had a heart attack on my monitor at work.
02:28ambrosebsI've tracked down the root cause as to why `mvn test` fails in core.typed. Anyone got ideas/explanations? https://groups.google.com/forum/?fromgroups=#!topic/clojure/8xjq99PtZTU
02:30MacCoasterHi. I'm familar with accumulator functions, such as one in C#'s LINQ. I'd like to do the same but instead of keeping state I just want it to generate something like (foo (foo (foo (foo seed arg1 arg2) arg3 arg4) ... and so on. What's the best approach to this in Clojure?
02:31MacCoasterso I can evaluate it later, that is.
02:31MacCoasterPerhaps recur?
02:32ambrosebsIt looks like an `iterate`?
02:32amalloyno, it's really just reduce, which i assume is the same as a LINQ accumulator
02:33amalloy(reduce (fn [acc args] (apply foo acc args)) seed [[arg1 arg2] [arg3 arg4]]) is what you asked for
02:36amalloy&(let [foo (partial list 'foo)] (reduce (fn [acc args] (apply foo acc args)) 'seed '[[arg1 arg2] [arg3 arg4] [arg5 arg6]]))
02:36lazybot⇒ (foo (foo (foo seed arg1 arg2) arg3 arg4) arg5 arg6)
02:37MacCoasteramalloy: aha, reduce, that's right :) thanks
02:38MacCoasteramalloy: though iterate does look like it may also solve that too? if x = seed, then f(seed), then that is fed as f(f(seed)), etc. no?
02:39amalloymhm, and arg1, arg2, ... argN?
02:40MacCoasteramalloy: assuming I don't need arg1...N, but yeah, if I did, reduce looks better.
02:43frozenlockhttp://dev.clojure.org/jira/browse/CLJ-1009 "make print-table org mode compatible". What happened to this feature?
02:46frozenlockOh wait... "Fix Version/s: Release 1.5" ... does that mean the next version?
02:48alandipertfrozenlock: it will be in 1.5 i think
02:49frozenlockWell, now I have a really good reason to be eagerly waiting 1.5 :D
02:50tomojjust use the RC?
02:50frozenlockThat, and also to not get #=ed
02:50tomojlooks like the patch is in https://www.refheap.com/paste/4ebd4be52cb8bcf2b4f382076
02:51tomojdid the font at refheap change? I like it.
02:53frozenlockAre the release candidates also on clojars?
02:53tomojno http://search.maven.org/#search%7Cga%7C1%7Cclojure
03:01frozenlocktomoj: Thanks, I'll try the last RC then. Living on the edge!
03:03frozenlock'ClassNotFoundException clojure.pprint'
03:03frozenlockWell... that didn't take long.
03:04frozenlockOh! you need to require it in 1.5!
03:05frozenlockMy world crumbles.
03:07ryanfis there a simple way in the repl to see the methods callable on an object? (i.e., the things that you can do (.foobar my-record) with for a given my-record)
03:07ryanfplease forgive my terminology being embarrassing since I don't know what I'm doing
03:10ifesdjeenryanf: yes, sure
03:11frozenlockryanf: just found https://github.com/flatland/useful/blob/develop/src/flatland/useful/bean.clj
03:11ifesdjeenryanf: (:members (clojure.reflect/reflect object)
03:12ifesdjeenryanf: (:members (clojure.reflect/reflect object))
03:12ifesdjeenprobably you want to pprint it's output though
03:13ifesdjeenryanf: you could also use repl-utils
03:13ryanfifesdjeen: cool, thanks
04:34cacodaemon&(defn t (t))
04:34lazybotjava.lang.IllegalArgumentException: Parameter declaration t should be a vector
04:34cacodaemon:)
04:52jcidahoHas anyone deployed datomic to EC2 using a free transactor - maybe writing to S3? There's some stuff on the web but just starting out - any words of wisdom would be appreciated
04:53ambrosebsDo we know how many GSoC slots we have for 2013?
05:23nonubyis there no any?
05:25ucbanybody using riemann here?
06:10pepijndevosI'm trying to do a proxy by siphoning a client into a server, but it dosn't like doing that.
06:38AnderkentHow can I put fully namespaced symbols into (case ...) ? I.e. (case a-symbol `foobar :x `barfoo :y) - it throws a duplicate case constant error for 'quote'
06:57AnderkentAlso, what the hell does #= do? Why doesnt #=1 work? Or #=(quote foo)?
07:09antares_,(= ::sym :other-ns/sym)
07:09clojurebotfalse
07:09antares_,::sym
07:09clojurebot:sandbox/sym
07:10antares_:other-ns/sym
07:10antares_,:other-ns/sym
07:10clojurebot:other-ns/sym
07:17meegoflHi, need a little help with for loop (not working) inside a function
07:17meegofli have this function - http://pastebin.com/sFWEseKK
07:18meegoflif i comment out the for loop (and give static value to index) the body works
07:18meegoflif the loop is uncommented it just not getting to the body (even when in debug) with no error
07:34aavmeegofl: in clojure most of things are evaluated lazily. in your example nothing triggers evaluation of (for …)
07:35aavmeegofl: if you want to do be sure that all side effects will be applied, you can wrap your for loop with (doall …)
07:36aavmeegofl: or, better, replace for with (doseq …). it is made specially for side effects
07:37meegoflaav: 10x! will try that now
08:06clgv&(defn f [x] (* x x))
08:06lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
08:06clgvoh the jail expands it completely until it finds def^^
09:08pandeirohow could i get a sequence of every day of a certain year, preferably w/ just core & java?
09:16FoxboronSo, i am testing some regex stuff in the repl, and it gives me the right results. But if i actually run the code with lein, the results of the RegEx is somehow inverted from what the repl does.
09:32jeremyheilerpandeiro, I imagine some combination of lazy-seq and Calendar would work.
09:33pandeirojeremyheiler: that's what i'm working out now, using Calendar's getActualMaximum()
09:33ljosjeremyheiler, pandeiro: or perhaps just iterate?
09:34pandeiroljos: how would the fn work?
09:36antares_pandeiro: https://github.com/michaelklishin/quartzite/blob/master/src/clojure/clojurewerkz/quartzite/date_time.clj#L58 does what you need but it relies on JodaTime (which is always a good idea anyway)
09:38pandeiroantares_: you're right, looks good... think i'm gonna try to do it w/o for now though
09:38ljospandeiro: I looked over Calendar api; I think it would be difficult with iterate because of how Calendar works. Use the date-time lib, prob better.
09:39jeremyheilerljos, pandeiro, yeah Calendar is a side effecty object.
09:39pandeirojeremyheiler: ljos: yeah i see that
09:40pandeirowhat i am doing is so simple though i think i'd like to just KISS as much as possible
09:40jeremyheilerYou could probably do it with iterate if you get a calendar on each iteration and reset the date to the day inputed, and return the next day
09:41pandeirojeremyheiler: yup read my mind
09:47TimMcpandeiro: If you use lazy-seq and make sure the Calendar instance doesn't escape the scope, it's fine that it's side-effecting.
09:50pandeiroTimMc: right i would just create a new instance on every iteration, i was thinking
09:54pepijndevosHow can I reconnect an Aleph client on error?
09:57TimMcpandeiro: No, I think you could just use the same instance.
09:59pandeiroTimMc: ah yeah sure, i am wanting to work with dates as [month date] vectors instead of java objects, so i was just passing each iterate the last vector, creating the instance, doing the math, and converting to my format
10:00pandeiroljos: thanks for the idea by the way, i think it's the nicest way to do it
10:01ljospandeiro: maybe (iterate #(let [cal (.clone %)] (.roll cal Calendar/DATE 1) cal) (Calendar/getInstance)) , that would be from now, but you could set the date.
10:02pandeiroljos: more or less what i did, but yeah as a named fn that takes an initial date or defaults to now
10:03pandeiroi was using .add too, not .roll
10:04TimMc,(take-while number? (let [mutable (atom 0)] (repeatedly #(let [r @mutable] (when (< r 5) (swap! mutable inc) r))))) ;; pandeiro
10:04clojurebot(0 1 2 3 4)
10:06pandeiroTimMc: that was to show me how to limit by year? or deal with the mutable state? or both?
10:07TimMcDealing with mutable state.
10:08TimMcConverting back and forth between Calendar and month/day sounds error-prone or overcomplicated.
10:08pandeiroTimMc: you're right
10:08TimMcNothing wrong with contained mutation.
10:08thalassios_xelonhello room :))
10:09pandeiroTimMc: so in your example i wouldn't even use iterate or pass a calendar obj param
10:09thalassios_xelon(let [x 5] (symbol "x")) evaluates to x,not to 5,do you know why?
10:11TimMcthalassios_xelon: Yes, that's expected.
10:12TimMcI suppose you're confusing runtime values with compile-time values.
10:12thalassios_xeloni am... first time trying metaprogramming
10:12thalassios_xelonthx TimMc
10:13TimMcTrying to write a macro?
10:13thalassios_xelonnot really a macro,just some dynamic code
10:14thalassios_xeloni will figure it out, thx
10:14thalassios_xelonbye room :)
10:24TimMcAnyone want to propose an over/under on when they'll be back asking about macros? :-P
10:27clgvsooooooon ;)
10:30TimMcI'd say more than 24 hours.
10:30TimMcbut less than a week for sure
10:31TimMcOh wait, maybe this is another boolean expressions thing.
10:37andyfingerhutTimMc: There is a Clojure patch on CLJ-1168 that seems like it should allow Leiningen to work with 1.5.0 and :jvm-opts ["-Dclojure.read.eval=unknown"] http://dev.clojure.org/jira/browse/CLJ-1168
10:37clojurebotAlles klar
10:38TimMcandyfingerhut: I tested it, it works great!
10:39TimMcI wasn't sure whether to mention that in the Jira.
10:39TimMc*Jira comments
10:39andyfingerhutTimMc: Were you able to test it with a Leiningen project with that line in its project.clj file, by any chance?
10:39andyfingerhutI wasn't sure how to do that with my own custom-built version of Clojure
10:40clgvandyfingerhut: you should be able to install that custom build locally via maven
10:41andyfingerhutclgv: Sorry, maven noob here. Would that be "mvn install" in my local Clojure source tree?
10:41TimMcI believe so.
10:41clgvandyfingerhut: from my leiningen knowledge, I'd guess so as well.
10:42andyfingerhutOK, trying that out...
10:42clgvyou can check by browsing the .m2 directory if your clojure build shows up there
10:43pepijndevoslamina is weird...
10:45TimMcandyfingerhut: Re-testing, I may be seeing something weird.
10:47andyfingerhutTimMc: Stu H has an updated version of the patch that he'd like feedback on, so better to test that one if you can grab it.
10:48TimMcandyfingerhut: Will do. The existing version is setting *read-eval* to true when I do lein run, I think.
10:49andyfingerhutBoth the original and Stu's newer patches should set *read-eval* to true while reading for the REPL, and while reading -e command line args, if you use -Dclojure.read.eval=unknown on the JVM command line. It should be :unknown at all other times, I believe.
10:50TimMcandyfingerhut: THe older patch was allowing clojure.main and the REPL to work properly, and (read-string "foo") entered into the REPL failed (as expected), but my -main fn is seeing *read-eval* true.
10:51TimMcHaving internet trouble, may be a few minutes.
10:51andyfingerhutTimMc: odd. Would be good to figure out why that is happening.
10:51TimMcI'm not testing in a clean project, and I should be.
11:01andyfingerhutTimMc: I've got a clean project, and I've verified it works as expected with Clojure 1.5.0-RC15, meaning it bombs out when you try to set -Dclojure.read.eval=unknown in project.clj. Soon will try out that same project with Stu's patch.
11:01TimMcandyfingerhut: The newer patch works. I'll also go back and see if I can reproduce the weird behavior of the old patch in a fresh project.
11:02andyfingerhutTimMc: :-)
11:03goraciohey ) ,(def a 1) ,(def a (+ a 2)) ,a
11:03TimMcI actually patched against master. Probably doesn't make a difference.
11:03goracio,(def a 1)
11:03clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
11:03goraciowhat??
11:03lazybotgoracio: What are you, crazy? Of course not!
11:03goracio,(def a 1)
11:03clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
11:04goracio,(def num 1)
11:04clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
11:04ravsterhello everyone
11:04andyfingerhutI'm patching against master, too, which is only 1 minor commit later than 1.5.0-RC15
11:04goraciolazybot down ?
11:05TimMcgoracio: That's clojurebot you're talking to, and the sandbox doesn't allow def.
11:05goracioah )
11:05goracioso
11:05goraciothis is valid (def a 1) (def a (+ a 2))
11:06goraciosomething like a = a+2
11:06goracioi guess
11:06goracioa is 3
11:06goracioi expected a is immutable
11:07clgv&(println "no, I am here")
11:07lazybot⇒ no, I am here nil
11:07clgvclojurebot kicked the bucket though
11:08clgv,(inc 1)
11:08clojurebot2
11:08clgvor not^^
11:08goracioso how that can be )
11:08clgvgoracia: ah now I see. you tried something forbidden in clojurebots's sandbox
11:09goracioor persistent only vector and map ?
11:09clgvgoracia: you cannot `def` anything in clojurebot's sandbox
11:09clgv`a` is var containing the result of its definition
11:10clgvwhen you implement functions you must not use `def` inside the function
11:10goracioso a is variable ?
11:11clgvinstead you'd do something like that (defn f [x] (let [y (+ x 2)] (* x y))
11:11goracioi know about let
11:12andyfingerhutTimMc: Patch on top of latest Clojure master looks good to me. I tried it with a brand new tiny Leiningen v2.0.0 project. "lein run" bombed out with -Dclojure.read.eval=unknown and 1.5.0-RC15. It worked and showed *read-eval* = :unknown with 1.5.0-master-SNAPSHOT that I built with the patch.
11:12goracioi thought we cann't a=a+2 in clojure but it appears we can )
11:12clgvgoracio: `a` is a symbol that is resolved to the variable you defined with the `(def a ...)` statement (provided you are in the samenamspace or imported the definition namespace in your current namespace)
11:12andyfingerhutclgv: Thanks for the help. Gotta go run to the day job now.
11:13clgvgoracio: well, you redefine the variable `a` with the value of its previous definition altered by 2
11:13clgvandyfingerhut: no problem. good day
11:13goracioclgv: a = a+2 also redefines a with previous a
11:14clgvgoracio: so what is your question/problem? variables and namespaces in clojure are indeed mutable
11:15goracioclgv: take Erlang there Y= 1 we defined Y and we cann't redefine it Y=Y+1 is not valid
11:16clgvgoracio: ok. but what is your clojure related problem? you want to forbid (def a 1) (def a (inc a)) ? which means forbidding variable redefinition?
11:16goracioclgv: problem how we can prove that a is immutable )
11:16clgvgoracio: you can't
11:17clgvgoracio: you could use (def ^:const a 2) - but that does not work for all righthandside expressions
11:17goracioclgv: that's pretty strange
11:18clgvgoracio: why? clojure does not promise that variables or namespace mappings are imutable
11:18clgvgoracio: it promises that values of its standard datatypes are imutable (lists, vectors, sets, maps ...)
11:19goracioclgv: i see then
11:19goracioclgv: Erlang is more immutable then Clojure then ))
11:20clgvgoracio: I dont know how Erlang manages namespaces so I cannot agree on that ;)
11:20Wild_Catgoracio: Clojure supports mutable datatypes anyway, so...
11:20antares_goracio: in a way, yes. Erlang can do that because everything is built around message passing, though. Take a look at http://clojure-doc.org/articles/language/concurrency_and_parallelism.html
11:21clgvgoracio: additionally, if you find yourself code that looks like "(def a 1) (def a (+ a 2)" your doing something pretty wrong.
11:21clgv*writing code
11:21clgv*you are^^
11:21matthavenerdoesn't erlang only allow two copies of a module in memory at a given time?
11:21goracioclgv: that was just for example )
11:21clgvwhere did my spellchecker go after launch?
11:22matthavenerand jvm allows more than that afaik
11:22clgvgoracioa: yeah, mine was an example as well. if you program in a similar way like the above. you are doing something wrong
11:25TimMcgoracio: Why do you keep putting closing parens at the end of your sentences?
11:27goracioTimMc: habbit
11:28goracioTimMc: from chats
11:28clgvcould be a lisp infection ;)
11:33pepijndevosWhat could be going on here? In aleph, I siphon stuff into other stuff, but the second time it doesn't work. Step one: find acurate problem description.
11:37pbostrompepijndevos: maybe paste some code to refheap too
11:38pepijndevospbostrom: step 2, don't hurry… :)
11:38pepijndevoshaving a ton of fun with the vis part of lamina.
11:38pbostrompepijndevos: worth looking into as well, the visualization stuff built in to lamina, very useful in debugging
11:39pbostrom(view-graph ch)
11:39pepijndevospbostrom: just what I said. very nice and a lot of fun
11:39pepijndevosbut not very helpful so far
11:39ravsterI'm trying to learn tools.logging. I'm using the example that they have in their readme. Where do I set the location for the logs?
11:40clgvravster: e.g. in the log4j.properties file - sadly the have no built-in config-function
11:41clgvravster; provided you use log4j with tools.logging - it supports other logging libs as well
11:41ravsterwhen I do a (divide 2 0) I just get a nil and thats it. No other output.
11:41ravsteryup, using log4j, clgv
11:41pepijndevospbostrom: okay, here you go.
11:41pepijndevoshttps://www.refheap.com/paste/11662#L-40
11:41pandeiro,(let [c (atom (java.util.Calendar/getInstance))] (swap! c #(.add % java.util.Calendar/DATE 1)) @c)
11:41clojurebotnil
11:41clgv,(divide 2 0)
11:41clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: divide in this context, compiling:(NO_SOURCE_PATH:0:0)>
11:42clgvravster: what is the definition of `divide`?
11:42pandeiroah i see what i did wrong
11:42pepijndevospbostrom: the problem seems to be that the second time around, the siphone a t line 40 doesn't work. If I trace a message from server-out, it only goes to println and keep-alive, not to client.
11:43clgvpepijndevos: hidden exceptions in other threads cause behavior like you described. I ran against this wall several times already
11:43pandeiro,(let [c (atom (java.util.Calendar/getInstance))] (swap! c #(do (.add % java.util.Calendar/DATE 1) %)) @c)
11:43clojurebot#inst "2013-02-23T16:44:23.468+00:00"
11:43ravsterthe exact same as in the readme for tools.logging. Decided that I might as well do it with a working example. https://github.com/clojure/tools.logging#usage
11:43pepijndevosclgv: oh, what do you do about something like that?
11:44clgvpepijndevos: I was lucky that I had the thready in control, when using a threadpool I could wrap the submission into try-catch to find those exceptions
11:44pepijndevosclgv: I have just one thread, and the one aleph uses presumably.
11:44clgv*threads
11:45ravsterclgv: oh, its supposed to print it out to the console, so its not showing in nrepl
11:45clgvpepijndevos: I dont know how things with aleph are
11:46clgvravster: ah ok. yeah it logs it as error and returns nil
11:47clgvravster: if you have no log4j.properties file, you'll get a warning on first logging attempt and thus nothing will be logged
11:47clgvravster: the config given in the readme is a console appender. there is a fileappender as well.
11:49clgvravster: try this configuration https://www.refheap.com/paste/11664
11:49ravsterclgv: should I be using log4j 2 instead?
11:49ravstertheir website seems to be 2.0 oriented.
11:50clgvravster; I use those dependencies [org.clojure/tools.logging "0.2.4"] [org.slf4j/slf4j-api "1.6.1"] [org.slf4j/slf4j-log4j12 "1.6.1"]
11:50clgvseems I missed two minor releases
11:51clgvah no, just one +2
11:55ravsterk, I'll install the slf4j stuff. I don't need to get the log4j package then?
11:55pepijndevosclgv, pbostrom: I can't find any exception. I can manually run the siphon command, and it'll just silently fail, it seems.
11:56pepijndevos(siphon server-out @cl) (view-graph server-out) -> no sign of @cl
11:56seangroveibdknox: Is there some way to disable connection pooling in korma?
11:56clgvravster: I do not have it as dependency
11:56clgvravster: and loggign works. I used it to debug my remote applications a lot ;)
11:56gfredericksseangrove: I think if you create the db map yourself you can
11:57gfrederickscheck the return value from the connection info fn you're using
11:57gfredericksthere's probably a :use-pool? key in there or something
11:57seangrovegfredericks: I'll check it now...
12:00clgvravster: 1.7.2 seems to be the newes slf4j-* version
12:02ravsterclgv: Have you tried clj-logging-config?
12:03clgvravster: I did not know of that lib until now. I wrote my own function to configure log4j programmatically
12:03ravsterokay
12:04seangroveIs there a way to find out what methods an object responds to? I'm trying to get the database connection that Korma uses to connect directly
12:05clgvravster: the readme looks good though
12:05ravsterI'm going to try your slf4j stuff first, and see if I get it.
12:08seangroveI'd like to automatically include all of the information from http://us5.api.mailchimp.com/1.3/ in my Mailchimp wrapper https://github.com/cloudfuji/chinpu
12:08seangroveCurious to know if there's an easy way to do this short of copy/pasting everything over
12:11ravsterclgv: Hey, your system worked for me. Thanks. I found the log file in the root of the project.
12:11ravsterclgv: thanks
12:11ohpauleezseangrove: Use a screen scraper?
12:12clgvravster: no problem. but you could try to use clj-logging-config if you do not like the properties file. the lib's readme looks promising
12:12pepijndevosThis is crazy! the output channel is fine. The input channel is fine. When I siphone the one to the other, nothing comes out of the output.
12:12ravsterand the log4j.properties file should just be under the src dir, right?
12:13clgvravster: you will need to include the properties file in any jar you build (e.g. put it in "resources" in a leiningen project)
12:13frozenlockWell.. I just realized how silly it was on my part to 'not' use print-table. This is amazing to analyse maps!
12:13ravsteroh, okay. thats a good idea. I should make better use of the "resources/" dir.
12:14clgvpepijndevos: you should call a plumber ;)
12:14pepijndevosclgv: you know a good one?
12:14clgvpepijndevos: not in your area, I guess^^
12:14pepijndevostoo bad
12:15pepijndevosI guess the out channel just doesn't like being siphoned
12:15pepijndevosI made a new channel, and that didn;t work either
12:16pepijndevosthere is a grey box in the graph as well that bothers me.
12:17pepijndevosmaybe the client channel turns into a ghost and haunts me after I close the connection
12:21pepijndevosokay, that is indeed the closed channel. But since this is a permanent-channel, it shouldn't matter.
12:22clgvpepijndevos: do you use aleph for usual program communication or for browser-server-communication?
12:23pepijndevosclgv: no browser is involved. Not sure if it's usual. I'm writing an IRC bouncer.
12:24pepijndevosI thought I'd just siphone everything into everything and it'd work.
12:24pepijndevosIt sortof does I guess, except the second time you connect the output from the server is not siphoned back to the client.
12:31pbostrompepijndevos: sorry to leave you hanging, I'll try to look at this a little later
12:32pepijndevospbostrom: ok, I'm trying to reproduce it with a minimal test case, and failing so far.
12:35muhoogot piggieback working!! {:dependencies [[com.cemerick/piggieback "0.0.3-SNAPSHOT"
12:35muhoo :exclusions [org.clojure/google-closure-library-third-party]]
12:35muhoo [cljsbuild "0.3.0"]]
12:35muhoo :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
12:35muhoogah
12:35muhoohttps://www.refheap.com/paste/11667 was supposed to be this
12:36muhoothe essential part is: it was *required* to add cljsbuild as an explicit dependency, otherwise, no piggieback. whatever magick is in cljsbuild, piggieback must have it. and now i have a working cljs in nrepl.el!
12:38dnolenmuhoo: nice!
12:50muhooheh, that is one massive freakin hairball. but it works https://www.refheap.com/paste/11668
12:54pepijndevosI can't reproduce the greyed out graph block. When I make myself a permanent channel, siphon some stuff and close that, I get no gray box in the permanent's graph, like in my real code.
13:00pepijndevosreproducified!
13:03callenbotRaynes: thank for the font changes. I'll take a look. Also I'll look into Helium.
13:07Bodilmuhoo: Any special reason you're using the 0.0.3 snapshot version of Piggieback?
13:07pepijndevosIf any lamina export cares to try this: https://www.refheap.com/paste/11669
13:08muhooBodil: i ended up there as part of the thrash. can try it with 0.2.0, i suspect that'll work too.
13:08Bodilmuhoo: Ah, OK, was just wondering if there were features I'm missing out on. :)
13:09muhooaccording to git, some bugfixes, IIRC
13:12pepijndevos$mail pbostrom seems to have to do with fork. https://www.refheap.com/paste/11669
13:12lazybotMessage saved.
13:17pepijndevoslamina is too magic
13:21BodilIf I want to do unit testing in Clojurescript, do I have any options other than Prismatic's cljs-test and that weird stuff in Clojurescript One?
13:21BodilBecause if that's it, I'm about to write a test framework of my own...
13:22kencauseyWill Midje just not work on cljs?
13:22BodilNever tried - can't really imagine it'll cross compile.
13:23kencauseyI would at least try
13:23technomancyI'd rather write my own
13:23kencauseyBrian Marick seems to be active right now and I suspect would be happy to help if it doesn't work.
13:24tomojBodil: please write one :)
13:24tomojI half-ported clojure.test to cljs
13:24technomancyclojure.test relies fairly heavily on vars IIRC
13:24BodilIt won't run on Cljs without somebody porting it. And I'm not a Midje fan, I'd prefer something more like clojure.test tbh...
13:24tomojbut not released
13:25Bodiltomoj: Any useful code I could borrow?
13:25muhoothere's some stuff in phantomjs for cljs testing, IIRC, but i don't remember th details
13:25muhoomaybe in cljsbuild docs, i saw this mentioned? fuzzy.
13:26Bodilmuhoo: That's just for running tests on Phantom, not writing them.
13:27tomojBodil: https://github.com/tomjack/cljs-test
13:27tomojI don't remember what state it's in
13:27tomojsorry for the git-deps too :(
13:28tomojyou can at least see the changes I made to clojure.test in the history for inspiration :)
13:28tomoj..or, at the very least, to see what not to do
13:29Bodiltomoj: Ah, so you were porting the test runner, not the assertion stuff? I was hoping you'd done the is macro. :)
13:29Bodiltomoj: I need something that supports async testing, so I can't reuse the test runner.
13:30tomojyeah, that's where I stopped
13:30tomojI pretty much just copied the is macro directly
13:31BodilOh, wait, that probably doesn't need much porting, does it?
13:32tomojhmm
13:33tomojit looks like I didn't give thrown? a try* version
13:33tomojbut I thought I remembered doing that
13:38tomojoh, it looks like I didn't even excise the var problems, either? I'm guessing this was my second attempt and I hadn't gotten there yet
13:41tomojand apparently my first attempt was so bad I deleted it
13:41Bodiltomoj: I get the feeling maybe clojure.test for Cljs isn't a great idea after all :)
13:42tomojI'd still like something analogous, even if it needs to change too much to be just a port
13:43tomoj..which means `is` I guess ?
13:44BodilThat's my favourite assertion ever, so I'm not giving up on it. :)
13:50dnolenBodil: a real cljs.test would be awesome
13:54Bodildnolen: Guess I'll see what I can do :)
14:02dnolenBodil: I wouldn't be against the minor changes to the compiler to support running tests - the way ClojureScript tests are done leaves much to be desired.
14:03dnolenBodil: it's really (run-tests ...) that needs help from the compiler. I'm also interested in enough support so that lein cljsbuild can easily hook into it.
14:06pppppauli'm getting into clojure concurrency stuff now, and i was wondering if anyone could point me in the direction of how to do a good/idiomatic timeout loop in clojure
14:06pppppaul:D
14:06antares_pppppaul: timeout loop?
14:07Bodildnolen: I suspect that's all just implementation details.
14:07pppppaulhmmm... every few seconds i want to try to reconnect to a server
14:07pppppaulantagon,
14:08pppppaulantares_,
14:08dnolenBodil: yes, I'm just saying if you're going to tackle cljs.test, I'd more than happy to get that into CLJS so everyone can benefit.
14:10antares_pppppaul: I use scheduled executors in the JDK for that: http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newSingleThreadScheduledExecutor(). You then can submit Clojure functions to them.
14:10antares_they implement all the interfaces executors expect
14:11antares_a very naive version can be impemented with an endless loop + sleeping in a thread, but you won't be able to cancel it gracefully
14:12Bodildnolen: I'm going to tackle some kind of testing framework, at least... let's see how well that turns out before we go calling it cljs.test or anything. :)
14:12pppppauli sorta want to stay away from threads... i have a single thread in my program right now and it's really taking more of my time to manage/debug that than i desire
14:13mpenetpppppaul: shameless plug: I wrote a lib that wraps that stuff https://github.com/mpenet/knit , I use it to do exactly what you describe in another lib
14:13pppppaulmpenet, going to check it out
14:14pppppaulalso, if anyone here has experience working with rabbitmq + clojure i would be very interested in having a chat. i'm having a lot of trouble dealing with exception handling/recovery with langohr
14:14alandipertdnolen: is the compiler support needed for tests you envision enough of a dynamic ns system?
14:15antares_pppppaul: yeah, exception handling in the Java client does not make it easy to recover. Langohr currently does not provide any solution.
14:15antares_it took some time to design in a few other clients, too
14:16pppppauli want to cry
14:17TimMcpppppaul: I think your nick has gained weight.
14:17pppppaulantares_, if you have any examples of simple error recovery (losing a connection to rabbitmq or anything) i would be greateful to take a look
14:18pppppaulTimMc, sometimes the 'p's grow... they are beyond my control
14:18antares_pppppaul: if there was a good demonstrative example, I'd have put it to the langohr docs already
14:18pppppaulantares_, crap
14:21pppppauli thought that agents or some other clojure concurrency construct would be a good fit for rabbit... do you think it would be easy or hard to implement a consumer with one? right now my main problem is that when an exception occurs my thread dies.
14:22antares_pppppaul: you can send-off incoming messages to an agent
14:22antares_pppppaul: but error handling has to happen in the consumer object langohr reifies for you
14:23antares_pppppaul: because in Langohr queue names and such are strings and not objects, recovery will include recovering the connection, then channels and consumers
14:23dnolenalandipert: no not general enough for that, just hooking into the analyzers namespaces atom with holds all the defs
14:24antares_and there is only so much we can do without wrapping key Java client classes or submitting changes to the Java client
14:24dnolenalandipert: I don't think dynamic namespaces will happen before the compiler can bootsrap itself.
14:24dnolenBodil: gotcha :)
14:24antares_maybe I'll sit down to try out a couple of ideas this weekend
14:25pppppaulantares_, currently i have channel and connection recover code (us atoms and reset!), i don't have consumer stuff ready... i think it may be a bit harder, going to have to make an atom or something for that as well
14:25antares_pppppaul: feel free to post what you have in mind to the clojure-rabbitmq mailing list
14:26antares_using an atom for channels should be fine
14:26antares_I agree with you that consumer recovery is the hardest part
14:26tomojoh, I found my attempt to remove var stuff from clojure.test
14:26pppppaulmy situation is very easy to deal with, though. i have 1 channel, 1 connection, and 1 consumer...
14:27pppppauli'm really leaning on moving to storm
14:27alandipertdnolen: sounds reasonable
14:28tomojthere are atoms in a macro ns holding a map of symbols to test functions
14:28tomojbut you can just use the analyzer instead?
14:29antares_pppppaul: storm is a pretty different beast. You can try messaging in https://github.com/ptaoussanis/carmine if your needs are very small.
14:30alandipertdnolen: apropos nothing, and not having researched myself, would pluggable analyzer mean pluggable syntax fronts in cljsc?
14:33pppppaulantares_, i would like to be enlightened about the tradeoffs of storm.
14:34antares_pppppaul: it's just a very different system. Not a messaging solution, even if it does messaging internally.
14:34pppppaulwell... i'm actually using rabbit messages for job processing
14:35pppppaulso... that's actually why i'm interested in storm
14:35pppppauli'm not really taking advantage of rabbitmq at all
14:38jweissRaynes: amalloy_ any hints on getting lazybot to reconnect automatically? i run him on my corporate irc server, and he occasionally loses the connection. the log file shows him continuously pinging himself. maybe get him to give up after x failed pings and start a new connection?
14:39Raynesjweiss: There is not mechanism for that. It need to be added to the new Irclj and lazybot needs to actually use the new Irclj (and someone needs to finish the new Irclj).
14:39Rayness/not/no*
14:40TimMcRaynes: Did that clojail bug I found get fixed yet? If not, need help?
14:40jweissRaynes: ok thanks
14:40RaynesTimMc: I don't actually remember the bug. If you want to take a shot at fixing it, by all means be my guest.
14:41RaynesTimMc: I always need help.
14:41TimMcRaynes: Is github up to date enough to do meaningful work?
14:41RaynesYep.
14:45antares_Raynes: now that you are in LA, ever thought of directing a movie called Resident Eval with clojurebot as the main character?
14:46RaynesHeh.
14:47ravsterhello all
14:49antares_hi ravster
14:50antares_pppppaul: by the way, by all means I and the rabbitmq team understand that ease of recovery is a problem. It just takes a while to design that, so far we are done with 2 clients out of… many.
15:02ohpauleezBodil: ping
15:03Bodilohpauleez: PONG
15:04ohpauleezGirl! what's going on?! - two things: are you going to be at ClojureWest, can you link me to your clojail file again? I can't seem to find it on github
15:06Bodilohpauleez: One: I'm supposed to be presenting there, so it's either that or make Alex mad at me. Two: https://github.com/bodil/thefutureisclojure/blob/master/src/server.clj
15:06ohpauleezBodil: One: excellent. Two: thanks!
15:07ohpauleezfirst thing in the morning? excellent
15:07ohpauleezhaha
15:10Bodilohpauleez: Protip: never tell Alex not to put you at the end of the day because you're going to be jetlagged. He takes things too literally. :P
15:10ohpauleezhaha
15:11ibdknoxBodil: at least you'll get it done early and have the rest of the day to relax :)
15:12Bodilibdknox: Good point. I guess you should know after the Conj too :)
15:13pbostromohpauleez: FYI, if you want to use def with your clojail, be sure to grab the very latest, 1.0.4, I patched an issue with that a couple days ago
15:13technomancybeing the last presenter sucks
15:13technomancyunless you are samaaron
15:13ibdknoxit really does
15:14ohpauleezpbostrom: Thanks for the heads!
15:14ohpauleeztechnomancy: truth
15:14ibdknoxtechnomancy: I think that is still my favorite clojure presentation so far
15:14muhoohmm https://www.refheap.com/paste/11677 Cannot call method 'setParameterValue' of undefined main-dev.js:27591
15:14Bodillol
15:14ibdknoxsuch a fun guy
15:15ohpauleezI imagine the first time I commit a major crime, will come from an evening of drinking with Sam Aaron
15:15TimMctechnomancy: 2nd time slot is best.
15:15TimMcEarly enough that people are awake, but you're not the first to try out the A/V tech.
15:15ohpauleezone thing will lead to another, someone will startup overtone
15:15ohpauleezand then bam, we're robbing a bank
15:15muhoomusicians, we know how to party
15:16ohpauleezagreed
15:16ibdknoxI tended to pick the first slot if I could
15:16ohpauleezbecause you're a baller
15:16ohpauleezwe get it ibdknox :)
15:16BodilFirst slot is keynote slot :)
15:16bbloomibdknox: so that people aren't awake enough to know if what you're saying actually makes sense? :-)
15:16ibdknoxbbloom: it's the best cover
15:17ohpauleezhahs
15:17ibdknoxbbloom: make some hand motions, point at some fullscreen pictures
15:17ibdknoxno one's the wiser
15:17ibdknoxworst presentation I ever gave was in Poland
15:17ibdknoxsuch a disaster
15:18ibdknoxand it was entirely my fault lol
15:18ohpauleezmostly because you realized you didn't know polish
15:18ibdknoxand I didn't know it was a keynote!
15:18jweissanyone know how to get a full stack trace on "OutOfMemoryError: Java heap space"? the bottom line of mine is at clojure.core$fn__5290.invoke(core_print.clj:191). clearly that is not the lowest stack frame.
15:18ohpauleezdamn
15:18ibdknoxthey told me on the plane ride over
15:18ibdknoxI had 3 presentations in 1.5 days
15:19jaenWow, I wasn't aware there were any Clojure presentations in the backward nation of Poland ; p
15:19ibdknoxand like an idiot I didn't give myself enough time to arrive early and adjust
15:19ibdknoxjaen: I was with Microsoft
15:19muhooso why would peerUri be undefined?
15:19cemerickibdknox: s/clojure presentation/presentation/ ftfy :-)
15:19brainproxyany good examples of using clojure to dynamically generate QR code PNGs with the zxing lib?
15:19ibdknoxcemerick: haha :)
15:20TimMcibdknox: Wow, Microsoft was using Clojure? :-P
15:20ibdknoxlol
15:20ibdknoxass.
15:20jaenibdknox: so it wasn't Clojure presentation then?
15:20jaenOh well ; d
15:20ibdknoxjaen: yeah, I was the PM for C# and VB
15:20ibdknoxso no Clojure unfortunately
15:20jaenNoone talks about interesting languages here...
15:20TimMcjaen: I dunno, Polish is an interesting language.
15:20jaenibdknox: oh, I see.
15:21jaenTimMc: I see what you did there... ; p
15:21jaenIt's pretty okay as far as languages go
15:21muhootoo many consonants
15:21ibdknoxI remember being astounded by how many beautiful people were in Warsaw
15:21jaenBut still, I'd prefer if people didn't laugh at me when I go like Clojure, Scala or Haskell
15:21TimMcmuhoo: *Tricky* consonants.
15:22muhoothough the czechs have the market cornered on consonants, IIRC
15:22jaenBecause dude, C++ or Java is what real men use
15:22jaenDuh
15:22TimMcYou think that's just an L with a stroke through it, but noooo...
15:22ibdknoxjaen: yeah, when I was there it seemed like EVERYONE was C++
15:22ibdknoxmanaged was considered a joke
15:23muhooin _, garbage collects you!
15:23jaenibdknox: yeah, people in Poland tend to boast that we the nicest girls in quite a radius
15:23jaenWell
15:23jaenThe CS curriculum where I study goes like 1 sem Pascal, 1 sem C, 2 sem C++, 1 sem Java
15:23jaenAnd that's it
15:23muhoothis madness must stop
15:24muhooteach haskell for CS101
15:24Bodiljaen: I kind of prefer that to Norway's 6 sem Java and that's it...
15:24jaenBodil: ok, fair point
15:24jasonbrayinteroping with a javascript function that takes an array of maps (like a named argument constructor) - I assume you can't just pass in a cljs array of maps.. is there an idiomatic approach?
15:24jaenAnd I have this tendency to troll the teachers with uncommon languages
15:24jaenThough I was a bit bummed
15:24jaenWhen I wrote my algorithms article in Haskell
15:25Bodiljasonbray: (clj->js)
15:25jaenAnd after I asked if the professor noticed any interesting languages, he was like "oh, yeah, someone had examples in python" ; /
15:25muhoook, that's weird. cljs is not creating the browser repl iframe
15:26jasonbraybodil: thanks
15:26muhooso when it tries to clojure.browser.repl/connect, there's no there there
15:26jaenmuhoo: I dunno about Haskell, but I really liked how SICP approached it and thusly I'm of mindset that if you don't start CS education with C or LISP, you're probably doinf it wrong.
15:26nuclearsandwichjaen Majority California is Java and maybe some scheme. It's a bigger issue. :(
15:26nuclearsandwichMajority of California, even
15:26pepijndevospbostrom: I filled a bug in lamina: https://github.com/ztellman/lamina/issues/58
15:27pendlepantscan someone explain to me what's going on in this gist? https://gist.github.com/zachpendleton/19eaa46bbeaed82913d0
15:27borkdudeJava is very dominant in education somehow
15:27pendlepantsI'd expect each function to be called once, but it looks like `two` is being called twice.
15:27ibdknoxThe few classes I took were all in Java as well at UNC
15:27drewcjaen: Even better would be Lisp, which is past LISP 1.5 ;) (and not capitalized:))
15:27nuclearsandwichborkdude $$$
15:28muhooi'm at a disadvantage having been self-taught C (linux), web stuff (js, php, sql) and lisp/scheme, and now clojure, and knowing very little java. and all the work out there seems to be java, and all the real-world things i want to do using clojure involve massive gobs of java library cruft
15:28pbostrompepijndevos: cool, you can also hit up the aleph mailing list, zach is pretty responsive there too
15:28borkdudenuclearsandwich how did it come about that Java relates to $$$?
15:28jaenI don't understand why Java is so dominant in education
15:29nuclearsandwichmuhoo I wouldn't consider being self taught a disadvantage. Especially if you're teaching yourself formal CS along with programming
15:29jaenAbout every other language
15:29jaenGive you more to learn about programming
15:29jaen*Gives
15:29Bodiljaen: It's because it's dominant in the job market.
15:29pepijndevospbostrom: maybe I will do that if he doesn't respond to the issue
15:29muhoonuclearsandwich: i agree. i really feel the pain now since learning clojure
15:29Bodiljaen: Which it is because it's dominant in education. And so on.
15:29jaenBodil: Figures, but it's so, so sad
15:29nuclearsandwichborkdude: Sun put a lot of marketing money into making java seem like the perfect language for learning to program and cashed in on the OOP will change everything about CS fad
15:29borkdudeJava takes the fun out of programming, but this is my personal opinion
15:30drewcmuhoo: I consider that an advanatage, save for php being 'web stuff' when IMO is <not-so-good> stuff :P But I am a self taught software developer ... who works primarily in Lisp
15:30pppppaulmuhoo, wrap that java
15:30jaenI worked for a year in Rails and then I was like, why not see how does Java fare, it can't be that dreadful I guess
15:30nuclearsandwichborkdude: my issue with java is that it 60%s everything. It's not fully committed to anything, efficiency, OOP, anything
15:30jaenSo I got a Java job
15:30ibdknoxmuhoo: I'm self taught :)
15:31jaenAnd this whole week was wasted on trying to deploy a liferay project and repeatedly failing
15:31jaenSo I don't get why Java is so popular in the job market
15:31Bodiljaen: Consultants usually bill by the hour. ;)
15:31muhooibdknox: well, but the IB in ibdknox may have given you a head start
15:31pppppauljava is popular because all universities teach it
15:31drewrjaen: it's all schools taught for years
15:31nuclearsandwichBodil: hahah
15:31jaenMust be some sort of inertia I guess... ; /
15:32borkdudepppppaul the question is, why did universities start to teach it
15:32ibdknoxmuhoo: not in terms of programming, I didn't think there even was an IB CS course
15:32pppppauljava was once the new shit
15:32pppppaulnow universities are doing nodejs and other crap
15:32drewcborkdude: because universities do not teach software development but programming, and that is a widely used programming language?
15:32pppppaulthey once did smalltalk too
15:33muhoosometime in the 90s it seems like universities got turned into trade schools
15:33jaenpppppaul: really? what universities do node?
15:33muhooand corporations said "we want Java!" and uni's obliged
15:33drewrborkdude: because it was easier than C++, and the promise of write-once-run-anywhere
15:33Wild_Catalso, Java has a cleaner design than C++
15:33pppppauljean, i dono because i don't care about universities cept for MIT. i've heard at least one doing nodejs in the usa
15:33Wild_Cat(although not as clean as a teaching language should be)
15:33nuclearsandwichdrewc universities claim to teach SE, whhen all they know is CS. So you get a crappy education in both CS and SE
15:33ibdknoxJava is *much* easier to teach theory with than C++ is
15:34borkdudeibdknox I agree on that.
15:34nuclearsandwichinstead of a thorough grounding in CS that lets you build your own SE career if you want
15:34nuclearsandwichat least that's my observation, as I enter my 7th year as a Math/CS undergrad
15:34Wild_Catyeah. It's hard to teach beginners about algorithms when before doing anything you have to grasp pointers and manual memory management.
15:34ibdknoxyep
15:34borkdudeI think a first programming language should have a REPL nowadays
15:34jaenWell, maybe Java has a clean design, but by the virtue of not doing almost anythin at all ; /
15:34Bodil"At least it's better than C++" actually sold this?
15:34Wild_Catthey get bogged down in the unnecessary details.
15:34drewrdrewc: how do you like Clojure compared to CL? I don't see very many converts. CL isn't lacking any power it seems.
15:35nuclearsandwichWild_Cat: I dunno, I had a much easier time groking data structures in C than Java because I understood how it all translated to assembly. Whereas java requires you to know jvm semantics
15:35Wild_Catjaen: that's the thing -- it tries very had to be foolproof. It does so by aiming for blandness and mediocrity, but it mostly succeeds.
15:35drewcnuclearsandwich: I have to agree with you there 100% ... I actually do want to go back to uni for CS, simply because I have been asked to and will be a proff as well as a student, but also do not want to take SE because I know more about the then the proffs do.
15:35ibdknoxnuclearsandwich: that's only true because you had some grounding in assembly
15:35ibdknoxmost don't
15:35muhooi remember java was sold back in the day as "C++ without memory allocation nightmares", and "write once, run everywhere!" and such hype
15:36nuclearsandwichibdknox: that's fair. I learned assembly when I was a kid. All the actually programming didn't come until later.
15:36Wild_Catmuhoo: a lot of it is true. At the very least, Java brought automatic memory management into the mainstream, and for that it deserves praise.
15:36nuclearsandwichdrewc choose your uni carefully
15:36pbostromyeah "write once, run anywhere" was a big selling point in the beginning
15:36nuclearsandwichIt matters a ton rightnow.
15:36jaenWild_Cat: It's a point about algorithms being hard to teach when chasing pointers (that's for example why I used Haskell to write the article for the algorithms course), but a programmer has to at some point learn about how the computer really works. And going Java only hardly helps in that regard.
15:37Wild_Catjaen: you can learn how the metal works once you grasp the basics of data structures and algorithms.
15:37borkdudeI remember writing my first Java program. I thought it was very verbose and slow to start. I never looked at Java gain until uni
15:37Wild_Catjaen: it's easier than being forced to learn both at once as a perfect noob
15:37drewc drewr: well, what comparison are you looking for? I 'like' some things, and there are many things that I do not like and will not use... and compared to CL, well, please show me mutiple implementations that follow that same standard :)
15:37Wild_Catbecause frankly, they're orthogonal.
15:37muhooin the case of java, it is so popular with corporations because it mirrors the structur of them
15:37borkdudemy colleagues are very keen on keep using Java in education
15:37jaenThat's why I would prefer a Scheme + C combo for CS introduction with them being taught one after other
15:38borkdudeI don't know why - maybe they just hate learning other languages
15:38jaenWild_Cat: it's a point, but I see a lot of people not caring about close to the metal
15:38Wild_Catjaen: note that I agree with you that *at some point*, one has to learn C.
15:38drewcnuclearsandwich: well, one of my friends is a prof at the local University, and we agree on a number of things and I actually own his book ... so likely there :)
15:38jaenOnce they learn about GCs and such
15:38muhooit's bureaucratic, and heirarchal, just like a corporation.
15:38nuclearsandwichdrewc cool, what school?
15:39Wild_Catjaen: oh, sure. Heck, *I* don't care about being close to the metal. I like ultra-high-level stuff, because I believe that programmer time is more important than CPU time.
15:39drewcnuclearsandwich: this school, for this guy: http://www.cs.ubc.ca/~gregor/
15:39Wild_Cat...although it is important to have *some* people who enjoy writing OS kernels and device drivers.
15:40muhooso i think it is cultural. it was funny, for example, watching linus try to sell git to google, they couldn't grapple with the decentralized approach. "but there's no central server!" heirarchy is deeply built into the enterprise mindset
15:40muhoo </philosophical digression>
15:40Wild_Catin a perfect world, I'd use Haskell and Smalltalk as teaching languages.
15:41Wild_Catin a non-perfect world, I believe Python is a great language for beginners -- not to mention it's excellent as a general-purpose lang.
15:41jaenAnd even if we disregard the ctm tangent, I really prefer a flexible language which Java, again, is not. I understand that it tries to target the center of the mean programmer, but I don't agree it's a good idea
15:41pppppaulmpenet, i am trying out knit
15:41jaenMediocre programmer won't become great in mediocre language but it will impede good programmers, I think.
15:41pppppauli would like to get it printing out stuff in the nrepl console... any suggestions?
15:42Wild_Catjaen: Java, in many ways, addresses the sad truth of the job market, which is that most programmers are, at best, mediocre.
15:42drewrdrewc: not sure; I'm always curious when I see a CL guy around :)
15:42jaenSo I'm kind of sad that's most of the time CS introduction promotes mediocrity.
15:42Wild_Catand those programmers, when given C++, will make things that haunt maintenance programmers for decades.
15:42Wild_Catwhen given Java, they can only manage to haunt them for years.
15:42drewrdrewc: especially one who rubs elbows with Gregor!
15:42jaenWild_Cat: yeah, that's probably it, but that doesn't make me less sad.
15:43Wild_Caton the plus side, the JVM is a cool idea.
15:43jaenOh yes, I think it's a good platform, that's for sure
15:43drewcdrewr: well, I am a little bit of a 'famous' CL guy, so what I say is not quite to relevant to other languages :P
15:43drewcdrewr: great /nick btw! :D
15:44Wild_Catalthough I really dislike what Oracle is doing with it these days. I mean, ask.com toolbar? On a 10-minute delayed install? *Really*, guys?
15:44drewr"drewr/c: causing more work for autocompletion since 2013"
15:45TimMcdrewr, drewc: Whichever of you is looking at going to a university, where are you looking?
15:45jaenWild_Cat: on an interesting note I find myself much more happier when I code C and chase pointers than when I write websited in RoR or struggle with liferay in Java.
15:45drewcdrewr: and, fwiw, `whois common-lisp.net` <---- Drew Crampsie is me .
15:45drewcTimMc: likely http://www.cs.ubc.ca/~gregor/
15:45jaenI find low-level stuff way easier to understand than having to understand all that code someone else wrote.
15:46Wild_Catjaen: that's hard to compare. Chasing pointers in C is not a functional domain. Writing websites is ;)
15:46muhoojaen: thank you. i've found for quite a while a parallel between c and clj, and couldn't figure out what it is
15:46drewrdrewc: I remember you from #emacs 12 years ago :)
15:47muhoothe commonality may be simplicity
15:47drewcdrewr: autocomplete? surely you type on a qwerty keyboard! drewr is even easier!
15:47drewrI didn't want to say it...
15:48jaenWild_Cat: maybe that means I'm as un-functional as it gets. Because I do quite agree that doing real complicated systems in C would be a nightmare.
15:48TimMcdrewc: *Most* of the classes in a standard CS curriculum would probably be useless to you.
15:48drewcdrewr: that is entirely possible ... still in #emacs today for that matter ... just decided to move into 'common' lisp rather then "Commn Lisp" so clojure and scheme as well
15:48drewcTimMc: yup, hence why I do not have to take them ...
15:48Wild_Catjaen: yeah, C is great for its intended purpose -- OS kernels and tiny bits of performance-critical code.
15:49drewcTimMc: I have been offered an internship with a lot of 'courses' that I will not need to take but will 'pass'
15:49drewrdrewc: No Lisp Left Behind
15:50drewcTimMc: I probably will not go back, but Gregor on a sailboat ... well I live on a sailboat, and own AMOP, and talk to him... so simply having that 'education' is worth it... regardless of if its official or not ... I do not think I will fire myself if it turns out that I am not a CompSci Graduate
15:51jaenmuhoo: that's an interesting angle. Both C and Clojure aim at being mostly simple with occasional weirdness here and there, at least as far as I can tell.
15:51drewcdrewr: 2013 is going to be a big year for "common common" lisp itself imo ... already started! http://alpha.common-lisp.net/
15:53Wild_Catjaen: I don't really see that many common points between C and any of the Lisps, TBH
15:54Wild_Cat...in fact, one of my main criticisms of C is that C programs are about as far from homoiconicity as you can go. C compilers spend so much time parsing and reparsing unnecessary text.
15:54jaenWild_Cat: I'm not sure if that would be how I would have thought of it myself, but if you think about it
15:55Wild_CatC macros and include files make me sad, especially since I learned Turbo Pascal before C.
15:55borkdudedrewc why is CL going to be big again in 2013?
15:55jaenBoth C and Scheme are about as basic implementations of the respective impertivey and functionaley paradigms as it gets
15:55drewcborkdude: I do not know, why?
15:55drewrdrewc: ah yes; how is quicklisp doing btw? I haven't seen any cl-gardeners traffic in a while
15:55ohpauleezborkdude: I think it was on a Mayan calendar or something
15:55drewcwas it ever big?
15:55jaenAt least that's how I understood muhoo
15:55borkdudedrewc why would 2013 be big for CL
15:55TimMcdrewc: "2013 is going to be a big year for "common common" lisp itself"
15:56Wild_Catjaen: you could go much, much simpler than C.
15:56jaenAnd as for homoiconicity I have a bit of a love-hate relationship with it - I love the idea of macros, I still can't get over parentheses, still somewhat unparsable to me ; /
15:56drewcdrewr: quicklisp is going great .. in fact, I am planning on having a common-lisp.net quicklisp dist
15:57drewcborkdude: I do not know, why?
15:57Wild_Catjaen: Clojure helps a lot with that -- it adds just enough syntax to make the whole thing readable.
15:57drewcTimMc: note the "common common" ;)
15:57Wild_Cat(vector/set/map syntax was Clojure's really good idea, and I wish CL or Scheme had it)
15:57borkdudedrewc because you said it's going to be a big year for CL. my question: why?
15:58drewcborkdude: my question
15:58drewc:
15:58TimMcdrewc: What is "common common" lisp?
15:58jaenWild_Cat: regarding the simpler-than-C: probably, though I haven't seen anyone go there, at least practically; as for Clojure: yeah it's better than CL/Scheme, but it's still a bit hard on me, even with additional brace types; it maybe a fault of mine a bit, since most programs I wrote in Clojure were thing I hacked quickly together in one or two days
15:59jaenAnd some functions were left unbroken over several indentations level since that how the code flowed.
15:59Raynescemerick: Asciidoc is pretty cool.
15:59jaenI need to get better at partitioning stuff in lisp, that probably will help a lot.
15:59RaynesI started writing a novel for giggles in it last night.
15:59Wild_Catjaen: me too, tbh. I'm still a massive Clojure noob.
15:59cemerickRaynes: Yup. It is the local maxima.
16:01Raynescemerick: Only thing that bothered me is that I didn't see a way to split a file up into logical units, like chapters.
16:01ssmolauWhat black magic must occur so that my repl see the environment variables exported by my bash.rc?
16:01borkdudeRaynes what advantages does it have compared to org-mode?
16:01cemerickRaynes: and keep each section in a different file, you mean
16:01cemerick?
16:01drewcTimMc: well, for some reason, Common Lisp was a standard, that was meant to unite things that Lisps did in Common, but is now used as the name of a programming language that meets the ANSI standard... I do not program in just that language ... I use threads, and continuations, and sockets, and iolib for 'proper' pathnames .... But the same code I use can be used on other implementations, though it is non standard. S
16:01drewco what common lisps have in common.
16:01mcohen3question about Clojure's answer to the static type fanatics... if i have a function that returns a map with several keys, and i consume this function from numerous other places in my app, if the structure of that returned map ever changes, client code calling that function may break. in java, i would be returning an object of some class, and if i changed the structure of that class in the same way, client code calling that fun
16:01mcohen3ction would simply not compile. what is clojure's answer to that problem? tests?
16:01Raynesborkdude: The fact that it isn't org mode and thus it can be edited properly in more than one editor and has tooling I can actually use.
16:03borkdudeRaynes tooling like?
16:04Raynesborkdude: I can basically do "a2x -fepub file" and get a readable epub file out of my book.
16:04cemerickor mobi or pdf or html...
16:04RaynesYes.
16:04dnolenmcohen3: be careful, or contribute to core.typed
16:05RaynesI can also style my book with css if I want, apparently, and the documentation makes this easy.
16:05technomancydrewc: is there something specific you're looking for in multiple implementations, like escaping the JVM?
16:05technomancyor is it just a principled thing?
16:05borkdudeRaynes I didn't try it but org-mode can export to docbook, which can export to epub etc - I searched for something like markdown, etc but I'm happy with org-mode for what I need now
16:06drewctechnomancy: I am not a pro clojure dev, so no idea about JVMs at all.
16:06borkdude(which is html, pdf, etc)
16:06mcohen3dnolen :) ok, i just wasn't sure if there was something i was missing
16:07Raynesborkdude: Yeah, and that's what a2x does. But it's there. I just type a2x and it's done. I don't have to learn Emacs commands and stuff. They have a whole page on writing books in asciidoc and it's just like 2 pages long.
16:07technomancydrewc: sure, I mean do you want an alternate implementation because there's something wrong with this one, or just because you don't like the idea of an implementation-defined language?
16:07borkdudeRaynes ok, cool
16:07seangroveOh god, I just figure out why korma wouldn't connect - somehow jdbc won't let me connect to postgres over localhost
16:08drewcRaynes: lol ... http://alpha.common-lisp.net/projects/cl-org-mode/index.html to https://github.com/drewc/smug/blob/master/smug.org to http://drewc.org/interface/monads.html#sec-5 ... now I can not use emacs and still use org-mode syntax! :P
16:08seangroveWhereas psql and rails are just fine with it. Aliasing any domain to 127.0.0.1 worked. Ugh.
16:10borkdudeRaynes can you do this with asciidoc? http://stackoverflow.com/questions/15011355/org-mode-counter-for-items-visible-in-export/15012114#15012114
16:11drewctechnomancy: Mu ... there is no definition of Clojure beyond the implementations afaik... so not liking is not relevant, I would prefer an R1RClojure , but then again, I stopped using 'new' things for programming quite a while ago ... It turns out that there is more money involved (for me) doing things "My Way" :)
16:11RaynesI doubt it, but I don't want to.
16:11borkdudeRaynes I don't mean to convert you, just exploring if it can do what I want right now
16:11RaynesWell, org-mode is just really for a different use case.
16:11RaynesIt's pretty powerful. I don't really need powerful though, I need a simple plain text format that I can write my text in.
16:12RaynesActually, I don't even need that since I'm not actually going to write a book right now.
16:12RaynesBut I wanted to play with some stuff for when I actually do.
16:12borkdudeRaynes what are you going to write your book in then?
16:12borkdudeRaynes sorry, misread
16:13RaynesWhen I continue my Clojure book I'll probably do it in asciidoc.
16:13RaynesNo Starch wants it done in openoffice, but I don't think I can do that.
16:13RaynesI don't have it in me to write a book like that. It's a terrible experience and I'm writing for fun and not profit.
16:13borkdudeRaynes I was happily surprised by what org-mode can do, but also I'm beginning to see its limitations. Btw, org-mode can export to odt as well.
16:13RaynesNot good enough.
16:14RaynesThey have this special template stuff that no plain text format can output to.
16:14RaynesI looked over every odt-outputting plain text format there is and none of them would work with their stuff.
16:14devncould you transform it and then give it to org?
16:14technomancykernel is from the axis of eval guy?
16:14borkdudehmm
16:14Raynesdevn: Huh?
16:15drewctechnomancy: http://web.cs.wpi.edu/~jshutt/kernel.html
16:15Raynesdevn: I could have written my own outputter for pandoc or something that would do what I want, but I was contracted as an author for No Starch and not an engineer.
16:15devn*nod*
16:16drewctechnomancy: So, Manuel Simoni is involved, but it is John N. Shutt who wrote the docs that matter :)
16:16technomancyseems like having a publisher assume authors would be OK with a word processor is a bad sign
16:16technomancyIIRC manning used to assume word (!) until a few years ago
16:17borkdudeThe Joy of Clojure was compiled using this: https://github.com/fogus/trout
16:19hiredmandnolen: the impossiblity of efficient implementation means never having to justify yourself
16:19technomancyhiredman: I thought that was Ola
16:19pandeiroanyone know why the heroku lein template would compile with ring-devel <=1.1.8 but not 1.2.0-beta1, something involving ring.util.request ?
16:19hiredmantechnomancy: him too
16:19weavejesterpandeiro: What's the exact error?
16:20pandeiroweavejester: Exception in thread "main" java.lang.ClassNotFoundException: myapp.web
16:21TimMcRaynes: Do it in LaTeX.
16:21weavejesterpandeiro: What's the whole stack trace? Can you require the namespace in a REPL?
16:21cemericktechnomancy: If you give a programmer a tool, odds are she'll implement something "better", regardless of the qualities of the original offering.
16:22devnDid I tell you guys about my awesome version of clojure without parens?
16:22pjstadigdnolen: what makes it hard to understand the appeal of Kernel?
16:22RaynesTimMc: Get out of my internet.
16:22pandeiroweavejester: when i try to load that namespace in the REPL, a message about ring.util.request not being on the classpath appears; but that is not anywhere in the stacktrace when i run `lein run -m myapp.web`
16:23weavejesterpandeiro: Try a lein clean? Sometimes that works
16:23dnolenpjstadig: what hiredman said
16:23TimMcRaynes: What, are you allergic?
16:23pandeiroweavejester: had tried that already.. let me paste the stacktrace
16:23TimMcTry NiTrIlE.
16:23RaynesTimMc: Yeah, I break out in hives.
16:23pjstadigdnolen: so i guess you meant was "it doesn't appeal to me because it can't be made performant"
16:24pjstadigwhich is fine, but people could still find it appealing for other reasons
16:24TimMc(That should exist, dammit.)
16:25pandeiroweavejester: http://sprunge.us/jVfK
16:26weavejesterpandeiro: Well, all that tells me is that myapp.web is not on the classpath...
16:26drewcpjstadig: heh ... the same thing was said about lexical scope .... it was 'slow' for interpreted code, but discovered because the compiled code 'accidently' did it... So was 'faster'. Imagine that, lexical scope can/cannot be made performant! :P
16:26bbloomdnolen: isn't kernel just an experiment in fexprs?
16:26pandeiroweavejester: yeah i know (?) ... and it is, of course ... it works fine with ring-devel 1.1.8
16:26dnolenpjstadig: it's not just about performance - that's just falls out the difficulty (from what I can tell) in applying any kind of analysis.
16:27borkdudeTimMc I wrote a large document in latex but I'm now converting to org-mode, because I want to change it's content a bit and latex just distracts me too much from the content ..
16:27weavejesterpandeiro: What's the error you get in the REPL when you require the namespace?
16:27dnolenpjstadig: but sure, I guess some people find that fun. But people also find Brainfuck fun, so whatever.
16:27antares_https://twitter.com/ClojureWerkz/status/305066453353246720
16:27pjstadigthere's a whole thesis on the vau calculus and making the theory of fexprs non-trivial
16:27antares_woops, meant for #leiningen, sorry :)
16:28pandeiroweavejester: FileNotFoundException Could not locate ring/util/request__init.class or ring/util/request.clj on classpath: clojure.lang.RT.load (RT.java:443)
16:28pjstadigmaybe it can't me made performant (which seems like an argument from silence?), but performance isn't the sum total of appeal for everyone
16:28borkdudeTimMc and actually code blocks, inline code etc writing in org-mode and then generating .tex works better (for me) than writing in latex: no weird things happen when string literals are used in inline code etc
16:29pjstadigi don't particularly feel the need to crap on someone just because they're pursuing something different than what I would pursue
16:29TimMcantares_: You know what I'd like to see in ClojureWerkz? A push for detailed changelogs.
16:29antares_TimMc: so are you saying that clojurewerkz.org projects changelogs are not useful?
16:29weavejesterpandeiro: Ah, ring.util.request. So that indicates your dependency is still pulling in an old ring-core.
16:29Raynesantares_: You clojurewerkz guys should get me set up with a website for laser.
16:29antares_TimMc: how much more detailed can be it? We don't want to jam a copy of the docs into the change log :/
16:29weavejesterpandeiro: Try "lein deps :tree" and see if anything is pulling in an old Ring dep
16:29drewcpjstadig: great read too, the $vau thesis ... and helped my increase performance for my first implementation by quite a bit.
16:29antares_Raynes: when is your birthday?
16:30Raynesantares_: 20 days ago.
16:30Rayneslol
16:30drewcRaynes: happy belated!
16:30RaynesThanks.
16:30antares_Raynes: so, in ~345 days we will see if there's anything to reveal :)
16:30TimMcantares_: Oh, you know what? I thought timbre was a "member project", but it's not.
16:30RaynesHehe
16:30antares_TimMc: timbre is Peter's library. He usually does all the right things but yeah, not change logs.
16:31pandeiroweavejester: compojure 1.1.5
16:31TimMcSo never mind. :-D
16:31pandeiroso i use :exclude ?
16:31RaynesI was waiting to release 1.0.0 of laser.
16:31weavejesterpandeiro: Or just have [ring/ring-core "1.2.0-beta1"] as an explicit dependency.
16:31pjstadigdrewc: yeah i've read the thesis
16:31RaynesWhich I'm totally gonna do tonight.
16:31clojurebotIt's greek to me.
16:31RaynesWeeee.
16:32pandeiroweavejester: ah of course, better.. thanks
16:32weavejesterpandeiro: Dependencies in your project.clj take precedence over second-degree dependencies
16:32TimMcantares_: You know what I don't see enough of, in general? Mentions in the changelog of what bugs were introduced in a given version.
16:32TimMcThat's super-classy stuff, right there.
16:32antares_TimMc: we started using issues more actively for what we find. I wish github had a nice way to link to issues :(
16:32weavejesterpandeiro: I guess you've just added [ring "1.2.0-beta1"], which depends on [ring/ring-core "1.2.0-beta1"]
16:32weavejesterp
16:33TimMcantares_: Beyond #42?
16:33antares_right now we sometimes add GH issue: #20 or something like that to the change log
16:33TimMcyeah
16:33pandeiroweavejester: yeah that's it
16:33antares_TimMc: #42 does not resolve from a markdown file in the repo
16:33weavejesterpandeiro: But [compojure "1.1.5"] depends on [ring/ring-core "1.1.6"] so the two ring-core deps are of equal importance. I think when that happens the first one is picked.
16:33antares_TimMc: but thanks for the suggestion, I agree that it is a good idea
16:33antares_TimMc: what projects do you use, by the way?
16:34pandeiroweavejester: wow so if i reversed the order of the deps, it would work? trying that...
16:35weavejesterpandeiro: Maybe. I can't remember exactly how it works.
16:35patchworkHow do you guys feel about using `resolve` to break circular dependencies up across namespaces?
16:35pandeiroweavejester: sure enough, you are right
16:35dnolenpjstadig: I should read the thesis. But the idea that certain design choices might make basic kinds of static analysis intractable unappealing. So I haven't bothered. But that's me.
16:36patchworkSo any forward references can just call (resolve qualified-name) to access a function yet to be defined?
16:36pandeiroi actually don't understand why the heroku template requires ring-devel and not core in the first place
16:36pjstadigdnolen: i get what you're saying, and i think i agree, but i've not seen any kind of formal analysis of the unanalyzability of Kernel
16:37bbloomi'm beginning to think, more and more, that it's preferable to have more sublanguages with well defined semantics and narrower applicability
16:37pandeirooh, maybe stacktrace
16:37bbloombecause you can express interesting ideas more susinctly and with more opportunities for static analysis
16:37pandeirobut wouldn't it be a best practice for the heroku template to make the ring-core dep explicit, since it uses ring.middleware.session.*, too?
16:40finishingmovewhat's Clojure used for, commonly? what kind of applications? (i'm new)
16:41pjstadigbbloom: that why i find macros appealing, you can extend syntax in a way that translates to well known, well analyzed, well optimized forms
16:41pjstadigwhich seems like an easier route
16:41dnolenpjstadig: http://en.wikipedia.org/wiki/Fexpr talks a bit about the issues
16:41pjstadig"In 2007, John N. Shutt proposed an extension of lambda calculus that would model fexprs without suppressing rewriting of operands, in an attempt to avoid Wand's result."
16:41drewrfinishingmove: anything; it's as general purpose as Java
16:42dnolenpjstadig: I also don't find reassuring that nearly every academic Lisper I've encountered pretty much has told me Kernel is horrible idea. Not that academics have all the answers or anything.
16:42pjstadigthe thing with fexprs is that everyone goes to Wand, but Stutt claims to have avoided the problems that Wand brings up
16:42pjstadiger.. Shutt
16:42finishingmovedrewr, that's cool.. :) any trends though?
16:43finishingmoveit's kind of a stupid question but u know what i mean i guess
16:43pjstadigdnolen: yeah, don't get me wrong, i have reservations about Kernel myself, but i still find it interesting in a way
16:43pjstadigit's and uphill battle to defend fexprs
16:43pjstadigso you gotta give the guy props
16:43drewrfinishingmove: it's all over the map -- web, science, prog lang research, data, you name it
16:43borkdudefinishingmove if you look at cemerick's survey, clojure is mostly used for web dev - but this doesn't mean it can't be used for other areas. web dev is probably just a popular field
16:44pjstadigWand basically killed fexprs in the 80s
16:44borkdudefinishingmove http://cemerick.com/2012/08/06/results-of-the-2012-state-of-clojure-survey/
16:45finishingmovecool, thanks for the info
16:46TimMcantares_: I think timbre is the only one from that page.
16:46TimMcIt's definitely a site I check when I need a lib.
16:49frozenlockRaynes: ping
16:50frozenlockAny reports of clojail misbehaving once uberjared?
16:51borkdudewhich languages allow shadowing of local variables in nested scopes? clojure, but not Java and C#
16:51borkdudesome more examples?
16:51borkdudelocal variables / locals
16:52dnolenborkdude: seems like nearly every major functional programming language right?
16:52borkdudednolen I'm trying to give an example to students who don't know functional languages
16:52technomancyborkdude: ruby does now, but it used to screw it up in 1.8
16:54bbloomborkdude: SQL
16:55antares_TimMc: file an issue about it ;)
16:56Raynesfrozenlock: Define misbehaving.
16:56TimMcantares_: Yeah, good idea.
16:56antares_TimMc: what clojurewerkz libraries do you use, by the way?
16:58frozenlockRaynes: That misbehaving---> "java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createClassLoader")"
16:58borkdudeI came up with this javascript example https://www.refheap.com/paste/11679 but this uses an anonymous function, is there an easier way to create a scope?
16:58TimMcantares_: None of the member projects, it turns out.
16:58Raynesfrozenlock: And you're running this jar with `java -jar my.jar`?
16:58antares_TimMc: hahahaha
16:58frozenlockRaynes: yup
16:58antares_TimMc: it's ok. Some day. It's unavoidable ;)
16:59TimMcantares_: I was surprised to not see an Amazon S3 project in there. I'm in the market for one.
16:59Raynesfrozenlock: Try java -Djava.security.policy=example.policy -jar your.jar
17:02frozenlockRaynes: It works.
17:03pppppaulis there an easy way for me to tell if my application is running via nrepl?
17:03frozenlockRaynes: would it be possible to just drop the policy in the resources?
17:03Raynesfrozenlock: I don't know of a way. There probably is, but you'll have to google around.
17:04frozenlockTime to stretch my google-fu!
17:04frozenlockThanks for the help :)
17:15TimMcpppppaul: Like, whether it was launched from the command line vs. calling (-main) in the REPL?
17:16TimMcpppppaul: If so: https://github.com/baznex/crosscram/blob/gui-demo/src/crosscram/demo.clj#L341
17:17Bodildnolen: Oh, I see what you meant about compiler support now...
17:17dnolenBodil: heh :)
17:18dnolenBodil: yes since we don't have vars, you must do var trickery through the analyzers namespace atom
17:18dnolenBodil: but you can easily do that in your macro.
17:19dnolendeftest macro or whatever
17:19Bodildnolen: That's what I'm doing now. Which makes me realise I don't much like the deftest/run-tests pattern.
17:21bbloomBodil: core.test isn't my favorite bit of clojure either
17:22hiredmanb
17:22hiredmanb
17:22TimMcLooks like someone forgot to pay their / bill today and ran out.
17:23TimMcpppppaul: Basically, my approach is "Don't do that, then."
17:44seangroveIn Korma, should the transform function be called whenever calling (select my-entity...)?
17:44seangroveIt never seems to be applied
17:53pppppaulTimMc, ok
17:53pppppauli just didn't want my repl running rabbitmq code
17:53pppppaulcus... that's just weird
17:54TimMcI figure that an explicit alternate entrance point is less trouble than some context-detecting magic.
17:58devnIs it possible to alias *1 to something else?
17:58TimMcdevn: What behavior would you like to see?
17:58pppppaulbut... i want to become a magician
17:58devn$1 does exactly what *1 does
17:59devn(def $1 *1) or somesuch
17:59devnim wondering if it's even possible
17:59TimMcdevn: Set up a watcher to copy values over. :-)
17:59devnwithout wiring up an atom or something
17:59devnyeah TimMc -- just curious if there's a simpler way
17:59TimMcTHat's pretty simple.
18:01TimMcdevn: This is what you have to work with: https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj#L261
18:09ravsterin tools.logging, and when using log4j, does the log4j.logger.user=DEBUG property only use that logger when we are in the user namespace?
18:09TimMcdevn: If you don't mind implementation details: (.refer *ns* '$1 #'*1)
18:10ravsterthats what I'm getting from the readme, but how would that make sense in a project with numerous namespaces?
18:16ravsternvm, just found with-logs
18:22seangroveAh, figured it out - later (defentity ...) calls were overriding previous ones
18:23abp`Hm, should as-> support :as? Currently it doesn't.
18:26ravsterhow does one set the logging level in tools.logging?
18:29technomancyravster: by reading lots and lots of documentation
18:31ravstertechnomancy: apparently :) . I should add a bunch of stuff to the readme when I figure all this out.
18:31technomancyjava logging is a quagmire
18:39bbloomtechnomancy: understatement of the year
18:43abp`More specifically: Should as-> support destructuring and restructuting? Currently it does/n't. (as-> (range 2) [one two :as numbers]) => [0 1 :as (0 1)] but (as-> (range 2) [one two]) => [0 1] It's just not checking for destructuring but using let under the hood.
18:50patchworktechnomancy: We just implemented our own logging, way simpler
18:51technomancypatchwork: I've been meaning to try timbre
18:51technomancybut yeah, rolling your own is better than dealing with the nightmares of seven-layer logging cake
18:51patchworkWell, we tried that first
18:51patchworkI didn't realize beforehand what we were getting ourselves into
18:51patchworkI wish someone had warned us
18:51technomancyoh?
18:52technomancyleiningen just uses println plus a couple dynamic vars (*debug?* etc)
18:52patchworkwe tried java logging first I mean
18:52patchworkI don't know how much time we dropped dealing with all the crazy
18:52technomancyoh, gotcha
18:52technomancypart of the problem is some level of logging config is unavoidable if you use certain java libs
18:52technomancyso you see reasonable people doing it, and you think to yourself "that must be a reasonable thing to do"
18:53technomancybut you don't realize they're not doing it out of choice
18:53bbloomi agree: printing some semi-standard syslog formatted plain text lines is by far the best way to go
18:53dnoleninteresting subtle behavior of declare I never really thought about: (def x 1) (def x), x is still bound to one.
18:53technomancybbloom: I'm surprised how effective k=v style logging is
18:54patchworkIt's really all you need. We added some stuff in front to be able to redirect output to different hosts etc
18:54patchworkbased on our own (simple) configuration
18:54bbloomdnolen: yeah, i was surprised when i saw the source of the `declare macro, but then i realized that it made sense: 'def is a primitive and `declare is not, so that *has to be* the behavior such that declare can be implemented in terms of def
18:54patchworkthough I suppose that is already going down the road of damnation
18:55bbloomtechnomancy: i've seen XML loggers in production.. *cringe*
18:55ravsterpatchwork: yikes. that doesn't bode well for me.
18:55patchworkravster: just getting into java logging?
18:55ravsterpatchwork: ya
18:56patchworkravster: roll your own, it will save you hours of pain
18:56ravsterI've spent the last 30 minutes trying to figure out how to set the log level for a program run
18:56patchworkunless like technomancy says you are forced to use it because of a dep
18:56bbloomtechnomancy: the best part of using syslog style logging is that you can trivially migrate from stderr to "real sys log" by checking *out* to be a dgram socket
18:56patchworkbbloom: That is exactly what we are doing!
18:56bbloomit's connectionless and unreliable, but on any sane modern unix, local dgram sockets are basically memcopy
18:56patchworkgood old dgrams
18:56dnolenbbloom: yes cljs was doing the wrong thing, ran into a surprising bug
18:57patchworknow I am thinking I should release our setup as a lib
18:57bbloomdnolen: cljs' def behavior is strange in general... the top level should be clj not cljs
18:57bbloom(when false (def x 1))
19:01TimMcdnolen: I believe defonce makes use of that def behavior.
19:02technomancyI like how tools.logging doesn't let you change log level at runtime because it's not supported across all backends
19:06ravsterpatchwork: is your logger opensource?
19:06patchworkIt is part of a larger project
19:06pppauli desire log
19:06patchworkI am thinking about releasing though
19:06ravsteroh okay
19:07patchworkthrough popular demand
19:07ravsterpatchwork: :D
19:09pppauli will fork it and rename it to b-log
19:10pppaulpatchwork, our first goal with a logger is to reduce the performance penalty of (println\(pprint
19:10pppaulwhat do you think?
19:12patchworkThat is certainly a worthy goal
19:12patchworkmine was just to make it simpler
19:12patchworkbut I think in the process, it is faster as well
19:13patchwork(since it is just throwing packets at a dgram socket)
19:13patchworkI will have to test it though, and make a project for it
19:15antares_ravster: use https://github.com/ptaoussanis/timbre instead
19:16antares_unless you need to use SLF4J or log4j in a legacy codebase, there is absolutely no reason to use tools.logging. Timbre is better, easier to use and you can contribute to it without hassle.
19:16patchworkantares_: That looks pretty good!
19:21ambrosebsHow can I tell clojure-maven-plugin not to `compile` files? I just want whatever lein does for releases/tests.
19:30ravstergood stuff.
19:42dnolenyow
19:43dnolensolving Zebra under CLJS core.logic is now down to 13ms
19:44ohpauleezdnolen: That's insane. congrats
19:44dnolen^not-native is pretty darn useful
19:50dnolenit takes about 8 seconds in latest Racket, we're doing pretty good!
19:50bbloomdnolen: heh :-)
19:51ohpauleezdnolen: Where is ^not-native documented
19:51ohpauleez?
19:51dnolenohpauleez: nowhere
19:52dnolenit's experimental and new
19:52ohpauleezahh, cool
19:54dnolenohpauleez: it just eliminates dispatch overhead on protocol invocations
19:55ohpauleezahh, awesome
20:04ivaraasendnolen: got any recommendations for CS books? currently on a shopping spree
20:28dnolenivaraasen: concepts techniques & models of computer programming
20:36frozenlockRaynes: FYI https://www.refheap.com/paste/11688.
20:39alandipertRaynes: https://github.com/tailrecursion/hiprepl clojail ftw!
23:24Raynesalandipert: Go Alan, go Alan.
23:26alandipertRaynes: 8-)
23:31Raynesalandipert: You should come visit me in LA.
23:31RaynesIt's only like 2.5k miles.
23:38alandipertRaynes: i just may dude, i got peoples in san diego and am out there periodically
23:44sshackWhat's the recommended way to do SSL in a ring/compojure app? let apache terminate the SSL for you (more moving parts), or will ring/jetty handle it for me?
23:47frenchypsshack: I'd like to know too. For what it's worth http-kit says to handle it with a nginx front end
23:48sshackfrenchyp: Fair enough. I'll consider nginx as a synonym for apache in that case.
23:48frenchypyes, of course
23:48xeqiclojars uses a nginx frontend
23:48xeqialso helps for serving static files through it
23:49sshackxeqi: True. I'm just thinking from an operational perspective. there's also the static serving portion of ring.
23:49sshackThe fewer moving parts I can have, the happier I am. "scaling" isn't an issue for me.
23:58frozenlockhttp://www.emacswiki.org/emacs/ThreadMacroFromClojure