#clojure log - Sep 26 2013

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:45 chord: starcraft clone please

0:45 i'm becoming desperate

0:45 i'm willing to dump my girlfriend and spend all my time on the game if you help me

1:07 logic_prog: my goal is to visualize some XML data in HTML/CSS. Is there a nice way to auto transform clojure.data.xml nodes into hiccup structs?

1:08 In fact, want every XML node mapped to a HTML Div, somehow preserving the names, then using CSS markup, I wnat to describe how the XML should bedisplayed.

1:09 brehaut: logic_prog: enlive uses the same structure as clojure.data.xml, and i believe (though not 100% sure) that tinsel can also use it

1:09 TimMc: logic_prog: What you want is probably in clojure.walk

1:10 noprompt: clojure.xml + clojure.walk?

1:10 brehaut: TimMc: of course, good point

1:10 logic_prog: so basically: don't use hiccup? :-(

1:10 I found hiccup/garden more intuitive than enlive

1:10 callen: logic_prog: don't use Hiccup, use Selmer! https://github.com/yogthos/Selmer/

1:11 logic_prog: it's better to use stuff like SCSS if you really need to generate your CSS :)

1:11 (sorry nopro :( )

1:11 Apage43: he's not templating

1:11 logic_prog: no hiccup, no garden

1:11 Apage43: he's generating html from scratch

1:11 logic_prog: next up you're going to tell me not to use vim

1:11 I'm generating HTML from scratch.

1:11 callen: logic_prog: oh, if you're not templating for a web app, then disregard me. Sorry :)

1:11 sm0ke: hello, i have downloaded a example project which uses multiple namespaces each with a main func defined..can i run a specific ns main function from lein ? i mean in java i could have given a classname ..how does clojure translates ns to class?

1:11 callen: logic_prog: I recommend Selmer for web apps/templating :)

1:12 brehaut: logic_prog: enlive is mostly confounded by the damn deftemplate stuff. snippets plus emit* is much similer to grok

1:13 logic_prog: walk function Usage: (walk inner outer form) Traverses form, an arbitrary data structure. inner and outer are functions. Applies inner to each element of form, building up a data structure of the same type, then applies outer to the result. Recognizes all Clojure data structures except sorted-map-by. Consumes seqs as with doall.

1:13 <-- that is what I want, correct?

1:13 callen: I use clojure.walk/walk all the time. I do not think doing so is a good idea.

1:13 Apage43: postwalk (or prewalk) are a bit more pre-baked

1:13 noprompt: java.lang.IllegalArgumentException: No method in multimethod 'emit-constant' for dispatch value: class clojure.lang.Var

1:13

1:14 Apage43: but there is what callen said

1:14 noprompt: i fucking hate that error.

1:14 callen: also walk doesn't behave exactly the way you expect. Making it fully recursive in the ways you want is initially non-intuitive.

1:14 and not tail-recursive, if memory serves.

1:14 noprompt: there's also clojure.zip/xml-zip

1:14 callen: logic_prog: what's the use-case again?

1:15 logic_prog: I have an xml file. I want to display it in HTML/CSS.

1:15 brehaut: callen: he wants a functor of <node> … </node> to <div class="node">…</div>

1:15 Apage43: tree transform!

1:15 logic_prog: I want to transform each XML node into a HTML node, where XML node of <blah> becomes HTML <div class=:blah">

1:15 callen: logic_prog: that's clojure.walk/walk

1:15 logic_prog: okay, thanks :-)

1:15 noprompt: form of tree!

1:15 callen: logic_prog: I can show you example code adapted from work-code if you're patient and let me sanitize it.

1:16 I've been doing a lot of recursive tree processing lately.

1:16 logic_prog: I am patient.

1:16 I will in paralle, try to work it out myself.

1:16 noprompt: there's a good joke in there. i promise.

1:16 callen: logic_prog: clojure.walk won't be tail recursive though.

1:16 logic_prog: it's fine,

1:16 these files are < 100 KB

1:16 callen: logic_prog: you may be best served by reduce and a clever use of context and the reducer fn or a loop/recur form.

1:16 Apage43: I have a *terrible* docbook XML -> markdown converter that I wrote for work =P

1:16 brehaut: logic_prog: its not length its depth that matters

1:16 callen: ^^ what brehaut said.

1:16 logic_prog: hmm

1:17 they're at most 5 layers deep

1:17 callen: you can increase the stack alloc for your JVM, but it's still dodgy.

1:17 oh, then you can cheat.

1:17 parse the XML into nested vectors and blast that bitch.

1:17 tree-seq/zip/walk...whatever.

1:17 I had to handle arbitrarily deep embedded documents. it was ugly and cancer-inducing.

1:18 noprompt: "blast that bitch" <-- wow

1:18 callen: 5 layers deep? you can't possibly mess that up.

1:18 I just got done writing a recursive processor for embedded documents that has the word "reduce" in it 6 times across 7 functions.

1:18 horrific.

1:19 logic_prog: you get lost with clojure.walk/walk - ping me. I can help you out. I've got to gather my stuff and go home now. :)

1:19 * noprompt switches playlist from "Psych System" to "Smile System"

1:19 logic_prog: callen: sure, though http://clojuredocs.org/clojure_core/clojure.walk/walk looks simple

1:19 it's almost like map-reduce

1:19 the first function is called on each node, then the latter to combine them

1:20 noprompt: ♫ Bom Bom ♫ Bom Bom ♫ Bom Bom Bom ♫

1:20 callen: logic_prog: well. it's fully recursive and simple if your problem can be baked down to homoiconic nested seqs/vectors.

1:20 logic_prog: my problem wasn't that nice. you may be luckier :)

1:20 logic_prog: yeah, I can all decisions can be made "locally"

1:21 callen: logic_prog: then god speed. I had to traverse my recursive documents two generations at a time. Sucked.

1:22 brehaut: (apropos nothing https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills is an amazing resource)

1:23 callen: brehaut: that's pretty sweet. Thank you :)

1:24 brehaut: callen: sadly does not include a mouseleave shim :/

1:25 callen: brehaut: write one :)

1:25 brehaut: callen: yeah basically

1:26 sm0ke: ok weird..i am doing a lein compile..and i dont see .class files inside target folder

1:26 brehaut: callen: mucking about with dom mouse events is however at the bottom of my list of 'fun to do' things

1:26 logic_prog: how do I convert all clojure.data.xml.Element into maps ?

1:26 brehaut: logic_prog: its presumably a record already right?

1:27 logic_prog: yes

1:27 but it's bitching ab me about:

1:27 #clojure.data.xml.Element{:tag :call, :attrs {:val interp}, :content (Require Import ZArith List String.)} UnsupportedOperationException Can't create empty: clojure.data.xml.Element clojure.data.xml.Element (xml.clj:43)

1:27 noprompt: take a look at some of dnolen's blurgh posts.

1:27 Apage43: OH yeah

1:27 logic_prog: the first line is when I try to print it out (it's an clojure.data.xml.Element)

1:27 Apage43: that was why I didn't use clojure.data.xml

1:27 because clojure.walk doesn't work on it

1:28 logic_prog: the second line is when I call (cloure.wak/walk identity identity data) -- which should just return itself

1:28 Apage43: clojure.walk only understands list/vector/set/map

1:28 noprompt: he's got some really nice examples of how to handle dom events with core.async. it's quite elegant.

1:28 Apage43: not records

1:28 and data.xml uses records

1:28 logic_prog: okay, so I should use clojure.xml/parse ?

1:28 brehaut: logic_prog: (into {} element) would trivially (but stupidly perhaps) convert them

1:28 oh for functors

1:29 Apage43: clojure.walk should work fine on what you get out of clojure.xml/parse, but yeah, you could also just do what brehaut said on the (outer) function, I believe

1:29 maybe

1:30 I wound up making it work for another project I had since I *needed* the parsing to be lazy (I was working on multi-gigabyte XML files)

1:30 noprompt: fwiw goog.events/listen handles all the horse shit around browser inconsistency with mouse clicks.

1:31 logic_prog: sing xml.parse

1:31 worked fine

1:31 brehaut: noprompt: basically every large javascript library has some wrapper for that nonsense. if you are writing javascript without some big ass library, you occasionally still want that stuff

1:31 logic_prog: will try brehaut's technique when I'm forced to use data.xml :-)

1:31 brehaut: i wouldnt call it a technique per se ;)

1:32 more of a hack

1:32 noprompt: brehaut: yeah, i was just bringing it up cause i don't think everyone knows about it.

1:33 brehaut: there's a lot of good stuff in goog.*. why people would want jQuery in the face of that kind of baffles me.

1:33 but hey, not my problem.

1:34 Apage43: dang

1:34 I didn't do any really tree-y stuff for that problem, just found the code

1:34 noprompt: ugh, why am i having problems with these macros in cljs? :-(

1:34 Apage43: it was just USPTO data

1:34 brehaut: noprompt: well, some of my projects the javascript requirements are so low that i dont want _any_ big arse library, jquery, goog or otherwise

1:36 noprompt: brehaut: oh definitely. i'm surprised how many JS developers i've met who've drank the "don't do js with jQuery" koolaid.

1:37 the dom api's suck, sure. but you can get a long way with "The Definitive Guide" as a reference and a few wrapper fns.

1:37 btw, the book is a godsend.

1:37 brehaut: i dont think i understand your koolaid comment

1:37 "don't do js with jQuery" do you mean dont do js without jquery?

1:37 noprompt: just learned the other day that Function.bind() can be used to do function currying in js.

1:38 brehaut: oh, yeah, that's what i meant. :P

1:38 brehaut: phew :)

1:38 i thnk i knew that about bind, but i also recall it being relatively new

1:39 noprompt: brehaut: right, if you wanna implement currying for ES3 you have to roll up your sleeves.

1:39 brehaut: noprompt: sorry i meant that the versions of bind that existed prior to ES6 introducing it didnt support partial application

1:39 eg the prototype.js one that came about first

1:40 noprompt: brehaut: right.

1:41 brehaut: hmm, i mght be full of crap looking at hte docs, or alternatively the prototype implementation has followed the spec

1:41 noprompt: omg, i think i'm going to jump off a mountain with these macros. ; _ ;

1:41 robink: I have a data structure (String, in this case) that's composed of n*m elements. How can I break it up into a list/vector of m number of elements of n size? There is no delimiter, I simply need to break every n elements. I don't care (or necessarily know) what m is, but know that both n and m are factors of the (count) of the structure.

1:41 noprompt: brehaut: eh, it's really not that important. :P

1:41 brehaut: probably not

1:42 ,(partition-all 3 (range 10))

1:42 logic_prog: does clojure have a ismap / isvector function?

1:42 clojurebot: ((0 1 2) (3 4 5) (6 7 8) (9))

1:42 logic_prog: (for my walker, I need to dispatch on type)

1:42 Apage43: robink: partition

1:42 brehaut: logic_prog: map? vector?

1:42 robink: Apage43: Thanks

1:42 Apage43: robink: careful though

1:42 robink: Apage43: How so?

1:42 Apage43: if you don't have a number of elements that chunk evenly, partition won't return the last chunk

1:42 logic_prog: brehaut: I like. Thanks!

1:43 Apage43: if you want the last chunk even if it isn't a whole chunk-size, use partition-alll

1:43 *all

1:43 robink: Apage43: Gotcha. Was wondering what would happen if you passed partition a number that wasn't a factor of (count mypileofstuff)

1:43 brehaut: logic_prog: you can always define your own by partially applying instance? with the interface or type too

1:43 noprompt: ,(map #(apply str) (partition-all 3 "foobarbazquux"))

1:43 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval57$fn>

1:43 Apage43: ,(parition 3 (range 10))

1:43 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: parition in this context, compiling:(NO_SOURCE_PATH:0:0)>

1:43 Apage43: I can't spell

1:43 noprompt: ,(map #(apply str %) (partition-all 3 "foobarbazquux"))

1:43 clojurebot: ("foo" "bar" "baz" "quu" "x")

1:43 robink: ooo

1:43 I like that.

1:44 Apage43: but partition leaves the last chunk off, parition-all doesn't

1:45 robink: Apage43: I will risk it with partition knowing that I have to pick a number whose modulo of the count of the collection is 0.

1:53 noprompt: i'm so confused. i have two macros in a clj file. i can require and use one of them with :require-macros but the other one blows up in my face and complains.

1:54 callen: noprompt: why are you using require-macros in Clojure?

1:55 noprompt: callen: it's cljs.

1:55 i'm having the problem in cljs.

1:56 callen: okay, I'm less confused now than I was before.

1:57 noprompt: You go to the doctor. You raise your arm in a funny way, you tell the doctor, "moving my arm like this hurts"

1:57 noprompt: what does the doctor say?

1:57 "Don't move your arm like that"

1:57 noprompt: lol

1:59 callen: man a little bit emacs goes a long way. i'm loving that little multi-shell hack.

2:00 callen: noprompt: http://i.imgur.com/b22KlwL.png

2:00 noprompt: lol

2:01 callen: where is that happening?

2:01 callen: noprompt: Prismatic offices. SF?

2:01 noprompt: callen: is that this week?

2:02 callen: noprompt: https://github.com/bitemyapp/dotfiles/blob/master/.emacs.d/clojure/clojure-config.el

2:02 my clojure/emacs magic ^^

2:02 noprompt: Oct 2

2:03 SHHHHHH SEKRIT

2:03 Apage43: I should go to that

2:03 noprompt: yeah me too.

2:03 callen: Apage43: yes, then you can meet me.

2:03 yisssss

2:03 noprompt: i think i can get my lazy ass out of Fresno.

2:03 Apage43: I usually can't be arsed to actually go to SF

2:03 * callen victory pumps

2:03 noprompt: plus it'll give me a reason to go to the house of prime rib.

2:04 that place is sooooooooooooooo legit.

2:04 callen: I actually only shared the link for lulz value, but this is is even better.

2:04 noprompt: I have a better place if you want.

2:04 well, not for rib. For steak.

2:04 noprompt: oh wait. ah, fuck it's on tuesday.

2:04 callen: have you been to HOPR?

2:04 callen: noprompt: Eds.

2:04 noprompt: Weds.

2:05 noprompt: callen: please tell me the plates are ~$50

2:05 oh, wait, yay!

2:05 the food at hopr is like an acid trip so good.

2:06 callen: noprompt: I haven't been to HOPR. I just suspect I know of a place that has superior steak.

2:06 noprompt: callen: i suppose i could be convinced to steak instead.

2:08 callen: nice stuff in that emacs file. think i'll pilfer some of it.

2:08 Apage43: calendared.

2:09 noprompt: that dom selection stuff in dommy definitely should be pulled out in to it's own lib.

2:10 maybe i just have javascript fever.

2:11 A FUNCTION IS LIBRARY.

2:11 *IS A.

2:11 lol @ "javascript fever"

2:12 Apage43: I think the every ten lines of code should be made into a separate library thing is more of a node-ism than a js-ism

2:12 brehaut: ive got a fever and the only cure is more dependancies

2:13 noprompt: "dependency fever"

2:15 Apage43: that's also fun when you combine it with the marekting tendency to call any project with a name a "technology"

2:17 noprompt: Apage43: it makes everything else feel so "primative"

2:18 gws: build 5 node.js function-libraries, and you're a Solutions Architect

2:19 noprompt: gws: that reminds me of visual studio. it's not a project; it's a solution.

2:19 can you imagine add this dependency to your "solution.clj" file.

2:20 Apage43: IIRC "solutions" were a workspace and could contain several "projects"

2:22 (and your projects could actually belong to multiple solutions.)

2:22 callen: noprompt: the trace stuff is hella useful.

2:24 chord: callen are you still alive?

2:25 callen: chord: ssshhhh

2:25 chord: callen: I got to chapter 14 of learn you a haskell

2:25 almost DONE

2:25 WHERE IS YOUR CLOJURE BOOK

2:26 callen do your parents know you procrastinate and slack off on making the clojure book?

2:26 noprompt: chord probably wears a helmut when he programs.

2:26 with all that type safety and all.

2:26 callen: chord: I am preparing to crush my opponents in Clojure Cup SIR

2:27 gws: http://www.mask-shop.com/images/helmut_kohl_promi_latex_maske__helmut_kohl_latex_mask.jpg

2:27 noprompt: he's probably got plastic on his funiture and foam around the corners of his coffee table.

2:27 chord: callen: you know those competitions are rigged to give the dumbest shit ideas first place

2:27 gws: chord: just like real life

2:27 chord: noprompt: you mad that you couldn't read the entire haskell book?

2:28 brehaut: noprompt: perhaps thats enough ad hominem for one day?

2:28 chord: gws: thats why you gotta do stuff outside of the competition such as starcraft clojure

2:28 noprompt: chord: not really. it's not like, you know, something worth getting upset about.

2:28 brehaut: yeah probably. i actually don't have problem w/ haskell, ml, etc.

2:29 robink: http://blogs.sfweekly.com/thesnitch/2013/09/sf_techie_explains_why_the_wor.php

2:29 brehaut: noprompt: i dont think many people here do.

2:29 noprompt: brehaut: i'm just messing with him.

2:29 robink: SFW, no swears, but gobs of snark

2:29 Your boss may complain that it's "politically incorrect" or "not aligned with our business principles"

2:30 noprompt: brehaut: i've actually been doing a bunch of SML for a college class i'm taking.

2:30 brehaut: nice!

2:30 noprompt: i keep meaning to spelunke into F# some more, but i dont have the time

2:30 chord: so now that we've got all of callen, noprompt, gws, brehaut, robink looking at the chat, now we can all start on starcraft clojure

2:31 noprompt: brehaut: tends to be much easier when you have a grade-gun pointed at your head.

2:31 s4muel: robink: Why? Because 2.0

2:31 chord: with 6 people total starcraft clojure cant fail

2:31 robink: s4muel: Yep

2:31 chord: Yes

2:31 brehaut: noprompt: aha yeah

2:31 robink: chord: Is that StarCraft written in Clojure?

2:31 brehaut: noprompt: ive written a couple of small services in F# at my old job. it was a very pleasant environment.

2:31 chord: robink: what else would it be

2:31 robink: chord: Or a StarCraft server written in Clojure?

2:31 noprompt: brehaut: i just found out that i've been loosing points for not showing up to the labs. i've just been doing them from home and submitting them. kind of lame.

2:32 brehaut: noprompt: :/ thats a bit lame

2:32 robink: chord: It could be a StarCraft mod written in Clojure, a StarCraft multiplayer server written in Clojure, a StarCraft server browser written in Clojure...

2:32 noprompt: brehaut: it really doesn't make much sense to me.

2:32 brehaut: me neither

2:32 gws: starcraft AI written in clojure...

2:32 chord: noprompt: you gotta go up to the professor and talk to him, you can't let him bitch slap you because you're afraid to talk back

2:32 robink: starcraft CLONE written in clojure

2:33 robink: chrisrossi: Network protocol compatibility?

2:33 *chord: Network protocol compatibility?

2:33 noprompt: brehaut: SML is fun though. it's fun shifting gears and working in a statically typed language.

2:33 callen: brehaut: F# is for corporate fascists.

2:33 chord: robink: no a new game

2:33 robink: chord: Oh, that'd be easier

2:33 brehaut: noprompt: agreed. im quite fond of the ML family in general.

2:33 robink: chord: Written in Clojure, Clojure-CLR or ClojureScript?

2:33 callen: be cool like technomancy and use OCaml.

2:33 brehaut: callen: open source corporate fascists?

2:33 chord: robink: clojure

2:34 robink: chord: Ah

2:34 noprompt: brehaut: oreilly has a new ocaml book coming out.

2:34 robink: chord: So making use of Swing and the Java 2D APIs for the client end of things?

2:34 noprompt: "real world ocaml"

2:34 chord: robink: I tried to get it in haskell but those assholes banned me from #haskell

2:34 robink: chord: It's getting to the point where writing it in ClojureScript would be actually feasable.

2:34 Ember-: why swing since we have javafx these days

2:34 which is like ten times better api

2:35 noprompt: whenever oreilly puts "real world <language x>" on a book you can almost gaurentee it's because no one gives a shit about <language x>.

2:35 robink: chord: Tried to "get it"? ...and why would they ban you? If you ask implementation questions that aren't 'StarCraft in Haskell'-specific, they wouldn't even have to know you want to make a StarCraft clone in a FL.

2:35 brehaut: noprompt: lol

2:35 Viesti: <want>namespace browser in emacs</want>

2:35 robink: Ember-: Yes, but you must remember that as far as computing technology goes, I'm living in the early '90s at best. Most of the time I regress to a '70s-programmer state.

2:35 s4muel: noprompt: Yeah, the 'Totally Academic' series didn't pan out

2:35 noprompt: that's not to say <language x> is bad though.

2:35 chord: robink: well you got guys like callen who tried to get me banned from this channel, THAT EXPLAINS EVERYTHING

2:36 robink: chord: Uh, not to me, but whatever.

2:36 Ember-: robink: oh, in that case you should use AWT, not Swing

2:36 :)

2:36 robink: Ah

2:36 Oh, my apologies, I thought I was in #gentoo-chat

2:36 Going all the way back to the sfweekly article

2:36 chord: robink: wait doesn't awt and swing suck shit for making a game?

2:37 brehaut: noprompt: when they achieve Real World Agda, I'll be buying that thing. no hesitation

2:37 Ember-: chord: they suck shit for making anything imho

2:37 noprompt: brehaut: that or Real World Coq.

2:37 robink: chord: I wouldn't necessarily use them for 2d accel, but they'd be OK for a UI

2:37 Ember-: but performancewise they have no problems

2:37 unless you want to make a super high performance 1st person shooter

2:37 in which case you shouldn't use JVM at all anyway

2:37 utkarsh: This would probably be obvious to you people, but how do I install clojurescript from a git clone of its source? I get "Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main" when I run bin/cljsc

2:39 chord: how exactly do you translate a c++ opengl win32sdk game to JVM based clojure, can you directly interface to win32sdk from jvm?

2:39 noprompt: utkarsh: how familiar with the clojure toolchain are you?

2:40 utkarsh: noprompt: I'm familiar with leiningen, but clojurescript doesn't use it to manage dependencies it seems.

2:41 noprompt: brehaut: "Real World BrainFuck: Code you won't understand tomorrow"

2:41 supersym: chord: Not that I know of

2:41 brehaut: noprompt: to be honest, thats no different to agda or coq ;)

