#clojure log - Sep 30 2013

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

0:00 ddellacosta: yes, but I'm really just testing existence in this specific instance, so could work.

0:04 also, regarding something that returns the first item that satisfies a predicate, I suppose since filter is lazy, you could just take 1

0:05 TEttinger: (fn [pred coll] (when (seq coll) (if (pred (first coll)) (first coll) (recur pred (next coll))))) does the same -- the source of some, that returns nil or the first match

0:06 ,((fn [pred coll] (when (seq coll) (if (pred (first coll)) (first coll) (recur pred (next coll))))) even? [1 3 5 7 9 4 6])

0:06 clojurebot: 4

0:06 TEttinger: ,((fn [pred coll] (when (seq coll) (if (pred (first coll)) (first coll) (recur pred (next coll))))) even? [1 3 5 7 9])

0:06 clojurebot: nil

0:31 marcopolo2: So I'm trying to understand pr-str in cljs, (pr-str [1,2,3]) => "[#<Array [1, 2, 3, 4]>]" , which can't be read by cljs.reader/read-string, shouldn't it return "[1,2,3,4]"?

0:31 ,(pr-str [1,2,3])

0:31 clojurebot: "[1 2 3]"

0:33 jonasen: marcopolo2: (pr-str [1 2 3 4]) returns "[1 2 3 4]" for me. What version of cljs are you using?

0:33 marcopolo2: jonasen: 0.0-1859

0:34 jonasen: try calling cljs.core.pr_str.call(null,[1,2,3])

0:34 jonasen: in the console, what do you get?

0:35 mullr_: I get "[1 2 3 4]" with 1909

0:35 jonasen: marcopolo2: [1,2,3] in that context is not a clojure vector, it's an java array

0:35 marcopolo2: jonasen: you're right, cljs.core.pr_str.call(null,cljs.core.vector.call(null,[1,2,3,4])) that is a vector

0:36 jonasen: s/java/javascript

0:36 marcopolo2: mullr_: I'm using core.async which I don't think has been updated to the newer cljs version

0:37 jonasen: marcopolo2: the newest cljs version works fine with core.async: http://cljsfiddle.net/fiddle/jonase.snake

0:39 marcopolo2: clojurescript version 0.0-1909 and core.async 0.1.242.0-44b1e3-alpha

0:40 marcopolo2: jonasen: kudos on cljsfiddle, I was using it earlier! Did you do something special with core.async, because other people had troubles too: https://groups.google.com/forum/#!topic/clojurescript/JxAxK4_cEyM

0:41 jonasen: marcopolo2: not that he was using 0.0-1889 and not 0.0-1909

0:41 s/not/note

0:42 marcopolo2: jonasen: Huh, thought it was core.async's fault

0:42 jonasen: Let me update cljs, thanks!

0:42 Now I can get sourcemaps again :)

0:46 jonasen: You're using core.async version:0.1.242.0-44b1e3-alpha

0:47 jonasen: marcopolo2: yes

0:48 and I had to explicitly include [org.clojure/tools.reader "0.7.8"] in my :dependencies

0:48 otherwise it pulled the wrong version for some reason

0:50 marcopolo2: jonasen: weird... maybe a some dependency is loading an older version?

0:55 jonasen: Figured it out, I had a js array sneak in there

0:55 jonasen: thank you

1:05 chord: anyone going to help with game yet?

1:20 channel dead

1:20 please someone tell me channel is not dead

1:21 what happened with split?

1:26 you guys are all stupid and dumb

1:28 nightfly: do your own work

1:28 come ask for help when you actually have something real to show

1:29 chord: nightfly so lets talk about diablo 3 then

1:29 you like diablo 3?

1:30 mullr_: I don't think the channel is entirely dead, merely lacking a pertinent topic.

1:32 chord: mullr_ work with me help me revive the channel

1:32 i'm so bored

1:32 mullr_: If you're bored, I recommend http://projecteuler.net/

1:36 chord: mullr_ I've already got A* on the queue that fixes programming boredom, but for non programming boredom there is nothing so i'm bored

1:36 mullr_: very well, then I suggest /r/bored. Beyond that, you may have to look elsewhere.

1:37 chord: mullr_ work with me here, whats your favorite video game

1:37 dissipate: not the star craft crap again...

1:37 i

1:38 am so sick of that

1:38 mullr_: chord: Not trying to be antisocial, but I imagine the channel denizens would appreciate it if most chatter was on topic.

1:38 dissipate: mullr_, he wants to make a starcraft clone in clojure

1:39 chord: mullr_ channel dead they're not even watching this window so it doesn't matter what we talk about

1:39 mullr_: dissipate: In this case I look forward to the demo

1:39 chord: FINALLY someone who doesn't hate starcraft

1:44 mullr_ what projects have you worked on

1:45 mullr_: mullr_: In clojure? This and that. Some NLP / web data extraction, currently doing parser work. Outside of that, spent a lot of time doing consumer photo software. Yourself?

1:46 chord: mullr_ I'm a loser who gets no respect from this channel

1:48 mullr_: chord: I'm going to go out on a limb here and assume I'm not just feeding the trolls. What have you worked on?

1:48 chord: www.github.com/chord-rts/rts

1:49 mullr_: A noble goal, if far from a starcraft clone

1:49 chord: mullr_ i just learned how to make a window

1:50 mullr_ these assholes in this channel won't help me get it to a full blown starcraft clone

1:50 TEttinger: mullr_: http://replygif.net/i/149.gif

1:50 mullr_: chord: What's your programming background?

1:51 chord: This asshole isn't going to help you either...

1:51 chord: I use Go but I got banned from #go-nuts, then I read learn you a haskell but I got banned from #haskell, so that meant couldn't make a game in Go or haskell, so i came to this channel

1:52 also got banned from #python and #ruby

1:52 so clojure is my only language that I can use to assemble a team

1:52 mullr_: And this is the day I got trolled on #clojure. Welcome to IRC, me! We're done here.

1:52 chord: mullr_ no bro I've changed

1:53 TEttinger: mullr_, /ignore has been wonderful for this

1:53 chord: mullr_ I don't troll anymore the code I showed you is proof that I've changed

1:53 dissipate: is there a failure here to ban trolls?

1:53 mullr_: done

1:53 TEttinger: he's used different IPs.

1:53 chord: mullr_ come on bro I'm going to implement an A* demo to prove that I'm not trolling anymore

1:53 mullr_: merely a failure to avoid feeding them, I apologize.

1:54 TEttinger: it's fine

1:54 chord: *cry cry cry* nobody likes me anymore *cry cry cyr*

1:54 TEttinger: *@*ip.50.47.83.14 is what I use for the filter

1:56 mullr_, I'm curious about this parser work. Do you use instaparse?

1:57 mullr_: TEttinger: I'm in clojurescript, so I've been rolling my own. I have some unique requirements as well… I'm trying to get good integration with Codemirror, both syntax highlighting and completion

1:58 in principle instaparse would be quite good at this, or at least the parsing with derivatives idea in general, since it reifies its parser state so clearly

1:58 TEttinger: I know some of these words

1:59 parsing is pretty over my head at this point

1:59 mullr_: hehe, sorry, I've been working on this for some time and tend to get caught up in it

1:59 chord: mullr_ if I get a demo of A* working will you help with starcraft clone project?

1:59 mullr_: There's a good talk on the theory instaparse is based on, if you're interested: http://www.youtube.com/watch?v=ZzsK8Am6dKU

1:59 TEttinger: I've been wondering about clojure-in-clojure and how it could work on a different platform, like luajit

1:59 mullr_: although that's not exactly what I'm using

2:00 TEttinger: what do you mean?

2:01 TEttinger: well outputting instead of JS, Lua, but since lua only has one data structure, it could use luajit's FFI types to have some data types implemented in C to use in clojure

2:01 ambrosebs: isn't there a lua target already?

2:01 TEttinger: the advantage would be easier interop with C in a dynamic way, I think.

2:02 :D

2:02 mullr_: https://github.com/takeoutweight/clojure-scheme may meet some of the same goals

2:03 Indeed, https://github.com/raph-amiard/clojurescript-lua at least exists

2:04 TEttinger: mullr_, beat me to it :)

2:04 muhoo: for some reason i think the official music of lua should be goa

2:04 dissipate: mullr_, why not just compile for LLVM?

2:06 TEttinger: dissipate: was that meant for me? I do think LLVM is excellent, but so is LuaJIT

2:06 LLVM has some issues running on windows last I checked, or at least clang did

2:06 dissipate: TEttinger, with LLVM, clojure could compete with the GHC.

2:07 TEttinger: dissipate, hell it could interoperate

2:07 mullr_: dissipate: Huh? You mean clojure code? Well, none of these projects are mine, but I'm sure someone's doing that too. The trouble with all these things is that clojure really wants a JIT with method inlining and puts lots of pressure on the GC.

2:07 TEttinger: F# has an LLVM port too

2:07 dissipate: TEttinger, i read GC support in LLVM is bad though

2:08 TEttinger: might be better to do it in LuaJIT, since you could (and someone already has) reused so much of cljs

2:08 I imagine targeting lua is much easier than targeting llvm opcodes

2:09 dissipate: mullr_, i see. i wonder how good the GC will be on LLVM

2:09 TEttinger, but you get good optimization on LLVM, no?

2:10 TEttinger: I think on both

2:10 LuaJIT is scary fast, I've had it occasionally outpace MSVC even with aggressive optimization

2:11 dissipate: TEttinger, what architectures are supported for LuaJIT?

2:11 TEttinger: a lot now.

2:11 ARM and PPC as well as all common desktop arches

2:11 mullr_: LLVM will give you *static* optimization. Clojure's design relies on the fact that virtual method calls will be optimized at runtime.

2:12 Pupnik__: TEttinger: are you volunteering to write a lua output for the cljs compiuler :)

2:12 TEttinger: Pupnik__, I have a starcraft clone to right first

2:12 *write

2:12 mullr_: no way, I'm writing it first :)

2:12 alisdair: TEttinger: it's ok, he's doing it in #erlang now

2:13 TEttinger: alisdair, thank you, you are an angel

2:13 dissipate: mullr_, what about clojure on the parrot vm?

2:13 mullr_: beats me, I know very little about parrot.

2:13 TEttinger: parrot has some issues with speed I think

2:13 dissipate: mullr_, i think one of the main Perl 6 compilers is for parrot

2:13 mullr_: Here's an interesting through experiment: if you were to design a VM especially for clojure, what would it look like? How would it be different from other VMs and why?

2:13 s/through/thought/

2:13 TEttinger: I seem to recall they changed the way you called the VM so many times, that only Perl 6 could keep up with the changes

2:14 clojurebot: Titim gan éirí ort.

2:14 chord: alisdair wtf are you stalking me?

2:14 TEttinger: mullr_, ooh.

2:14 alisdair: no i was in #erlang when you joined

2:14 dissipate: mullr_, it could be a self hosted VM.

2:15 TEttinger: honestly, clojurescript comes close already, since it runs, everywhere.

2:15 which I think is the main demand

2:15 and the hardest thing, really

2:15 mullr_: For reference, see http://www.cs.utah.edu/~mflatt/past-courses/cs6510/public_html/lispm.pdf, but also consider how immutably mostly everywhere can affect the garbage collector

2:16 TEttinger: mullr_, I think clojure really can use mutability for some things though

2:16 dissipate: TEttinger, yeah, but javascript is not desirable as a target, is it?

2:16 TEttinger: dissipate, maybe. a lot of things do target it

2:16 $google altjs

2:16 lazybot: [altJS - Web coding without JavaScript.] http://altjs.org/

2:16 dissipate: TEttinger, yes, almost every language does.

2:17 TEttinger, or rather there is a language X to JS compiler for almost every language X

2:17 mullr_: TEttinger: *mostly*. I think a garbage collector that assumes everything is mutable is quite different than one that assumes most things are immutable. I particular, you can't build circular references out of immutable parts and thus can in principle use a native reference counting scheme with no chance of error.

2:17 TEttinger: heh indeed

2:17 mullr_: *in*

2:17 *naive*

2:18 dissipate: mullr_, that's a great point, i never realized that.

2:18 mullr_, since the JVM assumes mutability, it is not optimized for immutable data structures

2:19 mullr_: dissipate: When you read about garbage collectors, they're mostly worried about cycles and about things changing out from under you; neither if which is a problem in immutable-land. But this is just a thought, not the result of experience or experiment.

2:20 TEttinger: dissipate, this could be very cool. the problem is you need to interop with mutable state in some way for most programs, and the OS probably isn't using CLJVM-compatible concurrency primitives for OpenGL access or whatever

2:20 Pupnik__: TEttinger: if that lua target for the cljs compiler just outputs plain old lua theres nothing stopping you frmo running it on luajit

2:20 dissipate: TEttinger, what do you think about switching browsers over to a bytecode based virtual machine that can access the DOM? forget about javascript.

2:20 Pupnik__: since it targets 5.1

2:21 TEttinger: dissipate, oh man I have thought about alternate internet formats for a little while now

2:21 it's all pie-in-the-sky, but it has a lot of potential

