#clojure logs

2016-04-13

01:33tolstoyWhy would that reloaded.repl thing, when you call "reset-all", when not changing any code, cause a "namespace not found" issue?
01:36tolstoyHm. lein clean fixes it? Weird.
02:00ilevdHow can I transform enlive node back to html?
02:07omilevd: if memory serves, enlive-html/html
02:12omilevd: memory doesn't serve well: it's emit*
02:21ilevdom: thanks, with (apply str .. ) it seems work
02:21omilevd: I forgot to say it returns a seq
02:22omilevd: I had to take a look at the a mailbox processor I wrote some time ago
02:29ilevdI think it must be a public lib api method
02:56ashnurso, I am working with mori data structures which is close enough to what you have to ask here, how would you accomplish this? https://gist.github.com/ashnur/34e241049825d1e66ce5519c20c52689
03:01TEttingerhi ashnur
03:02ashnurhi :)
03:03TEttingerthis is uh confusing. I'm not sure why the keys are 1 and 5, and the values "c" and "j"
03:04TEttingermaps in clojure and maybe mori are unsorted when made with the {} literal
03:04TEttingerI think for maps of less than 8 keys the sort order is "usually predictable", but that is an implementation detail on clojure and may not be true for cljs/mori
03:08ashnurkeys and values are such because this is example data, the original data is way more confusing with stupid names
03:09TEttingerI just don't see the relationship at all
03:09ashnurand i want a vector back, so that's ordered just fine
03:09ashnur[{1:"c"}, {5: "j"}] this is a list of hashMaps
03:09TEttingeroh there we go
03:09TEttingerI see now
03:10ashnuryeah, i wasted a night to figure out the relationships, there is actually way more data, it's coming from a Java backend
03:11TEttingerit looks up key x in the rec map to get the end result key of 1. in the second half of the data, it looks up key z in rec to get "c"
03:12TEttingerin mori, are rec and order equivalent to "rec" and "order", that is, they're strings but you can omit the quotes?
03:13ashnurthis is javascript and the object (hashMap) keys are always strings everywhere
03:13ashnurso I think yes?
03:14ashnurrec has the data from which the keys and values have to be chosen by the value of they key attribute and the put into objects using the order attribute
03:14ashnurso easy to write down in english :))
03:16ashnurand what's even worse, i simplified this because even the value of the key is actually coming from a list so i have a lookupf function for that
03:16ashnuri love good backend APIs.
03:17TEttinger,(def data [{ "key" "x", "values" [ {"order" 1, "rec" {"x" 1, "y" 2, "z" 3}}, {"order" 2, "rec" {"x" 5, "y" 7, "z" 9}}]},{ "key" "z", "values" [ {"order" 1, "rec" {"x" "a", "y" "b", "z" "c"}}, {"order" 2, "rec" {"x" "h", "y" "i", "z" "j"}}] )
03:17clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
03:17TEttingergah
03:18TEttinger,(def data [{ "key" "x", "values" [ {"order" 1, "rec" {"x" 1, "y" 2, "z" 3}}, {"order" 2, "rec" {"x" 5, "y" 7, "z" 9}}]},{ "key" "z", "values" [ {"order" 1, "rec" {"x" "a", "y" "b", "z" "c"}}, {"order" 2, "rec" {"x" "h", "y" "i", "z" "j"}}]}] )
03:18clojurebot#'sandbox/data
03:19TEttingerso that's one problem, there was a missing square bracket I think
03:20ashnuryes, thanks for pointing it out
03:21ashnurfixed the example :)
03:21ashnuri need something like parinfer for javascript :D
03:31TEttinger,(def data (atom [{ "key" "x", "values" [ {"order" 1, "rec" {"x" 1, "y" 2, "z" 3}}, {"order" 2, "rec" {"x" 5, "y" 7, "z" 9}}]},{ "key" "z", "values" [ {"order" 1, "rec" {"x" "a", "y" "b", "z" "c"}}, {"order" 2, "rec" {"x" "h", "y" "i", "z" "j"}}]}] ))
03:31clojurebot#'sandbox/data
03:33TEttinger,(def data [{ "key" "x", "values" [ {"order" 1, "rec" {"x" 1, "y" 2, "z" 3}}, {"order" 2, "rec" {"x" 5, "y" 7, "z" 9}}]},{ "key" "z", "values" [ {"order" 1, "rec" {"x" "a", "y" "b", "z" "c"}}, {"order" 2, "rec" {"x" "h", "y" "i", "z" "j"}}]}] )
03:33clojurebot#'sandbox/data
03:35ashnuri have no idea what's happening
03:35TEttingerI'm workin some magic
03:46TEttingerhooray!
03:46TEttinger,(let [atm (atom {})] (doseq [{:strs [key values]} data] (doseq [{:strs [order rec]} values] (swap! atm assoc-in [order](rec key)))) @atm)
03:46clojurebot{1 "c", 2 "j"}
03:46TEttingerit doesn't quite work yet
03:46ashnurholy shit that's longer than expected
03:47ashnurat least 3-4 things i never used
03:47ashnurfrom that list
03:58amalloywhy on earth would you use an atom for that
03:58amalloyit's just a reduce over the thing you're currently holding in the atom
03:59TEttinger,(let [atm (atom [])] (doseq [{:strs [key values]} data] (doseq [{:strs [order rec]} values] (swap! atm update-in [(dec order)] #(vec (concat % [(rec key)]))))) (mapv #(apply hash-map %) @atm))
03:59clojurebot[{1 "c"} {5 "j"}]
03:59TEttingerI'm kinda brain-blocked right now
03:59TEttingerI'm currently helping 3 different people, two of them in a java channel
04:02TEttingeramalloy, is it just a reduce though? his data seems to call for updating different parts of the returned value based on the value of the order key
04:02TEttingerI guess anything CAN be a reduce
04:03amalloyyou turn the doseq into a nested (for), producing a list of operations to perform
04:03amalloyand then you reduce over those, doing the swaps as pure functions on the accumulator
04:04amalloyor really it looks like it's so simple you don't even need to reduce, you can just (into {} (for ...))
04:04TEttingerthe underlying algorithm isn't what I'd call simple
04:04TEttingerit might work
04:04TEttingertry it
04:04amalloyyou're really talking about this snippet? (let [atm (atom {})] (doseq [{:strs [key values]} data] (doseq [{:strs [order rec]} values] (swap! atm assoc-in [order](rec key)))) @atm)
04:05TEttingerthe data that it needs to output is weird
04:05amalloy(into {} (for [{:strs [key values]} data, {:strs [order rec]} values] [order (rec key)]))
04:05amalloyi don't see how that's weird at all
04:05TEttingernope
04:06TEttingernot correct
04:06TEttinger,(into {} (for [{:strs [key values]} data, {:strs [order rec]} values] [order (rec key)]))
04:06clojurebot{1 "c", 2 "j"}
04:06TEttingerhe needs the keys to be 1 and 5, looked up in the "x" key for the first map
04:06TEttinger[{1 "c"} {5 "j"}] is the desired output
04:07amalloyi took the first version you wrote, which as you say doesn't work yte
04:07TEttingeryeah, I posted a working one
04:07TEttinger,(let [atm (atom [])] (doseq [{:strs [key values]} data] (doseq [{:strs [order rec]} values] (swap! atm update-in [(dec order)] #(vec (concat % [(rec key)]))))) (mapv #(apply hash-map %) @atm))
04:07clojurebot[{1 "c"} {5 "j"}]
04:07amalloyand wrote something equivalent without a doseq or an atom
04:09amalloyit would probably be a good exercise for you to perform the same transformation i did on your unfinished solution
04:09amalloythere's nothing weird or special about the requirements, and it transforms into a reduce/for perfectly well
04:10TEttingerit just seems kinda... imperious to not even address ashnur who asked the question and only critique the solution. I mean it could be better, and I'll do the improvement when I have time
04:13amalloyit was unnecessarily rude of me to lead with "why on earth would you do that"
04:15amalloybut i'm not especially interested in the 0th-order thing of answering every specific question in #clojure myself. i actually answered a *very* similar question earlier tonight, which you can see if you look through the logs for bmuk's question
04:15amalloyrather, i want to improve the answers given by the channel whether i'm here or not, which means code reviews of answers that could be better
04:16amalloyin particular from regulars who i would expect to be recommending functional solutions
04:16TEttingerI was kinda thrown off by the initial figuring out the data
04:16TEttingerthis is what I started with: https://gist.github.com/ashnur/34e241049825d1e66ce5519c20c52689
04:17amalloyyeah, figuring out someone's crazy input format and how they intend it to be related ot their output is not easy
04:18TEttingerand that's the cleaned up version too... apparently the server-side code outputs even nastier results
04:24ashnuryeah, the Java backend guy just dumps json on me from Hibernate
04:24ashnurand this is some virtual tables stored in pgsql. tables stored in tables :D
04:25ashnurand thanks for the help TEttinger
04:26TEttingerI'd take a look at what amalloy had for an improvement that should both perform better and scale more cleanly to more complex data
04:26ashnuri will do that too, i am asking these questions because the way clojure handles data seems really down to earth and want to practice it
04:27ashnurneed to leanr it eventually :)
04:31alexelcu@tobyirc @dysfun @jjmalina Hello, I'm a Scala developer and I like Clojure as well and trying to learn more. There's lots to learn from Scala though, things that you won't learn from Clojure and the reverse is also true and neither of them is a dead-end. Scala follows idioms and design patterns that are more common in the very static languages from the ML family / Haskell / Idris, etc. For example Scala developers are very much into modeling of types and
04:36TEttingerah!
04:36TEttingerashnur:
04:36TEttinger,(mapv #(apply hash-map (reverse %)) (reduce (fn [coll [k v]] (update-in coll [k] conj v)) [] (for [{:strs [key values]} data, {:strs [order rec]} values] [(dec order) (rec key)])))
04:36clojurebot[{1 "c"} {5 "j"}]
04:37TEttingerthanks amalloy, for a firm slap back to functional programming :)
04:37amalloyhaha, you're welcome. sorry for not doing it as politely as i could
04:38TEttingernah I should be used to your superior technical skills seeming like superiority sometimes
04:39TEttingerI'm trying to remember if you work at a place I know of
04:40TEttingerfacebook, groupon, what is now IBM as clients, nice
04:41TEttingerheh, and gfredericks works at or with Groupon, I wonder if there's a connection there
05:24sobelamalloy: i'm so with you on trying to be able to answer every question. i was a regular helper on #postgresql for years and it did more for rounding out my knowledge than pretty much anything else i did
07:16gizmo385So in the application that I'm working with, I'm trying to update a global state value. I've tried both atoms and dynamic variables, but no matter what I do, I can't seem to get the value to update until after the entire execution thread terminates?
07:16gizmo385For example, if I run my functions in the REPL and check the values of the atom/global AFTER the function finishes in the REPL, then the value is what I expect
07:16gizmo385But If I try to check the value mid-execution, it never changes. What gives?
07:17gxx3is clojure as interactive as CL with slime?
07:17gizmo385Any ideas on how to properly structure this so that it updates the variables immediately after calling set!, swap!, or whatever function I need to call to update the var
07:22gizmo385I've also tried it with refs and that isn't working either?
07:27Kneivagizmo385: can you show some code?
07:28kwladykagizmo385 i wrote article in that topic a few days ago clojure.wladyka.eu - maybe it will help you.
07:30gizmo385Yeah, let me put it in in a pastebin
07:34ridcullygizmo385: i ask, because we had this yesterday and misery loves company: are you actually realizing the result when you modify your atom? if your manipulation happens in something lazy it might not happen until you print it in the repl e.g.
07:35gizmo385@Kneiva @kwladyka @ridcully Here is the code that describes the state with a use example on the bottom: http://pastebin.com/96HmXui1
07:36gizmo385If I actually call the function I have at the bottom of the paste in the REPL, the value on :failure comes out to false even if raise-error! gets called
07:36gizmo385But, if I check the value of the error (by calling error?) in the REPL after the described function /finishes/ then the value is true
07:36gizmo385So I would think that something is happening lazily, but I can't figure out what? And I can't find any documentation on how to force the state change
07:37gizmo385@Kneiva @kwladyka @ridcully Here is the paste again incase all the disconnections threw it out of the screen: http://pastebin.com/96HmXui1
07:44kwladykagizmo385 i don't have too much time now but try :failure @error-occured?
07:46kwladykaeventually you don't call raise-error! before that
07:46gizmo385@kwladyka Just retried it, no dice
07:46kwladykajust use println in this function to see when it is run
07:46gizmo385But in a let, the forms bind in order. Could it not be evaluating the call to (parse ...) until I at it in the map?
07:47gizmo385Because I know that raise-error! is getting called at some point since the print statement in raise-error! runs
07:47gizmo385I tried the @error-occured to no avail :/
07:50gizmo385Got it. The function call isn't getting run. If I print the parse-result and then check the value, it runs
07:50gizmo385err it gets the right value
07:52gizmo385I feel like there should be a macro or function that I can use that forces non-laziness?
07:53MJB47(doc doall)
07:53clojurebot"([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through the successive nexts of the seq, retains the head and returns it, thus causing the entire seq to reside in memory at one time."
07:58gizmo385@MJB47 That certainly help :)
07:58gizmo385Thanks a bunch everyone :D
08:44mpenetgxx3: yes, cider is an equivalent of slime for clojure
08:46mpenetgxx3: clojure-mode actually used slime internally in the past, until it was replaced by something more customizable/upgradable for clojure. So you'll find a ton of keybinding/features inherited from slime for instance
09:45asdf12z_do a lot of people use speclj ? bdd test framework or the built in for clojure ?
09:45asdf12z_can't seem to mark a test pending in clojure.test
10:28Guest35203Anyone have any recommendations on schedulers? I'm looking at using Chime or Quartzite
10:54seangroveHey all, struggling with an error, "java.lang.IllegalArgumentException: Cannot open <nil> as a Reader., compiling"
11:38justin_smithGuest32455: I've had good luck with just using the ScheduledThreadPoolExecutor which comes with the jvm https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html
11:39Russell-Oh yes, there is. http://stackoverflow.com/questions/10957257/clojure-debugging-println-line-number-and-file-name
11:41justin_smithasdf12z_: I am pretty sure clojure.test has no concept of "pending", in fact I have no idea what a "pending test" would be
11:42Glenjamina test title with either no implementation, or one that's known to not be working
11:43Glenjaminoften a TODO as a testcase, that doesn't fail the build
11:54gigasquidhttps://gist.github.com/Medeah/2bc6e92b86ae7e8abc14
11:55justin_smith(inc gigasquid)
11:55justin_smithnice
12:12russellwI'm confused about the macro in the accepted answer in http://stackoverflow.com/questions/10957257/clojure-debugging-println-line-number-and-file-name - in particular about printing the name versus value of the argument
12:12russellw~(pr-str x) prints the name of the argument but ~x prints the value. How can that be?
12:12clojurebotExcuse me?
12:12russellwI would have expected either both to print the name or both to print the value
12:16justin_smithrussellw: I bet macroexpand would help
12:18justin_smith,(defmacro thing-and-string [x] `(list ~(pr-str x) ~x))
12:18clojurebot#'sandbox/thing-and-string
12:19justin_smith,(macroexpand-1 '(thing-and-string +))
12:19clojurebot(clojure.core/list "+" +)
12:19justin_smithrussellw: at the time of expansion, + is just a symbol, so emitting the string emits the string of that symbol. The value emitted by the macro is then evaluated when it is run.
12:21russellwjustin_smith, oh! That makes sense, thanks
12:22justin_smithrussellw: a big a-ha moment for me about macros is that you could just return a list of symbols, and that would be the code that gets compiled
12:22justin_smith,(defmacro demo [] (list 'println "hello" "world"))
12:22clojurebot#'sandbox/demo
12:22justin_smith,(demo)
12:22clojurebothello world\n
12:23justin_smithwhen we use helpful things like ` we can forget that is all they are doing sometimes
12:23russellwYeah, I guess with practice you get used to keeping the two levels of indirection straight
12:26Glenjamin,(defmacro lemme-see [x] (list 'list (name x) x))) ; attempt to get the same effect without `
12:26clojurebot#'sandbox/lemme-see
12:26Glenjamin,(macroexpand '(lemme-see +))
12:26clojurebot(list "+" +)
12:27justin_smithGlenjamin: nice
12:28justin_smith,(defmacro another-thing [x] (list 'list (name x) (type x) x)))
12:28clojurebot#'sandbox/another-thing
12:28justin_smith,(another-thing +)
12:28clojurebot("+" clojure.lang.Symbol #object[clojure.core$_PLUS_ 0x2ae38b7a "clojure.core$_PLUS_@2ae38b7a"])
12:30Glenjamin,(lemme-see +)
12:30clojurebot#error {\n :cause "Unable to resolve symbol: lemme-see in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: lemme-see in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: lemme...
12:30Glenjamin,(defmacro lemme-see [x] (list 'list (name x) x)))
12:30clojurebot#'sandbox/lemme-see
12:30Glenjamin,(lemme-see +)
12:30clojurebot("+" #object[clojure.core$_PLUS_ 0x6295c0bb "clojure.core$_PLUS_@6295c0bb"])
12:31Glenjaminah, earlier i got a read-eval error, but i think that was because of a `~x
12:31Glenjamin,`~x
12:31clojurebot#error {\n :cause "Unable to resolve symbol: x in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: x in this context"\n ...
12:54WorldsEndlessI need to do some XML templating. Anyone done this? Recommendations for libraries or approaches?
12:55justin_smithWorldsEndless: hiccup works decently for xml templating (though it doesn't specifically target it, it generates it OK if you use the tags right)
12:55justin_smithif you want to programmatically modify the structure clojure.data.xml is nicer though
12:56WorldsEndlessOkay; clojure.data.xml was what I was looking at
12:56WorldsEndlessI don't need to modify the structure but just fill in data values
12:57justin_smithyeah, I would use hiccup for that personally
13:01WorldsEndlessWhat woudl you read the template with? Hickory?
13:02justin_smithWorldsEndless: typically with hiccup the template is inside some templating function, not in a dedicated templating file
13:03justin_smithWorldsEndless: I have not tried hickory
13:03gmcrammWorldsEndless: Do you already have an xml template that you're trying to modify, or are you creating new ones?
13:03WorldsEndlessI have an XML template used for Apache FOP
13:03WorldsEndlessI need to fill in values
13:04justin_smithoh, that's different, I misunderstood
13:04gmcrammAh. IMO hickory might be a better bet then
13:04gmcrammYou could also look at enlive
13:04WorldsEndlessI like enlive, but hadn't thought of using it on xml
13:06gmcrammIt should work just fine with xml. At least, I don't see why it wouldn't.
13:17WorldsEndlessOh. Enlive actually has an xml-resource function. Nice!
14:34sdegutisAre there any other "escape-html" functions besides in Hiccup?
14:44sdegutisIs there a function in clojure.core like this? (fn [f x] (if (f x) x))
14:44sdegutissome-> comes to mind but it's not quite right since it returns (f x) if it's non-nil, rather than x itself
14:47sdegutisGood afternoon.
14:59amalloysdegutis: incredibly that function exists, not in clojure itself, but rather in every clojure library ever written
15:05sdegutisamalloy: yeah that's what I thought
15:05sdegutisamalloy: what do you call it?
15:18tolstoyWhen?
15:33sobelthat's coalesce
15:33sobelpopular sql function
16:46ben_vulpeshow do i use (.. class method method get-first-thinger) in interopland?
16:47ben_vulpesi want to call .get(0) basically
16:50Glenjaminben_vulpes: most use of .. can be replaced with ->> which imo is a bit clearer (as it's more common)
16:51amalloynot ->>, but ->
16:51amalloyand *all* uses
16:51Glenjaminack, yes
16:51cortexmantf
16:51Glenjamin,(-> (ArrayList. [(ArrayList. [1])] (.get 0) (.get 0))
16:52Glenjamindamn, missed a paren
16:52cortexmananyone else us a cider clojurescript repl?
16:52Glenjamin,(-> (ArrayList. [(ArrayList. [1])]) (.get 0) (.get 0))
16:52amalloyGlenjamin: or just (-> [[1]] (.get 0) (.get 0))
16:52cortexmani've noticed that when there are a lot of keyed reagent objects on the page it just times out a lot
16:52Glenjaminoh right, i forget vectors have methods
16:53Glenjaminalso, clojurebot appears to be absent :(
16:55amalloyGlenjamin: importantly, they implement List
16:55amalloywhich is why (ArrayList. [1]) also works
16:55Glenjaminyeah, i was thinking in java mode
16:56Glenjaminpresumably (nth (ArrayList. [1]) 0) also works
16:56amalloyyes
16:58Glenjaminoh, huh - nth also works on regex match objects
16:59alexei___For "public BoxUser.Info getInfo(String... fields)" is there anything special about calling this kind of methods? (.getInfo box-user) says "No matching field found"
17:00ben_vulpesthanks Glenjamin, amalloy
17:00ridcullyiirc you need to pass an empty String[]
17:01ridcullyit's ok to call getInfo() in java, but not in clojure
17:01Glenjaminhrm, i thought it was documented on the java iterop page, but yeah - Type... is actually sugar for an array parameter
17:02alexei___Ok, thanks: ^BoxUser$Info user-info (.getInfo (BoxUser/getCurrentUser api) (into-array String []))
17:02alexei___seems to work
17:06edaqHey thought I would mention a new site
17:06edaqneuro-linguistic-programming.angelfire.com
17:06edaqit is an interesting topic
17:18russellwI noticed that when I run a CPU intensive clojure program, even when I haven't done anything to multithread it, Windows task manager says it's using two, three or even four CPU threads - a pleasant surprise! Is this because the garbage collector is running in separate threads?
17:25arkhrussellw: depends on your code but garbage collection, future, send and send-off for agents, core async, etc. use their own threads or thread pools
17:25russellwRight, I wasn't even using any of the other things, though I was doing a lot of memory allocation
17:26Glenjaminwhen I did something similar, I found that GC was using the other cores
17:26russellwThis is good, it means you can get at least some benefit from multiple CPU cores without having done any multithreading in your code
17:26{blake}OK, given a list where some of the keys are case-insensitive duplicates, provide a consisten way to turn those keys into case-insensitive uniques. Like '(:abra :cadabra :Abra :ABRA) could become '(:abra :cadabra :Abra1 :ABRA4).
17:26Glenjaminyou might want to look into reducers/fold if you do want to parallelise the computation itself
17:27{blake}(I'm counting upper-case letters to give the unique number after the keyword. In case the list isn't always in the same order.)
17:27russellwGlenjamin, thanks, I'll keep that in mind
17:27{blake}(And the list is created from keys in a map.)
17:28Glenjamin{blake}: some sort of loop where you keep a counter and a set of lowercased keys-so-far
17:29{blake}Glenjamin: Yeah, that's what I started with. But it's getting uglier than I like. I was thinking of building a map like {:Abra :Abra1, :ABRA :ABRA4...}
17:29Glenjaminwhat is the real goal, this sounds like a bit of a weird thing to want to do
17:30{blake}Converting Mongo to SQL. Everything was going so well, until I discovered I had a map with keys like "401k" and "401K". :/
17:30Glenjaminand SQL is case sensitive?
17:30Glenjaminerm, insensitive
17:31{blake}Glenjamin: Yes. INsensitive.
17:31russellw{blake}, I think the job will become easier if you drop the requirement to preserve case
17:32{blake}russellw: There isn't really a requirement to preserve case.
17:32russellw{blake}, good, then a map like the one you have in mind, converting the keys to lowercase first, should do the job
17:33kenrestivoif i were to while but needed the results of the test, i.e. to log it, what should i use?
17:33Glenjaminwhy does a single entity have keys for 401k and 401K ?
17:34kenrestivoi.e. (let-while [foo (some-test)] (log foo))
17:34russellwConverting the keys to lowercase after lookup, that is. And I suppose any time a system allows a degree of freedom, bad data will creep in
17:34russellwThough it might be worth investigating whether those keys should actually be considered distinct
17:34{blake}Yeah, this is a...well, this mongo database has been through a lot.
17:34{blake}Some of the results are serialized with nippy. And some are not.
17:35{blake}The date formats change throughout.
17:36kenrestivoah (while (when-let [d (some-test)] (log d) true)) seems to work
17:36{blake}By which I mean, sometimes they're dates, sometimes they're strings.
17:37ridcullyphilosophical
17:48will_smCreated a webapp using figwheel for some school thing
17:48will_smMy server should be able to handle 200+ people refreshing every 10 seconds right?
17:48will_sm3kb of data each time
17:50russellwwill_sm, that's not a terribly heavy load so I would think it shouldn't be a problem. (Caveat, I've never heard of figwheel before)
17:50ridcullywill_sm: you are running figwheel as your primary server? are you asking because you see some problem?
17:51will_smrussellw, figwheel is used to get automatic reloading of clojurescript code. The server jetty I think
17:51russellwI'm assuming you're asking because it's not actually keeping up with the load
17:51will_smno problem, I have things working on my end, and I've never done anything that is not tiny scale
17:51russellwOh, well that's good then
17:52will_smso clojure is easy to scale in general right?
17:52russellwI'm not yet in a position to say for definite, but thus far my impressions of it are good
17:53russellwThe JVM is the world's best heavy duty runtime, and clojure seems to make good use of it
17:53russellwJust don't use instaparse for non-tiny files :)
17:53ridcullyfigwheel is a productivity drug
17:54Glenjamindid you get a parser working russellw ?
17:54russellwGlenjamin, the author got back to me, said it was really only intended for files on the tens of kilobytes scale, so I'll probably just write the parsers by hand
17:55will_smfigwheel + reagent has been a great experience
17:55will_smmaking a ring handler, not so much, but as expected from being an web noob
17:56Glenjamindid you look at https://github.com/ericnormand/squarepeg at all?
17:57russellwno, trying one parser generator was fun, trying two in succession would be not so much fun to my way of thinking. It's not like writing recursive descent parsers by hand is all that difficult after all :)
17:58Glenjaminmy favourite approach is to have the state parameter be the function
17:58russellwHow do you mean?
18:00Glenjaminhere's a JS example: https://github.com/creationix/mine/blob/master/mine.js#L130
18:01russellwah! That is elegant
18:02russellwI usually just interface the tokeniser and parser by having a global/module scope variable for the current token. in clojure, that would be done with the tokeniser executing (def tok ...) to set the current token, right?
18:03Glenjamini'd write it as a loop recur I think
18:03Glenjaminor maybe closure over an atom, wouldn't use a global
18:04russellwAlso iirc the Java standard library has a line number reader that keeps track of the current line number in the input for you, which I can use
18:04russellwNot that keeping track of the current line number is difficult, but it's one of those chores that it's all the nicer to have done for you
18:04{blake}Got an old clojure web app, which hasn't been deployed in a while. When I try to run it via "java -jar", I get "Could not find or load main class myapp.handler.main." Which, yeah, it's not called "main" so I can see why it wouldn't be found. What I don't know is why it's looking for it "all of a sudden".
18:05russellw{blake}, maybe it was previously run with some script or something that pointed it at the right thing?
18:06{blake}russellw: So, I could pass it a parameter to point to the right thing, maybe?
18:06russellw{blake}, I would think so
18:06amalloy,clojure.lang.LineNumberingPushbackReader
18:07amalloywell, rip clojurebot. that exists, anyway
18:08russellwamalloy, ah, sweet, thanks!
18:09cortexmancan you capture the output of pprint in a variable? it accepts a writer option
18:09cortexmanoh, with-out-str looks promising :)
19:02KingmobAnybody have time for a namespace/file/loading question? Does anyone know of a way to force loading of files? I have multimethods whose definitions are in multiple files, but nothing directly "require"s them, so the files aren't being loaded, it seems.
19:04amalloyyou force files to be loaded by requiring them
19:04amalloythere is no "i need this file to be loaded but i don't want to load it explicitly" mechanism
19:05KingmobI'd originally assumed all files added to a project/jar were loaded, not lazy-loaded.
19:06Kingmob..and was hoping that defining a defmethod in other files would get picked up, since nothing *other* than the defmethod is necessary elsewhere
19:07KingmobIs there a good way to say "require every file in this directory/namepsace"?
19:08amalloyno
19:09{blake},(def r {:abra 1 :cadabra 2 :Abra 3 :ABRA 4})
19:10Kingmobok, thx
20:30sdegutisOh man. Guys.
20:30sdegutisjustin_smith: ping
21:32asdf12z_whenever i write a let binding, often times i want to say... (let [term (if encode (url-encode term) term)] is there an easier way to say that? like update term if x is true only? instead of a if else
21:43justin_smithsdegutis keeps logging off, I just got my room at the hotel where clojure/west is happening
21:46iovechildrenmy gf doesnt know but i fuck her 2 autistic 16 year old girls is that bad ?
21:47iovechildrenputting my dick inside them is so fun
21:47iovechildreni hope we dont break up
21:49slideonmyp_enisi like to fuck my gfs autistic kids when she isnt around
21:50slideonmyp_enismy dick gets so hard
21:51slideonmyp_enisautistic kids are so dumb
21:51slideonmyp_enisstupid fuckers
21:51slideonmyp_enisi like taking them to victorias secret
21:51slideonmyp_enisand pimping them out
21:51slideonmyp_enisthen fucking them
21:52slideonmyp_enisgod i am so horny
21:52slideonmyp_enisi am going to see her tonight
21:52slideonmyp_enisgoing to buy her tickets to a play lolol
21:52slideonmyp_enisthen when shes gone im gonna fuck them !
21:53slideonmyp_enisdoes any1 here talk
21:53slideonmyp_enis?
21:53slideonmyp_eniswhy doesnt any1 here talk
21:53slideonmyp_enisdick in jailbait
21:53slideonmyp_enisdick `n`jailbait
21:53slideonmyp_enislol
21:54slideonmyp_enisits not abuse if it is consent !
21:54slideonmyp_enisthey think it is part of sex education
21:54slideonmyp_enisi teach them everything
21:54slideonmyp_enisughh
21:54slideonmyp_enis30 more minutes
21:54slideonmyp_enisuntil she goes away h
21:55slideonmyp_enisslide my dick into little children,
21:55slideonmyp_enishere them moan,
21:55slideonmyp_enisbeg for me to stop,
21:55slideonmyp_enisbut i dont
21:55slideonmyp_enisdaddys gonna fuck u up
21:55slideonmyp_enislike the little slut
21:55slideonmyp_enisu are
21:56slideonmyp_enisshes on my lap now
21:56slideonmyp_enismy dick is so hard
21:57slideonmyp_enis*strokes daughters hair *
22:00slideonmyp_enis*hits daughter i face **
22:00slideonmyp_enisyoga pants on children are so hot
22:01slideonmyp_enisslide my dick into little children,
22:01slideonmyp_enisslide my dick into little children,
22:01slideonmyp_enisslide my dick into little children,
22:01slideonmyp_enisslide my dick into little children,
22:01slideonmyp_enisslide my dick into little children,
22:01slideonmyp_enisslide my dick into little children,
22:01slideonmyp_enisslide my dick into little children,
22:02demophoonamalloy_: ^
22:36@amalloydemophoon: there's not much i can do with a webchat user who doesn't mind closing the tab and logging back in with a new username. i banned that guy once, and he was back 30 seconds later. the only thing you can really do is ignore them
22:41slideonmyp_enisahhh
22:41slideonmyp_enisthat was a refreshing fuck
22:41slideonmyp_eniswould u guys be interested in recordings on skype?
22:42slideonmyp_enisi can upload them to TOR