2:41 noprompt: its just harder to satisfy the compiler

2:41 callen: Agda - guaranteed to work, but you'll never change it again.

2:41 noprompt: utkarsh: that's not true. you can add clojurescript as a dependency to your project.

2:42 utkarsh: i was asking because, you can also add austin for a nice cljs repl experience if you jsut wanna hack around.

2:42 chord: robink: so you gonna start the rts in clojure project?

2:42 robink: chord: It's intriguing, but I'm not sure I'm up to the task right now.

2:42 noprompt: utkarsh: but that's not totally necissary.

2:42 chord: robink: you need to dump your girlfriend to create the time

2:42 robink: chord: I'd get lazy (not the good kind) and try to do it with mutable state.

2:43 noprompt: utkarsh: add this to your :dependencies [org.clojure/clojurescript "0.0-1889"]

2:43 robink: chord: No girlfriend, taking the quarter off, not much work :-)

2:43 chord: robink: oh jesus christ fine use Go language

2:43 robink: chord: ...

2:43 chord: robink: WTF YOU'RE NOT EVEN WORKING OMG YOU LAZY

2:43 noprompt: utkarsh: and this to your :plugins [lein-cljsbuild "0.3.2"]

2:43 robink: chord: No, I am working, and I'm lazy in the *wrong* way.

2:43 utkarsh: noprompt: Can I not just use the cljs compiler standalone, to compile a .cljs file to .js?

2:43 callen: utkarsh: you shouldn't

2:44 noprompt: utkarsh: you can but it's generally not recommended.

2:44 chord: robink: you need to stop the procrastination, look noprompt can keep you on schedule my managing you

2:45 noprompt: utkarsh: we can help you get a nice environment set up if you're patient.

2:45 supersym: utkarsh: I had some problems getting this stuff in my head too, its really the sum of all parts with cljs... so many stuff that gets combined into the compiled whole

2:45 muhoo: pedestal

2:46 noprompt: utkarsh: but it's not as simple as, say, coffeescript. also if you were to use cljs directly it would be slow and painful.

2:46 muhoo: if you don't want to have to deal with all the moving parts yourself

2:46 supersym: https://github.com/Gozala/wisp is more what does your 1-1 Clj-JS

2:46 chord: noprompt: if i changed project from clojure to clojurescript would that entice you to make the starcraft clone?

2:46 utkarsh: noprompt: callen: what would be the easiest way to just see the js output for a cljs script? Right now, my objective is to see the compiled output to see the optimizations performed by the compiler; I don't even need it to execute.

2:47 noprompt: utkarsh: i can post a quick gist for you.

2:47 utkarsh: noprompt: that would be wonderful. :)

2:47 akurilin: What are people's thoughts on noir.validation? I'm seeing that it's using the dynamic var trick in the middleware to aggregate validation errors. In one way that's very convenient, no need to add anything to the response yourself, yet also magical if you haven't read the source.

2:48 noprompt: utkarsh: alright, gimme a sec

2:49 chord: robink: you lazy to work on rts because you're high on drugs, i'm right aren't i

2:50 robink: chord: Well, not exactly

2:50 chord: robink:so thats a yes...

2:50 robink: chord: It's sort of an 0.3 thing where {0 false 1 true}

2:51 chord: robink: so multiply by 2 to compensate for bias means 0.6

2:52 robink: chord: Interesting that a 'bias multiplication' would turn any value over 1.5 to something "more than true"

2:52 utkarsh: noprompt: found this https://github.com/clojure/clojurescript/wiki/Quick-Start which seems to be exactly what I want. Giving it a try...

2:53 chord: robink: you've been playing starcraft 2, league fof legends, world of warcraft, and diablo 3

2:53 robink: thats why you're lazy

2:54 robink: chord: I don't *own* StarCraft 2, and have never played it. One of the reasons I'm probably not ideal for this task.

2:54 noprompt: utkarsh: oh, you sure?

2:54 utkarsh: noprompt: running the bootstrap script, will tell in a min

2:55 chord: robink: why is everyone in here hate starcraft

2:56 robink: chord: I don't, I just don't know how to talk functional programming patterns for an RTS, so will sit quietly until someone asks me a question about Clojure.

2:57 chord: robink: so you can learn!!!

2:57 robink: chord: Yes, but I can probably learn more by reading than by talking to you.

2:57 chord: robink: so go read and make it

3:00 robink: have you seen this https://artillery.com/

3:01 OtherRaven: chord: do you do this every day?

3:01 chord: OtherRaven: until the project succeeds yes

3:02 robink: chord: No, but that's sort of what I wanting to say about ClojureScript. The browser is close enough to being a viable platform that even a JS-compiled language handling a 3d canvas can actually be a possibility.

3:02 OtherRaven: chord: how many people have you gotten to work on this?

3:03 chord: OtherRaven: you and robink

3:03 robink: Oh no

3:04 chord: oh yes

3:04 OtherRaven: chord: okay, and how many have actually agreed to help?

3:04 because it's looking like zero

3:04 chord: OtherRaven: OtherRaven: 0.1 , robink: 0.2

3:06 OtherRaven: chord: you're... curious

3:07 chord: OtherRaven: whats the minimal amount of code that needs to be written before you jump into the project

3:08 OtherRaven: chord: I have no desire to write your game for you. I'll make my own, thanks.

3:09 chord: OtherRaven: AH HAH I FOUND AN OPENING LET ME JOIN YOUR GAME TEAM

3:09 OtherRaven: chord: newp

3:09 chord: OtherRaven: you afraid that I'll out haX0r you?+

3:10 callen: chord: you haven't written any code that anybody is aware of, so I doubt they're worried about that.

3:10 OtherRaven: chord: newp, I have no idea how good you are or aren't

3:10 callen: (he's not.)

3:10 chord: OtherRaven: train me then

3:10 OtherRaven: tehehe

3:10 chord: callen: I ASKED YOU TO TRAIN ME IN CLOJURE

3:11 OtherRaven: chord: okay, lesson one... <incoherent mumbling> and now for your homework: learn clojure

3:11 callen: chord: you can read the book

3:12 chord: OtherRaven: how about a deal, I write a clojure program that creates a window and you LET ME ON TEAM NOW

3:12 callen: remember how you didn't actually finish your clojure book

3:12 callen: how can i read the nonexistent book

3:13 callen: I'm working on a cookbook chapter and doing Clojure Cup first

3:13 I am not a parallel algorithm.

3:14 chord: OtherRaven: link to your current game you're working on so I know you're not BS'ing me

3:15 OtherRaven: chord: BSing you about what? I said I have my own game I'm working on, not that I want your help or to share it with you. My hobbies are my own, thanks.

3:15 chord: OtherRaven: so you have no demo of the game?

3:15 callen: in psychology this is called projection

3:15 Casting doubt on others because you know yourself not to be trustworthy.

3:15 OtherRaven: tehehe

3:16 chord: newp, and I don't need to demo anything to you

3:16 chord: callen: psychology also says that the way to help people with the disorder is to train them in clojure

3:16 callen: you see how this OtherRaven is intentionally refusing to show me the demo to rile me up

3:16 OtherRaven: XD

3:17 chord: actually, I'm waaaaay before the demoing state. You're just making wild assumptions.

3:17 s4muel: Have you guys read chord's book?

3:18 TEttinger: OtherRaven, have you seen libgdx?

3:18 s4muel: "Effortless Trollin'" ?

3:18 OtherRaven: valid point

3:18 s4muel: seriously, I can't believe anyone continues these discussions beyond 5 seconds. just /ignore, ffs

3:19 OtherRaven: TEttinger: newp, though I may have a look at it

3:20 TEttinger: OtherRaven, it's pretty good, I just started porting a swing game to it

3:20 chord: OtherRaven: I'm going to prove you wrong about me, I will have a stupid game up and running and show you the github code

3:20 TEttinger: s4muel: I have had him on ignore since I found http://i.imgur.com/KFR6caY.png

3:20 chord: that was taking out of context

3:20 s4muel: TEttinger: what a creep.

3:21 * OtherRaven snickers

3:23 devn: clojure people

3:23 o/

3:23 callen: devn: hai

3:23 TEttinger: hey devn

3:23 devn: sup

3:24 callen: devn: I have a full-house. Things ended up working out after all :)

3:24 devn: gf3, s4muel, and noplamodo are all on my team :D

3:25 errr... noprompt.

3:25 devn: nice

3:25 chord: callen: you feel good about rejecting me from your team

3:25 devn: chord: dude, be nice

3:25 please and thank you

3:27 TEttinger: callen, what's this team for?

3:27 devn: clojurecup

3:27 http://clojurecup.com

3:27 callen: TEttinger: ClojureCup! We're making Simonides :)

3:27 TEttinger: http://clojurecup.com/apps.html

3:27 devn: callen: I may do a one man team

3:27 callen: devn: traitor!

3:28 devn: callen: if we're in the car i might be able to sneak it

3:28 chord: devn: you make clojure starcraft clone for the cup ok?

3:28 callen: lol. sneaky.

3:28 devn: chord: ok

3:29 chord: devn: you lying to me?

3:29 devn: callen: lol, i dont have a plan though

3:29 callen: devn: I have a to-do list you could pick from.

3:29 devn: chord: im chilling

3:29 callen: devn: also you need to do something about getclojure - it keeps breaking and I like using it.

3:29 devn: wha?

3:29 it's broken?

3:29 callen: devn: is the source to getclojure on your github?

3:29 devn: yeah

3:29 callen: devn: it breaks all the time.

3:30 devn: albeit messy and stuff

3:30 callen: devn: is the data on the github too?

3:30 devn: yeah

3:30 callen: sweet!

3:30 thank you.

3:30 devn: it's the preparsed data

3:30 "the names have been changed to protect the innocent"

3:30 callen: the guilty you mean.

3:30 devn: either way

3:31 callen: I had somebody post a triple-star Clojure oneliner I wrote to Twitter as an example of horrible code.

3:31 devn: callen: what do you mean triple star?

3:31 callen: ,(:a @@@(atom (atom (atom {:a 1}))))

3:31 clojurebot: 1

3:32 callen: devn: http://c2.com/cgi/wiki?ThreeStarProgrammer

3:32 classic C2 wiki

3:32 devn: lol

3:32 man, i don't read enough c2

3:32 callen: Clearly.

3:32 * devn changes his homepage to be a random c2 wiki page

3:33 callen: Eggscellent.

3:33 devn: Eggsactly.

3:33 Eggsema. Eggsaterrestrial.

3:34 OtherRaven: this is getting eggsessive

3:34 chord: OtherRaven: you going to be in this chat tomorrow so that I can post github link to my first clojure project to prove you wrong?

3:35 callen: chord: I'll be waiting for you my love.

3:35 devn: OtherRaven: You'd do well on my eggsams.

3:35 You seem to eggcel at this kind of thing.

3:36 callen: I am relaying these egg puns to my housemates.

3:36 They have no idea what IRC or programming is, but they

3:36 OtherRaven: devn: XD

3:36 callen: are loving it.

3:36 devn: Eggspand on that though.

3:36 thought*

3:36 * OtherRaven has already eggsausted her supply of egg puns

3:37 TEttinger: that's eggregious

3:37 devn: For eggsample: I am eggcited right now.

3:37 OtherRaven: TEttinger: eggstrordinarily so

3:38 devn: I am trying to eggspress all of my emotions in terms of eggs.

3:38 TEttinger: these are some awful jokes I mean yolks

3:39 devn: (inc TEttinger)

3:39 lazybot: ⇒ 4

3:39 devn: TEttinger: We haven't even begun to crack the shell on it.

3:39 Apage43: This is eggsasperating.

3:39 callen: (inc TEttinger)

3:39 lazybot: ⇒ 5

3:39 TEttinger: haha

3:40 (inc devn)

3:40 lazybot: ⇒ 12

3:40 chord: omg stop these egg jokes

3:40 devn: Stop "beating" it to death?

3:40 kitofr: (inc egg)

3:40 lazybot: ⇒ 1

3:40 OtherRaven: you mean egg "yokes" :p

3:41 devn: egg beats talking about other off topic nonsense.

3:41 callen: OtherRaven: do you have a github? mine is bitemyapp.

3:41 Apage43: Not the worst idea that's hatched in here lately.

3:41 devn: hahaha

3:41 (inc Apage43)

3:41 lazybot: ⇒ 3

3:41 callen: (inc Apage43)