2:22 (that would never kick in unless there's some SOPA-style crippling regulation on the WWW)

2:22 dissipate: TEttinger, what do you think of just streaming instructions?

2:23 browsers would just be sandboxed thin apps that received instructions on the fly

2:27 TEttinger: I was thinking of a more declarative format, I dunno. Something that can be stored entirely on the client-side and thus be hosted by peers as well as servers

2:28 dissipate: TEttinger, S expressions no doubt

2:28 TEttinger: you bet.

2:29 the other advantage to using an S-Exp-based web format is how easily they could be piped from webpage to webpage

2:29 dissipate: TEttinger, you do know that the original author of javascript wanted to use Scheme, but that was rejected because it was too 'radical' of a language for developers?

2:29 TEttinger: yep

2:30 so he made a lot of scheme's qualities have a C-like syntax

2:30 dissipate: ok, just checking. :P

2:30 TEttinger: and then MS made VBScript and screwed up the net :P

2:30 "we can't be compatible, they're competitors!"

2:31 dissipate: i think the browser loading any kind of language is an old idea. i think it should all be some kind of bytecode. no more HTML, Javascript, CSS.

2:32 compile your stuff server side with whatever tools

2:32 TEttinger: I like the idea of clojailing everything and just executing clojure for webpages.

2:32 echo-area: Isn't javascript being described as "the assembly language" in clojurescript's introduction?

2:33 dissipate: echo-area, yes, that's precisely what i am getting at. javascript is just turning into a bytecode, or 'assembly'. might as well just replace it with bytecode and get rid of this language war nonsense.

2:35 Pupnik__: TEttinger: and peoples browser memory use will get even more crazy than it already is if they have to run JVMs instead of a JS vm

2:35 muhoo: idle wonderment: has anyone used instaparse to parse javascript and had it actually work?

2:37 dissipate: Pupnik__, i'm not talking about JVM. some other VM that can access the DOM directly.

2:37 TEttinger: dissipate, have you seen Google Native Client?

2:37 echo-area: dissipate: Maybe javascript would become the de facto "bytecode" language, because it's involved spontaneously

2:37 TEttinger: dissipate, I think that was in reference to when I said clojail, which uses the JVM

2:37 dissipate: TEttinger, nope, haven't tried it.

2:38 TEttinger: it's bytecode for chrome

2:38 and chromium

2:38 $google google native client

2:38 lazybot: [nativeclient - Native code for web apps - Google Project Hosting] http://code.google.com/p/nativeclient/

2:38 dissipate: echo-area, that's what is happening. except there is a faction of developers who like javascript and they think it should be the 'everywhere' language.

2:38 Cua: TEttinger: isn't it native code for the platform? x86/arm/etc..

2:38 where they use static analysis to make sure the binary behaves

2:38 dissipate: TEttinger, interesting. definitely checking it out.

2:39 echo-area: dissipate: Good to know

2:40 dissipate: TEttinger, looks like a competitor to asm js and HTML5

2:41 TEttinger: heh. but it is meant to port complex C/C++ apps to the browser

2:41 dissipate: TEttinger, yeah, the language restriction is lame.

2:41 TEttinger: by running x86 in the browser, effectively

2:41 dissipate: TEttinger, what about ARM for mobile devices?

2:42 TEttinger: I think it interprets it actually, but I don't really know

2:42 However, to run on different instruction set architectures (such as x86-32 and x86-64), you currently have to build and supply a separate .nexe file for each architecture. See target architectures for details about which .nexe files will run on which architectures. Portable Native Client will remove the requirement to build multiple .nexe files.

2:44 https://developers.google.com/native-client/announcements ah, they're getting close

2:44 PNaCl is basically sandboxed LLVM opcodes

2:45 dissipate: TEttinger, Sounds pretty restrictive. sure it has its use cases though.

2:45 TEttinger: yeah, Bastion ported a large SDL app with it

2:45 I think Bastion was monogame actually

3:41 sm0ke: hello i am opening a number of sockets using (with-open (repeatedly n (open-socket..))) but problem is close is not called on each sequence, any nice solution to this?

3:41 i mean not called on each item in sequence

3:43 mullr_: well, you'd want to do the open on the socket itself, not the sequence, right?

3:43 sm0ke: mullr_: yea i know whats wrong there..

3:44 mullr_: just want a elegant way to open multiple sockets

3:45 mullr_: Well, it's never easy to do that with open-socket unfortunately.

3:45 sorry, with-open

3:45 rhg^-1: pmap an anonymous function

3:45 mullr_: that's a good idea

3:46 sm0ke: the problem is that although i can call close on each one..but i also want to return something from the socket as functions return value

3:46 rhg^-1: I tend to hands those at 2am lol

3:46 sm0ke: so close cant be last statement

3:46 SegFaultAX: Using map for side-effects is an anti-pattern.

3:46 sm0ke: although i guess i can use try finally

3:46 rhg^-1: True

3:47 chord: So here is a question how do I do the pathfinding in starcraft 2

3:47 rhg^-1: do seq

3:47 SegFaultAX: chord: Start simple.

3:47 chord: SegFaultAX: how does that help

3:48 SegFaultAX: chord: Pathfinding on a large scale can be very challenging to do efficiently.

3:48 sm0ke: why is using map in side effect code an antipattern?

3:49 chord: SegFaultAX: I keep reading about A* on nav mesh, but what exactly does that mean

3:49 nightfly: I've wondered how path finding even works in a vector rather than a raster space

3:49 sm0ke: how will i generate a seq from each socket by reading data than?

3:49 metellus: sm0ke: map is lazy, so the side effects don't actually happen until the seq is realized

3:49 rhg^-1: It's for processing lists to lists

3:49 dobry-den: why not (let [result ...] (close-sockets) result)

3:49 sm0ke:

3:49 rhg^-1: Not effects

3:49 SegFaultAX: sm0ke: Why are you managing sockets directly?

3:49 rhg^-1: Semantics

3:49 chord: SegFaultAX: tell me that you're a path finding expert

3:50 sm0ke: dobry-den: thanks for that ugly tip :D :) gonna us that

3:50 use*

3:50 SegFaultAX: chord: I'm not, but used to work in games. That wasn't really my area, but incremental pathfinding was a challenge.

3:50 (Especially on relatively resource constrained mobile devices)

3:51 sm0ke: i guess i can use (for) instead of (map) for side effect code

3:51 hyPiRion: no

3:51 dobry-den: doseq

3:51 hyPiRion: ^

3:51 rhg^-1: ^

3:51 sm0ke: eee doseq doesnt 'yield' its just iteratoin right?

3:51 dobry-den: map and for will return a collection of intermediate values. doseq doesnt

3:51 sm0ke: why isnt there a yield in clojure

3:52 dobry-den: yes yes

3:52 dobry-den: well, if you have side-effect with a return value, i'd prob use for.

3:52 chord: SegFaultAX: what do you mean is a problem, starcraft 2 does pathfinding just fine it seems

3:52 sm0ke: dobry-den: thansk again for verifiying

3:53 hyPiRion: I'd probably use naov

3:53 mapv*

3:53 rhg^-1: I'd say it's a code smell

3:53 SegFaultAX: hyPiRion: Don't you hate when your fingers are a key off?

3:53 hyPiRion: SegFaultAX: haha, yeah

3:53 SegFaultAX: chord: I didn't say impossible, just challenging.

3:53 dobry-den: probably but sm0ke should prob arrive at version1.0 first

3:54 before dicking around with WWJD

3:54 sm0ke: whats WWJD?

3:54 SegFaultAX: I guessed "what would java do"

3:54 dobry-den: what would jesus do

3:54 sm0ke: Haha nice one...

3:55 WWSD: what would SegFaultAX do

3:55 rhg^-1: K...

3:55 SegFaultAX: sm0ke: Not manage sockets directly. Use a library.

3:55 rhg^-1: +1

3:56 sm0ke: SegFaultAX: sorry but imo thats superficial to say unless you dont know what i am doing

3:56 SegFaultAX: sm0ke: Unless you're writing a socket library, it doesn't really matter to me.

3:57 Managing socket pools or [insert resource here] pools in general is a solved problem, particularly in Java land.

3:57 chord: ok team here is a next group project: figure out how starcraft 2 does path finding then produce a proof of concept working example

3:57 ok teamt break lets go

3:57 sm0ke: i am just opening a number of ephermal sockets using (java.net.ServerSocket. 0) and getting their ports ... i'd say using a library for that is overkill

3:57 SegFaultAX: sm0ke: Ok, why are you doing this?

3:57 sm0ke: SegFaultAX: to get buch of free ports?

3:58 bunch*

3:58 dobry-den: (SocketServer. post) and then binding io/input-stream and io/output-stream to client sockets is pretty standard fare.

3:59 i think there's plenty of socket stuff you can do without needing a library

3:59 i thought java was the library

4:00 sm0ke: i agree...you can really make an irc client with a simple socket if you know what coming down the wire

4:00 dont need an irc library

4:00 dobry-den: yeah, so i imagine SegFaultAX is thinking of something more complex than some telnet shit

4:00 sm0ke: yes you never know WWSD

4:01 dobry-den: never a dull moment with WWSD

4:04 SegFaultAX: One of the traits I look for when hiring engineers is judgement. Some people like to use a library or framework for /everything/, others only when it's absolutely necessary (NIH syndrome). In my experience, discovering where someone falls on that continuum can tell you a lot about their judgement and overall experience.

4:05 dobry-den: in clojure, i find that it's too easy to find myself rolling everything myself.

4:06 shaving all the yaks

4:08 SegFaultAX: Well that's sorta my point though, part of growing as an engineer is learning how and when to pick your battles. No answer is objectively right in all situations, but knowing when to shave a yak or using a freshly shorn yak from someone else is an important skill.

4:08 Maybe one of /the/ important skills.

4:09 chord: starcraft 2 path finding

4:09 come on guys help me

4:09 just this one time

4:09 then you can ignore me

4:09 SegFaultAX: So yea, if you're bullshitting around and writing something for fun, whatever. If you're building something that you actually anticipate using or maintaining for any length of time, it might be worth the extra 5 minutes of googling to see if someone else has already shaved your yaks for you.

4:10 Jarda: SegFaultAX: but with clojure you can achieve what you need in 15-25 lines of code, instead of going through the code of someone else that does effectively the same that you try to accomplish

4:11 chord: Jarda: you are a path finding expert right

4:11 Jarda: like input validation etc. Everything I've found is so massive that I find it easier to just write 20 lines of own input validation logic

4:11 sm0ke: chord: hey who told you to write a game in clojure?

4:12 Jarda: than to use half an hour trying to find out how to implement

4:12 sm0ke: i really think thats a strange decision

4:12 chord: sm0ke: how the hell does starcraft 2 do pathfinding, its something to do with a* and nav mesh but its hard to find gritty details

4:12 sm0ke: chord: i dont know starcraft sorry

4:13 chord: sm0ke: but you know path finding

4:13 sm0ke: yea i find my way to home everyday :D

4:13 what kind of path finding you can use dijkastras?

4:14 chord: sm0ke: i'm talking about not on a grid but on a polygonal area

4:14 sm0ke: there are fancy things like a*..but thats when you have grid layout with abstacles

4:14 dobry-den: i can't tell if this constant chord/sc2 thing is an endless joke or if you're really staking out #clojure for the offchance someone can spill the beans on sc2 implementation.

4:14 SegFaultAX: Jarda: Again, knowing when to invent and when to reuse is a _skill_

4:15 chord: dobry-den: if you know how to do starcraft 2 like path finding i'm listening

4:15 sm0ke: wtf is pathfinding on plygon?

4:15 SegFaultAX: And it's very often that there isn't a right answer. Then you have to go on gut or team consensus.

4:15 chord: sm0ke: look in most modern 3d games you can move in any direction not just constrained to a grid right?

4:15 glosoli: hey folks, just want to make sure, the best way to check if something that should be a varchar field fetches from database is not nil, by invoking it as a parameter to nil?

4:15 Jarda: SegFaultAX: but in my short experience with clojure comparing to other languages I find doing stuff myself with clojure often quick and effective

4:16 because the syntax is so powerful

4:16 sm0ke: SegFaultAX: eee man we got your point but lets be realistic some an already written library is not the nest anwser..that it!

4:16 sometimes*

4:16 best*

4:16 crap

4:16 SegFaultAX: Jarda: Sure, but it's not just about LOC. You're also trading off productiveness, time spent debugging, documentation, etc.

4:17 chord: OK LOOK CLOJURE IS JUST GOOD CAN WE GO BACK TO STRARCRAFT 2 PATHFINDING PROBLEM

4:17 sm0ke: chord: yes but why dont you divide your map into sectors than its grid with abstacles!

4:17 dobry-den: glosoli: maybe if it's an assertion, but usually db-fetches are done in something like a (when-let [user (db/find-user id)] ...)

4:17 SegFaultAX: chord: Please stop spamming.

4:18 Jarda: SegFaultAX: yeah but if your code is there visible to you and it's not complex debuggin is easy. If you are using something off-the-shelf you have a black box you would have to dive into to understand what happens

4:18 chord: sm0ke: how does that give you paths with arbitrary angles

4:18 glosoli: dobry-den: well table row is retrieved just fine, it's just the case where I am interposing description field (varchar) which might be nil at some point, what I was doing at the moment is (when-not (nil?

4:19 Jarda: but yeah, I'm of course using ring and compojure and friends to not invent the (complex) wheels

4:19 SegFaultAX: Jarda: Well, that all depends. Anyway, you get the idea.

4:19 sm0ke: chord: no it wont but once you have a sector to sector path..you can take two sectors in a path and do fancy stuff with optimal direction

4:21 SegFaultAX: chord: Just pre-compute the path finding nodes for each map.

4:21 chord: SegFaultAX: and how does that help

4:21 dobry-den: glosoli: do you have a code example

4:22 SegFaultAX: chord: You don't need to do pixel perfect pathfinding (you wouldn't want to anyway, it's too expensive and the precision doesn't buy you anything)

4:23 chord: If you precompute the pf grid, it's much less expensive to do large scale pathing.

4:23 chord: SegFaultAX: I found a blog on it http://www.third-helix.com/2011/03/gdc-2011-ai-summit/

4:23 SegFaultAX: And potentially simpler to implement, since you can determine ahead of time static obstacles like terrain.

4:24 chord: SegFaultAX: need you to translate it to english

4:24 * SegFaultAX is done feeding chord

4:24 glosoli: dobry-den: http://bpaste.net/show/4kHN2dvh1KXn1HM6qxAS/ checking for retrieving row and etc, is done before, this is only part when I want to format the description field which contents are optional

4:24 dobry-den: though I made a mistake in bpaste it's not doc but description

4:25 chord: SegFaultAX: I tried reading the blog it I had no clue what it was talking about http://www.third-helix.com/2011/03/gdc-2011-ai-summit/

4:27 dobry-den: glosoli: that looks pretty standard although i'd just do (when description ...) unless you need to differentiate between nil and false

4:27 glosoli: dobry-den: aah I don't, ok thaks! :)

4:28 thanks"

4:34 chord: SegFaultAX: did you read the blog post

4:42 SegFaultAX are you there?

4:42 dobry-den: did you read the blog?

5:56 you are all dumb

5:56 did you know that

5:56 yah you didn't know it so I'm telling you

6:31 glosoli: Hmm I found some code where syntax quotes are used at the end of the var name, what's the purpose of it ? i.e. (status-change! db' id nil current-status initiator-id)

6:34 ciphergoth: Just run "slamhound" over my sources, and it's got rid of all the things that say eg (:require [foo.bar.baz])

6:34 where I refer to foo.bar.baz/quux in the sources

6:35 Is there a way to prevent that?

6:41 (:use [foo.bar.baz :only [quux]]) becomes (:require [foo.bar.baz :refer [quux]]) and that's fine, (:require [foo.bar.baz :as baz]) is copied over unchanged and that's also fine.

7:43 sm0ke: is it possible to figure out from where i am getting a dependency like log4j

7:43 in lein

7:44 mullr: sm0ke: I seem to remember a way to print the dependency tree

7:44 TEttinger: lein deps :tree ; ?

7:44 sm0ke: TEttinger: awesome

7:45 mullr: how delightfully legible :)

7:45 TEttinger: take out the ; ?

7:45 I don't know if it works or if it goes by a different command

7:47 wow nice, it works

7:47 sm0ke: its actually very nicely printed..god job lein

7:47 the best ive ever seen

7:50 utkarsh: what is the current preferred way to run small clojure scripts quickly (jvm boot)? "drip"?

7:50 or is there something better/new?

7:55 hyPiRion: not yet, afaik

8:47 s4muel: utkarsh: https://github.com/technomancy/grenchman

8:51 Jookia: Does Clojure handle Unicode in implementation or in its standard? Or not at all?

8:52 clgv: Jookia: the JVM handles Unicode ;)

8:52 Jookia: clgv: So if I write an application in Clojure, it's Unicode status is implementation defined, meaning moving to something like Javascript will ruin things?

8:53 clgv: Jookia: huh? what exactly do you mean?

8:54 utkarsh: s4muel: ah, thanks, will check it out.

9:09 john2x: I have a macro which defn's a function from a string. I want to apply it to a list of strings. I'm trying (doall (map)) but it's not working. https://www.refheap.com/19169

9:14 Jookia: clgv: I mean, in C++ strings are made of chars which are usually 8 bits. What does Clojure define chars as?

9:15 clgv: Jookia: clojure does not define them. the JVM does with its String and Char classes

9:15 Jookia: clgv: Oh.

9:21 clgv: john2x: you cant do that via the functions doall+map

9:22 john2x: clgv: i'll have to call the macro for each string?

9:22 clgv: john2x: you need a macro to do it

9:23 john2x: ok, so a second macro which accepts a vector of strings?

9:24 clgv: john2x: yeah and maybe the macro you apply the strings to if that generality is useful

9:26 john2x: hmm how would this second macro look like? I still can't use doall+map to apply the first macro over the strings?

9:33 jagaj: is there somewhere that describes a basic and modern clojure + emacs setup (that isn't a video)? everything I'm finding is pretty old.

9:38 jstew: jagaj: Not really. There's a good very basic tutorial at http://www.braveclojure.com/using-emacs-with-clojure/. Doesn't tell you how to set up paredit/nrepl/clojure mode though

9:43 clgv: john2x: (defmacro mapply [m & args] `(do ~@(map (fn [x] `(m ~x)) args)))

9:44 oh little error

9:44 edw: I've been getting illegal access errors on starting nrepl recently with a 'pp does not exist' exception and stacktrace. Anyone else seen this?

9:44 clgv: john2x: (defmacro mapply [m & args] `(do ~@(map (fn [x] (list m x)) args)))

9:45 john2x: clgv: wow, thanks!

9:47 clgv: np

9:52 john2x: trying to understand the macro, why doesn't (do (map #((list m %)) args)) work?

9:53 i mean why does it need to be done in a macro?

9:56 clgv: john2x: because it needs to be executed at macro expansion time (or compile time) whereas your doall+map is executed at runtime

9:57 john2x: ah, makes sense. thanks again!

10:02 mimieux:

10:24 edw: I've been getting illegal access errors on starting nrepl recently with a 'pp does not exist' exception and stacktrace. Anyone else seen this?

10:26 seangrov`: Is there a good lein template for starting a new clojure web-server project?

10:30 jonasen: seangrov`: lein new compojure <name>?

10:41 sm0ke: hello i am using edn for configuring my project...do i write every property down in a giant map? is that idomatic?

10:43 clgv: sm0ke: you could. but if it is natural for your application you can also use nested maps

10:44 sm0ke: clgv: thanks that makes sense ...to nest ealted config props in one key as another map

10:44 related*

10:46 hmm i think someone should send a patch to fireplace to classify .edn also as a clojure source

10:46 mdrogalis: sm0ke: Sometimes I do [{..} {..} {..}]

10:46 Akin to Datomic's schema format.

10:49 sm0ke: mdrogalis: how does that helps with reading simple config at all?

10:50 mdrogalis: sm0ke: It depends on your circumstances. It's just another option to know about.

10:51 sm0ke: yea i guess mix and match clojure data structures as needed

10:54 so another question...how do i get a file on classpath? easy clojure way

10:55 mdrogalis: sm0ke: Are you using Leiningen?

10:55 llasram: sm0ke: clojure.java.io/resource

10:55 lunk: ,(let-fn [(foo [x] (+ 5 x))] (foo 7))

10:55 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: let-fn in this context, compiling:(NO_SOURCE_PATH:0:0)>

10:56 sm0ke: llasram: thanks

10:56 Bronsa: lunk: it's letfn

10:56 ,(letfn [(foo [x] (+ x 5))] (foo 7))

10:56 clojurebot: 12

10:57 lunk: !!!

10:57 hah, it was a more basic error than i thought

10:57 thanks

11:00 wakeup: hi

11:02 sm0ke: i am getting a Cyclic load dependency among my namespaces what should i do?

11:04 i must be doing things the wrong way i gues

11:04 vijaykiran: sm0ke: separate out common functions into a different namespace

11:05 wakeup: Using compojure: How do I access ring's sessions?

11:06 sm0ke: vijaykiran: thanks

11:07 vijaykiran: wakeup: request should have a session key .. you can read it in handler functions

11:07 wakeup: Ah I got it

11:08 was doing bad destructuring

11:08 ok

11:09 does anybody know by coincidence if/how I can get a list of all

11:09 session maps?

11:34 seangrov`: How do I specify multiple dynamic class names in a hiccup template?

11:35 Right now I have something like [:a {:class (str name " " "logo")} "..."], but it seems pretty ugly

11:41 klrr_: clojure vs racket, which is best

11:42 nDuff: Depends on what you want.

11:42 klrr_: i want lisp

11:42 nDuff: Racket is probably a better teaching language. It certainly has a much more flexible parsing model.

11:42 *shrug*. Too big a question to answer definitively.

11:42 klrr_: im talking about #lang racket, not their HTDP book

11:43 nDuff: ...but if "I want LISP" means you care about purity over practicality, go with Racket.

11:43 klrr_: purity as in pure functions or purity as in something else?

11:44 nDuff: About willingness to make design decisions that trade against practicality.

11:44 klrr_: nDuff: well, i dont got problem thinking functionally if that's what you mean

11:45 so, racket is "more" functional than clojure? i thought clojure advocated FP

11:45 nDuff: I didn't say anything about that.

11:45 Chousuke: I don't think racket is less pragmatic than clojure, really

11:45 `cbp: I want to learn racket to study math as inspired by Sussman's talk.

11:45 Chousuke: Clojure just runs on the JVM which can be a major practical benefit.

11:46 nDuff: klrr_: ...Clojure's preference for immutible data by default probably makes it a bit more FP-friendly, though you can certainly do proper FP programming in Racket.

11:46 klrr_: im not talking about ecosystem or implementation, im tlaking about language itself

11:46 okey

11:46 bbloom_: klrr_: why don't you read http://clojure.org/rationale and a bit of http://racket-lang.org/ to get a feel

11:46 then try one or both for a while for your particular use cases

11:46 Chousuke: klrr_: in Clojure's case, those are the same thing

11:46 bbloom_: they are both great languages

11:47 sm0ke: lein guys why doesnt lein uberjar makes a runable one?

11:47 i meant hey guys

11:47 :/

11:47 klrr_: ive been writing a IRC bot in racket since last week, first i tried a proper functional design, but did not work, now im doing a trigger-event design, and program still dont work

11:47 `cbp: sm0ke: you can java -jar the uberjar

11:47 bbloom_: klrr_: maybe spend some time studyign https://github.com/flatland/lazybot

11:48 klrr_: gonna check it out, but i suck at reading code

11:48 Chousuke: klrr_: well, "don't work" really doesn't say much about what is wrong :P

11:48 bbloom_: klrr_: then i suggest learning how to do that before learning clojure or racket ;-)

11:48 nDuff: sm0ke: if your OS is set up right, you don't need shebang magic for a jar to be runnable.

11:48 Chousuke: it's probably not a problem with the language though

11:48 nDuff: sm0ke: Linux has had the ability to pick interpreters based on file magic for ages, and Windows does the same based on extensions.

11:48 klrr_: it compiles but dont work

11:49 Chousuke: well you have a bug, then

11:49 or several

11:49 sm0ke: `cbp: its doesnt run like that

11:49 klrr_: thanks for info

11:49 nDuff: sm0ke: ...then we'd need a reproducer.

11:49 sm0ke: `cbp: i already have a :main in project.clj..and lein run also works

11:49 `cbp: sm0ke: then you're missing a main namespace, a -main function and a :gen-class on the main name space i think

11:49 llasram: nDuff: Most Linux distros these days have disabled that for JAR files though. In practice it doesn't work well for JARs, because you almost always need setup the environment or pass other command line options, etc

11:50 `cbp: sm0ke: then maybe you're missing the :gen-class

11:50 sm0ke: an error message after you do java -jar would be helpful :P

11:50 sm0ke: wait ..i get this error ..Error: Could not find or load main class my_project.core

11:51 `cbp: sm0ke: you're missing (:gen-class) in that namespace

11:51 seangrov`: Is there a better way of destructuring this? https://www.refheap.com/a0bbfac3c320ab92aaafa878f

11:52 sm0ke: `cbp: but why doesnt `lein run` requires a gen-class

11:52 EchoBot1: Echo: `cbp: but why doesnt `lein run` requires a gen-class

11:52 seangrov`: I thought the map would be coerced into a seqable and nth would work

11:52 EchoBot1: Echo: I thought the map would be coerced into a seqable and nth would work

11:52 `cbp: seangrov`: you can use {:strings []} i think or maybe its :strs

11:52 EchoBot1: Echo: seangrov`: you can use {:strings []} i think or maybe its :strs

11:53 seangrov`: `cbp: problem is I don't know the keys ahead of time

11:53 sm0ke: ,(print "/kick EchoBot1")

11:53 EchoBot1: Echo: ,(print "/kick EchoBot1")

11:53 clojurebot: /kick EchoBot1

11:53 EchoBot1: Echo: /kick EchoBot1

11:53 ambrosebs: seangrov`: I think you just want (let [[[k v]] map] ...)

11:53 EchoBot1: Echo: seangrov`: I think you just want (let [[[k v]] map] ...)

11:53 nDuff: sm0ke: because ''lein run'' is using the Clojure compiler, so it doesn't need things to be compiled ahead-of-time?

11:53 EchoBot1: Echo: sm0ke: because ''lein run'' is using the Clojure compiler, so it doesn't need things to be compiled ahead-of-time?

11:54 nDuff: /ignore EchoBot1!*@* ALL

11:54 EchoBot1: Echo: /ignore EchoBot1!*@* ALL

11:54 sm0ke: nDuff: cant i just put an :aot in project.clj instead of modifying my code?

11:54 EchoBot1: Echo: nDuff: cant i just put an :aot in project.clj instead of modifying my code?

11:55 seangrov`: ,(let [m {:a 10} [[k v]] m] k)

11:55 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>

11:55 nDuff: sm0ke: better not to.

11:55 seangrov`: ambrosebs: I thought that would work, but seems like I was wrong

11:55 `cbp: ,(let [m {:a 10} [[k v]] (seq m)] k)

11:55 clojurebot: :a

11:56 llasram: sm0ke, nDuff: And that still won't create a class for the namespace

11:56 seangrov`: `cbp: Yeah, was trying to avoid an explicit seq call so I could put the binding form in the fn params

11:56 llasram: sm0ke: Instead of adding gen-class to your code, I suggest just launching via the Clojure library main class

11:56 sm0ke: Remove the `:main` key from your project.clj

11:56 seangrov`: Not the biggest deal in the world, but the difference between 2 lines and ~5

11:56 sm0ke: oh googling shows that i only need to put (:gen-class) inside my ns

11:56 thats should be ok ..let me try

11:57 llasram: Then run like: java -cp my-project.jar clojure.main -m my.name.space

11:57 `cbp: seangrov`: I'm not sure if you really wanna destructure like that though shince, maps don't preserve order and all that. Maybe you just wanna use vectors?

11:57 since*

11:57 sm0ke: llasram: thanks for that tip going to note that one down

11:58 but its really hairy..for that i need to remove :main?