3:41 lazybot: ⇒ 4

3:42 TEttinger: (inc Apage43)

3:42 lazybot: ⇒ 5

3:42 callen: These terrible yolks are scrambling my nerves.

3:42 TEttinger: (inc callen)

3:42 lazybot: ⇒ 11

3:42 devn: If this sort of thing continues, there might be a mass eggsodus.

3:42 OtherRaven: callen: newp, sorry

3:43 devn: People may be eggspelled from #clojure for having bad yolks. :(

3:43 akurilin: Any of you guys using liberator here? Wondering if there's a way to have the :handle-malformed handler return a body with content type that's not just text/plain.

3:43 chord: you guys are so boring with your egg jokes that I'm starting non the project that I kept talking abotu

3:43 TEttinger: s/ex/egg

3:44 aw, lazybot...

3:44 callen: OtherRaven: np, figured I'd ask because your nick was unfamiliar.

3:44 devn: s/\sit\s/\segg\s/g

3:44 OtherRaven: callen: yeah, I'm pretty new XD

3:45 devn: akurilin: have you looked at the core.clj source?

3:46 Apage43: akurilin: totally guessing (reading the source)

3:46 devn: https://github.com/clojure-liberator/liberator/blob/master/src/liberator/core.clj#L156

3:46 Apage43: but It looks like you set a :media-type on the :representation in your response context

3:46 as devn just linked

3:47 chord: do you guys use clojure from linux or windows, I need to know for the game

3:47 callen: Mac and Linux.

3:47 s4muel: OtherRaven: welcome to #clojure. don't be afraid of posting horrid code, after all, you're just breaking out of your shell.

3:47 devn: oh god

3:47 callen: OtherRaven: do not be afraid of being wrong. Walking gingerly around your ignorance only sustains your lack of knowledge. Being vigorously wrong, all the time.

3:47 s4muel: that's what years of slashdot will do to you

3:47 callen: OtherRaven: it brings on correction and new knowledge.

3:47 Apage43: after all, you can't make an omelette without catching a few exceptions

3:47 OtherRaven: s4muel: thanks, I may just do that

3:47 callen: OtherRaven: break things, make mistakes!

3:48 devn: s4muel: your most recent joke was like someone eggsuming bodies from a cemetery. let it be dead.

3:48 OtherRaven: callen: I'll go with being cautiously wrong... that way I can always turn around and say "I thought that might not be right... and I was right" XD

3:48 devn: akurilin: is that helpful at all?

3:48 callen: OtherRaven: shed your ego, just learn! be wrong!

3:49 OtherRaven: you will become awesome-r faster if you just *go*!

3:49 devn: you mean eggo

3:49 ?

3:49 callen: devn: GOD

3:49 OtherRaven: lol

3:49 * callen has an aneurysm

3:49 devn: eggeurysm?

3:49 Apage43: trying too hard now

3:49 TEttinger: callen's been scrambled

3:49 akurilin: devn, Apage43 looking at it right now, thanks for the direction. I'm trying to implement server-side html form validation, and I figured I'd just use :malformed? for that purpose, then I found out it default to plain even though the only :available-media-type I set is html

3:49 TEttinger: his brain is fried

3:49 OtherRaven: you need your head eggsamined

3:50 john2x: who's joining the clojurecup?

3:50 Apage43: and ex->eggs is just too easy, come on :)

3:50 callen: john2x: memememememememe

3:50 Apage43: folks, I hear

3:50 callen: john2x: and my brave team of 3 comrades.

3:51 Apage43: all I do is hang out in IRC though

3:51 devn: better than playing WoW

3:51 akurilin: devn, what's sad is that I totally ran into the documentation of the 3 supported ways of returning responses at some point in the past 2 days and I haven't been able to fin dthem since

3:51 devn: IRC is a text-based adventure game

3:52 s4muel: ... guys i thought this was nethack

3:52 * s4muel has been doing it wrong all along

3:52 OtherRaven: filled with eggs and trolls

3:52 devn: akurilin: i've never used liberator so i can't be too helpful. sorry :\

3:52 scottj: callen: what is your team building?

3:52 Apage43: what, with your bare hands? Against his bear hands?

3:52 akurilin: devn, ha no worries, that's plenty already!

3:52 callen: scottj: http://clojurecup.com/apps.html Simonides

3:53 devn: akurilin: happy hunting, sir.

3:53 callen: I want to win Clojure Cup just so I can hang a hammock at my desk at work instead of a chair.

3:54 if I lose...I'll probably just buy a hammock. Or if a teammate wants the hammock.

3:54 devn: im going to write a game of simon says that uses core.logic, core.async. core.typed, reducers, datomic, transients, refs, agents, and atoms in a point free style

3:54 callen: ^^ instant winner.

3:56 devn: callen: you missed the best part. i'm doing it in clojurescript

3:56 well, part of it

3:56 im actually compiling to COBOL

3:56 Apage43: dang

3:57 devn: and, if i have time, i'm going to have it wear pants

3:57 literally.

3:57 TEttinger: devn, all through one clojure macro right?

3:58 devn: well yeah, but it's a macro to generate macros to write a macro which...

3:58 TEttinger: 5 star general

3:58 devn: the people's clojure army

4:00 s4muel: The Ten Pass Campaign

4:00 TEttinger: Heh, I haven't heard the star programmer term dug up in a while

4:01 TEttinger: blame callen

4:02 s4muel: Figures.

4:03 TEttinger: is Raynes the one to ask about lazybot?

4:03 Raynes: does lazybot have the ability to run one instance over multiple servers?

4:09 chord: WE ARE ALL HUMANS

4:11 devn: Don't get so eggcited

4:12 We don't even know for sure that we eggsist

4:20 chord: devn: have you seen this artillery.com

4:20 www.artillery.com

4:21 mercwithamouth: cow-orker: how's your game coming?

4:21 amalloy: TEttinger: yes, it does

4:21 mercwithamouth: have you gotten the camera engine working yet?

4:31 nonuby: if building a library that works in an async fashion is the idiomatic approach to take care of your own thread pool (thread pool per async library) like http kit does, then the high level programmer than augment shit by passing a c as a callback (keep core.async stuff cpu bound and thus no/rare need to adjust its own threadpool)

4:32 c as callback meaning channel from core.async as callback

4:32 chord: answer is 47

4:32 nonuby: awesome!

4:43 chord: nonuby you work on starcraft clone written in clojure ok?

4:44 nonuby: eh?

4:44 chord: ok?

4:46 YOU ANSWER YES

4:48 TEttinger: uh, is there a good way to store an indirect reference to a slow-to-compute value that I don't expect to change often but don't think I want to use a concurrency primitive for? I was thinking like (let [walls ['north-wall 'east-wall]] (map eval walls)), but that doesn't respect let bindings.

4:48 err

4:49 the let should have had the definitions for north and east wall as like 1 and 2

4:49 the problem is eval doesn't seem to know what's in a let

4:51 kaw: Pretty sure eval is almost always the wrong answer, but it's not entirely clear what the actual slow-to-compute problem is?

4:51 TEttinger: yeah, it's going to be a texture region pulled from an atlas

4:51 java code

4:52 I don't really want to recompute the texture get a lot

4:53 chord: tettinger: link to your github code for your game

4:53 kaw: Ah, no

4:53 But there are too many to just load them all up front?

4:53 mpenet: TEttinger delay maybe?

4:53 ,(doc delay)

4:53 clojurebot: "([& body]); Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force or deref/@), and will cache the result and return it on all subsequent force calls. See also - realized?"

4:53 mpenet: or that's what you want to avoid

4:57 chord: who here has had their girlfriend dump them

4:58 TEttinger: mpenet, that might be good. what I want to be able to do is define a level-map, call it dungeon, made of different wall tiles. the wall tiles are generated without knowing what images the end result will use, and the images could be drawn from a number of wall themes, but a north-south wall should be able to be requested, and another theming function just decides which north-south wall.

4:59 does that make sense? like I would return a dungeon made of calls to things like north-south-wall, and another function takes those calls or delays or whatever they are and turns them into the appropriate versions

5:01 kaw: Are you sure it's really slow to compute? It sounds like you're kind of mentally binding together choosing a tile variation with loading the actual tile, if I'm understanding you right

5:01 TEttinger: I think I just got it

5:01 kaw: Do you have such a large tile set that it'd be bad to keep it all loaded at once?

5:02 TEttinger: kinda.

5:02 chord: www.artillery.com

5:02 TEttinger: https://dl.dropboxusercontent.com/u/11914692/slashem-revised.png

5:04 kaw: Targeting mobile devices?

5:04 TEttinger: what I'll do is just return a vector of functions, and call the functions passing in the theme as an arg when "realizing" them

5:04 kaw: I guess the thing is that if it really is bad to keep it all in memory at once, you need a strategy for releasing them when you no longer need them, not just for loading them as they first become needed

5:05 TEttinger: no, I'm not too concerned about memory because I'm not targeting mobile

5:05 I just wasn't sure how to do the name-f thing

5:05 name-0o

5:06 name-of

5:11 Apage43: maybe you want https://github.com/clojure/core.memoize ?

5:12 (or just clojure.core/memoize if you never need to release the cached value. That's just built in to clojure.)

5:13 pong TEttinger

5:13 ,(doc memoize)

5:13 clojurebot: "([f]); Returns a memoized version of a referentially transparent function. The memoized version of the function keeps a cache of the mapping from arguments to results and, when calls with the same arguments are repeated often, has higher performance at the expense of higher memory use."

5:14 TEttinger: oh yes. thanks Apage43

5:15 chord: EAT THAT BITCHES I FINISHED READING LEARN YOU A HASKELL

5:15 you all thought I would fail to finish

5:15 I showed you all

5:15 Apage43: i hear go has starcraft in the standard library

5:16 chord: Apage43: you talking to me?

5:16 Apage43: just letting that float

5:17 chord: do i know you

5:26 sm0ke: Hello anyone working with jeromq? i have small example i cant get working

5:26 where do i paste code?

5:27 Apage43: refheap.com

5:28 sm0ke: https://www.refheap.com/19020

5:30 i first start listeners then publishers

5:32 jonasen: sm0ke: why have you wrapped the code in go blocks?

5:33 sm0ke: jonasen: i am just using fireplace wanted to just do everthing from same ide without freezing ti

5:33 jonasen: its just for prototyping..do you think thats what is wrong here?

5:35 interestingly it never gets up to the "listeners quit" statement!

5:36 one sec does pub needs to be binded before connect on sub?

5:36 nonuby: how about inserting a (Thread/sleep 1000) between the go blocks

5:36 sm0ke: nonuby: yea let me do that

5:37 nonuby: between the go blocks?

5:37 nonuby: yes

5:37 so l16

5:37 sm0ke: nonuby: i am actually executing every form individually

5:38 nonuby: okay, still not dug too far into core.async but what about changing go to future

5:38 sm0ke: aha exactly what i thought!

5:39 pub needs to bind before sub connects!! weird

5:46 i have edited it with the sleep which fixes it

5:53 OK more weirdness to follow..it seems that i just need to have a sleep there..then it doesnt matter even if sub start before pub

5:54 if i remove it nothing works

6:30 TEttinger: so I'm having a bit of trouble with reflection that isn't going away with type hints

6:30 (def ^OrthographicCamera camera (OrthographicCamera.))

6:30 (.setToOrtho camera false 800 480)

6:31 the second line seems to be reflecting, but I can't figure out why

6:31 oh it could be a float thing

6:31 nope.

7:13 ro_st: hyPiRion: loved your article

7:13 more! more! :-)

7:13 TEttinger: so, lein run doesn't seem to show any reflection warnings with that code, but lein compile does

7:14 hey cgrand

7:15 ro_st, have you used *warn-on-reflection* in clojure?

7:15 hyPiRion: ro_st: yay :D

7:15 clgv: somtimes there are evil dependencies that switch on *warn-on-reflection* in one of their main namespaces ;)

7:15 hyPiRion: There will be another one about indexing and persistent vector's tail next week. I guess we'll filter out all the non-clojurians in that one

7:16 clgv: hyPiRion: what did you write about?

7:16 hyPiRion: clgv: http://hypirion.com/musings/understanding-persistent-vector-pt-1

7:16 How Clojure's Persistent Vector work

7:17 clgv: ah nice.

7:17 cgrand: TEttinger: hi

7:19 ro_st: hyPiRion: the diagrams did it for me. what did you use to make them?

7:20 it'd be great to see how that picture varies for sets, maps, lists and vectors (which i'm guessing it does)

7:21 wunki: is there a fn in clojure which swaps the arguments of a fn?

7:21 ro_st: swaps them when, wunki?

7:22 wunki: first argument becomes second, second argument the first

7:22 hyPiRion: ro_st: nothing more than graphviz (dot). Unfortunately I can't/don't want to release the source of the graph generation, because that's part of a project at university I'm working on

7:22 wunki: for threading purposes

7:22 hyPiRion: It'll be released in mid December though, I promise!

7:23 TEttinger: like ##((fn [f a b] (f b a)) / 1 0)

7:23 lazybot: ⇒ 0

7:23 clojurebot: It's greek to me.

7:23 ro_st: wunki: (fn [f & args] (apply f (reverse args)))

7:24 TEttinger: wunki, it does seem like that should exist already

7:24 wunki: ro_st: that could be a good one indeed. Would think there is a fn in core for that though

7:24 TEttinger: there's ->>

7:24 ,(doc ->>)

7:24 clojurebot: "([x form] [x form & more]); Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc."

7:24 TEttinger: since you mentioned threading

7:25 ro_st: hyPiRion: no problem. just dig it, it's a really nice viz

7:25 look forward to the release!

7:25 wunki: TEttinger, exactly, but when you start with a `->` and then comes a function which should have been `->>`

7:25 TEttinger: ah I get it

7:26 ro_st: that's usually a good indication that you probably want to break things up

7:26 wunki: I know from previous experience that you could just add a `->>` in the `->`, but Clojure was a while ago for me

7:26 ro_st: readability > brevity

7:26 s4muel: wunky: https://github.com/Prismatic/plumbing/blob/master/src/plumbing/core.clj#L275-L289

7:26 wunki rather, derp

7:28 wunki: ah, thanks s4muel. Another great library from Prismatic :)

7:28 hyPiRion: ro_st: http://hypirion.com/data/pvec-pt-1.tar.gz is the source for the text and the .dot files, if you're interested.

7:29 ro_st: thx!

7:29 heh "Jason W01fe is happy to give a talk anywhere any time on the calculus of arrow macros"

7:31 wunki: another solution is btw: (-> m (select-keys some-fn) (->> (fmap some-fn)))

7:32 TEttinger: fmap?

7:32 ,(doc fmap)

7:32 clojurebot: Titim gan éirí ort.

7:32 wunki: [clojure.algo.generic.functor :refer [fmap]]

7:33 ,(doc clojure.algo.generic.functor/fmap)

7:33 clojurebot: excusez-moi

7:33 TEttinger: so a little more active now -- I had a question earlier about an odd reflection problem. the second line gives a warning:

7:34 (def ^OrthographicCamera camera (OrthographicCamera.))

7:34 (.setToOrtho camera false 800.0 480.0)

7:34 this is with *warn-on-reflection* true

7:35 opqdonut: hmm. what is the signature of the setToOrtho method?

7:35 TEttinger: I can't figure out why that would have that problem... hang on, will fetch

7:36 https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/OrthographicCamera.java#L141

7:36 do I need to cast to float?

7:37 nope, didn't solve it

7:37 thanks opqdonut

7:38 the actual error:

7:38 Reflection warning, dk/DKGame.clj:18:4 - call to setToOrtho can't be resolved.

7:42 opqdonut: TEttinger: sorry, no idea. seems mysterious

7:42 clgv: TEttinger: don't forget that the type information of the object might be also missing

7:42 opqdonut: TEttinger: you _could_ try hinting camera with the fully qualified class name, i.e. ^com.badlogic.gdx.graphics.OrthographicCamera

7:43 clgv: that would only help if it is not imported

7:44 TEttinger: oh just saw your `def` statement. that is the problematic spot. even if you type hint it clojure cannot be sure that its value wont change

7:45 TEttinger: usually you should use type hints somewhere locally to the method calls

7:57 TEttinger: clgv, will try

8:03 clgv, woohoo! that did it

8:03 no warnings!

8:04 clgv: the clojure compiler can only infer the type for `def` forms with ^:const metadata since anything else might change during runtime

8:05 TEttinger: (inc clgv)

8:05 lazybot: ⇒ 8

8:05 clgv: :D

8:05 TEttinger: (karma technomancy)

8:06 clgv: $karma technomancy

8:06 lazybot: technomancy has karma 76.

8:06 clgv: that's a bit ;)

8:06 clojurebot: Pardon?

8:06 TEttinger: puts everyone but amalloy to shame

8:06 $karma amalloy

8:06 lazybot: amalloy has karma 71.

8:06 TEttinger: $karma Raynes

8:06 lazybot: Raynes has karma 36.

8:06 clgv: his bot should love him more ;)

8:06 TEttinger: haha

8:07 Bronsa: clgv: that's not true (def tag handling)

8:07 try (def ^String x "") (defn a [] (.hashCode x)) (def x 1) (a)

8:08 if you manually type hint you're declaring to the compiler that the tag of the var is not going to change

8:09 clgv: Bronsa: humm well, it does not always seem to work that way