11:58 seangrov`: `cbp: Yeah, this data structure is a little wonky - it's a vector of maps with only one k:v pair

11:58 I realize it's an edge case though, so not worried about it at all, thanks

12:00 sm0ke: crap ..now there seems to be probject with config file i put inside /resource folder..

12:00 problem*

12:01 `cbp: sm0ke: use clojure.java.io/resource to get a path to files inside the jar

12:01 sm0ke: (io/file (io/resource..) fails for config file inside resource when run from uberjar

12:01 llasram: sm0ke: Just don't call `io/file` on it

12:01 The return value is a URL, which you can open a reader on etc just fine

12:02 sm0ke: can i (slurp (io/resouce)) ?

12:02 llasram: yes

12:02 sm0ke: nice

12:03 you guys are awesome..

12:03 just one last thing..i get this warning..Warning: specified :main without including it in :aot.

12:03 Implicit AOT of :main will be removed in Leiningen 3.0.0

12:04 mtp: ok

12:05 llasram: sm0ke: If you want it AOT'd to work with your main namespace `gen-class`ing, just make sure you have an `:uberjar` profile wich specifies `:aot :all`

12:05 The lein `app` template adds that for you even

12:06 If you have that, then you'll get everything AOTed whenever you build an uberjar anyway

12:06 sm0ke: llasram: i just did a :aot [myproject.core] ..it seems to remove that warning

12:06 llasram: Yeah, but also means your main namespace is always AOTed, even when launching a REPL

12:07 WHich is almost never what you really want

12:08 sm0ke: llasram: thanks ...:uberjar profile makes sense

12:08 llasram: why wouldnt you want aot compilation for repl btw?

12:09 llasram: sm0ke: Cool. If you still get the warning, hen you can add a :^skip-aot on your :main namespace symbol (in the project.clj) to explicitly disable the extra :main AOTing

12:09 CommandBot: Greetings! Send me a PM and I'll echo it back to you. If it contains the word 'die', I'll die as a bonus!

12:11 Greetings! Send me a PM and I'll echo it back to you. If it contains the word 'die', I'll die as a bonus!

12:11 llasram: sm0ke: It causes a number of problems. It means launching a REPL first has to compile, which means any compilation exceptions prevent your REPL from launching.

12:12 It creates concrete class files for any protocols and deftypes, which then can be found by class loaders instead of the potentially changed dynamic versions, causing hilarious mismatches

12:12 It can leave stale versions of the classes for functions you define, which in some cases can be picked up in preference to your Clojure code, even if your code has changed since

12:13 AOT is a fine optimization for deployment, but is bad bad news for development

12:28 `cbp: (inc llasram)

12:28 lazybot: ⇒ 10

12:37 bbloom_: ambrosebs: i find it entertaining how little some haskell proponents know about the fundamentals of type theory

12:38 ambrosebs: bbloom_: what have you seen now?

12:38 bbloom_: ambrosebs: all the people who keep suggesting unsafeWhatever as a way to turn off type checking

12:38 horrible.

12:39 indigo: Why would you want to turn off type checking in Haskell

12:39 ambrosebs: bbloom_: I'm surprised it's named so mildly after learning what it really does.

12:40 technomancy: ambrosebs: congrats on meeting your goal. curious: what made you go with indiegogo for the campaign?

12:40 bbloom_: ambrosebs: it's not "mild" it's precise

12:40 "safe" has a very particular meaning in type theory

12:40 see http://msdn.microsoft.com/en-us/library/vstudio/t2yzs44b.aspx too

12:41 ambrosebs: technomancy: AFAIK kickstarter doesn't support australians

12:41 technomancy: oof; that sucks

12:41 bbloom_: people don't seem to realize that you can enforce type safety separately from type correctness. and they double don't realize that you can enforce both using either static or dynamic means

12:41 ambrosebs: bbloom_: I assumed it meant "statically unsafe"

12:41 seangrov`: ambrosebs: Out of principle?

12:41 indigo: TIL you can use pointers in C#

12:41 bbloom_: ambrosebs: ah i see

12:41 technomancy: seangrov`: ahaha

12:41 bbloom_: indigo: C#'s native interop features are AMAZING

12:42 indigo: unsafe code & Managed C++ are a fucking feat of engineering

12:42 indigo: Heh

12:42 justin_smith: didn't a bunch of the haskell people work on that vm?

12:42 bbloom_: seriously. the CLR's design is stellar

12:42 justin_smith: yup. heavily influenced by MSR

12:42 and MSR is/was a major GHC contributor

12:43 technomancy: bbloom_: especially compared to JNI, I'll bet

12:43 bbloom_: technomancy: no contest.

12:43 technomancy: being able to pin memory and tell the GC to work around you is mega useful

12:43 you can get crazy good perf out of your interop libs

12:44 technomancy: bbloom_: counting my blessings that I have never had to care about that

12:44 bbloom_: however, the CLR is clearly tuned for a type system that is better than the JVMs, so their JIT isn't as good

12:44 but it's a manhours limitation, not a design one

12:45 technomancy: eh, pinning memory is fun. it's when you need to do COM that things get depressing :-P

12:46 technomancy: bbloom_: I've been interfacing with libreadline from ocaml recently and it's not as bad as I was expecting

12:47 bbloom_: technomancy: yeah, if you have good facilities for it, it's no more painful than writing C

12:48 except maybe a larger conceptual surface area

12:48 technomancy: that's some faint praise for you

12:49 bbloom_: anyway, ambrosebs: when do we get a stretch goal that lets us infer type hints to prevent reflection in CinC? :-)

12:50 bordatoue: is there anyway to split string within double qoutes

12:51 `cbp: bordatoue: I'm not sure what you mean can you give an example?

12:52 ambrosebs: bbloom_: sounds like something we'd need CinC for :)

12:52 bbloom_: oh

12:52 bbloom_: didn't read that properly :P

12:53 bordatoue: `cbp: say i have a string "a","b","c,e" , i need to split them based on double quotes so that I get [a b ce] , i have tried regex but couldn't work it

12:53 ambrosebs: bbloom_: stretch goals will be core.typed from here on :)

12:53 justin_smith: bordatoue: something like

12:53 ,(clojure.string/split "this string \"has a quote\" in it" #"\"[^\"]*\"")

12:53 marcopolo2: ambrosebs: Congrats on meeting your goal, I'm excited to see what you'll get done! :D

12:53 clojurebot: ["this string " " in it"]

12:53 ambrosebs: marcopolo2: thanks!

12:54 marcopolo2: ambrosebs: How possible is core.typed on Clojurescript?

12:54 ambrosebs: I'm hoping to get maybe 8-10 months of dev time. I can get some serious work done then.

12:54 marcopolo2: already possible.

12:55 marcopolo2: ambrosebs: woah! Can I use it now?

12:55 ambrosebs: marcopolo2: kinda, you can certainly tell me where it breaks https://github.com/clojure/core.typed/blob/master/src/test/cljs/cljs/core/typed/test/dnolen/utils/dom.cljs

12:55 marcopolo2: it's needs a lot more work but the basics are there

12:56 I'll probably release a typed CLJS tutorial with my next stretch goal

12:56 `cbp: bordatoue: ##(map second (re-seq #"\"([^\"]+)\"" "\"a\", \"b\", \"c,e\""))

12:56 lazybot: ⇒ ("a" "b" "c,e")

12:57 `cbp: oh or justin_smith's

12:57 marcopolo2: ambrosebs: nice!

12:57 justin_smith: mine was almost there, yours is closer to what he wants

12:58 rasmusto: is this a reasonable use case for reduce? I want to make sure that the function is deterministic https://www.refheap.com/19176

12:59 bordatoue: `cbp: thanks very much, I was trying to solve it using a single regex rexpression

13:00 marcopolo2: rasmusto: What is this suppose to do?

13:02 `cbp: rasmusto: I think any operation that goes fully through a collection to get a single value is a reasonable case for reduce

13:03 AimHere: Why stop at single values. Reduce will handily turn a collection into another one if you ask it nicely!

13:04 `cbp: Ok I guess i shouldve said anything that goes through a collection fully is a good case for reduce :P

13:04 rasmusto: marcopolo2: I want to go through the collection and "pick" an element from each of the sub-collections, after "picking", all of the items in that elem are off limits, so I have to remove them as options from the remaining elements

13:04 marcopolo2: those are the :used items

13:05 `cbp: okay, thanks

13:05 bordatoue: `cbp: I can use re-seq while reading lines from the file , or should I use some other alternative that compiles to regex, then search for a pattern

13:07 marcopolo2: rasmusto: gotcha, `cbp is right, as long as your are going through a collection, even if you result with a larger collection, reduce is fine

13:08 AimHere: Well if you have an infinite collection going in, you might not get anything out at all with reduce

13:09 `cbp: bordatoue: you can do something like (map #(re-seq..) (line-seq input))

13:09 bordatoue: `cbp: thanks

13:10 `cbp: bordatoue: unless the file is huge then you might want something different from map

13:14 rasmusto: the code I pasted is something that I'd normally do with a loop/recur, I don't quite know why reduce hasn't really been in my toolbox

13:25 marcopolo2: I've gotten to a stable point in my webworker library for clojurescript: https://github.com/MarcoPolo/servant

13:26 It uses core.async to deal with webworkers in a sane way. It's somewhat similar to core.async's thread call

13:30 arrdem: with ac-nrepl, is there a way to automagically populate the ac name trie with the symbols in my ns?

13:30 justin_smith: reduce can also be used if you don't want to traverse the whole input

13:30 ,(reduce (fn [a b] (if (number? b) (reduced a) (conj a b))) [] [:a :b :c :d 0 :e :f])

13:30 clojurebot: [:a :b :c :d]

13:31 seangrov`: marcopolo2: Should the if-not in the readme be when-not?

13:32 marcopolo2: seangrov`: yeah, it should

13:33 seangrov`: marcopolo2: Looks really interesting! Do I have to be using core.async in my project to use servant though?

13:34 marcopolo2: seangrov`: You do because the call to a servant-fn will return a channel where the result will be

13:34 seangrov`: Also thanks :)

13:35 seangrov`: It's too bad there isn't a way to seamlessly combine core.async-using and non-core.async-using libraries :P

13:35 tbaldridge: seangrov`: it's called a callback

13:36 seangrov`: (take! c (fn [val] ...dosomething...))

13:36 rasmusto: justin_smith: oh, cool!

13:36 seangrov`: tbaldridge: Yeah, but I have to be pretty aware that the library is using core.async, and I can't just treat it as a normal callback-based library unless the author provides a separate interface for that

13:37 cored: http://www.indiegogo.com/projects/typed-clojure

13:37 that looks interesting

13:40 muhoo: seangrov`: why?

13:40 if it's referentially transparent, should it matter?

13:42 seangrov`: muhoo: I mean, to use a library that uses core.async internally (if my project isn't using it), then I either have to bring in core.async and learn it enough to write the line like tbaldridge, or the author has to write a separate set of interfaces for consuming "return" values via callbacks

13:43 It really feels like it's mixing things up and splitting the ecosystem a bit

13:44 Not the biggest deal in the world obviously, but and interesting problem I've been thinking over recently

13:44 tbaldridge: seangrov`: some might say it is the new ecosystem :-P

13:44 muhoo: indeed, core.async appears to be taking over the world

13:44 but there's a way to make async things sync, by using promises/futures/etc, IIRC

13:45 geoffeg: i heard a talk on core.async at strangeloop this year, the speaker (rich hickey, i think) mentioned there's no support for networking, any change in that limitation?

13:46 muhoo: why couldn't you do network i/o in core.async? seems like it'd be ideally suited for it.

13:47 marcopolo2: seangrov`: Webworkers use callbacks and that can get really ugly when you need to juggle several webworkers at once, I guess I choose to not have that ugliness leak out.

13:48 geoffeg: http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html (see the "Future Directions" section)

13:48 tbaldridge: geoffeg: it's a hard topic (channels over a network), and I don't think there is a good solution

13:49 mdrogalis: I was just going to summon you for an answer, tbaldridge :)

13:49 tbaldridge: geoffeg: core.async assumes messages are reliable, and nothing short of a system failure will drop a message, not so with networks. There are 1001 things that can cause a drop of a message

13:49 not to mention that stuff like alt! is pretty much impossible to do over a connection.

13:50 My advice? Wrap rabbit-mq or zero-mq, and interop via core.async.

13:51 geoffeg: tbaldridge: mostly i was thinking of how nice it would be to use core.async-style interop in the browser for browser to server communication

13:52 marcopolo2: geoffeg: That isn't hard at all, I had to do something similar for the servant library

13:52 tbaldridge: geoffeg: that can be done, use web workers and put!/take!

13:53 *web sockets

13:53 muhoo: i did something like that with web sockets and edn recently

13:54 geoffeg: thanks, i'll take a look

13:54 tbaldridge: (inc muhoo)

13:54 lazybot: ⇒ 3

13:54 muhoo: it was long-polling, core.async wasn't out yet so i had a j.u.c queue instead

13:54 tbaldridge: yeah if you use http-kit it's about 30 lines of code total

13:54 muhoo: ah, right, looking, i migrated from web sockets to long polling

13:55 for backwards compatibility

13:55 sockets was easier tho.

13:55 marcopolo2: muhoo: j.u.c. queue?

13:56 muhoo: marcopolo2: yep, looking up which one, there was a neat little hack i got from alan that helped

13:59 https://github.com/flatland/useful/blob/develop/src/flatland/useful/state.clj#L54 i

14:00 marcopolo2: i used clojure.core.cache/fifo-cache-factory

14:00 not sure why

14:01 so basically it was a blocking queue

14:01 * muhoo memory fades away in the mist

14:01 marcopolo2: muhoo: That's practically the definition of a channel!

14:02 muhoo: yeah, i was reinventing the wheel

14:02 now i use lamina, and soon i'm sure i'll join the core.async bandwagon

14:08 `cbp: justin_smith: :-O I didn't know that

14:09 (inc justin_smith)

14:09 lazybot: ⇒ 7

14:11 marcopolo2: `cbp: since 1.5 apparently https://github.com/clojure/clojure/blob/c6756a8bab137128c8119add29a25b0a88509900/src/clj/clojure/core.clj#L6139

14:12 `cbp: :-)

14:24 rasmusto: how does reduced work with a parallel reduce?

14:30 llasram: rasmusto: Only `fold` may happen in parallel, not `reduce`

14:30 rasmusto: llasram: ah, okay. And I assume that "reduced" doesn't work there :)

14:30 callen: llasram: reduce reduce or Clojure foldy reduce?

14:31 borkdude: say I have a collection [ {:name "foo" :function nil} {:name "bar" :function nil}], what is the most idiomatic way of updating it to for example [ {:name "foo" :function string?} {:name "bar" :function nil}]

14:31 llasram: rasmusto: I don't believe so, although I think it could sanely end a part of the computation early

14:31 rasmusto: hmm, ok

14:32 llasram: callen: Does it matter? They're both in terms of the CollReduce protocol. They just have a different default for an unspecified initial reduction state parameter

14:32 callen: llasram: well, by your response, now I know the bit that matters.

14:32 I should re-read the code in reducers

14:33 llasram: callen: fair enough :-)

14:34 borkdude: something like this? https://www.refheap.com/19181

14:35 rasmusto: ,(map (fn [m] (if (= (:name m) "foo") (assoc m :function string?) m)) [{:name "foo" :function nil} {:name "bar" :function nil}])

14:35 clojurebot: ({:name "foo", :function #<core$string_QMARK_ clojure.core$string_QMARK_@1d2d2c9>} {:name "bar", :function nil})

14:35 rasmusto: whoooo, I matched my parens!

14:35 borkdude: rasmusto ok

14:35 rasmusto: borkdude: yeah, that seems about right

14:36 borkdude: I was wondering, maybe there is something like qpath expressions for clojure collections :)

14:36 rasmusto: borkdude: I don't know what those are

15:04 yedi: what are some good clojure cup entries

15:04 muhoo: link to the clojure cup entries?

15:05 callen: muhoo: http://clojurecup.com/apps.html

15:06 muhoo: huh, no apps there, in chrome on android anyway

15:06 yedi: callen, what was yours

15:06 `cbp: callen: which one did you guys make

15:06 Jarda: muhoo: you need to login (with a github id or something)

15:06 muhoo: :-/

15:07 callen: `cbp: Simonides

15:07 yedi: ^^

15:07 muhoo: one day, people will have websites that you don't have to login to see the the content of.

15:07 callen: my team was myself, gf3, noprompt, and s4muel.

15:07 * muhoo cursees facebook

15:07 callen: muhoo: you don't need to be logged in

15:07 muhoo: click my damn link I sent you

15:07 I sent you the link to the clojure cup apps.

15:07 Jarda: callen: you can't see anything without login there

15:07 arrdem: damnit.. we didn't even get a ranking up :/

15:08 callen: arrdem: er. ranking? what?

15:08 arrdem: callen: http://clojurecup.com/app.html?app=cloutjure

15:09 callen: oh damn.

15:09 us: http://clojurecup.com/app.html?app=simonides

15:09 Jarda: I don't really like those sites

15:09 it seems it's just buggy when you are not logged in

15:09 muhoo: Jarda: no anonymity for you!

15:10 we must track everything you do, everything you see

15:10 Jarda: http://dl.dropbox.com/u/1815350/Selection_022.png

15:10 * muhoo grumbles about kids on his lawn

15:10 callen: muhoo: can you put off the 5 minutes of hate for another week?

15:10 Jarda: yeah but as you can see from my screenshot it's not apparent that I should login

15:10 no 'Login to see this app'

15:11 that screenshot is from http://clojurecup.com/app.html?app=cloutjure

15:11 `cbp: Jarda: I don't think you have to log in..

15:11 callen: you don't have to log in...

15:11 Jarda: please calm down.

15:11 Jarda: callen: yeah, I just don't see anything :)

15:11 muhoo: anyway, it doesn't matter. i'm sure the good apps will get attention in other ways and all have github repos anyway

15:11 TimMc: Jarda: Not seeing it, here.

15:11 gws: i wasn't either, but i went to the main page and then hit the back button and it worked

15:12 arrdem: so it looks like you have to hit clojurecup.com/ before anything else will render for you :|

15:12 callen: LOL

15:12 Jarda: oh yeah

15:12 true

15:12 if I navigate around there I see the stuff

15:12 * arrdem facepalms

15:12 TimMc: Nice.

15:12 gws: so don't worry about putting a "log in to see this page" just "solve this browser puzzle to see this page" :)

15:12 arrdem: callen: anyway. shiny!

15:13 Jarda: :D

15:13 ok, sorry about misleading

15:13 callen: arrdem: the shinies were gf3's doing :)

15:13 arrdem: I did the data collection, aggregation, and storage.

15:14 mtp: i read 'data aggravation'

15:15 arrdem: callen: yeah I did all the IRC log prep work and have everything yall've ever said in here along with every link posted in a huge mongo table.

15:15 callen: not too far from the truth.

15:15 arrdem: aand then we didn't manage to get it on the website :/

15:16 mtp: good

15:16 i hate the web

15:16 :)

15:17 arrdem: I used to hate the web.. then I found clj-http, data.json and clj-tagsoup and the web became data :D

15:17 callen: arrdem: similar story here. All of the backend stuff works, the design is in place, but the dashboard itself is not really fully functional.

15:18 `cbp: arrdem: sort by lazybot's karma? :-D it surprisingly correlates!

15:18 arrdem: callen: aaand this is why systems ppl should not participate in hackathons :|

15:18 `cbp: I actually didn't get around to pulling bot karma, I figured that it would indeed correlate and therefor wouldn't have a high information value

15:19 yedi: arrdem: cloutjure doesn't seem to listing any names

15:19 arrdem: yedi: yeah that's because gdev hard coded a list and we never got a data connection built

15:20 callen: arrdem: I think a similar story happened to a lot of teams.

15:20 stuff got built but not hooked up.

15:20 llasram: arrdem: I had a really similar experience. We decided to do this old pen-and-paper turn-based strategy game we though we could get away with having a trivial interface for.

15:20 technomancy: back in my day we only had 24 hours

15:21 callen: I spent most of the contest writing JS. I am not happy about this.

15:21 llasram: arrdem: In the process of not getting it finished, wrote about 2x as much ClojureScript as Clojure

15:21 arrdem: technomancy: get back on your rocking chair grandp

15:21 callen: llasram: great idea for a project tho.

15:21 arrdem: llasram: that's cool!

15:21 callen: llasram: please finish it :)

15:22 when Simonides is made release-ready, people will have an open source analytics option :)

15:22 `cbp: llasram: is yours the risk one?

15:22 llasram: `cbp: Oh, no. It's `spellcast`

15:23 octe: (java.nio.file.Paths/get (into-array String ["/"]))

15:23 should that not work?

15:23 it doesnt seem to find the correct method to match

15:23 technomancy: http://technomancy.us/47 <- didn't finish with 24 hours either

15:24 octe: two path methods on the class, one which takes varargs strings, the other which takes a URI object

15:24 hiredman: octe: it takes a string, and vararg strings

15:24 llasram: If I do a hackathon again, I'll either have a frontend person on the team or just do a library + advertipage

15:25 octe: hiredman: huh?

15:25 callen: llasram: we had a frontend person, but we needed 1 backend person with 3 frontend people instead of the other way around

15:25 arrdem: llasram: having UI sketches & shared knowlege of the data backend beforehand should make a real webapp doable.. barely.

15:25 hiredman: octe: pull up the java docs and look at the method signature

15:25 octe: yes, i'm looking..

15:25 hiredman: get(String first, String... more)

15:26 octe: oh, doh

15:26 i was reading it wrong..

15:26 thanks..

15:29 that was kind of stupid

15:43 dobry-den: yeah, i had to go to homepage first

15:58 chouser: Does anyone know how to get simple-check's string generator to generate empty strings along with whatever else it generates? /cc reiddraper

15:59 dobry-den: Clojure question: In a webapp, I have helper methods like (url-for <entity>) where different things happen based on which of these keys an entity has (:forum/uid, :topic/uid, :user/uid, etc.). And over time I realize all my helper functions are doing this.

15:59 reiddraper: chouser: you could use gen/frequency to alternatively generate (gen/return '')

15:59 chouser: reiddraper: ok, I'll try that. Why aren't empty strings included by default? or are they just unlikely?

15:59 reiddraper: chouser: (def my-string (gen/frequency [[9 gen/string] [1 (gen/return '')]]))

16:00 chouser: good question, lemme see

16:00 dobry-den: What's the general solution for when you have a bunch of functions dispatching on a key like that?

16:00 `cbp: dobry-den: multimethods

16:02 dobry-den: Multimethods, the few times i've used them, will group functions by function-name. I now have a dozen helper methods and it seems I would want to group them by the key (:forum/uid vs :user/uid vs :topic/uid etc) that they dispatch on.

16:04 I've never used anything like Records or Protocols or Interfaces. Could this be a time when I'd want to have a Forum, Topic, User, etc records that conform to an interface?

16:04 I don't really know when to use those kinds of constructs

16:04 reiddraper: chouser: looks like it's a combination of two things: the 'size' parameter should be starting at 0 during tests, but it's starting at 1 (a small bug), and further, the string generators always create a string of 'size', instead of randomly choosing 0..size

16:05 llasram: dobry-den: Having a group of multimethods which dispatch on the same values is just a matter of application-internal convention

16:05 reiddraper: chouser: mind submitting a github issue and i'll get it fixed up shortly?

16:05 llasram: Although you can add sugar to make it more obvious

16:05 chouser: reiddraper: ah, ok. I thought that's what I was seeing, but I wasn't sure.

16:05 `cbp: dobry-den: Protocols dispatch on type only, multimethods dispatch on a given function

16:06 dobry-den: In a convention db-driven webapp, could it make sense to represent your domain models with types, then? (i.e. wrap DB rows with a type - i guess that'd be a defrecord)

16:07 llasram: dobry-den: I don't really suggest it, but you could always do something like this: https://gist.github.com/llasram/6768951

16:07 dobry-den: llasram: i'll play with that

16:09 does anyone know of a github repo for a conventional Compojure + relational DB webapp with "users" and other models?

16:09 `cbp: dobry-den: I don't think there's a conventional way to handle db data

16:10 dobry-den: fair enough, i really just mean "any"

16:10 indigo: I'm sure you can find something with Compojure and Korma

16:11 `cbp: dobry-den: many people use something like korma, I myself implement simple operations on single entities like create/update/delete/save in an orm-like fashion using records/multimethods and do more complicated stuff by writing the sql "by hand"

16:13 dobry-den: i actually have the db stuff working smoothly (datomic). i'm just trying to arrive upon a better way to represent the entity once it's been pulled from the DB and wrapped for my views

16:14 indigo: dobry-den: https://github.com/khanage/clojure-blog-test from a quick github search

16:14 Actually I should go ahead and write some sort of quick blog/wiki tutorial with Compojure and Korma

16:19 noncom: hi, i'm trying to evaluate an (ns) macro with (eval), and it fails, saying that it is impossible to change *ns* root binding with (set!). ok, i've googled and they say use (binding) to setup a namespace for (eval). but how do repls, like in counterclockwise, manage to eval (ns) so easily?

16:19 dobry-den: indigo: I'm working on a forum with Compojure + Datomic. I'm just trying to figure out how to handle this file which keeps growing https://github.com/danneu/clj-forum/blob/master/src/forum/helpers.clj

16:20 although the uncomitted changes have tripled the size of that file

16:23 I think i've been drinking too much anti-noun koolaid

16:23 indigo: Haha

16:24 dobry-den: You could always split up the handlers

16:26 dobry-den: Hahah... not n*sync with this repo

16:26 dobry-den: I've seen people split up the routes, but that has made it confusing for me to see the full endpoint profile of their app

16:27 rhg135: Hello, i was wondering how you would parse html on nodejs, i found http://docs.closure-library.googlecode.com/git/closure_third_party_closure_goog_caja_string_html_htmlparser.js.html but i've never used sax is this the best way?

16:28 glosoli: rhg135: This is clojure room lol

16:28 dobry-den: rhg135: like jquery?

16:28 rhg135: clojurescript is a thing :P

16:30 im trying to rewrite a small program in clojurescript because of the memory usage of the jvm among other things

16:30 arcatan: i can't quite tell, so do i need to have signed the clojure contributor agreement to contribute code to jvm.tools.analyzer? (ambrosebs?)

16:31 dobry-den: rhg135: why cant you use any of the libs people use on node.js with vanilla js?

16:31 for parsing html

16:31 like an embedded jquery

16:32 rhg135: elaborate please

16:32 im new to js

16:32 dobry-den: rhg135: i just searched "node js parse html" and found https://github.com/MatthewMueller/cheerio

16:33 seangrov`: Anyone have fn showing in emacs as the greek symbol using font-lock mode for clojure? I have partial working, but can't figure out lambda

16:33 mtp: i think "prettify" does that

16:33 or some other emacs module

16:33 rhg135: hm, deal with the jvm or learn js

16:34 seangrov`: rhg135: Learn js before you use cljs

16:34 rhg135: i think ill just deal with the jvm

16:34 i get js, but not the language itself

16:34 dobry-den: rhg135: sorry, your "node.js" part of the question threw me off

16:34 rhg135: i mean not the idioms

16:34 dobry-den: just use https://github.com/levand/domina

16:34 or https://github.com/Prismatic/dommy

16:35 if you know what $("#content h1") does, in domina it's (sel "#content h1")

16:36 icarot2: dobry-den: is your name intended to mean "good day"?

16:36 rhg135: but i don't have a dom to manipulate

16:36 dobry-den: rhg135: do you have a string of html?

16:36 rhg135: yes

16:37 well no but ik node.js has a lib to download it

16:37 dobry-den: https://github.com/levand/domina/blob/b8ab7c5a616f059949fd78397636442b91a35882/src/cljs/domina.cljs#L66

16:38 rhg135: thx

16:38 thats perfect

16:39 ambrosebs: arcatan: yes

16:39 arcatan: do you have a CA?

16:39 dobry-den: rhg135: (-> (html-to-dom "<h1>Hello</h1>") (sel "h1") (text)) ;=> "Hello"

16:39 arcatan: ambrosebs: no

16:39 rhg135: mhm

16:40 you read my mind

16:40 callen: bryanwoods: Gradual type system for Ruby that, if enabled, converts your startup's code base to Scala upon raising a Series B

16:40 ambrosebs: arcatan: ah. what are you thinking of contributing btw?

16:40 dobry-den: rhg135: i think you get certain advantages by writing javascript via ClojureScript without much experience with javascript.

16:41 rhg135: probably

16:41 js has an ideology oposite to clojure

16:41 callen: sorta.

16:42 dobry-den: i wrote my first client-side app recently to learn clojurescript and it was nice to focus on clojure abstractions instead of reverse-engineering "how would i do it in js?"

16:42 yedi: anyone wanna give me strangeloop login credentials for a user who went to strangeloop..?

16:42 =D

16:42 noncom: hi, i'm trying to evaluate an (ns) macro with (eval), and it fails, saying that it is impossible to change *ns* root binding with (set!). ok, i've googled and they say use (binding) to setup a namespace for (eval). but how do repls, like in counterclockwise, manage to eval (ns) so easily?

16:44 arcatan: ambrosebs: i'd have just submitted a fix for expr-seq, as it's broken and it'd be handy for me

16:44 rhg135: i'm writing server-side just not on jvm

16:45 ambrosebs: arcatan: should be the children function instead of :children right?

16:46 callen: The important part of AOT is that vars get interned from def decls at compile-time right?

16:46 are there any wrinkles I am missing?

16:46 gfredericks: ,(letfn [[foo [] :foo]] (foo))

16:46 clojurebot: :foo

16:47 arcatan: ambrosebs: yeah

16:47 ambrosebs: arcatan: ok i'll push a release for you

16:47 arcatan: ambrosebs: thanks :)