8:10 TEttinger: Bronsa, yeah, I was getting reflection warnings for every call that didn't have the method's object typehinted, even if that object was def'ed with a typehint

8:10 (clojure 1.5.1)

8:12 Bronsa: do you have an example of this?

8:18 glosoli: Hey folks, I have some form template made with Enlive (with values hardcoded for the development) and I am curious if anyone could suggest a sane way for them to be removed each time I deploy the app ? there is dev profile in the project which defines the mocks used for the development, but I am a bit confused how can I cleanly mock form template depending on the profile

8:20 TEttinger: Bronsa, yes. it's java interop stuff, but:

8:20 (def ^OrthographicCamera camera (OrthographicCamera.))

8:20 (.setToOrtho camera false 800.0 480.0)

8:20 will send out a reflection warning

8:20 if I hint camera in the method call, it does not

8:21 the line is https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/OrthographicCamera.java#L141

9:05 tbaldridge: mdrogalis: ping

9:08 mdrogalis: tbaldridge: pong

9:08 tbaldridge: mdrogalis: deep walking macros? https://www.youtube.com/watch?v=HXfDK1OYpco

9:08 mdrogalis: tbaldridge: Hell yeah!

9:09 Well my work day is shot for the next hour. ;)

9:09 tbaldridge: lol

9:09 mdrogalis: Better than a blog post.

9:10 tbaldridge: yeah, I really stink when it comes to writing blog posts

9:14 clmsy: hi everyone

9:14 solussd: hi

9:14 clmsy: i have no lisp background or actually any functional prog. background , im a python developer

9:14 solussd: that's not a bad place to start from

9:14 clmsy: but i m interested in clojure and started to learn it

9:15 can i ask questions here

9:15 ?

9:15 solussd: a good book is, imo, the best place to start.

9:15 sure

9:15 mdrogalis: tbaldridge: I'll give you some feedback in ~2 hours. Going to have to watch it in pieces.

9:15 llasram: clmsy: Fortunately yes, what with that being a question and all :-)

9:15 clmsy: well i thought 4clojure.com is pretty cool

9:16 can someone explain me what does ' do infront of lists ?

9:16 solussd: some of the online tutorials are pretty cool, but a good book would explain things, like quoting lists, for example, better.

9:16 clmsy: can you recommend me one solussd

9:16 solussd: pytting a ' in front of any clojure code "quotes" it, which means you'll get the literal datastructure and it will not be evaluated

9:17 The orielly "Clojure Programming" is a good start

9:17 clmsy: ah ty ^^

9:18 ill pick it up first thing

9:18 llasram: +1 for /Clojure Programming/. And once you've got a handle on the basics of the language, I highly recommend /The Joy of Clojure/

9:18 solussd: lists look like this (1 2 3). The first item in a list is treated as a function though, so if you want the literal list you have to quote it so it isn't evaluated, e.g., '(1 2 3)

9:18 ,'(1 2 3)

9:18 clojurebot: (1 2 3)

9:18 solussd: (1 2 3)

9:18 ,(1 2 3)

9:18 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

9:19 llasram: clmsy: The exceptions start to make sense pretty quickly, I promise :-)

9:19 solussd: The joy of clojure is a wonderful book, but much more advanced

9:19 clmsy: allrighty =)

9:20 solussd: do you have any java experience?

9:20 clmsy: yes i do

9:20 i have jvm exp

9:20 but 0 lisp

9:20 and 0 fp

9:20 solussd: that exception is saying that the first item in the list (a java.lang.Long, 1), does not implement the IFn interface, which all functions implement

9:20 clmsy: hmm

9:21 solussd: most of clojure implements abstractions. At ground-level those abstractions are java interfaces

9:21 clmsy: nice examples ^^ ty man

9:22 solussd: np- have fun learning clojure! It was the most fun I had learning a language since, well, python. :)

9:22 clmsy: (list [:a :b :c])

9:22 llasram: ditto, though s,python,EVARR!!!one,

9:23 solussd: if you put a comma before it, it'll get evaluated here

9:23 ,(list [:a :b :c])

9:23 clojurebot: ([:a :b :c])

9:23 solussd: so that made a list containing a vector

9:24 if you want to use the items in the vector as args for the list function, use 'apply'

9:24 ,(apply list [:a :b :c])

9:24 clojurebot: (:a :b :c)

9:24 clmsy: what if i want

9:24 '(:a :b :c)

9:24 Bronsa: ,(list* [1 2 3])

9:24 clojurebot: (1 2 3)

9:25 solussd: you need to put a comma out front for the IRC bot to know you want to eval it

9:25 clmsy: i want the datastructre of a vector

9:25 solussd: then just use [:a :b :c]

9:25 clmsy: ,[:a :b :c]

9:25 clojurebot: [:a :b :c]

9:25 solussd: or construct one:

9:25 ,[:a :b :c]

9:25 clojurebot: [:a :b :c]

9:25 solussd: ,(vector :a :b :c)

9:25 clojurebot: [:a :b :c]

9:26 AimHere: ,(vec '(:a :b :c))

9:26 clojurebot: [:a :b :c]

9:26 solussd: vec takes a collection (e.g., a list) and converts it to a vector

9:26 clmsy: lists can be constructed with either a function or a quoted form.

9:26 (= (list __) '(:a :b :c))

9:26 this is the 4clojure question

9:27 i need to use list fn to create a datastruce

9:27 solussd: ah yes, (list '(:a :b :c))

9:27 clmsy: thats what i understand

9:27 yes

9:27 ty

9:27 solussd: err wait no

9:27 AimHere: No

9:27 solussd: it wants (list :a :b :c)

9:28 list takes any number of args and returns a list of them

9:28 ,(= (list :a :b :c) '(:a :b :c))

9:28 clojurebot: true

9:28 clmsy: just a sec

9:28 quick question

9:28 (:a :b :c)

9:28 this is a vector right

9:28 ?

9:28 AimHere: It's a list

9:28 solussd: that's a list

9:28 clmsy: damn

9:28 so what is the : do here

9:29 AimHere: In clojure, vectors have square brackets, and maps have curlies, and sets have hash-curlies, like #{:a :b :c}

9:29 clmsy: oh man your right yeah

9:29 solussd: vectors use [], maps use {}, sets use #{}, lists use (), and lists that arent quoted are evaluated

9:29 AimHere: That's a keyword

9:29 Keywords are a funny kind of data structure, that just evalutes to itself.

9:30 solussd: a keyword is a symbol that always evaluates to itself. It can be used as a function, which "looks itself up" in an associative datastructure, like a hash-map

9:30 AimHere: When people were programming in other lisps, they found that they sometimes just wanted to pass along as symbol (a name for something, similar to a variable name) without bothering to evaluate it

9:30 solussd: keywords are nice as keys in a map: {:mykey "some value"}

9:30 then you can use it, as a function, to look itself up:

9:30 AimHere: For instance, in C or C++, you might enum up a list of integers, just because you want to have something bound to a name that you pass on

9:31 solussd: ,(:mykey {:mykey "some value"})

9:31 clojurebot: "some value"

9:31 AimHere: What the integers they evaluate to actually are doesn't matter - In clojure you'd use keywords instead

9:31 clmsy: thanks a lot for the rich explaining guys

9:32 AimHere: Yeah, you get this because clojure is a new and growing language. In 5 years time this would be replaced by 'RTFM, newguy'

9:33 solussd: i hope not. :) At least, not if I'm around!

9:34 http://www.clojurebook.com

10:14 mercwithamouth: so how many of you all have clojure jobs?

10:18 schmir: mercwithamouth: I'm currently working on clojure project at work

10:23 s4muel: i use clojure @ my job, i don't necessarily have a 'clojure job'

10:30 francis_wolke: I have a 'clojure job'

10:36 repl: Hey guys, how do you use the function key? Example in the documentation uses it with map(i.e. map key {:foo 20 :bar 30}). And this is not working for me: (key {:foo 10})

10:37 jweiss: ,(key (first {:this :that})

10:37 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

10:37 jweiss: ,(key (first {:this :that}))

10:37 clojurebot: :this

10:37 logic_prog: dnolen: are you responsbile for writing core.logic ?

10:37 jweiss: key works on map entries, not maps

10:37 dnolen: logic_prog: yes

10:37 logic_prog: dnolen: awesome, I'm working through reasonched schemer again, and would like to thank you for all your work

10:38 dnolen: logic_prog: thanks!

10:38 * jweiss needs to add code to lazybot where it will keep adding close parens until it doesn't get EOF

10:38 logic_prog: dnolen: I feel like the notion of unification is under appreciated in the programming world

10:38 repl: jweiss: neat, going to try it that way, thanks.

10:38 TEttinger: jweiss: ##(#(+ % %) 1))))))))))))))))))

10:38 lazybot: ⇒ 2

10:38 logic_prog: dnolen: even though the algorithms have "worst case exp time", generally, if the dataset is huge, we need speialized algorithms anyway; and in practice, if the dataset is small, things just work

10:39 dnolen: logic_prog: it's very useful, and yes I think core.logic is a good fit for smaller things

10:39 ljos: Is it possible to use the the normal clojure predicates in core.logic? I want to test if something is a string but (run* [q] (string? q) (== q "string")) doesn't work.

10:39 dnolen: logic_prog: the recent expresso lib is particularly nice use case, http://github.com/clojure-numerics/expresso

10:40 logic_prog: dnolen: ha, I'm actually re-studying core.logic precisely because of symbolic computation

10:40 francis_wolke: ljos: You have to return a goal for your prediate. eg #s or #f

10:40 dnolen: ljos: it's possible to convert a predicate into a constraint but it's experimental, I don't recommend it

10:40 logic_prog: dnolen: in particular, I'm interested in the issue of: suppose I have the following first order logic proposition with forall quantifiers -- can I assign variables to get this other proposition

10:41 dnolen: so it's sorta like "finding if there exists variables that satisfy blah" which is sorta like unification

10:41 ljos: francis_wolke (== true (string? q)) does not work either.

10:41 dnolen: is there another way to check the type of a var at runtime, after it has been relised?

10:41 dnolen: ljos: that's because q is a logic var, you need to project it - note this will make your program non-relational

10:41 (project [q] (== true (string? q)))

10:42 which will still blow up if q is not groun

10:42 ground

10:42 oh sorry actually in this case it won't but of course there are cases where it will

10:42 repl: jweiss: OK, got it. So even when I'm using hashmap like an object, it's still a collection of pairs and I need to use first to retrieve the only pair it has.

10:42 francis_wolke: ljos: you're attempting to unify true with string. Which isn't going to work.

10:43 dnolen: logic_prog: sounds cool!

10:43 francis_wolke: dnolen: which book would you reccomend after the reasoned schemer?

10:44 jweiss: repl, what is it you want? maps have many keys.

10:44 ljos: dnolen: Thank you.

10:45 repl: jweiss: Yeah, I understood maps are always collections after looking at your code. I was thinking if there's only one pair, that's treated as one map entry but I was wrong.

10:46 jweiss: repl: if you know ahead of time that it's going to be one pair, maybe map isn't the best form. a vector of 2 items maybe

10:47 repl: then you can use first and second to retrieve (or destructure)

10:47 repl: jweiss: I see. I'll try using a vector then.

10:47 jweiss: ,(let [[k v] [:this :that]] (list k v))

10:48 clojurebot: (:this :that)

10:48 jweiss: (let [x [:this :that] k (first x) v (second x)] (list k v))

10:48 ,(let [x [:this :that] k (first x) v (second x)] (list k v))

10:48 clojurebot: (:this :that)

10:54 logic_prog: dnolen: I know that #u -> u#, #s -> u#, and #t -> true; but what does #f maps to? nil?

10:55 dnolen: francis_wolke: a Prolog book, either Sterling & Shapiro or Brako

10:55 ljos: np

10:55 logic_prog: probably #f -> false

10:56 logic_prog: dnolen: makes sense, for some reason, I was trying "fail" instead nd getting a function

11:00 repl: jweiss: Works MUCH better using a vector, cheers. :-)

11:03 jweiss: bad version: (reduce + (reduce concat (map vals order)))), better using val: (reduce + (map (comp val first) order))), now much better for vector: (reduce + (map second order)))

11:05 jweiss: repl: nice :)

11:05 dnolen: logic_prog: fail is a function and so is succeed

11:05 logic_prog: same for #u and #s in TRS miniKanren

11:10 jweiss: repl: there may be more efficient ways to represent pairs if vector doesn't cut it perf-wise. cons cell maybe? i never see those in clojure so maybe not :)

11:13 repl: jweiss: I'm porting dotted cons pair from common lisp actually. (a . b) is not supported in Clojure, so tried map first, now using [a b]. (a b) should work equally well in this context.

11:13 jweiss: repl: the (a . b) syntax isn't supported, but it has a Cons type