16:49 callen: Would AOT affect the behavior of an embedded nrepl in an uberjar?

16:51 TimMc: ^^ obliquely asking if I need lein-otf.

16:52 * TimMc shrugs

16:52 callen: ;_;

16:53 fine, I'll do SCIENCE

16:53 TimMc: I don't actually know much about AOT *or* nrepl. :-P

16:53 dobry-den: rhg135: i don't know enough about domina or dommy or the cljs solutions to know if any of them are portable to the jvm

16:53 er nvm

16:53 you're using node on the server-side

16:53 rhg135: they're not but it's alearning experiance

16:54 i hear nice things about node and want to learn

16:55 callen: rhg135: if you hear nice things about node you're talking to the wrong people :)

16:55 rhg135: prob lol

16:56 well one guy does love perl so you may be on to somn

16:56 dobry-den: the nice thing to node for this community is that it's a platform to host cljs on

16:57 ambrosebs: arcatan: just posted a new version on the clojure mailing list

16:57 let me know if it works

16:57 dobry-den: i'd like to experiment by porting some of my clojure cli tools to node

16:58 rhg135: hmhm

16:58 thats what im doing

16:58 i tried shell scriipting but there's no nice way too call shell

16:59 clojure.java.shell/sh is nice

17:01 chouser: reiddraper: got another question for you. Is there a way to prevent gen/return from shrinking?

17:02 dobry-den: rhg135: it would be a fun toy project to implement shell commands with Java's io/shell libs https://github.com/danneu/captain-githook/blob/master/src/captain_githook/util.clj#L38

17:02 chouser: That is, I'd like this to shrink only to ":hi", not to ":" (sc/quick-check 1 (prop/for-all [t (gen/return :hi)] false))

17:06 ambrosebs: bbloom_: enjoying your opinionated HN responses

17:08 chouser: what library is that?

17:12 chouser: ambrosebs: https://github.com/reiddraper/simple-check

17:14 bbloom_: ambrosebs: damn static typing people :-P

17:14 arcatan: ambrosebs: it works. thanks again.

17:15 gfredericks: do we have a standard link for when people ask about clojure conventions (whitespace etc)?

17:15 ambrosebs: arcatan: great

17:15 chouser: for-all caught my eye, is that way to seed a check?

17:15 rasmusto: gfredericks: this maybe? https://github.com/bbatsov/clojure-style-guide

17:15 bbloom_: ambrosebs: it's pretty clear to me that "tagless" evaluation is pretty much just an optimization :-)

17:16 callen: gfredericks: batsov's guide is not authoritative or correct.

17:16 gfredericks: do not use batsov's guide.

17:16 rasmusto: stop linking batsov's guide.

17:16 rasmusto: reading through it, some seems a little dated, my bad

17:16 callen: Some of it is outright wrong.

17:17 ambrosebs: bbloom_: :)

17:17 chouser: ambrosebs: yeah, I'm not sure if that's the right description. It's how you collect up a top level of independent variables. I think.

17:17 Jarda: anyone familiar with core.async for clojurescript awake?

17:18 ambrosebs: chouser: ok

17:18 tbaldridge: Jarda: yes

17:18 Jarda: I'd like to implement single page application navigation on top of core.async signals

17:19 so that I would have 'views' that are just loops listening to different view related signals

17:19 one of them would be a 'navigate' signal

17:19 that would tell the view-loop to abort and then initialize a new view loop

17:19 tbaldridge: Jarda: right, sounds normal

17:19 Jarda: does it make sense?

17:19 tbaldridge: Jarda: yes

17:20 Jarda: ok, cool

17:21 just wanted to make sure I'm on right track before I dive too deep into this :)

17:21 thanks tbaldridge

17:22 it seems core.async might be the answer how to write client-side apps without these javascript frameworks (like angular or backbone etc)

17:22 rasmusto: callen: what'd you recommend for a conventions reference? clojure.core source?

17:22 gfredericks: callen: okay good to know, thanks :)

17:23 I saw the thing about not shadowing clojure.core vars. Seemed iffy.

17:24 technomancy: clojure.core is very unconventional

17:25 tbaldridge: Jarda: yeah there some research in that area to be done, I'm not sure that anyone knows all the answers

17:25 rasmusto: technomancy: I'm reading through it atm, and that's definitely true

17:28 technomancy: I like riastradh's style guide even though it's focused more on scheme

17:29 callen: rasmusto: anything official clojure

17:29 technomancy: http://mumble.net/~campbell/scheme/style.txt

17:30 glosoli: What do folks use for debugging Clojure under Emacs ?

17:31 callen: glosoli: generally, avoid debugging.

17:31 glosoli: callen: why >

17:31 ?

17:31 callen: it's more time-consuming than better ways of solving most problems.

17:32 debugging should be reserved for truly insane stuff.

17:32 scottj: glosoli: people defend the status quo. since there's no kickass debugging in emacs, people claim it's not necessary.

17:32 glosoli: scottj: I see heh

17:32 scottj: glosoli: there is ritz, but it's not polished

17:33 amalloy: (inc scottj)

17:33 lazybot: ⇒ 1

17:33 Jarda: (dec Jarda)

17:33 lazybot: You can't adjust your own karma.

17:33 callen: glosoli: Ritz is the best way to do it, but learning to solve problems without a stepping debugger is useful.

17:34 glosoli: callen: Yeah but sometimes solving them without debugger and using println feels kinda weird... in a bad sense

17:34 callen: glosoli: particularly things like trace and just learning to read your code.

17:34 I'm not saying use println.

17:34 Why does everyone assume the only alternative to debuggers is println?

17:34 an alternative to Ritz would be something like limit-break.

17:34 glosoli: callen: Well that's probably because I am novice, not that I am familiar with other stuff

17:34 hmm

17:34 limit-break

17:35 Never heard of it

17:35 callen: glosoli: if you're a novice you should forgo debuggers and learn to use things like trace.

17:35 glosoli: callen: do you know any good resources on that or smth ? (being lazy...

17:35 callen: glosoli: https://github.com/clojure/tools.trace

17:35 technomancy: clojurebot: style?

17:35 clojurebot: style is http://mumble.net/~campbell/scheme/style.txt

17:35 technomancy: sweet

17:36 clojurebot: botsnack

17:36 clojurebot: Thanks, but I prefer chocolate

17:36 rasmusto: callen: I was about to provide a counter example of official clojure being useful for style, but https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L266 is actually very very clean

17:36 glosoli: callen: thanks! :)

17:36 technomancy: this is a great guide

17:37 I had totally forgotten that C-x [ and C-x ] let you navigate by page breaks <3

17:40 borkdude: What is the default way of 'unescaping' html entities when I slurp or clj-http client/get some html?

17:40 for example &amp; -> &

17:42 glosoli: Hmm one more question anyone using Emacs knows what's required to be able to Jump into Java sources while doing interops ?

17:42 callen: glosoli: when my nrepl is connected, go to definition works fine for me.

17:43 glosoli: callen: hmm do you have your config published somewhere so I could try to look the differences ?

17:43 callen: there's no config

17:43 it's just nrepl.

17:43 github.com/bitemyapp/dotfiles/

17:43 PntBlnk: Hi folks, quick question. Is there a way to hook a Clojure function call into the nREPL compile step? I'm using an LDAP connection pool ref and each time I compile I have to create a new pool, and if I don't close it before I compile the I end up with a pile of open connections to the LDAP server. I'm sure there's something very obvious I should be doing but it escapes me.

17:44 technomancy: callen: nrepl.el doesn't do that by default

17:44 callen: well. Then either I change something or I've gone crazy.

17:45 marcopolo2: borkdude: I'm sure there are some Java libraries that will do that for you if there aren't any clojure ones

17:45 technomancy: usually the java source isn't even downloaded

17:45 chouser: PntBlnk: you can probably do that inside a macro definition

17:46 hyPiRion: PntBlnk: robert hooke may hooke your Clojure functions

17:46 borkdude: marcopolo2 do you know which java (std?) lib can do this?

17:46 PntBlnk: chouser: thanks for the tip. Can you think of an example I could try?

17:46 to look for that is :)

17:47 borkdude: I'm finding StringEscapeUtils on google, but I'm a bit surprised I woudl need a special library for this

17:50 java isn't a batteries included language in many ways ;)

17:51 chouser: PntBlnk: actually, just a top-level expression will be evaluated as the namespace is compiled. Can you just use like a defonce and then close and re-open it?

17:51 marcopolo2: borkdude: I mean you could use a hashmap and just do (get escape-map char char)

17:51 borkdude: marcopolo2 yeah I could do that

17:52 chouser: Like (defonce conn nil) (when conn (disconnect conn)) (def conn (connect ...))

17:59 PntBlnk: chouser: I'm not certain I understand your question, or for that matter if we're talking about Clojure or Emacs Lisp

18:00 seangrov`: callen: Trying to use core.typed in a project that also uses Korma - would you be up for a pr that added type annotations?

18:00 chouser: PntBlnk: heh, sorry. I may not have understood your question correctly. My sample code was meant for your .clj file.

18:02 PntBlnk: chouser: Oh I see where the confusion lies. IRC proper is blocked here at my work and I'm using a browser client and saw no code.

18:05 callen: seangrov`: I'm going to say yes, but only because I know you'll be thorough about it. Is it safe to assume this won't break anything for users that don't use core.typed?

18:06 I'm afraid I haven't used it much, only read the literature.

18:17 seangrov`: callen: Yeah, it shouldn't affect anyone not using it

18:17 Not sure if I'll get around to it or not, but I'd like to for this part of the project I'm working on now

18:18 callen: seangrov`: well, it might take some cleanup or modification, but I'm friendly to the idea.

18:21 rhg135: what do y'all think of objc (if it was more c++ like in availability)

18:22 * noprompt wants a decent pairedit for javascript.

18:29 muhoo: noprompt: what, you don't like manually figuring out }]})};});}] ?

18:31 hyPiRion: No need for a full-blown paredit for that though, just need a balancer

18:31 noprompt: muhoo: no i love it. i'm just looking for some sane people to troll.

18:31 :P

18:31 technomancy: doesn't paredit work for js?

18:31 noprompt: technomancy: kind of.

18:32 technomancy: there's a thing you can do to stop it from inserting spaces where it doesn't make sense

18:32 hyPiRion: You can use hl-parens though, and then go full rainbow?

18:32 noprompt: hyPiRion: i do in fact, use rainbow parens for js. :)

18:32 hyPiRion: noprompt: ah, nice

18:33 `cbp: I think i stopped using paredit with js because it would put spaces where i didn't want them

18:33 noprompt: technomancy: probably should just dig in to this book on writing Emacs extensions and stop whining. :)

18:33 `cbp: like foo ()

18:33 technomancy: the one from the 90s?

18:33 mtp: start hacking

18:33 hyPiRion: hah

18:34 technomancy: `cbp: (set (make-local-variable 'paredit-space-for-delimiter-predicates) '((lambda (_ _) nil)))

18:34 muhoo: i tried to love paredit, but it made me crazy with not letting me delete things when it screwed up and guessed wrong.

18:34 noprompt: technomancy: yes that one. didn't realize it was that old!

18:34 `cbp: :-o

18:34 technomancy: `cbp: merry christmas

18:35 `cbp: technomancy: =)

18:35 noprompt: technomancy: is it not a good book?

18:35 technomancy: noprompt: I don't know, actually

18:35 the built-in docs are quite good though

18:35 muhoo: so i end up using mark-sexp and C-x C-x

18:36 TimMc: muhoo: Select and C-w to delete anything, prefix with C-q to insert anything.

18:36 noprompt: technomancy: the emacs rocks guy said he recommends it. also, i do like help as well.

18:36 muhoo: TimMc: i'll have to give it another go. i remember C-w not working. didn't know about C-q tho

18:37 rhg135: is there anyway to use sockets, in browser side cljs?

18:37 muhoo: rhg135: websockets work ine

18:38 TimMc: (kill-region and quoted-insert. I should start learning the actual function names.)

18:38 rhg135: if you have a server

18:38 i dont :c

18:39 so chromium webapp?

18:39 glosoli: Does having nrepl-ritz in emacs require some specific lein config to be able to navigate between Java sources from interop ?

18:43 amalloy: TimMc: select/kill is not really necessary; if you want to delete a single character, C-u C-d or C-u BACKSPACE works

18:47 TimMc: Oh, fair.

18:58 davidfstr: I am trying to install a 3rd party library for use in my code. In Python or Ruby I would use a package manager such as pip or gem to do this. How is this done is Clojure or what tool(s) should I look into?

18:58 (In case it matters, the library is: https://github.com/clojure/tools.trace )

18:59 havenn: davidfstr: leinhttps://github.com/technomancy/leiningen#readme

18:59 davidfstr: Oops, I meant: lein: https://github.com/technomancy/leiningen#readme

19:00 glosoli: any ideas what could be wrong when I jack in nrepl, and then try to jump to some java source, I get http://bpaste.net/show/i18oeBXJ7aZkKpQTNmyL/

19:09 akurilin: So with ring's wrap-file-info it looks like it will set the file content-type correctly in development, when the files are on disk, and it will fail to correctly identify MIME type in production when everything's in a .jar. Tricky quirk to spot :)

19:09 I think weavejester's recommendation from before was to just use (wrap-content-type) only

19:09 davidfstr: havenn: Thanks. I'll take a look at lein.

19:11 akurilin: Hm, I guess I can't think of a specific use case where I would need to rely on file extension rather than the extension in the request url, so I'll probably roll with just wrap-content-type

19:13 Apparently curl also implicitly guesses MIME type for you instead of default to text/plain, which seems pretty inconvenient for debugging. Inconsistent with browser behavior.

19:21 noonian: akurilin: chrome has a nice option from the dev console where if you right click on a captured network you can get a curl command that emulates what the browser used; it won't be a nice curl command though it will have tons of options

19:22 akurilin: noonian, I did use that as well actually, it was neat, but it was hitting that same problem of curl generating Content-Type header for me, while the browser wouldn't

19:22 can't find an option to turn that off in curl

19:22 noonian: akurilin: ah, thats does sound annoying

19:31 mlb-: What's the most popular library for doing logging? Using "println" works, but it's beginning to feel a bit hackish.

19:31 akurilin: timbre

19:32 There's spyscope as well, but I couldn't figure out what it has over timbre.

19:33 rhg135: i can vouch for timbre

19:33 tis nice

19:33 technomancy: I like println

19:33 with tools.trace

19:33 rhg135: that too

19:33 technomancy: wrap it in a couple macros that check a dynamic var

19:34 rhg135: mhm

19:41 hyPiRion: I tend to just hack up something for what I need. e.g. here's a smallish logging thing I made for command-line programs where I want to dump data out based on a logging level: https://www.refheap.com/19192

19:42 But it really depends on your use case

19:47 mlb-: akurilin, rhg135, technomancy: Thanks guys, I'll check these out

19:47 hyPiRion: I'm tempted by that route, but I figured "logging things" is a problem possibly solved by some people smarter than me ;]

19:48 technomancy: mlb-: it really depends on how granular you need to be when turning sensitivity up/down

19:48 personally I think those kinds of granular tweaks are better addressed by tools.trace

19:49 hyPiRion: mlb-: that, and well, people would reinvent the wheel all the time

19:49 technomancy: since any logging framework is never going to get close to what tools.trace can offer

19:49 most of the time all you care about is "am I in verbose mode? how about quiet mode? ok, just normal then"

19:50 akurilin: technomancy, what exactly does tools.trace do over regular logging that dumps the value and returns it? Does it somehow track and print every change to that value?

19:50 don't want to miss out on anything great in my toolbox when it comes to debugging.

19:51 technomancy: it logs all args and return values

19:51 for every call of a given function

19:51 seangrov`: akurilin: Certainly worth trying out to understand it

19:53 akurilin: seangrov`, it's just tricky to relate to why it's awesome without it clarifying somewhere how one would use it and what kind of scenarios it enables that weren't possible before

19:53 I'll play around with function tracking to get started.

19:53 indigo: What do you guys think of liberator

19:53 akurilin: *tracing

19:53 seangrov`: akurilin: quickly tracing/untracing functions is pretty nice

19:53 You can do it from outside of the function

19:54 technomancy: akurilin: with logging you typically need to redeploy to add it somewhere

19:54 with tools.trace you just M-x turn it on when connected over nrepl

19:54 mlb-: I'm trying to sell Clojure at $DAYJOB, so... enterprise-tastic here. For better or worse.

19:55 seangrov`: mlb-: Datomic is apparently a good smuggling point

19:55 akurilin: technomancy, seanaway does this do some kind of alter-var-root behind the scenes to add the extra logging step? As in, can I untrace something in production after I do what you suggested?

19:55 technomancy: akurilin: right; typically you toggle tracing

19:55 akurilin: technomancy, that scenario does sound nice though

19:55 technomancy: if you forget to turn it off, it will be disabled next time the process restarts

19:55 akurilin: *seangrove, not seanaway.

19:56 technomancy: (vs leaving logging statements in and forgetting to take them out so they stay there for years)

19:56 rhg135: dont you need to define fns differently?

19:57 akurilin: technomancy, when you say "turn it off", do you mean that running deftrace on a function will toggle it off? Couldn't find that mentioned in the docs/source

19:57 *running a second time

19:57 technomancy: akurilin: no, I mean toggling trace

19:57 I've never used deftrace

19:57 would be wary of anything that put actual c.t.trace calls in the source itself

19:59 frozenlock: technomancy: Wasn't even aware of clojure.tools.trace, thanks dad! :D

19:59 technomancy: haha

20:00 akurilin: technomancy, I see, I found those trace/untrace in the source, thanks.

20:03 Bitbucket just died :(

20:07 rasmusto: trace-ns seems pretty powerful for learning

20:08 hyPiRion: akurilin: fine here

20:09 akurilin: hyPiRion, yeah the dashboard just came back up. https://twitter.com/bitbucket/status/384821264965468161

20:09 hyPiRion: ah

20:11 rhg135: how would you use c.t.t in not-emacs? manual calls?

20:11 rasmusto: rhg135: do you have a repl?

20:12 rhg135: yes ofc

20:12 technomancy: rhg135: I wrote a generic wrapper for it here: https://github.com/technomancy/nrepl-discover/blob/master/src/nrepl/discover.clj

20:12 you can call the calls it makes or you can implement auto-discover for your editor/repl of choice =)

20:12 rasmusto: rhg135: it seemed pretty easy to just call (trace-ns 'my.ns) manually (I'm just learning the tool myself)

20:13 rhg135: ya

20:13 i think so

20:13 manually then

20:13 muhoo: how do you UNtrace?

20:13 like, i'm in the repl, i want to trace something, i do, i find the bug, now i want to turn the damn tracing off again?

20:14 rasmusto: muhoo: there's untrace

20:15 muhoo: ah, great, didn't see that

20:15 rasmusto: muhoo: er, wait

20:15 muhoo: yeah, i don't recall seeing an untrace

20:15 rasmusto: untrace-ns exists

20:15 muhoo: oh, thanks

20:19 akurilin: Anybody using runit here to daemonize their ring apps? I'm wondering if you *have* to have two separate services (folders, really) declared with runit to swap one running app for another.

20:20 Or if you can get away with just one somehow.

20:20 mtp: akurilin‘ put a symlink in the runsvdir

20:20 switch the symlink around when you want to switch apps

20:20 also i <3 runit and you should convince more people of its utility

20:21 akurilin: mtp, Not sure I got the sequence right. You overwrite the existing .jar with a new version, then don't you need a 2nd symlink in /etc/service to boot the new version?

20:22 mtp: what no

20:22 i'm saying have a symlink to your active version in /etc/service

20:22 /etc/service/foo should be a symlink to /path/to/service-test; when you want to kick it over to service-prod, replace /etc/service/foo with a link to service-prod

20:23 akurilin: mtp, sure, but then won't it kill service-test and spin up service-prod, creating a gap of n seconds while the latter boots?

20:24 mtp: okay. it sounds you want to have them both running and handle the changeover some other way.

20:24 akurilin: mtp, I want there to be no service interruption.

20:24 mtp: <mtp> okay. it sounds you want to have them both running and handle the changeover some other way.

20:24 logic_prog: dnolen: where can I get a short 1-page description of the unification algorithm used by core.logic

20:25 dnolen: I don't need it to be fast; I just need to understand how it works

20:25 akurilin: mtp, okay, thanks for clarifying!

20:47 callen: Vote for simonides! http://clojurecup.com/app.html?app=simonides

20:50 Raynes: For your entertainment, folks, ScheduledThreadPoolExecutor.setContinueExistingPeriodicTasksAfterShutdownPolicy

20:50 indigo: callen: Voted!

20:50 muhoo: ok, i've got the clojure cup apps to show up in chrome on linux, yay, but where is the code for teh apps?

20:50 callen: indigo: thank you :)

20:51 muhoo: we're not obligated to post the code unless we want to.

20:51 muhoo: Raynes: ThatIsANameOnlyAGermanCouldLove

20:51 callen: muhoo: I'm not posting the source to Simonides until things get cleaned up and the fucks per KLOC goes down.

20:51 muhoo: if you really want to poke around, I could add you as a collaborator on my private github repo.

20:51 muhoo: http://www.vidarholen.net/contents/wordcount/

20:53 chord: pathfinding problem starcarft

20:53 we gotta figure out how to do this

20:53 ok team brainstorm now please

20:53 muhoo: nah, just curious. i thought clojure cup was all open source, didn't know it wasn't

20:54 rhg135: chord: the fact you're not banned is a testament to #clojure's patience

20:54 chord: rhg135: hey I'm trying to figure out how starcraft does the pathfinding that is constructive progress

20:55 rhg135: it is

20:55 callen: muhoo: no, it's not obligatory because sometimes people want to do stuff that could turn into a business/startup for the competition.

20:55 muhoo: the judges have access to the code though.

20:55 chord: rhg135: so you've done nothing?

20:55 rhg135: no

20:55 i dont work for free :P

20:57 chord: rhg135: so you are clueless and useless at pathfinding in games

20:57 rhg135: yup

20:57 and damn proud

20:58 callen: chord: can't you just...go die in a muddy creek or something?

20:58 rhg135: lol

20:58 Raynes: lol

20:58 rhg135: thats a polite version of my thoughts

20:58 indigo: chord: Go bother the Racket people or something

20:58 chord: if you guys don't know how to do something you all give up thats the difference between me and you guys

20:58 Raynes: chord: More a testament to the fact that nobody who is a mod pays any real attention to the channel.

20:59 Er, rhg135 ^

20:59 Foxboron: WOAHWOAHWOAHWOAH

20:59 Clam down people

20:59 Jeez

20:59 callen: Foxboron: you clam up.

20:59 Raynes: Yeah, clam the hell down.

20:59 rhg135: that too

20:59 Raynes: callen: Clam down.

20:59 Stahp.

20:59 callen: Raynes: I can mussel through this.

20:59 rhg135: ...

20:59 Foxboron: This is an IRC channel. Winning arguments is like winning paralympics

20:59 we are here to spread love and knowledge

20:59 amalloy: Raynes: technomancy is an op. he gave chord a temporary kick a while ago, i believe

20:59 Foxboron: now, be awesome and friendly

20:59 rhg135: k...

21:00 gfredericks: are kicks IP-based?

21:00 rhg135: no

21:00 Foxboron: gfredericks: depends

21:00 technomancy: gfredericks: bans can be

21:00 rhg135: hostname

21:00 mtp: kicks are nicked

21:00 bans are hostmasked

21:00 Foxboron: gfredericks: usually they follow a set regex pattern, but vhosts etc and nicks can make you avoid the ban

21:00 mtp: also i don't see chords's content

21:00 gfredericks: I still haven't figured out how to ignore on this client

21:00 metellus: there isn't any

21:01 TEttinger: callen, this simonides looks interesting, but it doesn't work for me

21:01 chord: if you guys know how starcraft 2 does pathfinding please talk

21:01 rhg135: there

21:01 mtp: i mean, his words only show up on my screen when i want them to

21:01 which is "not often"

21:01 chord: or you guys are useless

21:01 rhg135: no more chord

21:01 mtp: fools lists are better than ignore

21:01 chord: hey you guys are bashing on me its not my fault that you don't want to learn pathfinding

21:01 TEttinger: http://simonides.clojurecup.com/demo/playground/ gives me Not Found

21:02 * gfredericks goes to check if there is a wiki article on internet trolls

21:02 callen: TEttinger: go through demo.

21:02 TEttinger: I did

21:02 callen: TEttinger: click the demo link?

21:02 TEttinger: it wfm.

21:02 TEttinger: and I clicked submit, it took me there

21:02 callen: TEttinger: http://simonides.clojurecup.com/demo/playground?user-id=tettinger&submit=Submit

21:03 rhg135: gfredericks: there is

21:03 TEttinger: gives me Not Found when I click Submit

21:03 callen: TEttinger: I don't know why it does that to you, but it works for me.

21:03 TEttinger: chrome latest, windows 7, ghostery, adblock

21:03 callen: TEttinger: are you blocking cookies?

21:03 yes...ghostery...