11:14 ,(class (cons 1 '(2)))

11:14 clojurebot: clojure.lang.Cons

11:14 jweiss: i doubt that accessing a Cons is any faster than vector, but Cons may have less mem overhead. just guessing

11:15 AimHere: I do vaguely remember some talk from RHickey or someone that 2-element vectors are probably what you should use instead of pairs

11:15 jweiss: ah ok

11:15 that's what I use but I never cared about performance

11:17 arrdem: LEIN_IRONIC_JURE? really?

11:17 AimHere: That's a vague recollection though, but consing up lists doesn't seem all that idiomatic, and there's likely a more Clojuric way of doing whatever the Clisp is doing

11:18 TimMc: jweiss: It's not just syntax; Clojure doesn't support pairs in the general case.

11:18 repl: jweiss: Yeah, I wanted to use cons initially. It doesn't work that well when used with reduce. conj works though: e.g. (reduce conj [] […]) => doesn't work with cons.

11:18 TimMc: &(cons 1 2)

11:18 lazybot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long

11:18 AimHere: &(cons 1 '(2))

11:18 lazybot: ⇒ (1 2)

11:18 TimMc: Right, but that's not (1 . 2)

11:18 That's (1 . (2))

11:19 jweiss: i see, no pairs of atoms then

11:21 TimMc: arrdem: Indeed. ಠ_ಠ

11:21 AimHere: repl > conj takes multiple args, something like (apply (partial conj []) [...]) might cut down on function call overhead or something, but that's a very rough guess

11:21 arrdem: TimMc: I need an emacs macro for that face.

11:22 AimHere: I don't know the filthy details of what reduce or partial are doing when I call them

11:23 TimMc: AimHere: I don't see the beginning of this discussion, but what's wrong with into?

11:23 mercwithamouth: o_O

11:23 AimHere: TimMc, good point, that might be better still! I keep forgetting about into

11:29 repl: TimMc: AimHere: Just tried into, it gives you a vector where concat gives you a list, and concat gives you a lazy seq. into should be very efficient because it uses conj.

11:32 TimMc: into is efficient because it uses transients

11:33 hyPiRion: efficienter

11:34 bja: that's going to be a commit message whenever I next use transients

11:38 chrisrossi: so, xml. there's an emit-element function, that's mostly undocumented, that only outputs to stdout. what's the standard way you guys spit xml back out to an output stream?

11:38 bbloom: chrisrossi: are you trying to output to somewhere other than stdout?

11:38 chrisrossi: yes.

11:39 justin_smith: chrisrossi: I don't use clojure.data.xml, but you could use with-out-str

11:39 bbloom: clojure has a more general mechanism for redirecting streams

11:39 (doc *out*)

11:39 clojurebot: "; A java.io.Writer object representing standard output for print operations. Defaults to System/out, wrapped in an OutputStreamWriter"

11:39 chrisrossi: i figure there must be a more robust serializer somewhere.

11:39 ah, interesting.

11:39 thanks.

11:39 justin_smith: (with-out-str (println "hi"))

11:39 ,(with-out-str (println "hi"))

11:39 clojurebot: "hi\n"

11:39 justin_smith: and yeah, for more power you can use (binding [*out* ...] ...)

11:40 bbloom: chrisrossi: if you (source with-out-str) it will be clear. see also with-open

11:40 chrisrossi: yep, that's pretty easy to read code. makes sense.

12:06 arrdem: anyone care to comment on monger vs congomongo?

12:06 telling me to get a better K/V store is OK too.

12:09 Raynes: arrdem: Both of those are reasonable driver wrappers.

12:10 arrdem: Raynes: Ok. Examples aren't that different, but I figured I'd ask.

12:14 * nDuff tends to think "get a better K/V store" *is* a decent answer, though.

12:15 nDuff: (particularly since MongoDB isn't a K/V store at all, and using it as if it were one is probably pretty suboptimal)

12:15 arrdem: ...do you _actually need_ a K/V store, or a document store?

12:18 mercwithamouth: redis ftw?!

12:19 egghead: https://github.com/lantiga/exoref ?

12:19 :p

12:30 konr: what cool things are there to write presentations, besides impress.js?

12:30 egghead: reveal.js

12:30 indigo: bespoke.js

12:30 egghead: I've also used http://slid.es

12:30 beberlei: latex?

12:31 egghead: which lets you just use a little web gui for creating slides

12:31 indigo: IMO it's better to just use PowerPoint/Keynote/whateverthecrap and make it into a PDF

12:31 egghead: indigo: so you can print it out or what?

12:32 indigo: egghead: That and so I can use gestures to look through it

12:32 konr: Thanks! I've used org-mode->latex->pdf and gluing GIMP images together. Time to be modern!

12:32 indigo: Also I hate how some people do a 2D presentation flow with reveal.js

12:33 IMO presentations are supposed to flow in a linear fashion

12:33 arrdem: nDuff: really what I need is an enumerable event store

12:34 egghead: indigo: reaveal can work out if you just have the x axis be topics and the y axis be drill down into specifics about the topic

12:34 arrdem: nDuff: which I happen to be building using records in Mongo, potential scaling issues be damned.

12:34 indigo: I know what it's for, I just think it's confusing and unnecessary ;P

12:34 Why not just lay out the presentation linearly and have bookmarks relating to topics

12:35 Usually when I read slides I mean to read them all, and going down down down right down down right is annoying

12:36 egghead: indigo: as a presenter I don't mind it, but ya when I read reveal slides I often forget to press down

12:36 indigo: Also what if I want to search for a keyword

12:36 I mean I could go to the general overview

12:37 But still, it's a bit annoying and not user-friendly to do that

12:39 What would be cool is to have a markdown->pdf presentation engine

12:40 Hey, there's an idea ;)

12:40 jtoy: &(defn myf ([a ] (myf 1 +)) ([b func] (func 1 b))) ; (myf 4)

12:40 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

12:42 dmillett: I'm fairly new to Clojure and would like some feedback if anyone is willing? https://github.com/dmillett/clash

12:43 arrdem: dmillett: have you tried throwing multi-million entry files at this? when does it fall over?

12:44 dmillett: do lines have to be regular?

12:44 dmillett: I've tried up to 200 MB file (just a single file) so far. I had to adjust the heap settings upwards of 1+ gb in the project.clj

12:45 I built it where there would some textual structure -- right now it looks for regex groups and pairs them with whatever keyset you want

12:45 nDuff: rkneufeld: with my #bash hat on, it'd be a lot saner for lein-try not to try to emulate clojure syntax in shell. that is, to support just lein-try org.codehaus.plexus/plexus-utils 3.0.15, no square brackets involved.

12:45 rkneufeld: ...that, *or* to allow legitimate clojure syntax to be passed in within a single, quoted argv element

12:46 rkneufeld: ...as in: lein try '[org.codehaus.plexus/plexus-utils "3.0.15"]'

12:46 rkneufeld: nDuff: It actually does support excluding square brackets or even the version

12:46 nDuff: rkneufeld: [] isn't only globbing in zsh -- it's quoting in bash too, it just has fallback behavior of being a noop.

12:46 s/quoting/globbing/

12:46 rkneufeld: ...but having corner cases where that fallback doesn't occur is pretty evil.

12:47 rkneufeld: rkneufeld: i don't follow what case you are talking about.

12:47 nDuff: rkneufeld: whenever globs don't match in bash, their default behavior is no-op.

12:47 rkneufeld: nDuff: yeah, it may be worth considering removing the square-bracket version all together

12:47 nDuff: rkneufeld: so, [123] will be delivered to the program as '[123]', *unless* the current directory contains a file named 1, a file named 2, or a file named 3, or the "nullglob" shell option is available.

12:47 rkneufeld: its really been nothing buth trouble.

12:47 nDuff: rkneufeld: I wholeheartedly agree.

12:48 rkneufeld: 0.4.0 time :D

12:48 nDuff: s/available/enabled/

12:48 rkneufeld: I'm going to create an issue for that. I don't have time to do it right this second, but I'd love if you chimed in in support of removing that feature.

12:48 (time to do it this second meaning I can't do the *code* portion today)

12:48 jweiss: rkneufeld: thanks for lein-try BTW, helped a lot for my plugin, lein-runproject (which is similar but runs the :main of the project isntead of creating a repl)

12:49 * nDuff tries to lein try org.codehaus.plexus/plexus-utils, and headscratches a bit at the exceptions resulting.

12:49 rkneufeld: paste of it?

12:55 https://github.com/rkneufeld/lein-try/issues/16

12:57 nDuff: I wasn't able to reproduce the exception: https://www.refheap.com/19037

13:00 nDuff: rkneufeld: Hmm. In my case, it isn't finding the artifact at all -- doesn't look like it's successfully looking in central, for that matter. https://www.refheap.com/9c58a2fdbbcc25da1c093a547, and hangs indefinitely.

13:05 mercwithamouth: is there a legitimate purpose for 'quote' ?

13:05 nDuff: rkneufeld: ...and lein is otherwise able to pull from both central and clojars uneventfully.

13:05 mercwithamouth: for spelling it out vs the reader macro, you mean, or to have it at all?

13:05 rasmusto: ,(eval (quote (prn "test)))

13:05 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading string>

13:06 technomancy: mercwithamouth: no, it was added as a joke. no one noticed until now

13:06 rasmusto: ,(eval (quote (prn "test")))

13:06 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

13:06 mercwithamouth: outside of possibly writing forms that change depending on what type of form is returned???

13:06 lazybot: mercwithamouth: How could that be wrong?

13:06 mercwithamouth: technomancy: easter egg! you agree with me!

13:06 nDuff: mercwithamouth: if you didn't have quote, how would you define a list as data, without executing it?

13:07 mercwithamouth: nDuff: *shrugs*

13:07 nDuff: mercwithamouth: ...well, there's your answer.

13:07 metellus: ,(list 1 2 3)

13:07 clojurebot: (1 2 3)

13:07 llasram: mercwithamouth: How would you quote symbols for writing macros without it?

13:08 mercwithamouth: llasram: dunno, i've never done that =P

13:08 justin_smith: hell, how would def or let work without quote

13:08 mercwithamouth: <- clojure newb

13:08 llasram: mercwithamouth: Well, there you go

13:08 * mercwithamouth keeps reading... sigh

13:09 llasram: Not the newb part -- I meant quoting as being primarily useful in Clojure for macros. In e.g. Common Lisp it's a bit more generally useful because you don't have non-evaluating data structures like vectors

13:09 justin_smith: I mean I guess it could be (def (symbol "foo") 0) or something so really it is a subcase of the macro case

13:10 llasram: justin_smith: But you'd still need to (syntax) quote the form. Well, or I guess you would write: (list (symbol "def") (symbol "foo") 0)

13:10 But... eww

13:10 mercwithamouth: still very lost...i'll keep reading then come back to harass you all with more questions

13:10 justin_smith: llasram: yeah, seriously

13:11 mercwithamouth: well no...now i see exactly how code is considered 'data'

13:11 literally...

13:12 egghead: so, you see that the code is data (list structures), but do you see that the data is code!

13:12 :p

13:13 mercwithamouth: ,(list '+ 'x 'x)

13:13 clojurebot: (+ x x)

13:13 mercwithamouth: guess so

13:14 rasmusto: ,'(+ x x)

13:14 clojurebot: (+ x x)

13:17 zakwilson: Combine that with having the compiler available at runtime and it becomes very easy to write programs that write programs. Sure, eventually you get skynet, but before that you have an immensely expressive language.

13:29 dobry-den: I've written a program that lets me 'add-dep raynes/laser' from the command line and it conjs the closest match from clojars.org/search?q=raynes/laser into my project.clj deps.

13:31 i will turn it into a lein plugin for the fellow lazy

13:31 once i figure out how

13:33 i will try to use it to ensnare other rubyists

13:34 * zakwilson can imagine rubyists being ensnared with an "ooh shiny" ntick like that.

13:36 dobry-den: zakwilson: when i first was learning clojure, the long trip to clojars was grueling

13:37 mercwithamouth: sigh...a lot of rubyists are coming to clojure aren't they? =( I swear i didn't realize until after i'd gotten here

13:37 dobry-den: clojure is the natural evolution of a rubyist

13:37 the final form

13:37 mercwithamouth: *heads over to #haskell

13:38 dobry-den: you may be right there....i wish i gave it a try back in 2008. i ran away

13:38 rubyists are very enthusiastic though smug...i hope that isn't brought to the clojure crowd

13:38 dobry-den: i spent 6 months with scala and haskell. took copious notes. dismissed clojure without much thought because of the syntax

13:39 then i tried clojure, got over the parens after an hour, and immediately felt like i could do something immediately.

13:39 mercwithamouth: dobry-den: same

13:40 ToxicFrog: mercwithamouth: it takes serious effort to be as smug as the Ruby community~

13:40 `cbp: dobry-den: did you do any lisp before? I know some people that just cant get over the parenphobia

13:40 dobry-den: dunno about the smug epithet. maybe if you spend too much time in a rails coredev brouhaha

13:41 mercwithamouth: scala is actually cool until you get to def distribute[A,B](fab: F[(A, B)]): (F[A], F[B])

13:41 ToxicFrog: lol

13:42 dobry-den: you're right...let me take that back. the rails community is smug... #ruby is much better

13:43 dobry-den: `cbp: tryclojure.org was my first experience with lisp ~6 months ago. the breakthrough is when i realized that lisp devs don't painstakingly manage their parens.

13:43 ie i discovered paredit

13:43 `cbp: dobry-den: so you knew emacs?

13:43 mercwithamouth: dobry-den: yes... paraedit is awesome...and even more so slurp and barfing...dunno if thats and emacs-lvie thing only?

13:44 dobry-den: i knew vim and just spent a weekend fiddling with emacs + evil-mode + nrepl

13:44 mercwithamouth: C-left/C-right ?

13:44 cored: Clojure next evolution for a Rubyists

13:44 that doesn't sound quite right

13:44 mercwithamouth: how is evil-mode by the way? I've spent a good amount of time with emacs and vim so i was fine with the emacs keybindings....i've turned vipermode on a few times though it sort of annoys me

13:45 dobry-den: there's something novel about getting lost in bare-bones software with nothing but knowing how to search for help-files.

13:45 jweiss: dobry-den: wait till you see paredit + multiple cursores :)

13:45 *cursors

13:45 mercwithamouth: well ruby was originally a lisp, right?

13:45 dobry-den: in emacs, i'd just learn one thing at a time as i needed. it. C-x C-f to open a file. got it. C-h k to see what a key just did. go tit

13:45 uris77: elixir is probably the next ruby, most rubyist will flock there

13:46 until they get bored

13:46 mercwithamouth: i never got bit by the multiple cursor bug with sublime..

13:46 ToxicFrog: dobry-den: I don't think it's just Rails; I gave up on Ruby due to the community impression well before Rails was popular (or, I think, even existed)

13:46 `cbp: jweiss: does Magnar have a video of that? :-D

13:46 technomancy: mercwithamouth: maybe you're thinking of R?

13:46 jweiss: `cbp: indeed he does, IIRC. let me see if i can find

13:46 mercwithamouth: technomancy: no..definitely ruby

13:47 dobry-den: mercwithamouth: evil-mode is pretty install-and-forget-about-it for me. bare-bones emacs + evil-mode is pretty close to vim once you learn how to open a file.

13:47 technomancy: there's a talk where Matz says he was greatly inspired by lisp and then points to the fact that predicates end in ? and there are higher order functions, followed by vigorous hand-waving.

13:48 `cbp: On that note I wanted to see his webrebels talk but I don't even know if they're releasing those videos :-(. I heard he did some serious emacs wizardry

13:48 mercwithamouth: ok ok so it wasn't a lisp..lisp simply inspired him to create ruby.

13:48 dobry-den: clojure feels comfortable after 4 years of ruby. ruby's blocks pave the way to lambda functions

13:49 jweiss: `cbp: http://www.youtube.com/watch?v=D6h5dFyyUX0&feature=player_embedded#t=174

13:49 `cbp: jweiss: thx

13:49 jweiss: `cbp: it's part of the paredit emacs rocks video (at the end)

13:49 uris77: javascript feels more like lisp to me than ruby.

13:50 mercwithamouth: jweiss: this video shows paraedit with multiple cursors?

13:50 havenwood: An aside from the Ruby manpage: If you "like the concept of LISP, but don't like too many parentheses, Ruby might be your language of choice."

13:50 dobry-den: but javascript's dynamic scope is what makes it feel so foreign to ruby and clojure imo.

13:50 jweiss: mercwithamouth: yeah, doesn't it?

13:50 technomancy: havenwood: insert "and have never heard of Dylan" in there somewhere

13:51 mercwithamouth: jweiss: indeed

13:51 jweiss: i use that all the time now

13:52 it's like lisp-aware search/replace :)

13:53 dobry-den: mercwithamouth: http://www.haskell.org/haskellwiki/Random_shuffle

13:55 arrdem: Raynes: so shall we or shall we not give you reputation points for every refheap link ever posted here? I'm undecided.

13:55 havenwood: dobry-den: i like your dep-add idea, though it'd be nice to be able to remove as well :O

13:58 mdrogalis: tbaldrid_: ping

13:59 havenwood: dobry-den: something like `lein-dep --add raynes/laser` and `lein-dep --remove raynes/laser`

13:59 zakwilson: I feel a lot of CL influence in some parts of Ruby.

14:02 tbaldridge: mdrogalis: pong

14:03 mdrogalis: tbaldridge: 2 things. #1: You different than I pictured you. :P #2: Terrific video. You're a great teacher.

14:03 Really easy to follow along.

14:03 You sound different* ^

14:03 tbaldridge: nice!

14:04 mdrogalis: It wasn't remotely as scary a concept as I thought it'd be.

14:04 tbaldridge: thanks, I appreciate that.

14:04 mdrogalis: Anytime. Post that thing everywhere. People will watch it for sure.

14:04 tbaldridge: I hope to work on the go macro one this weekend, it isn't too much more complex, just more of it.

14:05 mdrogalis: How'd you get your fn to show up as a lambda?

14:05 `cbp: where is that video? or is it none of my business :-D?

14:06 dobry-den: havenwood: I considered that but postponed it since it's the "go out on the internet, find the latest version of X and the artifactid incantation to copy into project.clj every time" part that slows me down

14:06 tbaldridge: mdrogalis: I use https://github.com/overtone/emacs-live

14:06 havenwood: dobry-den: look forward to trying it! :)

14:07 tbaldridge: its not exactly a light emacs config, but it has some nice features I like.

14:07 dobry-den: havenwood: i made an effort to use maven central as a fallback if clojars failed but maven is sort of a mess

14:08 i dont even know if im in the right place half the time i'm manually trying to find a lib on maven

14:08 mdrogalis: `cbp: https://www.youtube.com/watch?v=HXfDK1OYpco

14:08 tbaldridge: Pretty neat. I appreciate the knowledge!

14:09 callen: mdrogalis: ZOOOOOOOOMG

14:09 `cbp: mdrogalis: thanks

14:09 callen: tbaldridge: Thank you for posting that!

14:09 `cbp: tbaldridge: thanks too

14:09 mdrogalis: tbaldridge: You diagnose non-trivial problems really fast.

14:11 tbaldridge: mdrogalis: practice makes perfect, most of those bugs I've hit 20 times before, perhaps I'll learn someday :-P

14:12 callen: oh the mistakes I am learning from with recursive data right now ;_;

14:12 mdrogalis: Heh,

14:14 callen: here's a tip from somebody that knows: "preserve the full path to child elements zipper-style so it's easier to re-construct the tree later.

14:14 "

14:30 dobry-den: Are the ribbon images broken for anyone else? https://github.com/blog/273-github-ribbons

14:31 Nevermind.

14:53 gf3: s4muel & noplamodo: Hola guys

14:53 dobry-den: For debugging purposes, I want to <pre>(pprint request-map)</pre> in the layout-html file of my Compojure app. What's an easy way to make `request-map` available for every route?

14:53 gf3: s4muel & noplamodo: Feel free to add me on IM and send me viagra spam: gianni@runlevel6.org

14:53 dobry-den: Naive approach, of course, would be to pass `request-map` into every single route

14:54 llasram: dobry-den: A dynamic var, bound by some middleware? Spooky action-at-a-distance, but might be appropriate here

14:59 dobry-den: llasram: Right now my handler.clj requires my controllers and each route passes params into a respective controller: https://github.com/danneu/clj-forum/blob/master/src/forum/handler.clj#L17 - how would i bind the request so that controllers and views can see it?

15:07 llasram: dobry-den: You'd add middleware around the current contents of your `app` var. Just another of function in the composition

15:15 marcopolo2: Is there a way to know the name of the compiled clojurescript file ahead of time?

15:15 as in knowing it will become main.js

15:15 Could a macro reading the project.clj work?

15:17 gfredericks: marcopolo2: back when I used cljsbuild you could set the output file

15:18 ,(class {(range) :foo})

15:18 clojurebot: clojure.lang.PersistentArrayMap

15:18 gfredericks: ,(hash (range))

15:18 dobry-den: llasram: I'd have to bind it in another file just so controller namespaces can require it, right?

15:18 clojurebot: #<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>

15:18 gfredericks: oh right

15:18 marcopolo2: gfredericks: I mean being able to see the name of the output file within the clojurescript program

15:23 llasram: dobry-den: No... Look up how ring middleware works. Essentially you write a function which will recieve the request, then can directly respond, or pass that request down the chain by calling the function composing the rest of the application. That function returns with the response, the middleware returns that, and the response flows back up the stack

15:24 dobry-den: That means you can write a middleware function which binds the request to some dynamic var for the dynamic scope of the rest of the application

15:24 I'd actually be kind of surprised if there wasn't already something like that

15:28 dobry-den: Yeah, I understand middleware superficially, and I've just written this: https://www.refheap.com/19041 - But wouldn't `req` have to be required into any namespace that wants to see it?

15:29 llasram: dobry-den: Oh, yes -- sorry, I misunderstood what "it" was in your question :-)

15:30 So yes, you'll need to :require or otherwise reference it everywhere you want to reference it

15:32 dobry-den: ah of course. i don't know why dynamic scope is so nebulous to me. i feel like a monkey near a monolith.

15:33 mtp: dynamic scope proceeds up the /call stack/, not the level-of-textual-nesting stack

15:33 jfyi

15:35 llasram: mtp: Er, yes?

15:35 mtp: llasram, you're not the one who found dynamic scope nebulous, i'm trying to clarify it for dobry-den

15:36 dobry-den: mtp: Doesnt that just mean anything that's called within (binding [x ...] <stuff>) where x is (def ^:dynamic x)

15:36 mtp: dobry-den, my secret is i don't actually know clojure :)

15:36 i just know how dynamic vs. lexical scope works

15:36 (in the general case)

15:36 llasram: dobry-den: Don't worry, you've got it

15:37 dobry-den: I'm unfamiliar with computer science 101 terms like 'call stack' - is why i asked

15:37 bja: how might I mock or monkey patch something for testing in clojurescript?

15:37 dobry-den: llasram: thanks tho, this middleware did it

15:50 muhoo: "Your mock object is mocking you. For needing it." -- Rich Hickey

15:52 etehtsea: (select-keys nil [:a :b])

15:52 {}

15:52 why this is allowed?

15:52 I don't get it

15:53 mdrogalis: Is it possible to add an interface to an existing Java class?

15:53 callen: ahhh, nothing like replacing 20 lines of loop recur with 3 + 2 + 1 lines of reduce.

15:55 mdrogalis: Java 8 is bringing interface injection. I don't know of a way around it that doesn't involve deep magic.

15:55 mdrogalis: callen: Sad :(

15:55 callen: Funny how those Java blokes end up having to implement everything dynamic languages do anyway

15:55 despite insisting YAGNI

15:55 mdrogalis: Yeah

15:55 callen: also I want to know how Groovy won the Script Bowl.

15:56 mdrogalis: Wow, seriously? What order did it come in?

15:56 I didnt hear anything about it

16:06 callen: mdrogalis: Java One. I don't know the order, scraping the barest minimum of details from Twitter :(

16:26 muhoo: installed base. history. millions and millions of people who already know java, and groovy was the shortest path for them.

16:26 met a java guy recently who tried clojure and scoffed at it ("too slow"), does all his day-job work in groovy now.

16:26 callen: lol.

16:27 muhoo: that doesn't explain why Groovy won script bowl - how is that decided?

16:27 also isn't Groovy substantially slower than Clojure?

16:27 muhoo: haven't a clue, but my blind guess is above.

16:28 technomancy: isn't the script bowl judged by how loud the audience cheers?

16:28 muhoo: technomancy: aren't most things? :-)

16:28 technomancy: so unfamiliarity is highly penalized

16:28 tbaldridge: I'm porting PHP to Java then and entering the ScriptBowl next year then....

16:30 mdrogalis: Hah

16:30 Well I know they vote out the lowest scoring language

16:30 Should have voted out Java from its own conference ;(

16:30 eric_normand: groovy probably looks cool to a java guy

16:30 same stuff but shorter

16:31 mdrogalis: True.

16:34 callen: I love how Scala lost just because of compilation time.

16:38 mdrogalis: That seems like a pretty silly competition anyhow.

16:41 noprompt: dnolen: thanks for fixing that. :) after pulling everything down and getting it all set up i'm eager to dig through source. :)

16:41 dnolen: (context is the (keyword :keyword) bug)

16:42 it'd be nice if you could fill out the CA online. :-/

16:52 callen: noprompt: get my email?

16:52 noprompt: callen: lemme check.

16:52 callen: noprompt: also add my email address that I sent it from to gchat so we can see each other on gchat/hangouts please. :)

16:53 s4muel: you too!

16:53 noprompt: callen: ok. now we can share music, pictures, games, and more!

16:53 callen: lol. Just need a way to do the conference call tonight.

16:53 noprompt: callen: it's life 2.0.

16:54 callen: noprompt: does the division of responsibilities seem okay?

16:55 noprompt: callen: am i "CJ"

16:55 callen: noprompt: yeah I was basing it on the email

16:56 noprompt: I asked you if the name was okay. I didn't know what else to call you.

16:56 noprompt: callen: my name is Joel.

16:56 you hear that #clojure? my name is Joel!

16:56 callen: Okay, thank you. I figured cj was wrong but I was using what was at the beginning of the email address.

16:56 * noprompt shouts his name from the top of the #clojure mountain.

16:56 callen: That's why I asked if it was wrong in the email.

16:57 ToBeReplaced: every time i have to use chef, i want to break my monitor

16:58 callen: ToBeReplaced: chef sucks. I'm sorry you have to use it :(

16:58 dnolen: noprompt: no problem. Always excited about new contributors.

16:58 ToBeReplaced: callen: have you used anything you've liked?

16:59 callen: ToBeReplaced: Fabric and Ansible.

16:59 noprompt: dnolen: fwiw there's a typo in devnotes/testing https://github.com/clojure/clojurescript/blob/master/devnotes/testing#L9

16:59 callen: re-materializing trees that were serialized into constituent objects *and* you've got two different kinds of cardinality in the "children" is a special kind of hell.

16:59 dnolen: noprompt: yeah I should probably just delete that file

17:00 noprompt: the wiki has the correct instructions

17:00 noprompt: dnolen: yeah, I "discovered" that. :-P

17:01 callen: I need an update-in that works across embedded maps and embedded maps inside of vectors keyed by an id. How fucked am I?

17:01 (keyed by a pk, not by "placeness" in the vector. I'm not that stupid)

17:01 noprompt: callen: doesn't sound that bad.

17:02 and by "that" i mean **that**

17:02 callen: noprompt: you would think, but the path is a vector of keywords and you don't know upfront which keywords are for fields or primary keys.

17:02 noprompt: I've also been ass-deep in this for a long time and this is just yet another problem this Vietnam has thrown in my face.

17:03 I'm losing patience.

17:03 noprompt: callen: zippers.

17:03 callen: noprompt: not possible.

17:03 noprompt: this is about going from a tree to a bag of entities in Datomic, back to a tree.

17:03 noprompt: but nice thought. zipper'ish behavior is what I'm trying to do with the keyword path

17:04 noprompt: also you're forgetting that zippers can't handle the multi-cardinality keyword referenced children.

17:04 not unless I special-case the fuck out of it and then I'm back to where I started.

17:04 this is not a normal tree.

17:05 Apage43: these ain't your dad's trees

17:05 noprompt: sounds like a bush more than a tree.

17:05 callen: either way, fucked.

17:05 * callen goes back to hating life

17:06 dnolen: noprompt: http://github.com/clojure/clojurescript, fixed the README.md to link to Developer page of wiki

17:06 noprompt: dnolen: thanks!

17:07 Apage43: is it not reasonable to "normalize" the thing into a consistent form first?

17:07 callen: I don't think even my zipper approach will work. The path generator in the tree->bag-of-entites stuff doesn't know at the point of cross-generational linking whether it's cardinality many or one.

17:07 Apage43: the normalized form is either the bag of entities or the original tree.

17:07 noprompt: i just wanna say. the clojure community has had an enormous positive effect on my life.

17:07 Apage43: yeah

17:07 noprompt: everyone here is awesome <3

17:08 * callen screams in the background about blood for the motherland while everyone has a love fest

17:09 Apage43: it sounds like you're saying you've got them mixed tho

17:10 callen: Apage43: no, I'm just trying to back from the bag of entities to the original, unchanged tree format.

17:10 Apage43: using the metadata I inject at the time I create the bag of entities.

17:10 Apage43: ah

17:10 callen: I'm like 5 loop/recur forms past the point of sanity.

17:11 ToBeReplaced: callen: have you considered doing it in more than one pass?

17:12 callen: ToBeReplaced: top-level tree re-materialization is a reduce. That effectively is multiple-passes

17:12 I'm even cheating and sorting the children by path length

17:12 ToBeReplaced: i mean the real answer is fix it upstream, but if i was in that spot, i might make a pass to collect data like "is this a PK level or not" and use that to simplify the algo

17:12 callen: so I don't have to worry about creating intermediate shim objects

17:12 ToBeReplaced: there is no upstream to fix. All the right metadata is in place.

17:13 I'm just losing stamina and patience after having traverse a mental universe of problems from earlier parts of this problem.

17:13 having to traverse*

17:13 s/objects/maps/g you get the idea.

17:13 ToBeReplaced: well, something's gotta be broken, right? what you're describing is much too complex to be required

17:13 callen: no. it's just that complex.

17:13 the data model is insane and translating it to Datomic takes work.

17:14 It's a bullshit hybrid Semantic database + document store + EAV

17:14 ToBeReplaced: fair enough

17:14 noprompt: that was like the experience i had this summer moving a huge mysql database to neo4j.

17:14 callen: I have to sanitize it into a bag of entities Datomic understands while preserving enough information to return to the bullshit semantic tree whatcha-muh-fuck-whocares thing-jigger it originated with.

17:14 noprompt: MySQL would be simpler because the pathological cases are extreme normal form or extreme denormalization.

17:15 noprompt: loop/recur; futures everywhere.

17:15 callen: I'd prefer that to this bizarro world semantic database lkmrslgkmrtklhmsrlkyjmdkltyjkdmfglkhmdtrjhmdryop

17:15 Apage43: problems happen because those are not necessary roundtrippable

17:15 which I guess is where the extra metadata comes in

17:15 callen: I have to be able to reconstitute it.

17:15 users won't understand the bag of entities.

17:16 noprompt: it took about a month to just get the migration working and about another week to make it fast.

17:16 callen: noprompt: I'm about 2 weeks into this.

17:16 noprompt: one of the more painful data migrations i can remember.

17:16 callen: It's nearly working.

17:17 In some sense, it *is* working.

17:17 Inserts/upserts are working fine for the most part.

17:17 noprompt: callen: did you break out the whiteboard yet?

17:17 callen: It's the reconstitution back into the original, unmigrated form, that isn't working yet.

17:17 noprompt: many times.

17:17 the problem is in my head, my sanity is just damaged atm.

17:18 I have to write an update-in that understands map association vs. vector pk-based injection.

17:18 noprompt: i'm curious about datomic. where does it fit in the database world?

17:18 callen: once I do that, this should actually start working.

17:19 noprompt: EAV, never lose history of state, highly efficient / low latency querying/aggregations if you're on the JVM

17:19 Apage43: I'm in a similar state, though for dumber reasons. Spent a long time thinking on improvements to our replication protocol, and the last couple months have involved it all getting torn apart under the weight of the existing code, and I'm just too tired of dealing with it to load the whole thing into my head any more

17:19 callen: available reads, consistent writes - roughly speaking.

17:19 noprompt: what's it closest to in terms of database types? graph? table? k/v?

17:19 Apage43: which sucks, since I'm not *entirely* confident it's all still correct

17:19 callen: noprompt: relational maps.

17:19 noprompt: but the maps are actually EAV.

17:20 full schema enforcement, database functions, etc.

17:20 noprompt: a single entity can satisfy multiple 'types' of data.

17:20 you define the equivalent of a table implicitly through keyword namespacing.

17:20 :user/name :user/email :user/bcrypt-password

17:20 noprompt: interesting. i wonder if i should have looked more at that before choosing neo4j on this project.

17:20 callen: an entity can satisfy that type and multiple otehrs.

17:20 noprompt: it is decidedly not a graph store. I have my own reservations about neo4j but they might not be relevant to your problem.

17:21 Datomic is an alternative to RDBMS for when you actually *care* about your data. I don't think it replaces anything else except for maybe document stores.

17:21 noprompt: callen: i'm building a prep-sports application. so students attending schools, playing for football/basketball/etc teams, game stats.

17:22 callen: we needed to have traversable/queryable transactions and full history of entities, so Datomic fit our problem neatly.

17:22 noprompt: a graph store made the most sense.

17:22 callen: noprompt: your thing doesn't sound like a graph problem to me, but you would know better than I.

17:22 Apage43: I'm hesitant to use graph stores for things that aren't graph problems

17:22 callen: ^^ precisely.

17:22 noprompt: callen: trust me that's a graph problem.

17:22 Apage43: even if that data feels like a graph

17:22 callen: I've had bad experiences with premature use of neo4j before.

17:23 you can store adjacencies and graph meta data in entites in Datomic obviously, I don't know how efficient it would be.

17:23 noprompt: callen: fwiw, i looked at the other available options excluding datomic (cause of the price tag).

17:24 callen: I try to avoid projects where $3k is anything other than a sneeze, but fair enough.

17:24 Apage43: mostly cause graph stores start to get problematic when you have too much stuff

17:24 callen: noprompt: I don't know if you should use Datomic or not. I don't know enough about your data.

17:24 noprompt: actually it was kind of funny because i've read on more than one occasion that modeling sports data is excellent fit for graph databases.

17:24 callen: Apage43: if I *had* to store a graph I'd use something like Jiraph or Twitter's graph store.

17:25 I don't trust of what most people that work on graph databases tell me anymore.

17:25 most of what*

17:25 nDuff: callen: there are also shops that have real money, but have an allergy to spending it on licensing. Current employer is very cash-rich, but has a serious OSS-or-internal-or-bust streak.

17:25 noprompt: Apage43: are you sure? because from everything i've read it sounds like they're capable of working with a tremendous amount of data. i think it's when you have too many relationships that it actually gets bad.

17:25 * nDuff has had no luck trying to fight that aspect of corporate culture.

17:26 callen: nDuff: we're in bio. You can't have autarky/autarchy in the bio/med field.

17:26 it's impossible.

17:26 $3k being a perpetual license made it an even easier decision.

17:26 noprompt: worth considering that if it scaled that well, Twitter wouldn't have had to make their own.

17:27 and Twitter's is just sharded adjacency lists IIRC

17:27 "just"

17:27 Apage43: noprompt: yeah. That's the thing, Under a certain size you can do whatever, but after that size the "shape" of your data affects you a lot

17:27 and the kind of things you want to ask

17:28 callen: dozba: every service will evolve to the point where it becomes postgres. a service that cannot become postgres will be replaced by one that can.

17:28 relevant ^^ lol

17:28 nDuff: callen: $3K per process? It's an interesting place to be in when software licensing costs have a significant impact on decisions about larger-boxes-vs-more-boxes, but that's more than enough to have that effect.

17:28 callen: nDuff: ...have you looked at Datomic's pricing?

17:28 nDuff: it's $3k for 5 *peers*

17:28 perpetual

17:28 nDuff: if that's 5 _transactors_, it'd be one thing.

17:28 callen: that could hypothetically be a bejeezus-load of throughput.

17:29 I don't think you understand Datomic.

17:29 there's only ever one transactor.

17:29 nDuff: I don't.

17:29 callen: there's only ever going to be one transactor.

17:29 nDuff: I'm too scared off by the pricing.

17:29 callen: there's fail-over, but there's only one transactor.

17:29 Apage43: (IIRC that is *concurrent* peers too, you can have them -installed- on more than 5 machines, only 5 of them can actually be *online* at once, which is actually pretty nice, since you can hot swap stuff in)

17:29 noprompt: Apage43: foturnately, i think for what i'm doing it shouldn't be a problem. if it ends up being a bottleneck down the road, then of course you'll worry about it then.

17:29 :-)

17:30 Apage43: yeah, I expect not

17:30 callen: the transactor is limited by the queue, which has been benchmarked at 1 mm messages per second.

17:30 storage isn't really an issue if you know what you're doing.

17:30 5 peers is a lot of read throughput.

17:30 nDuff: (or, rather, by having experience in exactly how hard it would be to get my organization to cover the pricing, having tried and failed to fight that battle elsewhere)

17:30 noprompt: Apage43: right now it's just me developing this application. modeling sports data with mysql is *insane*. k/v doesn't make sense and neither does a document store (cause then you have to resolve relationships).

17:30 *manually

17:31 callen: noprompt: sounds like either a relational EAV or graph to me.

17:31 I can't say which would be better.

17:31 bwreilly: developing...with mysql is *insane*

17:31 noprompt: it's *not* relational

17:32 callen: the distinction doesn't matter a ton in this case.

17:32 relational EAV meaning Datomic, the way relations work there is not like SQL DBs.

17:32 it's more flexible than that.

17:32 you're storing attributes of scalar or many refs

17:33 storing those relationships in terms of an adjacency list graph in Datomic isn't that big of a leap.

17:33 I just don't know that it's necessarily a good idea.

17:33 noprompt: i'll definitely look at datomic on my next greenfield project.

17:34 callen: ping me with questions and all that.

17:34 Apage43: I actually expect datomic might handle it better than some other systems, on account of the way it does local caching

17:34 * callen thinks back to the benchmarks he did on this and sighs happily

17:35 Apage43: if you hit the same entity several times during a traversal you won't actually have to go fetch it from storage again.. probably

17:35 callen: I should make a graph traversal benchmark for Datomic, lol.

17:35 noprompt: in my case the users (my co-workers) are interested in getting more in depth statistics about players/teams. the sql queries to make some of that stuff happen are nightmarishly ugly.

17:35 callen: Apage43: you wouldn't - it'd be cached.

17:35 Apage43: right

17:35 callen: Apage43: if you can shard peers by "concern" or graph section then the LRU gets smarter.

17:35 that's getting into more inside baseball than is likely necessary though.

17:36 jimrthy: That seems like a good place to start

17:36 tbaldrid_: and it should be mentioned, inserting graphs into Datomic is suuuper simple. You can actually insert an entire mesh of entities as a single transaction

17:36 noprompt: what takes 3 or 4 queries and then manual processing, is one Cypher query and minor post processing once you have the data.

17:36 jimrthy: Sorry...wrong window

17:36 callen: tbaldridge: I've been using that faculty to handle insert/upserting documents with arbitrarily embedded children as bags of entities.

17:36 tbaldridge: nice

17:37 callen: so I can do partial overwrites of the entire hierarchy in one go

17:37 noprompt: tbaldridge: that sounds really interesting. unfortunately i've already put months of effort into the project so that's where i'm at.

17:37 callen: without having to "think" about which parts I'm overwriting.

17:37 jimrthy: That seems like a good way to start

17:37 Dammit.

17:37 tbaldridge: noprompt: I know, I just get excited about Datomic sometimes </bias>

17:37 callen: tbaldridge: I'm excited about watching your deep macros video later :)

17:40 noprompt: tbaldridge: fwiw, i did look at datomic when i started. however, considering that i work for a newspaper that's just barely getting by right now, a dataomic license is a bit out of the question. :(

17:40 tbaldridge is making a video?

17:40 now *that* i'm really excited about.

17:40 tbaldridge: noprompt: http://www.youtube.com/watch?v=HXfDK1OYpco

17:41 muhoo: you can do a lot with datomic free

17:42 i was kind of surprised.

17:43 noprompt: haha i feel like paul rudd from the celery man video.

17:43 callen: muhoo: yeah Datomic Free didn't seem that bad to me.

17:43 noprompt: "now tayne i can get in to"

17:43 callen: I think people are more averse to H2 than it merits.

18:12 noprompt: callen: the next time you use the word "muggles" to describe a subset of programmers, see if you can't figure out a way to slip in a jungle book reference, perhaps with a mowgli or balloo reference.

18:15 callen: okay, so I'm changing tactics on this tree materialization problem

18:16 top-down means a search problem generating a path across maps *and* keys

18:16 I'm going to do bottom-up merges of nth-most children into direct parents only.

18:16 no partial trees.

18:18 bottom-up idea courtesy of a coworker :)

18:33 gfredericks: if a POST has no body, is there anything wrong with it having no content-type?

18:37 amalloy: gfredericks: When an entity-body is included with a message, the data type of that body is determined via the header fields Content-Type and Content- Encoding.

18:37 http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2

18:38 so if you don't include a body, i don't think there's any reason you need an encoding; certainly post isn't special in any relevant way (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5)

18:47 robink: I'm using Clojure to try to complete a challenge in one of those free online courses (this one is about cryptography). I've got an ASCII string (sadly represented as a 7-bit literal packed ASCII string of #{0 1} (with *no* MSB for an 8-bit byte, despite that all the data is 7-bit). Most likely I can (and should) how to figure out the minutia entirely by myself, but I had a couple of questions:

18:47 One: is it better to store te enciphered text as a BigInt(eger), or a byte array?

18:48 I'm going to want to be able to perform modulo, bitwise xor and indexed manipulation of it, and while I realize you can do that with Strings, Java makes them immutable (and of course not persistent), so despite Clojure's extensive support for persistently mutating Java's String class instances, I'd like to keep it in a form that both Clojure and Java can consider "mutable" (but not actually mutable, or at least not treated that way if I'm packing the

18:48 ciphertext into a mutable Java array)

18:50 This is extremely low priority, the class and challenge are not superhard, I am neither extremely serious nor extremely committed to a study of cryptography, and my work, academic, and hobby careers will not be negatively impacted if I fail at this.

18:50 In fact, I'd rather have a stronger understanding of Clojure and an only slightly improved understanding of OTPs when I'm done with this than to understand the math and theory perfectly and to have solved the problem in Python.

18:51 In fact, mostly I just want to become better at handling untyped packed data directly (in any language, but in Clojure as well) without having to resort to types and classes that may be partially appropriate for what is being transformed, but not appropriate for the types of transformations I'm attempting.

18:53 Right now the strings are stored as an 8-bit-padded BigInteger, since I can call .xor on it (clojure.core/bit-xor doesn't operate on BigInt(eger)s, so I'm most likely not going to use it).

18:54 The other thing is this is the kind of data that really really could (and probably should) be treated as a vector/list/Array.

18:54 Just not a String for the time being

18:57 noncom: i'd use either NIO buffers or byte arrays. and bit operations yeah. if you go with nios then i'd advice to look at vertigo library made by zach tellman

18:57 actually, immutability and all fancy clojure stuff, i see no good application for when tossing bits like that

18:58 do not use bigints for that

18:58 thats for sure

18:58 robink: noncom: Gotcha

18:58 noncom: They aren't great but I can run a modulo on the entire chunk as a single unit with them as BigIntegers.

18:59 noncom: I could probably do the same thing with a byte array, but I'd need to think about *how* (I am almost as bad at programming as I am with math)

18:59 noncom: what do you mean to run a modulo on the entire chunk?

19:00 robink: noncom: i.e. with the entire cyphertext as a BigInteger, I can do (mod mybigint magicnumber) and get the remainder of a modulus operation on the entire ciphertext, rather than pieces at a time.

19:00 noncom: oh i see

19:01 robink: noncom: I could do useful things with a modulo of each piece, and there is probably some extremely obvious way to perform what would be a (mod onebignumber mydivisor) on a byte array or something similar, but the how if it is not immediately apparent to me.

19:01 noncom: well, i think that all else will be harder though. but you could convert the array/niobuffer into a bigint specifically for that operation

19:01 robink: noncom: So base everything off of an array, bytestream or NIO stream?

19:02 noncom: Can do, I just want to make sure the few times I use Java I never mutate whatever it is I'm working on.

19:02 noncom: if you have the entire data at once, then no streams, just buffers

19:02 robink: noncom: because if I screw up the cyphertext and can't think of how to reverse what I've done, that is not a good thing.

19:02 noncom: OK

19:02 noncom: can you safe-copy the original text?

19:03 robink: noncom: Sure, I'm happy to make copies or do COW.

19:03 noncom: Or make a buncha references to it.

19:03 noncom: Whatever's good Clojure practice and not horrible Java practice.

19:03 noncom: uh.. well anyway, it does not reeally come to me whats the benifit of using clojure here...

19:04 aside maybe from the cool vertigo lib

19:04 robink: noncom: REPL, ability to easily shuttle stuff between types/classes, immutability (I get back my original work and what I'm working on if I mess something up)

19:04 jtoy: how can I get the name of the current function? (str fn) adds an object id

19:04 robink: noncom: and of course persistent data so I can make loads of weird changes and not exponentially increase memory usage.

19:04 noncom: oh i see

19:04 right

19:06 mgaare: robink: so you have a string of 0s and 1s representing bits?

19:06 jtoy: not exactly but close enough : (str (resolve (quote +)))

19:07 robink: mgaare: That's what I started with. I partitioned it, stuck a '0' at the beginning of every 7-bit chunk, turned it into a String, and then cast it to a BigInteger with (BigInteger. myasciibitstream 2)

19:07 noncom: jtoy: (str (:name (meta #'ns/fn)))

19:07 robink: mgaare: a byte/character array may have been better

19:08 mgaare: but I want to make sure I don't mutate it or lose a handle on the original data, since I'm not holding on to the string of 7-bit-packed 1s and 0s. That's what the instructor gave us in the challenge, but it's not what I want to work with.

19:08 jtoy: &(str (resolve (quote +)))

19:08 lazybot: java.lang.SecurityException: You tripped the alarm! resolve is bad!

19:09 noncom: ,(str (:name (meta #'str)))

19:09 clojurebot: "str"

19:09 robink: mgaare: I want a more direct representation, I don't want to have to think in base 2 save for doing bitwise ops, and if I succeed at transforming the two strings, I want to immediately see the results in all their ASCII-encoded glory.

19:10 noncom: jtoy: ^

19:10 jtoy: noncom: thanks!

19:10 mgaare: why are there two strings?

19:11 jtoy: ,(str (:name (meta (quote str))))

19:11 clojurebot: ""

19:11 robink: mgaare: They are two differing strings that have been encoded by the same OTP.

19:11 noncom: jtoy: nono, you must use #' to take meta on a var

19:11 robink: mgaare: I'm supposed to be able to suss out what the OTP XOR key is (and thus, the strings) from the differences between the two.

19:12 noncom: ,(name (:name (meta #'meta)))

19:12 clojurebot: "meta"

19:12 noncom: haha lisp fun

19:12 robink: mgaare: Most likely I'm going to have to use statistical analysis on something, but I'm also hoping I can find a more general solution.

19:12 jtoy: ,(name (:name (meta (symbol (quote meta))))

19:12 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

19:13 jtoy: ,(name (:name (meta (symbol (quote meta)))))

19:13 clojurebot: #<NullPointerException java.lang.NullPointerException>

19:13 noncom: ,(symbol (quote meta))

19:13 clojurebot: meta

19:13 jimrthy: @reload

19:13 @reload

19:14 robink: mgaare: I'm also happy to write sufficiently inefficient and expensive code so that the CPU gets hot for a good few hours, but I have only 4GB of memory, so I also want to be efficient in my memory usage, not overflow the stack, and generally try to make use of Clojure's persistent data structures.

19:14 noncom: ,(name (:name (meta (var meta))))

19:14 clojurebot: "meta"

19:14 noncom: this is you want?

19:14 robink: noncom: I want that?

19:14 jtoy: noncom: yes

19:14 rasmusto: ,"meta"

19:14 clojurebot: "meta"

19:14 noncom: nono jtoy's plaing with the syntax

19:14 robink: Ah

19:15 jtoy: noncom: yes, thanks :)

19:15 noncom: robink: well, you sound like you need to go and make experiments right in the repl then

19:16 robink: noncom: Yeah, that's what I'm about to do.

19:17 noncom: I also probably should have a notepad with pseudocode, mathematical expressions, Clojure, LC or functional Python so I can prove to myself that I'm doing something actually *useful*

19:17 mgaare: robink: I think all you have to do is xor the two cyphertexts together

19:17 robink: mgaare: I'm not sure what the xored value *means*

19:17 mgaare: Plus the two have to be eventually differentiated from the xored value.

19:17 mgaare: robink: I think that yields the otp

19:17 robink: mgaare: Seriously?

19:17 mgaare: Holy cow, testing.

19:18 mgaare: erm, no I think I'm wrong

19:18 robink: mgaare: Bummer, that would have been cool.

19:18 mgaare: but hey try it anyway :D

19:19 but yeah I am definitely wrong

19:20 robink: I also need to figure out how to turn a BigInteger back to a String/character-array.

19:20 noncom: yeah, well, good luck, i gotta go sleep... :zzz

19:20 robink: 'k

19:20 an xor of the two ciphertexts is still probably useful, but I am trying to figure out *how*

19:20 mgaare: robink: you can do it with a reduce

19:22 callen: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

19:22 bottom-up tree materialization from bottom-most children won the day!

19:22 It works!

19:22 * callen cackles maniacally

19:22 robink: mgaare: Ah, thanks

19:23 mgaare: I don't know if it's the fastest way

19:48 callen: showed experienced coworker of mine the Clojure code I used to solve my tree materialization problem, he said, "wow. Clojure looks really nice!"

19:48 #representin ;)

19:49 AimHere: That's the spirit. Reel him in and catch him before he sees the java stacktraces...

19:50 callen: AimHere: he used to do Java and Scala. Our shop is Python. Clojure is like a glorious return home for him.

19:51 the Java stack traces won't scare him off

19:51 they certainly don't bother me anymore.

19:53 Raynes: lein-try is the best thing ever.

19:54 rkneufeld: Pretty sure I've told you this before, but man, you're the best. When we are a) in a more reasonable country together b) I am over the age of 21, I will totally buy you a beer.

19:54 That multiple choice didn't work out quite as well as I had hoped, but you get the point.

19:54 callen: Raynes: I was praising him for it the other way. I'm using it in the Korma example for Clojure Cookbook.

19:54 Raynes: Buy him alcohol for me, please.

19:55 callen: Isn't he in Limey-land?

19:55 Raynes: *shrug*

19:56 If he is in Britain then I do not need you to buy alcohol for him, as I am of age to do so.

19:57 callen: >18 year olds are far more mature in England, obviously.

19:57 technomancy: do they not get treated like children there?

19:57 Raynes: They instantly become so the moment they cross continental boundaries into the UK areas.

19:57 technomancy: or are children just more mature there

20:00 http://p.hagelb.org/mystery.gif

20:02 brehaut: just very drunk children

20:02 (based on NZ which is also grog at 18)

20:03 callen: kiwis have such twee slang.

20:03 brehaut: grog is twee?

20:04 AimHere: Sure it is

20:05 It might have been what gruff macho manly-men said back when they were pirates on the high seas, but now it's talk-like-a-pirate-day-style whimsical...

20:06 callen: ^^ twoof.

20:10 brehaut: i guess if bad beer is bud or miller, you dont need a word like grog any more

20:10 technomancy: doesn't grog specifically refer to a mixture of rum and water?

20:10 brehaut: probably

20:11 but its a suitable stand in for any lowish alchohol nastiness

20:11 some beverages shouldnt be allowed to be called beer.

20:12 the germans were on the right track there

20:14 (side rant: one of the most popular beers here claims to be an IPA. It's not even an ale)

20:14 Raynes: brehaut: Beer snob.

20:14 brehaut: Raynes: damn right

20:15 Raynes: brehaut: I had a pretty craptastic beer recently.

20:15 Can't remember the name at the moment.

20:15 I should have immediately complained to you about it.

20:15 brehaut: ha

20:15 noprompt: yeah, beer is one of those things i don't fool around with. either you get it right or you don't get it all.

20:16 don't show up to my house with a sixer of some low brow beer.

20:16 nkozo: there is some inter-thread Queue you can use with java.nio.channels.Selector ?

20:17 brehaut: noprompt: surely that would be a low brau beer

20:17 Raynes: noprompt: I won't show up at your house with any beer.

20:17 Seeing as how the USA does not deem me appropriate to purchase it. :)

20:17 * Raynes grumbles and mutters profanity under his breath.

20:17 noprompt: Raynes: true but you can die for it.

20:18 the country that is.

20:18 die for your country.

20:18 rasmusto: Raynes: you're just a yuengling

20:18 Raynes: noprompt: I was about to say that with you saying I can die for beer, I'm probably not going to show up at your house at all :P

20:18 TEttinger: I just this year became allowed to rent a car! Haven't tried, but I think the requirement is 25 years

20:18 noprompt: rasmusto: yuengling? is that like a mashup of young and juggling?

20:19 rasmusto: noprompt: it's a beer, and a pun

20:19 technomancy: TEttinger: it's all downhill from here till the AARP

20:19 TEttinger: chinese german beer, right?

20:19 technomancy, ha I thought you said ARRP

20:19 noprompt: Raynes: that's probably true. who wants a free bag of oranges anyway.

20:19 TEttinger: &google annual roguelike release party

20:19 lazybot: java.lang.RuntimeException: Unable to resolve symbol: google in this context

20:19 noprompt: the AARPANET

20:19 TEttinger: $google annual roguelike release party

20:19 lazybot: [The annual roguelike release party - RogueBasin] http://roguebasin.roguelikedevelopment.org/index.php?title=The_annual_roguelike_release_party

20:20 chrisrossi: oh man, that's good. (aarpanet)

20:31 hyPiRion: What a strange country. We can rent cars when we're 18 over here

20:32 callen: TEttinger: what country are you in?

20:32 noonian: we can crash cars where we're 16 over here!

20:32 TEttinger: callen, US

20:32 callen: TEttinger: lol, you can rent cars before you're 25.

20:32 TEttinger: I rented a car 3 times before I turned 25.

20:32 you just pay more.

20:32 TEttinger: THEY LIED TO MEEEE

20:33 callen: yeah, they did.

20:33 some rental companies might have different policies, but I've rented from large and small car rental companies before I was 25

20:33 once when I was 18, then 21, then 24

20:34 motorcycle rental places are a lot less likely to rent to people under 25 for good reasons, but it's not a law, just a matter of policy and what they've worked out with their insurance company.

20:34 most insurance companies have surcharges in their agreements with the rental places to cover people under 25 and under 21.

20:34 you just pay the surcharge.

20:34 unless the rental company doesn't want to bother at all, but that's when you call a *different* company.

20:35 'Murica. Freedom through money.

20:35 If you'd like any advice on how to import pallets of vodka from Russia through Tel Aviv at the age of 16, ping me.

20:47 demosthenes: hi

20:53 dnolen: Bronsa: ping

20:53 Bronsa: dnolen: pong

20:53 dnolen: Bronsa: so I think we're still using the clojure reader in CLJS in one place

20:53 is clojure.tools.reader.reader-types/indexing-push-back-reader equivalent to clojure.lang.LineNumberingPushbackReader?

20:54 demosthenes: is clojure like haskell

20:54 TEttinger: demosthenes, yes and no.

20:54 Bronsa: dnolen: it provides the same functionalities, yes

20:54 havenwood: demosthenes: in many ways

20:54 dnolen: k

20:56 chord: starcraft

20:57 muhoo: chord: dude, let it drop

20:57 demosthenes: wat about starcraf

20:59 chord: is there a clojure game development tutorial

20:59 muhoo: chord: http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html ?

21:01 chord: so how the hell do I create an opengl window on linux with clojure

21:01 OtherRaven: chord: use lwjgl

21:01 TEttinger: demosthenes: http://bestinclassblog.tumblr.com/post/21867047812/pitting-j-against-haskell-clojure is a decent comparison

21:02 OtherRaven: or one of the other java wrappers for openGL

21:02 brehaut: http://briancarper.net/blog/520/making-an-rpg-in-clojure-part-one-of-many

21:02 chord: OtherRaven: NO I AM A MAN I DO THINGS FROM SCRATCH I DON'T USE BLOATED LIBRARIES

21:03 dnolen: Bronsa: thx

21:03 OtherRaven: chord: lwjgl is actually very lightweight

21:03 brehaut: chord: this is the wrong channel, you are looking for #x86asm

21:04 chord: I want to know how to open an opengl window in linux, I know how to do this with win32sdk and c++ in Windows

21:04 But since I'm assuming you guys are dumb enough to run Windows I can't gloat showing you my game if its not running under linux

21:05 Bronsa: dnolen: you'll proabaly need a bit of more boilerplate if you're going to construct if from a io/reader

21:05 Cua: is this a new kind of trolling?

21:05 brehaut: Cua: sadly not new

21:05 dnolen: Bronsa: man, getting line number with mismatched parens is SOOOOO AWESOME

21:05 OtherRaven: Cua: I think so

21:05 Bronsa: dnolen: heh

21:05 dnolen: Bronsa: the error is missing a space

21:05 brehaut: Cua: been going on a couple of weeks now

21:05 dnolen: Caused by: clojure.lang.ExceptionInfo: EOF while reading, starting at line2065 {:column 1, :line 7529, :type :reader-exception}

21:05 Bronsa: ^

21:06 Bronsa: oh

21:06 Cua: sad er

21:06 OtherRaven: Every channel needs a troll. It's, like, a rule somewhere.

21:06 dnolen: bbiab

21:07 * Cua lurks to continue crunching clojure's docs

21:07 Bronsa: dnolen: fixed, thanks

21:08 dnolen: Bronsa: what I have to do to communicate the file?

21:08 Bronsa: catch and add that information?

21:09 Bronsa: gotta run for a bit, but I'd like to know what the best way to communicate the file w/ the error would be in your opinion, back in 30 or so

21:11 Bronsa: dnolen: sorry, I'm going to bed (2:40 am here); tomorrow I'll see if I can put file info in the reader-error automatically when reading from an input-stream

21:15 olegon: Morgawr, Clojure is a awesome language ((:

21:16 Morgawr: olegon: yep it is indeed

21:16 olegon: My first lisp like language. Do you recommend any book?

21:16 Morgawr: olegon: http://clojure.org/books

21:17 I recommend the O'reilly one called "Clojure Programming"

21:17 it's really well written

21:17 anyhow rushing to bed now, nn ;)

21:17 olegon: and this one: http://deptinfo.unice.fr/~roy/sicp.pdf?

21:19 AimHere: olegon, that's a classic, but be warned, it's not Clojure, so the examples won't work

21:20 timvisher: so is there anyway to require an ns that wasn't in the `(ns ...` form at compile time without recompiling everything?

21:20 in clojurescript, I should say. :)

21:20 olegon: I wanna learn more about functional languages/LISP. I think it's better than studying clojure. D:

21:20 Agreed?

21:20 AimHere: Well in that case, SICP is probably as good a place to start as any

21:20 timvisher: because i have to wait 45 minutes every time I recompile and that really puts a damper on things :\

21:22 olegon: would you say you're pretty hand with the maths?

21:22 i found SICP difficult as I'm not so handy with them. :D

21:23 AimHere: That's a point, SICP needs some familiarity with some basic calculus and whatnot

21:23 At least for some parts of it

21:25 olegon: timvisher, I just finished highschool, but I love programming and math, hm.

21:26 timvisher: olegon: then the maths may be fresher for you than they were for me when i attempted to make my way through it. i will say that whether you can make it through the book or not you should _totally_ watch the course. amazing stuff.

21:28 dnolen: timvisher: it won't recompile everything if you're using auto builds

21:30 olegon: timvisher, I understand some concepts of functional languages like immutable data, recursion, high order functions, currying, composition. I started programming in Haskell, but some concepts like functor, monads are strange for me.

21:31 timvisher: olegon: functional programming is easy. it's just programming without state. it's all the stuff that falls out of doing that that can be tricky and rewarding to wrap your head around. :)

21:31 olegon: I started a game with JavaScript using WebGL and WebSockets using a functional library called UnderscoreJS. Now, I wanna learn ClojureScript to create a game because Clojure is really a functioan language.

21:32 With CLojure, I think I'll create a better design with less side effect.

21:32 hm

21:32 timvisher: dnolen: that is something i haven't tried yet. i should get me some cljsbuild auto going

21:34 olegon: timvisher, but I think that Clojure can be a "hard language" to make a game. How can I create a game without state? D:

21:35 timvisher: olegon: sounds like you should check out Land of Lisp

21:35 :)

21:35 olegon: There's a lot of state and events. ;~

21:35 AimHere: Clojure can do state, there's just a few hoops to jump though

21:35 timvisher: but clojure is also eminently practical and admits wholeheartedly that state is useful

21:36 AimHere: And you can always just cart the 'state' about in a function that just takes the player input and returns a function with the next game-state, if you're feeling intrepid!

21:37 timvisher: ,,monads

21:37 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: monads in this context, compiling:(NO_SOURCE_PATH:0:0)>

21:37 timvisher: heh

21:38 olegon: I'm confused. I create a function cons in my library. It takes a object and a array and return a new array. Cons is a pure function, but I use "array = cons(value, array);"

21:38 It's idiot, I think.

21:39 I need some state. I used cons to add a new connection (new socket) in a array of connections.

21:40 noprompt: AHHHHH YEAH!

21:40 just cut [garden "1.0.0"]!

21:40 timvisher: dnolen: every considered coming down to the Clojadelphia meetups in Philly?

21:40 * noprompt is so excited.

21:40 noprompt: now with CLJS support!

21:41 and a snarky new line on the README

21:41 "It is designed for stylesheet authors who are interested in what's possible when you trade a preprocessor for a programming language."

21:41 * timvisher high fives noprompt with wild abandon, hollering at the moon in glee!

21:42 * noprompt returns timvisher's high five with a high ten and a chest bump.

21:42 noprompt: lol

21:42 ... there are some breaking changes though.

21:43 * timvisher appreciates the bro lovin' 'er now-en-then

21:51 muhoo: noprompt: so, garden as a replacement for, say, less?

21:52 noprompt: muhoo: absolutely.

21:52 muhoo: but not totally.

21:53 muhoo: that is, it's not a preprocessor. it's a library with a compiler and a few functions.

21:53 muhoo: it's totally bullshit free.

21:54 muhoo: unfortunately, there are no third party libs for it.

21:54 muhoo: nice, thanks

21:55 Bronsa: dnolen: I'm pushing a commit for tools.reader that makes file-info available for reader-errors

22:02 noprompt: muhoo: in short. it's awesome. it's what Sass, Less, etc. will never be until they have proper namespaces, functions, and data structures, which, lets face it, will be *never*.

22:05 chord: ok did some research

22:05 I need to use JOGL

22:05 is that right?

22:09 Bronsa: dnolen: you can update to tools.reader 0.7.8 once it hits maven, then apply http://sprunge.us/VjYU and you'll have file info in the ex-data

22:33 kennylovesroaste: olegon: think about your goals and not your language

22:54 ivan: where did https://github.com/evanescence/test2 go?

23:03 logic_prog: anyone know of a decent alternative to domina?

23:16 TEttinger: ivan: https://github.com/brandonbloom/test2

23:16 ivan: ah, thanks

23:17 TEttinger: just guessing

23:17 I don't actually know if it's the right one

23:17 ivan: it is

23:17 Google doesn't seem to index github in a timely manner

23:18 TEttinger: I used github to search for: test2 clojure

23:18 ivan: ah

23:18 TEttinger: OtherRaven: Do you use LWJGL?

23:22 chord: installing jdk for linux right now

23:22 you guys thought I would fail at clojure

23:22 YOU ARE WRONG

23:22 Kelet: Nah, I know you'll raise to fame and make a starcraft clone

23:22 sinistersnare: chord: have you been seriously chat spamming this for so long, and are finally learning to program?

23:23 no, hes used fancy words, hes just a troll

23:23 chord: sinistersnare: I just finished recently reading "Learning You A Haskell"

23:24 sinistersnare: its only now that I have free time to move onto clojure

23:24 Kelet: Why don't you make a starcraft clone in Haskell?

23:24 brehaut: i just finished Harry Potter: does that make me a wizard?

23:24 sinistersnare: ok well im done talking to you, after you trolled #haskell , i dont want part of this

23:24 chord: Kelet: if you guys are all experts at Haskell then there is no problem in recruiting you all to help, but thats not the case

23:25 sinistersnare: in more quisitive news, im a clojure newbie, and am wondering if any one yall would like to help improve this article on Libgdx using Clojure https://github.com/libgdx/libgdx/wiki/Using-libgdx-with-Clojure

23:25 on the official Libgdx wiki

23:26 chord: brehaut: which kind of wizard

23:27 brehaut: sinistersnare: have you seen brian carpers blog post (which is quite old now)

23:27 TEttinger: the RPG one?

23:27 brehaut: yeah that one

23:27 TEttinger: have you seen the cyber dungeon quest article on entity systems in clojure?

23:27 $google resatori entity clojure

23:27 lazybot: [Clojure Entity Component System | resatori] http://resatori.com/clojure-entity-component-system

23:27 brehaut: that vaguely rings bells but i cant place it

23:28 TEttinger: it's pretty slick

23:29 sinistersnare: brehaut: nope, cant seem to find it on his blog either

23:29 brehaut: sinistersnare: http://briancarper.net/blog/520/making-an-rpg-in-clojure-part-one-of-many

23:29 part one of one though

23:29 chord: brehaut: so are we forming a project together to make an rpg in clojure?

23:29 brehaut: am I allowed in?

23:31 sinistersnare: brehaut: that seems pretty cool

23:31 brehaut: yeah

23:31 modulo really old clojure stuff

23:31 sinistersnare: do you have any advice on unidiomatic clojure i used with the article?

23:31 brehaut: not really sorry

23:31 sinistersnare: its ok :)

23:31 brehaut: (its the work day here)

23:31 kennylovesroaste: an open rpg would rock

23:32 how about little goals

23:32 _scape: ,(map #(conj % 1) (partition 3 [0 0 0 1 1 1]))

23:32 clojurebot: ((1 0 0 0) (1 1 1 1))

23:32 _scape: why is it adding it to the front of each seq?

23:32 brehaut: _scape: seqs (and lists) conj on the front, vectors conj on the end

23:32 TEttinger: _scape: that's the behavior of conj with seqs

23:32 _scape: oh, ok

23:33 should i use rseq or reverse then?

23:33 TEttinger: ,(map #(concat % [1]) (partition 3 [0 0 0 1 1 1]))

23:33 clojurebot: ((0 0 0 1) (1 1 1 1))

23:33 brehaut: mapcat

23:33 kennylovesroaste: lispy languages are great for open environments

23:33 _scape: thanks

23:33 what's the reasoning for having it different?

23:34 brehaut: actually probabnoy not mapcat. what am i saying

23:35 _scape: appending to the front is the natural (and cheap) operation for lists. they are single ended, singled linked. to do other wise would require walking through the whole list

23:35 _scape: vectors on the other hand are designed using a hash trei internally which makes appending to the end cheap

23:35 TEttinger: trie or tree?

23:35 noonian: sinistersnare: its a lot of java access from clojure, but the only thing that stuck out to me was the (def ..) inside (def main-screen ...)

23:35 brehaut: trie

23:35 kennylovesroaste: chord: i'm interested in an rpg

23:35 brehaut: sorry typoed

23:36 TEttinger: noonian: hey I was wondering if my code was wrong in there too

23:36 chord: kennylovesroaste: brehaut is ignoring me on rpg question

23:36 kennylovesroaste: chord: : start off small with good ideas

23:36 sinistersnare: kennylovesroaste: hes a troll i think

23:36 hes trolled #haskell too, and a couple other chans from what i hear

23:36 tbaldridge: kennylovesroaste: yeah, he's a troll ignore him

23:36 kennylovesroaste: tbaldridge: : who's a troll?

23:36 tbaldridge: kennylovesroaste: chord

23:36 _scape: thx brehaut

23:36 kennylovesroaste: oh

23:36 chord: they are taking things out of context

23:36 kennylovesroaste: i'm mostly interested in AI

23:37 TEttinger: kennylovesroaste, I'm actually working on an RPG as well. it uses libGDX, which is why sinistersnare's tutorial is handy for me

23:37 nDuff: Hmm; I've got some incompatibilities between modern cljs (1889) and 1443.

23:37 kennylovesroaste: and simulation

23:37 sinistersnare: noonian: thats true, i think it could go in the let form

23:37 kennylovesroaste: TEttinger: : I don't care about grafiix

23:37 TEttinger: : more AI simulation

23:37 noonian: TEttinger: what code is that?

23:37 nDuff: ...well, might try to pin them down this weekend or so.

23:37 sinistersnare: TEttinger: :) i dont do a ton of game dev myself, but i love working with and talking about libgdx :)

23:37 brehaut: _scape: http://hypirion.com/musings/understanding-persistent-vector-pt-1

23:37 TEttinger: noonian, uh, it's very similar to sinistersnare's. let me get the repo

23:38 kennylovesroaste: here's the thing, graphics are such a great undertaking, that I'm more interested in cool AI techniques

23:38 sinistersnare: noonian: would putting it in the let form work with the forward declaration (declare ^Stage stage) ?

23:38 kennylovesroaste: then move to 2d, then 3d

23:38 start small

23:38 as in flocking techniques, personalities, etc..

23:38 noonian: sinistersnare: no, but do you need that? it doesn't look like anything in that file refers to a top level stage

23:39 TEttinger: https://github.com/tommyettinger/dungeon-kingpin/blob/master/src/dk/DKGame.clj#L40 uh here's mine. total mess.

23:39 kennylovesroaste: clojure is about small enginges

23:39 engines

23:39 sinistersnare: no thats a good point, noonian. thanks :)

23:39 noonian: sinistersnare: hehe, any time

23:39 kennylovesroaste: so if anybody is interested in entity graphs, i'm interested too

23:42 sinistersnare: ok im going to bed, thanks all for your time! and the wiki is publicly editable if yall wanna make some changes, id really appreciate it!

23:42 _scape: link me

23:42 sinsnare|zzZZzz: _scape: https://github.com/libgdx/libgdx/wiki/Using-libgdx-with-Clojure

23:42 _scape: thanks

23:42 sinsnare|zzZZzz: if you were referring to me :p

23:42 chord: holy shit is starting a clojure program of eclipse suppose to be this slow?

23:42 is that normal

23:43 noonian: TEttinger: lots of nested defs :p

23:43 Cua: this channel has no policy regarding blantant trolling?

23:43 brehaut: Cua: we have practically no ops

23:43 Cua: just use your own ignore list

23:44 Cua: okay, but I still see replies to him from other

23:44 brehaut: yeah. sorry

23:44 TEttinger: we're helpless and defenseless other than ignore lists. obviously it makes trolls feel like they have some power to make a tiny mess of channels full of smart people.

23:44 scottj: Cua: /ignore -replies chord will help with replies that mention him

23:44 _scape: sinsnare|zzZZzz: yes :) i put up a tut as well, didn't know this existed! http://blog.juncoapps.com

23:44 Cua: sigh, okay

23:44 scottj: thank

23:45 chord: why are you guys all mad at me for trying to make a starcraft clone in clojure

23:45 TEttinger: thanks _scape

23:46 sinsnare|zzZZzz: _scape: oh ive seen that! i have seen a lot of libgdx clojure stuff, but i really wanted something on the official wiki so that there is a trusted and up to date source of information

23:46 _scape: chord: i'm with you :D

23:46 sinsnare|zzZZzz: i gotcha, makes sense

23:46 sinsnare|zzZZzz: ok i actually have to go :p see yall later!

23:47 noonian: I wonder if that would run on android

23:47 _scape: i got it to

23:47 noonian: nice!

23:47 _scape: ran well too, on nexus 7 v1

23:47 clojurebot: excusez-moi

23:48 chord: _scape: www.artillery.com

23:49 _scape: is that in clojure?

23:50 chord: no

23:50 but if they can do that

23:50 _scape: yea

23:51 i'm actually building something similar in clojure, not planning it to be as fast paced, thinking of using ring for serverside communication

23:51 no dev tools though :D

23:52 chord: _scape so you making a starcraft clone in clojure?

23:52 noonian: /facepalm

23:53 _scape: no, chord, but RTS and future setting-- not sure that qualifies as a 'clone' since I envision it much differently

23:54 chord: _scape: what path finding algorithm are you using?

23:54 _scape: yet to be programmed, thinking of using fringe

23:56 chord: _scape: do you know what modern rts games use for path finding?

23:57 _scape: usually a mix, amit's break down is rather concise

23:57 chord: _scape: amit what?

23:58 _scape: http://theory.stanford.edu/~amitp/GameProgramming/ nice little break down, there are a few other decent links out there as well

23:58 gotta split! later chord

23:59 chord: NO

Logging service provided by n01se.net