21:04 TEttinger: not that I'm aware of

21:04 unless you fit the pattern of an existing tracker

21:04 callen: nuts.

21:04 TEttinger: Ghostery found 0 trackers

21:05 so it's not that

21:05 callen: ;_;

21:05 indigo: Yeah, playground is not found for me as well

21:05 :(

21:05 callen: it worked for all of us

21:05 whyyyyyyy

21:06 it worked for me just now when I tried it too

21:06 rhg135: not me

21:06 TEttinger: it stored a cookie even

21:06 callen: I clicked demo in the top right

21:06 TEttinger: just checked

21:06 indigo: Is defining events supposed to work too

21:06 rhg135: now its chugging

21:06 muhoo: there are some really good ideas in these apps

21:06 callen: indigo: that is not supposed to work

21:06 indigo: Ah kk

21:07 callen: demo/playground and the raw feed should work.

21:07 TEttinger: the cookie goes away when I click submit wat

21:07 seangrov`: callen: I tried it yesterday, couldn't get the querying to work or see any list of events

21:07 indigo: Ohh

21:07 demo/playground works

21:07 demo/playground/ doesn't ?

21:07 callen: oh. that's it.

21:07 * callen facepalms

21:07 callen: seangrov`: most of that isn't working.

21:07 * indigo pats callen

21:07 callen: we're not allowed to touch it.

21:08 seangrov`: callen: Ok, no problem, was just curious

21:08 callen: clicks aren't showing up in feed.

21:08 hrm.

21:09 indigo: That query builder is pretty slick, though

21:09 I remember implementing something like that via Backbone.js

21:09 (never again)

21:11 chord: is anyone working on figuring out how starcraft 2 does path finding

21:11 callen: events are definitely streaming in

21:11 I wonder why feed isn't...

21:13 muhoo: "because nobody wants to type that crap every time they create an executor." as always, great docs Raynes

21:14 TEttinger: callen, is clojure cup over?

21:14 callen: I see events from "rustler"

21:14 TEttinger: yes.

21:15 TEttinger: ah

21:15 that's me

21:15 callen: I see tet

21:15 TEttinger: that's also me

21:15 callen: yeah so events are streaming in

21:15 TEttinger: but I think it's sorted the wrong way in the display

21:15 callen: I wonder why the feed page is stuck

21:15 I don't think so.

21:15 It's the same thing I'm doing in _plugin/head

21:16 I'm forwarding the port from the ES server on the DO VPS

21:16 and querying it directly

21:16 {"timestamp": {"order": "desc"}}

21:17 (doc/search events-index events-type :filter {:limit {:value 50}} :sort [{:timestamp {"order" "desc"}}])))))

21:17 TEttinger: ^^

21:17 Something, somewhere is fucking me.

21:17 but I don't know what.

21:18 TEttinger: what is doc?

21:18 callen: ES API

21:18 Elastisch

21:19 TEttinger: could it be fetching 50 and THEN sorting?

21:19 callen: there's no way

21:19 well

21:19 it could be

21:19 but that would be sadistic.

21:19 that's clearly not the intent

21:19 and I saw gf3's events stream in after it got deployed and I'm positive there were more than 50 events at the time

21:20 TEttinger: but you might be right and it's worth testing.

21:20 gf3: callen: Is it slow or something?

21:20 TEttinger: gf3, we see your events but nothing newer

21:21 well I do

21:21 callen has god mode on

21:21 gf3: Awkward

21:21 To be fair, I did hardcode my events, sooooo…..

21:22 muhoo: all i see is gf3

21:22 * muhoo made a rhyme

21:22 TEttinger: last event is at "2013-09-30T07:22:36.531-00:00"

21:22 gf3: Maybe everyone is just naming themselves gf3?

21:22 :D

21:22 callen: gf3: no, that template should be the actual iterator in the template

21:22 muhoo: /nick spartacus

21:22 callen: gf3: it should be executing at runtime.

21:23 gf3: muhoo: Heh

21:23 callen: gf3: unless you changed it out from underneath me

21:23 TEttinger: what happened at some hour, 36 minutes?

21:23 no that's 22 minutes...?

21:24 callen: I'm opening the jar in emacs to verify the template.

21:24 TEttinger: ,(.getMinutes (java.util.Date. 1380525756531))

21:24 clojurebot: 22

21:25 callen: gf3: http://i.imgur.com/0c8ln4J.png

21:25 gf3: that's runtime yo.

21:25 gf3: callen: Yeah man, I was kidding

21:26 callen: http://i.imgur.com/sdopxaN.gif

21:26 gf3: I'm just pissed the parts I was sure were going to work don't.

21:27 gf3: callen: If only we had 2 more hours

21:27 callen: no joke.

21:27 `cbp: :(

21:27 callen: well the project will get wrapped up regardless

21:28 and be ready for public consumption soon.

21:28 gf3: Ja

21:31 callen: Something that I thought was going to be slow: Execution time mean : 72.732372 µs

21:31 FEELS GOOD MAN

21:35 chord: anyone here familiar with "funnel algorithms"

21:35 muhoo: you know what amusses me? when i write a fucked-up, complicated function that i don't even fully understand how it works, and i'm dreading having to debug the SOB, and it works the first time i test it.

21:38 chord: muhoo do you know about funnel algorithms in path finding?

21:39 callen: muhoo: ...success?

21:41 indigo: callen: Ew, emacs

21:41 ;D

21:42 callen: indigo: that's not my usual environment, I normally use a native emacs, but I was debugging a remote jar and too lazy to TRAMP it.

21:42 Make fun of Emacs? That's a paddlin'.

21:43 indigo: Nah, I'm jk

21:44 nightfly: chord: from google http://digestingduck.blogspot.com/2010/03/simple-stupid-funnel-algorithm.html

21:44 TonyMontana: hello

21:44 indigo: Vim repl support is still kinda lame

21:44 `cbp: what's a good window tiler for mac os? Does xmonad work well?

21:44 TonyMontana: i am spanish

21:44 callen: `cbp: I use SizeUp

21:44 TonyMontana: is it an north american chat?

21:44 callen: `cbp: I love Xmonad, but Xmonad does *not* work well.

21:44 TonyMontana: USA or united kingdom?

21:44 callen: TonyMontana: there are Spanish speakers in North America too.

21:45 also known as Mexicans, the country your people plundered.

21:45 TonyMontana: just ask your question in here.

21:45 `cbp: callen: aw I'll try sizeup

21:45 im mexican

21:45 callen: `cbp: then help me arouse racial tensions dating to centuries ago.

21:46 TonyMontana: mexicans are not spanish. mexicans are monkeys

21:46 callen: `cbp: also that explains the goddamn cactus on your github.

21:46 'ho damn. Tony goin' for the gold.

21:46 TonyMontana: I happen to have some housemates that are mexican, they're nice and intelligent people. You should consider being nicer to other people :)

21:47 `cbp: callen: I couldnt find a sombrero pic i liked

21:47 mullr: `cbp: I use ShiftIt, which gives me a least a little control

21:47 `cbp: at least on wikimedia

21:48 mullr: thanks

21:48 mullr: https://github.com/fikovnik/ShiftIt

21:48 TonyMontana: what is the topic of this channel?

21:50 Mexico is a very dangerous country

21:50 rhg135: clojure is awesome, TonyMontana

21:50 callen: TonyMontana: I believe there was a time 70 or 80 years ago when Spain was not such a safe place. ;)

21:51 TonyMontana: i agree with you, callen

21:51 callen: TonyMontana: but I don't need you to agree with me, I need you to be more polite and civilized and not insult entire countries of people.

21:52 muhoo: what is this, the new #clojure theme song now? http://www.youtube.com/watch?v=woySeSNBL3o

21:52 callen: TonyMontana: being rude is not how you get help. You will learn to be respectful of other peoples' feelings or you will learn to do without the company of others.

21:52 TonyMontana: are you a USA citizen?

21:52 callen: TonyMontana: it doesn't matter who you are and where you're from - only what you do.

21:53 TonyMontana: do you have a Clojure question or not?

21:53 rhg135: muhoo: possibly

21:53 TimMc: technomancy: Can we get an op up in here?

21:53 TonyMontana: i dont know that "clojure" means

21:53 muhoo: /ignore TonyMontana

21:54 TonyMontana: okey, ignore me

21:54 callen: Clojure is a programming language.

21:55 well this is a new one for me: CompilerException java.lang.RuntimeException: Unable to resolve symbol: require in this context, compiling:(tardis/is/awesome/handler.clj:1:70)

21:56 TonyMontana: do you know a chat room for speaking english with others USA citiziens?

21:56 callen: TonyMontana: this would be the place.

21:58 TonyMontana: but you are talking about Clojure programming language" . I dont know this.I only know others languages, for example Java/C++

21:59 callen: TonyMontana: well, learn Clojure if you like.

22:02 TEttinger: this is the channel for http://clojure.org . If you aren't talking about clojure or applications you are writing in clojure, you won't get much response. Many IRC channels on Freenode are centered around programming languages.

22:03 seangrov`: #clojure has been attracting strange people this last couple of months

22:03 * CoconutCrab admires the tolerance of the #clojure people

22:03 callen: CoconutCrab: love your nick.

22:03 even if those creatures are terrifying.

22:04 * CoconutCrab hides on coconut tree

22:05 arohner: seangrov`: that's what happens when the channel doubles in size

22:05 TimMc: CoconutCrab: This is the image I will always see in my head when I think of that animal: http://creepyanimals.com/wordpress/wp-content/uploads/2010/02/coconut-crab.jpg

22:06 TonyMontana: what the fuck

22:06 * CoconutCrab thinks they are cute

22:06 callen: they are, in a "eats your face" sort of way.

22:06 rasmusto: it looks like a buff spider

22:06 callen: arohner: admire CCI for supporting Ambrose btw.

22:06 TEttinger: the way they move is freakier http://www.arkive.org/coconut-crab/birgus-latro/video-12.html

22:06 lunging

22:07 callen: TEttinger: egads

22:07 scariest part? not the biggest crab.

22:07 http://en.wikipedia.org/wiki/Japanese_spider_crab

22:08 leave it to Japan to have the Godzilla crab.

22:08 CoconutCrab: biggest land anthropod, IIRC

22:08 seangrov`: arohner: Hopefully the SNR doesn't get too bad

22:09 It would be interesting to graph the channel size over time

22:09 * CoconutCrab dives in clojure's documentation

22:09 callen: I think arohner has me ignored. Could someone please ask him nicely to unignore me?

22:10 chord: callen: I will if you ask the others to unignore me

22:16 callen: why do you always ignore me

22:18 marcopolo2: "Coconut crabs may be responsible for the disappearance of Amelia Earhart's remains, consuming them after her death and hoarding her skeletal remnants in their burrows."

22:19 callen: marcopolo2: LOL

22:19 marcopolo2: That's enough of the internet for tonight, good night

22:21 seangrov`: hah

22:23 TimMc: Who runs the n01se.net logger? They desperately need NTP.

22:23 CoconutCrab: I kind of want a giant land crustacean as a pet.

22:27 muhoo: TimMc: that's chouser, no?

22:28 callen: chouser is a giant land crustacean?

22:35 muhoo: n01se.net is chouser, IIRC

22:36 TEttinger: arohner: callen admires CCI for supporting Ambrose btw.

22:43 amalloy: TimMc: it's chouser for sure

22:49 chord: lets talk about starcraft 2 path finding

23:02 so how would you implement path finding if you had to

23:13 PATH FINDING

23:13 you guys we can do this together

23:14 we are all friends

23:17 AimHere: Well if you're emulating protoss dragoon pathfinding it's easy to do in clojure: (rand-nth [:north :northeast :east :southeast :south :southwest :west :northwest])

23:17 Call that every 2 seconds, you're golden

23:18 `cbp: lol

23:23 arohner: TEttinger: thanks!

23:27 muhoo: is there a conditional concat? i.e. (if foo (concat bar foo) foo) so i don't have to have foo in there 3 times?

23:28 sorry, (if foo (concat bar foo) bar)

23:30 OtherRaven: muhoo: not that I know of, though that doesn't mean much

23:30 `cbp: muhoo: you could use cond-> i guess

23:32 cond->>

23:33 muhoo: ah, good point, thanks.

23:35 TEttinger: there's a cond->> ?

23:35 ,(doc cond->>)

23:35 clojurebot: "([expr & clauses]); Takes an expression and a set of test/form pairs. Threads expr (via ->>) through each form for which the corresponding test expression is true. Note that, unlike cond branching, cond->> threading does not short circuit after the first true test expression."

23:35 muhoo: sure, and it's awesome

23:36 i didn't know about it until i read the codeq source. then i was like "yeah..."

23:37 AimHere: muhoo, if foo returns a nice falsy nil, then doesn't (concat bar foo) work just dandy?

23:38 muhoo: AimHere: no, it concats nil into the list [1 2 3 4 nil]

23:38 AimHere: That shouldn't happen

23:38 TEttinger: ,(concat [1 2 3] nil)

23:38 clojurebot: (1 2 3)

23:38 AimHere: ,(concat '(1 2 3) nil)

23:38 clojurebot: (1 2 3)

23:38 muhoo: ,(concat [1 2 3 4] [nil])

23:38 clojurebot: (1 2 3 4 nil)

23:39 TEttinger: ,(concat [1 2 3] (when false [1 2 3]))

23:39 clojurebot: (1 2 3)

23:39 metellus: that's only if foo is a vector containing nil

23:39 AimHere: (if [nil] (concat [1 2 3] [nil]))

23:39 Oops

23:39 metellus: which won't work with if either

23:40 muhoo: i ended up with (cond-> bar foo (conj foo))

23:41 still some duplication there but golf is only fun for so long

23:41 AimHere: ,(conj [1 2 3] [nil])

23:42 clojurebot: [1 2 3 [nil]]

Logging service provided by n01se.net