#clojure logs

2013-09-30

00:00ddellacostayes, but I'm really just testing existence in this specific instance, so could work.
00:04ddellacostaalso, regarding something that returns the first item that satisfies a predicate, I suppose since filter is lazy, you could just take 1
00:05TEttinger(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
00:06TEttinger,((fn [pred coll] (when (seq coll) (if (pred (first coll)) (first coll) (recur pred (next coll))))) even? [1 3 5 7 9 4 6])
00:06clojurebot4
00:06TEttinger,((fn [pred coll] (when (seq coll) (if (pred (first coll)) (first coll) (recur pred (next coll))))) even? [1 3 5 7 9])
00:06clojurebotnil
00:31marcopolo2So 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]"?
00:31marcopolo2,(pr-str [1,2,3])
00:31clojurebot"[1 2 3]"
00:33jonasenmarcopolo2: (pr-str [1 2 3 4]) returns "[1 2 3 4]" for me. What version of cljs are you using?
00:33marcopolo2jonasen: 0.0-1859
00:34marcopolo2jonasen: try calling cljs.core.pr_str.call(null,[1,2,3])
00:34marcopolo2jonasen: in the console, what do you get?
00:35mullr_I get "[1 2 3 4]" with 1909
00:35jonasenmarcopolo2: [1,2,3] in that context is not a clojure vector, it's an java array
00:35marcopolo2jonasen: you're right, cljs.core.pr_str.call(null,cljs.core.vector.call(null,[1,2,3,4])) that is a vector
00:36jonasens/java/javascript
00:36marcopolo2mullr_: I'm using core.async which I don't think has been updated to the newer cljs version
00:37jonasenmarcopolo2: the newest cljs version works fine with core.async: http://cljsfiddle.net/fiddle/jonase.snake
00:39jonasenmarcopolo2: clojurescript version 0.0-1909 and core.async 0.1.242.0-44b1e3-alpha
00:40marcopolo2jonasen: 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
00:41jonasenmarcopolo2: not that he was using 0.0-1889 and not 0.0-1909
00:41jonasens/not/note
00:42marcopolo2jonasen: Huh, thought it was core.async's fault
00:42marcopolo2jonasen: Let me update cljs, thanks!
00:42marcopolo2Now I can get sourcemaps again :)
00:46marcopolo2jonasen: You're using core.async version:0.1.242.0-44b1e3-alpha
00:47jonasenmarcopolo2: yes
00:48jonasenand I had to explicitly include [org.clojure/tools.reader "0.7.8"] in my :dependencies
00:48jonasenotherwise it pulled the wrong version for some reason
00:50marcopolo2jonasen: weird... maybe a some dependency is loading an older version?
00:55marcopolo2jonasen: Figured it out, I had a js array sneak in there
00:55marcopolo2jonasen: thank you
01:05chordanyone going to help with game yet?
01:20chordchannel dead
01:20chordplease someone tell me channel is not dead
01:21chordwhat happened with split?
01:26chordyou guys are all stupid and dumb
01:28nightflydo your own work
01:28nightflycome ask for help when you actually have something real to show
01:29chordnightfly so lets talk about diablo 3 then
01:29chordyou like diablo 3?
01:30mullr_I don't think the channel is entirely dead, merely lacking a pertinent topic.
01:32chordmullr_ work with me help me revive the channel
01:32chordi'm so bored
01:32mullr_If you're bored, I recommend http://projecteuler.net/
01:36chordmullr_ I've already got A* on the queue that fixes programming boredom, but for non programming boredom there is nothing so i'm bored
01:36mullr_very well, then I suggest /r/bored. Beyond that, you may have to look elsewhere.
01:37chordmullr_ work with me here, whats your favorite video game
01:37dissipatenot the star craft crap again...
01:37dissipatei
01:38dissipateam so sick of that
01:38mullr_chord: Not trying to be antisocial, but I imagine the channel denizens would appreciate it if most chatter was on topic.
01:38dissipatemullr_, he wants to make a starcraft clone in clojure
01:39chordmullr_ channel dead they're not even watching this window so it doesn't matter what we talk about
01:39mullr_dissipate: In this case I look forward to the demo
01:39chordFINALLY someone who doesn't hate starcraft
01:44chordmullr_ what projects have you worked on
01:45mullr_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?
01:46chordmullr_ I'm a loser who gets no respect from this channel
01:48mullr_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?
01:48chordwww.github.com/chord-rts/rts
01:49mullr_A noble goal, if far from a starcraft clone
01:49chordmullr_ i just learned how to make a window
01:50chordmullr_ these assholes in this channel won't help me get it to a full blown starcraft clone
01:50TEttingermullr_: http://replygif.net/i/149.gif
01:50mullr_chord: What's your programming background?
01:51mullr_chord: This asshole isn't going to help you either...
01:51chordI 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
01:52chordalso got banned from #python and #ruby
01:52chordso clojure is my only language that I can use to assemble a team
01:52mullr_And this is the day I got trolled on #clojure. Welcome to IRC, me! We're done here.
01:52chordmullr_ no bro I've changed
01:53TEttingermullr_, /ignore has been wonderful for this
01:53chordmullr_ I don't troll anymore the code I showed you is proof that I've changed
01:53dissipateis there a failure here to ban trolls?
01:53mullr_done
01:53TEttingerhe's used different IPs.
01:53chordmullr_ come on bro I'm going to implement an A* demo to prove that I'm not trolling anymore
01:53mullr_merely a failure to avoid feeding them, I apologize.
01:54TEttingerit's fine
01:54chord*cry cry cry* nobody likes me anymore *cry cry cyr*
01:54TEttinger*@*ip.50.47.83.14 is what I use for the filter
01:56TEttingermullr_, I'm curious about this parser work. Do you use instaparse?
01:57mullr_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
01:58mullr_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
01:58TEttingerI know some of these words
01:59TEttingerparsing is pretty over my head at this point
01:59mullr_hehe, sorry, I've been working on this for some time and tend to get caught up in it
01:59chordmullr_ if I get a demo of A* working will you help with starcraft clone project?
01:59mullr_There's a good talk on the theory instaparse is based on, if you're interested: http://www.youtube.com/watch?v=ZzsK8Am6dKU
01:59TEttingerI've been wondering about clojure-in-clojure and how it could work on a different platform, like luajit
01:59mullr_although that's not exactly what I'm using
02:00mullr_TEttinger: what do you mean?
02:01TEttingerwell 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
02:01ambrosebsisn't there a lua target already?
02:01TEttingerthe advantage would be easier interop with C in a dynamic way, I think.
02:02TEttinger:D
02:02mullr_https://github.com/takeoutweight/clojure-scheme may meet some of the same goals
02:03mullr_Indeed, https://github.com/raph-amiard/clojurescript-lua at least exists
02:04TEttingermullr_, beat me to it :)
02:04muhoofor some reason i think the official music of lua should be goa
02:04dissipatemullr_, why not just compile for LLVM?
02:06TEttingerdissipate: was that meant for me? I do think LLVM is excellent, but so is LuaJIT
02:06TEttingerLLVM has some issues running on windows last I checked, or at least clang did
02:06dissipateTEttinger, with LLVM, clojure could compete with the GHC.
02:07TEttingerdissipate, hell it could interoperate
02:07mullr_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.
02:07TEttingerF# has an LLVM port too
02:07dissipateTEttinger, i read GC support in LLVM is bad though
02:08TEttingermight be better to do it in LuaJIT, since you could (and someone already has) reused so much of cljs
02:08TEttingerI imagine targeting lua is much easier than targeting llvm opcodes
02:09dissipatemullr_, i see. i wonder how good the GC will be on LLVM
02:09dissipateTEttinger, but you get good optimization on LLVM, no?
02:10TEttingerI think on both
02:10TEttingerLuaJIT is scary fast, I've had it occasionally outpace MSVC even with aggressive optimization
02:11dissipateTEttinger, what architectures are supported for LuaJIT?
02:11TEttingera lot now.
02:11TEttingerARM and PPC as well as all common desktop arches
02:11mullr_LLVM will give you *static* optimization. Clojure's design relies on the fact that virtual method calls will be optimized at runtime.
02:12Pupnik__TEttinger: are you volunteering to write a lua output for the cljs compiuler :)
02:12TEttingerPupnik__, I have a starcraft clone to right first
02:12TEttinger*write
02:12mullr_no way, I'm writing it first :)
02:12alisdairTEttinger: it's ok, he's doing it in #erlang now
02:13TEttingeralisdair, thank you, you are an angel
02:13dissipatemullr_, what about clojure on the parrot vm?
02:13mullr_beats me, I know very little about parrot.
02:13TEttingerparrot has some issues with speed I think
02:13dissipatemullr_, i think one of the main Perl 6 compilers is for parrot
02:13mullr_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?
02:13mullr_s/through/thought/
02:13TEttingerI seem to recall they changed the way you called the VM so many times, that only Perl 6 could keep up with the changes
02:14clojurebotTitim gan éirí ort.
02:14chordalisdair wtf are you stalking me?
02:14TEttingermullr_, ooh.
02:14alisdairno i was in #erlang when you joined
02:14dissipatemullr_, it could be a self hosted VM.
02:15TEttingerhonestly, clojurescript comes close already, since it runs, everywhere.
02:15TEttingerwhich I think is the main demand
02:15TEttingerand the hardest thing, really
02:15mullr_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
02:16TEttingermullr_, I think clojure really can use mutability for some things though
02:16dissipateTEttinger, yeah, but javascript is not desirable as a target, is it?
02:16TEttingerdissipate, maybe. a lot of things do target it
02:16TEttinger$google altjs
02:16lazybot[altJS - Web coding without JavaScript.] http://altjs.org/
02:16dissipateTEttinger, yes, almost every language does.
02:17dissipateTEttinger, or rather there is a language X to JS compiler for almost every language X
02:17mullr_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.
02:17TEttingerheh indeed
02:17mullr_*in*
02:17mullr_*naive*
02:18dissipatemullr_, that's a great point, i never realized that.
02:18dissipatemullr_, since the JVM assumes mutability, it is not optimized for immutable data structures
02:19mullr_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.
02:20TEttingerdissipate, 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
02:20Pupnik__TEttinger: if that lua target for the cljs compiler just outputs plain old lua theres nothing stopping you frmo running it on luajit
02:20dissipateTEttinger, what do you think about switching browsers over to a bytecode based virtual machine that can access the DOM? forget about javascript.
02:20Pupnik__since it targets 5.1
02:21TEttingerdissipate, oh man I have thought about alternate internet formats for a little while now
02:21TEttingerit's all pie-in-the-sky, but it has a lot of potential
02:22TEttinger(that would never kick in unless there's some SOPA-style crippling regulation on the WWW)
02:22dissipateTEttinger, what do you think of just streaming instructions?
02:23dissipatebrowsers would just be sandboxed thin apps that received instructions on the fly
02:27TEttingerI 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
02:28dissipateTEttinger, S expressions no doubt
02:28TEttingeryou bet.
02:29TEttingerthe other advantage to using an S-Exp-based web format is how easily they could be piped from webpage to webpage
02:29dissipateTEttinger, 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?
02:29TEttingeryep
02:30TEttingerso he made a lot of scheme's qualities have a C-like syntax
02:30dissipateok, just checking. :P
02:30TEttingerand then MS made VBScript and screwed up the net :P
02:30TEttinger"we can't be compatible, they're competitors!"
02:31dissipatei 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.
02:32dissipatecompile your stuff server side with whatever tools
02:32TEttingerI like the idea of clojailing everything and just executing clojure for webpages.
02:32echo-areaIsn't javascript being described as "the assembly language" in clojurescript's introduction?
02:33dissipateecho-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.
02:35Pupnik__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
02:35muhooidle wonderment: has anyone used instaparse to parse javascript and had it actually work?
02:37dissipatePupnik__, i'm not talking about JVM. some other VM that can access the DOM directly.
02:37TEttingerdissipate, have you seen Google Native Client?
02:37echo-areadissipate: Maybe javascript would become the de facto "bytecode" language, because it's involved spontaneously
02:37TEttingerdissipate, I think that was in reference to when I said clojail, which uses the JVM
02:37dissipateTEttinger, nope, haven't tried it.
02:38TEttingerit's bytecode for chrome
02:38TEttingerand chromium
02:38TEttinger$google google native client
02:38lazybot[nativeclient - Native code for web apps - Google Project Hosting] http://code.google.com/p/nativeclient/
02:38dissipateecho-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.
02:38CuaTEttinger: isn't it native code for the platform? x86/arm/etc..
02:38Cuawhere they use static analysis to make sure the binary behaves
02:38dissipateTEttinger, interesting. definitely checking it out.
02:39echo-areadissipate: Good to know
02:40dissipateTEttinger, looks like a competitor to asm js and HTML5
02:41TEttingerheh. but it is meant to port complex C/C++ apps to the browser
02:41dissipateTEttinger, yeah, the language restriction is lame.
02:41TEttingerby running x86 in the browser, effectively
02:41dissipateTEttinger, what about ARM for mobile devices?
02:42TEttingerI think it interprets it actually, but I don't really know
02:42TEttingerHowever, 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.
02:44TEttingerhttps://developers.google.com/native-client/announcements ah, they're getting close
02:44TEttingerPNaCl is basically sandboxed LLVM opcodes
02:45dissipateTEttinger, Sounds pretty restrictive. sure it has its use cases though.
02:45TEttingeryeah, Bastion ported a large SDL app with it
02:45TEttingerI think Bastion was monogame actually
03:41sm0kehello 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?
03:41sm0kei mean not called on each item in sequence
03:43mullr_well, you'd want to do the open on the socket itself, not the sequence, right?
03:43sm0kemullr_: yea i know whats wrong there..
03:44sm0kemullr_: just want a elegant way to open multiple sockets
03:45mullr_Well, it's never easy to do that with open-socket unfortunately.
03:45mullr_sorry, with-open
03:45rhg^-1pmap an anonymous function
03:45mullr_that's a good idea
03:46sm0kethe 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
03:46rhg^-1I tend to hands those at 2am lol
03:46sm0keso close cant be last statement
03:46SegFaultAXUsing map for side-effects is an anti-pattern.
03:46sm0kealthough i guess i can use try finally
03:46rhg^-1True
03:47chordSo here is a question how do I do the pathfinding in starcraft 2
03:47rhg^-1do seq
03:47SegFaultAXchord: Start simple.
03:47chordSegFaultAX: how does that help
03:48SegFaultAXchord: Pathfinding on a large scale can be very challenging to do efficiently.
03:48sm0kewhy is using map in side effect code an antipattern?
03:49chordSegFaultAX: I keep reading about A* on nav mesh, but what exactly does that mean
03:49nightflyI've wondered how path finding even works in a vector rather than a raster space
03:49sm0kehow will i generate a seq from each socket by reading data than?
03:49metellussm0ke: map is lazy, so the side effects don't actually happen until the seq is realized
03:49rhg^-1It's for processing lists to lists
03:49dobry-denwhy not (let [result ...] (close-sockets) result)
03:49dobry-densm0ke:
03:49rhg^-1Not effects
03:49SegFaultAXsm0ke: Why are you managing sockets directly?
03:49rhg^-1Semantics
03:49chordSegFaultAX: tell me that you're a path finding expert
03:50sm0kedobry-den: thanks for that ugly tip :D :) gonna us that
03:50sm0keuse*
03:50SegFaultAXchord: I'm not, but used to work in games. That wasn't really my area, but incremental pathfinding was a challenge.
03:50SegFaultAX(Especially on relatively resource constrained mobile devices)
03:51sm0kei guess i can use (for) instead of (map) for side effect code
03:51hyPiRionno
03:51dobry-dendoseq
03:51hyPiRion^
03:51rhg^-1^
03:51sm0keeee doseq doesnt 'yield' its just iteratoin right?
03:51dobry-denmap and for will return a collection of intermediate values. doseq doesnt
03:51sm0kewhy isnt there a yield in clojure
03:52sm0kedobry-den: yes yes
03:52dobry-denwell, if you have side-effect with a return value, i'd prob use for.
03:52chordSegFaultAX: what do you mean is a problem, starcraft 2 does pathfinding just fine it seems
03:52sm0kedobry-den: thansk again for verifiying
03:53hyPiRionI'd probably use naov
03:53hyPiRionmapv*
03:53rhg^-1I'd say it's a code smell
03:53SegFaultAXhyPiRion: Don't you hate when your fingers are a key off?
03:53hyPiRionSegFaultAX: haha, yeah
03:53SegFaultAXchord: I didn't say impossible, just challenging.
03:53dobry-denprobably but sm0ke should prob arrive at version1.0 first
03:54dobry-denbefore dicking around with WWJD
03:54sm0kewhats WWJD?
03:54SegFaultAXI guessed "what would java do"
03:54dobry-denwhat would jesus do
03:54sm0keHaha nice one...
03:55sm0keWWSD: what would SegFaultAX do
03:55rhg^-1K...
03:55SegFaultAXsm0ke: Not manage sockets directly. Use a library.
03:55rhg^-1+1
03:56sm0keSegFaultAX: sorry but imo thats superficial to say unless you dont know what i am doing
03:56SegFaultAXsm0ke: Unless you're writing a socket library, it doesn't really matter to me.
03:57SegFaultAXManaging socket pools or [insert resource here] pools in general is a solved problem, particularly in Java land.
03:57chordok team here is a next group project: figure out how starcraft 2 does path finding then produce a proof of concept working example
03:57chordok teamt break lets go
03:57sm0kei 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
03:57SegFaultAXsm0ke: Ok, why are you doing this?
03:57sm0keSegFaultAX: to get buch of free ports?
03:58sm0kebunch*
03:58dobry-den(SocketServer. post) and then binding io/input-stream and io/output-stream to client sockets is pretty standard fare.
03:59dobry-deni think there's plenty of socket stuff you can do without needing a library
03:59dobry-deni thought java was the library
04:00sm0kei agree...you can really make an irc client with a simple socket if you know what coming down the wire
04:00sm0kedont need an irc library
04:00dobry-denyeah, so i imagine SegFaultAX is thinking of something more complex than some telnet shit
04:00sm0keyes you never know WWSD
04:01dobry-dennever a dull moment with WWSD
04:04SegFaultAXOne 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.
04:05dobry-denin clojure, i find that it's too easy to find myself rolling everything myself.
04:06dobry-denshaving all the yaks
04:08SegFaultAXWell 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.
04:08SegFaultAXMaybe one of /the/ important skills.
04:09chordstarcraft 2 path finding
04:09chordcome on guys help me
04:09chordjust this one time
04:09chordthen you can ignore me
04:09SegFaultAXSo 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.
04:10JardaSegFaultAX: 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
04:11chordJarda: you are a path finding expert right
04:11Jardalike 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
04:11sm0kechord: hey who told you to write a game in clojure?
04:12Jardathan to use half an hour trying to find out how to implement
04:12sm0kei really think thats a strange decision
04:12chordsm0ke: how the hell does starcraft 2 do pathfinding, its something to do with a* and nav mesh but its hard to find gritty details
04:12sm0kechord: i dont know starcraft sorry
04:13chordsm0ke: but you know path finding
04:13sm0keyea i find my way to home everyday :D
04:13sm0kewhat kind of path finding you can use dijkastras?
04:14chordsm0ke: i'm talking about not on a grid but on a polygonal area
04:14sm0kethere are fancy things like a*..but thats when you have grid layout with abstacles
04:14dobry-deni 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.
04:14SegFaultAXJarda: Again, knowing when to invent and when to reuse is a _skill_
04:15chorddobry-den: if you know how to do starcraft 2 like path finding i'm listening
04:15sm0kewtf is pathfinding on plygon?
04:15SegFaultAXAnd it's very often that there isn't a right answer. Then you have to go on gut or team consensus.
04:15chordsm0ke: look in most modern 3d games you can move in any direction not just constrained to a grid right?
04:15glosolihey 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?
04:15JardaSegFaultAX: but in my short experience with clojure comparing to other languages I find doing stuff myself with clojure often quick and effective
04:16Jardabecause the syntax is so powerful
04:16sm0keSegFaultAX: eee man we got your point but lets be realistic some an already written library is not the nest anwser..that it!
04:16sm0kesometimes*
04:16sm0kebest*
04:16sm0kecrap
04:16SegFaultAXJarda: Sure, but it's not just about LOC. You're also trading off productiveness, time spent debugging, documentation, etc.
04:17chordOK LOOK CLOJURE IS JUST GOOD CAN WE GO BACK TO STRARCRAFT 2 PATHFINDING PROBLEM
04:17sm0kechord: yes but why dont you divide your map into sectors than its grid with abstacles!
04:17dobry-denglosoli: maybe if it's an assertion, but usually db-fetches are done in something like a (when-let [user (db/find-user id)] ...)
04:17SegFaultAXchord: Please stop spamming.
04:18JardaSegFaultAX: 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
04:18chordsm0ke: how does that give you paths with arbitrary angles
04:18glosolidobry-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?
04:19Jardabut yeah, I'm of course using ring and compojure and friends to not invent the (complex) wheels
04:19SegFaultAXJarda: Well, that all depends. Anyway, you get the idea.
04:19sm0kechord: 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
04:21SegFaultAXchord: Just pre-compute the path finding nodes for each map.
04:21chordSegFaultAX: and how does that help
04:21dobry-denglosoli: do you have a code example
04:22SegFaultAXchord: 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)
04:23SegFaultAXchord: If you precompute the pf grid, it's much less expensive to do large scale pathing.
04:23chordSegFaultAX: I found a blog on it http://www.third-helix.com/2011/03/gdc-2011-ai-summit/
04:23SegFaultAXAnd potentially simpler to implement, since you can determine ahead of time static obstacles like terrain.
04:24chordSegFaultAX: need you to translate it to english
04:24glosolidobry-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
04:24glosolidobry-den: though I made a mistake in bpaste it's not doc but description
04:25chordSegFaultAX: 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/
04:27dobry-denglosoli: that looks pretty standard although i'd just do (when description ...) unless you need to differentiate between nil and false
04:27glosolidobry-den: aah I don't, ok thaks! :)
04:28glosolithanks"
04:34chordSegFaultAX: did you read the blog post
04:42chordSegFaultAX are you there?
04:42chorddobry-den: did you read the blog?
05:56chordyou are all dumb
05:56chorddid you know that
05:56chordyah you didn't know it so I'm telling you
06:31glosoliHmm 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)
06:34ciphergothJust run "slamhound" over my sources, and it's got rid of all the things that say eg (:require [foo.bar.baz])
06:34ciphergothwhere I refer to foo.bar.baz/quux in the sources
06:35ciphergothIs there a way to prevent that?
06:41ciphergoth(: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.
07:43sm0keis it possible to figure out from where i am getting a dependency like log4j
07:43sm0kein lein
07:44mullrsm0ke: I seem to remember a way to print the dependency tree
07:44TEttingerlein deps :tree ; ?
07:44sm0keTEttinger: awesome
07:45mullrhow delightfully legible :)
07:45TEttingertake out the ; ?
07:45TEttingerI don't know if it works or if it goes by a different command
07:47TEttingerwow nice, it works
07:47sm0keits actually very nicely printed..god job lein
07:47sm0kethe best ive ever seen
07:50utkarshwhat is the current preferred way to run small clojure scripts quickly (jvm boot)? "drip"?
07:50utkarshor is there something better/new?
07:55hyPiRionnot yet, afaik
08:47s4muelutkarsh: https://github.com/technomancy/grenchman
08:51JookiaDoes Clojure handle Unicode in implementation or in its standard? Or not at all?
08:52clgvJookia: the JVM handles Unicode ;)
08:52Jookiaclgv: So if I write an application in Clojure, it's Unicode status is implementation defined, meaning moving to something like Javascript will ruin things?
08:53clgvJookia: huh? what exactly do you mean?
08:54utkarshs4muel: ah, thanks, will check it out.
09:09john2xI 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
09:14Jookiaclgv: I mean, in C++ strings are made of chars which are usually 8 bits. What does Clojure define chars as?
09:15clgvJookia: clojure does not define them. the JVM does with its String and Char classes
09:15Jookiaclgv: Oh.
09:21clgvjohn2x: you cant do that via the functions doall+map
09:22john2xclgv: i'll have to call the macro for each string?
09:22clgvjohn2x: you need a macro to do it
09:23john2xok, so a second macro which accepts a vector of strings?
09:24clgvjohn2x: yeah and maybe the macro you apply the strings to if that generality is useful
09:26john2xhmm how would this second macro look like? I still can't use doall+map to apply the first macro over the strings?
09:33jagajis there somewhere that describes a basic and modern clojure + emacs setup (that isn't a video)? everything I'm finding is pretty old.
09:38jstewjagaj: 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
09:43clgvjohn2x: (defmacro mapply [m & args] `(do ~@(map (fn [x] `(m ~x)) args)))
09:44clgvoh little error
09:44edwI've been getting illegal access errors on starting nrepl recently with a 'pp does not exist' exception and stacktrace. Anyone else seen this?
09:44clgvjohn2x: (defmacro mapply [m & args] `(do ~@(map (fn [x] (list m x)) args)))
09:45john2xclgv: wow, thanks!
09:47clgvnp
09:52john2xtrying to understand the macro, why doesn't (do (map #((list m %)) args)) work?
09:53john2xi mean why does it need to be done in a macro?
09:56clgvjohn2x: because it needs to be executed at macro expansion time (or compile time) whereas your doall+map is executed at runtime
09:57john2xah, makes sense. thanks again!
10:02mimieux
10:24edwI've been getting illegal access errors on starting nrepl recently with a 'pp does not exist' exception and stacktrace. Anyone else seen this?
10:26seangrov`Is there a good lein template for starting a new clojure web-server project?
10:30jonasenseangrov`: lein new compojure <name>?
10:41sm0kehello i am using edn for configuring my project...do i write every property down in a giant map? is that idomatic?
10:43clgvsm0ke: you could. but if it is natural for your application you can also use nested maps
10:44sm0keclgv: thanks that makes sense ...to nest ealted config props in one key as another map
10:44sm0kerelated*
10:46sm0kehmm i think someone should send a patch to fireplace to classify .edn also as a clojure source
10:46mdrogalissm0ke: Sometimes I do [{..} {..} {..}]
10:46mdrogalisAkin to Datomic's schema format.
10:49sm0kemdrogalis: how does that helps with reading simple config at all?
10:50mdrogalissm0ke: It depends on your circumstances. It's just another option to know about.
10:51sm0keyea i guess mix and match clojure data structures as needed
10:54sm0keso another question...how do i get a file on classpath? easy clojure way
10:55mdrogalissm0ke: Are you using Leiningen?
10:55llasramsm0ke: clojure.java.io/resource
10:55lunk,(let-fn [(foo [x] (+ 5 x))] (foo 7))
10:55clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: let-fn in this context, compiling:(NO_SOURCE_PATH:0:0)>
10:56sm0kellasram: thanks
10:56Bronsalunk: it's letfn
10:56Bronsa,(letfn [(foo [x] (+ x 5))] (foo 7))
10:56clojurebot12
10:57lunk!!!
10:57lunkhah, it was a more basic error than i thought
10:57lunkthanks
11:00wakeuphi
11:02sm0kei am getting a Cyclic load dependency among my namespaces what should i do?
11:04sm0kei must be doing things the wrong way i gues
11:04vijaykiransm0ke: separate out common functions into a different namespace
11:05wakeupUsing compojure: How do I access ring's sessions?
11:06sm0kevijaykiran: thanks
11:07vijaykiranwakeup: request should have a session key .. you can read it in handler functions
11:07wakeupAh I got it
11:08wakeupwas doing bad destructuring
11:08wakeupok
11:09wakeupdoes anybody know by coincidence if/how I can get a list of all
11:09wakeupsession maps?
11:34seangrov`How do I specify multiple dynamic class names in a hiccup template?
11:35seangrov`Right now I have something like [:a {:class (str name " " "logo")} "..."], but it seems pretty ugly
11:41klrr_clojure vs racket, which is best
11:42nDuffDepends on what you want.
11:42klrr_i want lisp
11:42nDuffRacket is probably a better teaching language. It certainly has a much more flexible parsing model.
11:42nDuff*shrug*. Too big a question to answer definitively.
11:42klrr_im talking about #lang racket, not their HTDP book
11:43nDuff...but if "I want LISP" means you care about purity over practicality, go with Racket.
11:43klrr_purity as in pure functions or purity as in something else?
11:44nDuffAbout willingness to make design decisions that trade against practicality.
11:44klrr_nDuff: well, i dont got problem thinking functionally if that's what you mean
11:45klrr_so, racket is "more" functional than clojure? i thought clojure advocated FP
11:45nDuffI didn't say anything about that.
11:45ChousukeI don't think racket is less pragmatic than clojure, really
11:45`cbpI want to learn racket to study math as inspired by Sussman's talk.
11:45ChousukeClojure just runs on the JVM which can be a major practical benefit.
11:46nDuffklrr_: ...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:46klrr_im not talking about ecosystem or implementation, im tlaking about language itself
11:46klrr_okey
11:46bbloom_klrr_: why don't you read http://clojure.org/rationale and a bit of http://racket-lang.org/ to get a feel
11:46bbloom_then try one or both for a while for your particular use cases
11:46Chousukeklrr_: in Clojure's case, those are the same thing
11:46bbloom_they are both great languages
11:47sm0kelein guys why doesnt lein uberjar makes a runable one?
11:47sm0kei meant hey guys
11:47sm0ke:/
11:47klrr_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`cbpsm0ke: you can java -jar the uberjar
11:47bbloom_klrr_: maybe spend some time studyign https://github.com/flatland/lazybot
11:48klrr_gonna check it out, but i suck at reading code
11:48Chousukeklrr_: well, "don't work" really doesn't say much about what is wrong :P
11:48bbloom_klrr_: then i suggest learning how to do that before learning clojure or racket ;-)
11:48nDuffsm0ke: if your OS is set up right, you don't need shebang magic for a jar to be runnable.
11:48Chousukeit's probably not a problem with the language though
11:48nDuffsm0ke: Linux has had the ability to pick interpreters based on file magic for ages, and Windows does the same based on extensions.
11:48klrr_it compiles but dont work
11:49Chousukewell you have a bug, then
11:49Chousukeor several
11:49sm0ke`cbp: its doesnt run like that
11:49klrr_thanks for info
11:49nDuffsm0ke: ...then we'd need a reproducer.
11:49sm0ke`cbp: i already have a :main in project.clj..and lein run also works
11:49`cbpsm0ke: then you're missing a main namespace, a -main function and a :gen-class on the main name space i think
11:49llasramnDuff: 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`cbpsm0ke: then maybe you're missing the :gen-class
11:50`cbpsm0ke: an error message after you do java -jar would be helpful :P
11:50sm0kewait ..i get this error ..Error: Could not find or load main class my_project.core
11:51`cbpsm0ke: you're missing (:gen-class) in that namespace
11:51seangrov`Is there a better way of destructuring this? https://www.refheap.com/a0bbfac3c320ab92aaafa878f
11:52sm0ke`cbp: but why doesnt `lein run` requires a gen-class
11:52EchoBot1Echo: `cbp: but why doesnt `lein run` requires a gen-class
11:52seangrov`I thought the map would be coerced into a seqable and nth would work
11:52EchoBot1Echo: I thought the map would be coerced into a seqable and nth would work
11:52`cbpseangrov`: you can use {:strings []} i think or maybe its :strs
11:52EchoBot1Echo: seangrov`: you can use {:strings []} i think or maybe its :strs
11:53seangrov``cbp: problem is I don't know the keys ahead of time
11:53sm0ke,(print "/kick EchoBot1")
11:53EchoBot1Echo: ,(print "/kick EchoBot1")
11:53clojurebot/kick EchoBot1
11:53EchoBot1Echo: /kick EchoBot1
11:53ambrosebsseangrov`: I think you just want (let [[[k v]] map] ...)
11:53EchoBot1Echo: seangrov`: I think you just want (let [[[k v]] map] ...)
11:53nDuffsm0ke: because ''lein run'' is using the Clojure compiler, so it doesn't need things to be compiled ahead-of-time?
11:53EchoBot1Echo: sm0ke: because ''lein run'' is using the Clojure compiler, so it doesn't need things to be compiled ahead-of-time?
11:54nDuff/ignore EchoBot1!*@* ALL
11:54EchoBot1Echo: /ignore EchoBot1!*@* ALL
11:54sm0kenDuff: cant i just put an :aot in project.clj instead of modifying my code?
11:54EchoBot1Echo: nDuff: cant i just put an :aot in project.clj instead of modifying my code?
11:55seangrov`,(let [m {:a 10} [[k v]] m] k)
11:55clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>
11:55nDuffsm0ke: better not to.
11:55seangrov`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:55clojurebot:a
11:56llasramsm0ke, nDuff: And that still won't create a class for the namespace
11:56seangrov``cbp: Yeah, was trying to avoid an explicit seq call so I could put the binding form in the fn params
11:56llasramsm0ke: Instead of adding gen-class to your code, I suggest just launching via the Clojure library main class
11:56llasramsm0ke: Remove the `:main` key from your project.clj
11:56seangrov`Not the biggest deal in the world, but the difference between 2 lines and ~5
11:56sm0keoh googling shows that i only need to put (:gen-class) inside my ns
11:56sm0kethats should be ok ..let me try
11:57llasramThen run like: java -cp my-project.jar clojure.main -m my.name.space
11:57`cbpseangrov`: 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`cbpsince*
11:57sm0kellasram: thanks for that tip going to note that one down
11:58sm0kebut its really hairy..for that i need to remove :main?
11:58seangrov``cbp: Yeah, this data structure is a little wonky - it's a vector of maps with only one k:v pair
11:58seangrov`I realize it's an edge case though, so not worried about it at all, thanks
12:00sm0kecrap ..now there seems to be probject with config file i put inside /resource folder..
12:00sm0keproblem*
12:01`cbpsm0ke: use clojure.java.io/resource to get a path to files inside the jar
12:01sm0ke(io/file (io/resource..) fails for config file inside resource when run from uberjar
12:01llasramsm0ke: Just don't call `io/file` on it
12:01llasramThe return value is a URL, which you can open a reader on etc just fine
12:02sm0kecan i (slurp (io/resouce)) ?
12:02llasramyes
12:02sm0kenice
12:03sm0keyou guys are awesome..
12:03sm0kejust one last thing..i get this warning..Warning: specified :main without including it in :aot.
12:03sm0keImplicit AOT of :main will be removed in Leiningen 3.0.0
12:04mtpok
12:05llasramsm0ke: 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:05llasramThe lein `app` template adds that for you even
12:06llasramIf you have that, then you'll get everything AOTed whenever you build an uberjar anyway
12:06sm0kellasram: i just did a :aot [myproject.core] ..it seems to remove that warning
12:06llasramYeah, but also means your main namespace is always AOTed, even when launching a REPL
12:07llasramWHich is almost never what you really want
12:08sm0kellasram: thanks ...:uberjar profile makes sense
12:08sm0kellasram: why wouldnt you want aot compilation for repl btw?
12:09llasramsm0ke: 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:09CommandBotGreetings! 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:11CommandBotGreetings! 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:11llasramsm0ke: 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:12llasramIt 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:12llasramIt 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:13llasramAOT is a fine optimization for deployment, but is bad bad news for development
12:28`cbp(inc llasram)
12:28lazybot⇒ 10
12:37bbloom_ambrosebs: i find it entertaining how little some haskell proponents know about the fundamentals of type theory
12:38ambrosebsbbloom_: what have you seen now?
12:38bbloom_ambrosebs: all the people who keep suggesting unsafeWhatever as a way to turn off type checking
12:38bbloom_horrible.
12:39indigoWhy would you want to turn off type checking in Haskell
12:39ambrosebsbbloom_: I'm surprised it's named so mildly after learning what it really does.
12:40technomancyambrosebs: congrats on meeting your goal. curious: what made you go with indiegogo for the campaign?
12:40bbloom_ambrosebs: it's not "mild" it's precise
12:40bbloom_"safe" has a very particular meaning in type theory
12:40bbloom_see http://msdn.microsoft.com/en-us/library/vstudio/t2yzs44b.aspx too
12:41ambrosebstechnomancy: AFAIK kickstarter doesn't support australians
12:41technomancyoof; that sucks
12:41bbloom_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:41ambrosebsbbloom_: I assumed it meant "statically unsafe"
12:41seangrov`ambrosebs: Out of principle?
12:41indigoTIL you can use pointers in C#
12:41bbloom_ambrosebs: ah i see
12:41technomancyseangrov`: ahaha
12:41bbloom_indigo: C#'s native interop features are AMAZING
12:42bbloom_indigo: unsafe code & Managed C++ are a fucking feat of engineering
12:42indigoHeh
12:42justin_smithdidn't a bunch of the haskell people work on that vm?
12:42bbloom_seriously. the CLR's design is stellar
12:42bbloom_justin_smith: yup. heavily influenced by MSR
12:42bbloom_and MSR is/was a major GHC contributor
12:43technomancybbloom_: especially compared to JNI, I'll bet
12:43bbloom_technomancy: no contest.
12:43bbloom_technomancy: being able to pin memory and tell the GC to work around you is mega useful
12:43bbloom_you can get crazy good perf out of your interop libs
12:44technomancybbloom_: counting my blessings that I have never had to care about that
12:44bbloom_however, the CLR is clearly tuned for a type system that is better than the JVMs, so their JIT isn't as good
12:44bbloom_but it's a manhours limitation, not a design one
12:45bbloom_technomancy: eh, pinning memory is fun. it's when you need to do COM that things get depressing :-P
12:46technomancybbloom_: I've been interfacing with libreadline from ocaml recently and it's not as bad as I was expecting
12:47bbloom_technomancy: yeah, if you have good facilities for it, it's no more painful than writing C
12:48bbloom_except maybe a larger conceptual surface area
12:48technomancythat's some faint praise for you
12:49bbloom_anyway, ambrosebs: when do we get a stretch goal that lets us infer type hints to prevent reflection in CinC? :-)
12:50bordatoueis there anyway to split string within double qoutes
12:51`cbpbordatoue: I'm not sure what you mean can you give an example?
12:52ambrosebsbbloom_: sounds like something we'd need CinC for :)
12:52ambrosebsbbloom_: oh
12:52ambrosebsbbloom_: didn't read that properly :P
12:53bordatoue`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:53ambrosebsbbloom_: stretch goals will be core.typed from here on :)
12:53justin_smithbordatoue: something like
12:53justin_smith,(clojure.string/split "this string \"has a quote\" in it" #"\"[^\"]*\"")
12:53marcopolo2ambrosebs: Congrats on meeting your goal, I'm excited to see what you'll get done! :D
12:53clojurebot["this string " " in it"]
12:53ambrosebsmarcopolo2: thanks!
12:54marcopolo2ambrosebs: How possible is core.typed on Clojurescript?
12:54ambrosebsI'm hoping to get maybe 8-10 months of dev time. I can get some serious work done then.
12:54ambrosebsmarcopolo2: already possible.
12:55marcopolo2ambrosebs: woah! Can I use it now?
12:55ambrosebsmarcopolo2: 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:55ambrosebsmarcopolo2: it's needs a lot more work but the basics are there
12:56ambrosebsI'll probably release a typed CLJS tutorial with my next stretch goal
12:56`cbpbordatoue: ##(map second (re-seq #"\"([^\"]+)\"" "\"a\", \"b\", \"c,e\""))
12:56lazybot⇒ ("a" "b" "c,e")
12:57`cbpoh or justin_smith's
12:57marcopolo2ambrosebs: nice!
12:57justin_smithmine was almost there, yours is closer to what he wants
12:58rasmustois this a reasonable use case for reduce? I want to make sure that the function is deterministic https://www.refheap.com/19176
12:59bordatoue `cbp: thanks very much, I was trying to solve it using a single regex rexpression
13:00marcopolo2rasmusto: What is this suppose to do?
13:02`cbprasmusto: I think any operation that goes fully through a collection to get a single value is a reasonable case for reduce
13:03AimHereWhy stop at single values. Reduce will handily turn a collection into another one if you ask it nicely!
13:04`cbpOk I guess i shouldve said anything that goes through a collection fully is a good case for reduce :P
13:04rasmustomarcopolo2: 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:04rasmustomarcopolo2: those are the :used items
13:05rasmusto`cbp: okay, thanks
13:05bordatoue`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:07marcopolo2rasmusto: 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:08AimHereWell if you have an infinite collection going in, you might not get anything out at all with reduce
13:09`cbpbordatoue: you can do something like (map #(re-seq..) (line-seq input))
13:09bordatoue`cbp: thanks
13:10`cbpbordatoue: unless the file is huge then you might want something different from map
13:14rasmustothe 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:25marcopolo2I've gotten to a stable point in my webworker library for clojurescript: https://github.com/MarcoPolo/servant
13:26marcopolo2It uses core.async to deal with webworkers in a sane way. It's somewhat similar to core.async's thread call
13:30arrdemwith ac-nrepl, is there a way to automagically populate the ac name trie with the symbols in my ns?
13:30justin_smithreduce can also be used if you don't want to traverse the whole input
13:30justin_smith,(reduce (fn [a b] (if (number? b) (reduced a) (conj a b))) [] [:a :b :c :d 0 :e :f])
13:30clojurebot[:a :b :c :d]
13:31seangrov`marcopolo2: Should the if-not in the readme be when-not?
13:32marcopolo2seangrov`: yeah, it should
13:33seangrov`marcopolo2: Looks really interesting! Do I have to be using core.async in my project to use servant though?
13:34marcopolo2seangrov`: You do because the call to a servant-fn will return a channel where the result will be
13:34marcopolo2seangrov`: Also thanks :)
13:35seangrov`It's too bad there isn't a way to seamlessly combine core.async-using and non-core.async-using libraries :P
13:35tbaldridgeseangrov`: it's called a callback
13:36tbaldridgeseangrov`: (take! c (fn [val] ...dosomething...))
13:36rasmustojustin_smith: oh, cool!
13:36seangrov`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:37coredhttp://www.indiegogo.com/projects/typed-clojure
13:37coredthat looks interesting
13:40muhooseangrov`: why?
13:40muhooif it's referentially transparent, should it matter?
13:42seangrov`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:43seangrov`It really feels like it's mixing things up and splitting the ecosystem a bit
13:44seangrov`Not the biggest deal in the world obviously, but and interesting problem I've been thinking over recently
13:44tbaldridgeseangrov`: some might say it is the new ecosystem :-P
13:44muhooindeed, core.async appears to be taking over the world
13:44muhoobut there's a way to make async things sync, by using promises/futures/etc, IIRC
13:45geoffegi 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:46muhoowhy couldn't you do network i/o in core.async? seems like it'd be ideally suited for it.
13:47marcopolo2seangrov`: 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:48geoffeghttp://clojure.com/blog/2013/06/28/clojure-core-async-channels.html (see the "Future Directions" section)
13:48tbaldridgegeoffeg: it's a hard topic (channels over a network), and I don't think there is a good solution
13:49mdrogalisI was just going to summon you for an answer, tbaldridge :)
13:49tbaldridgegeoffeg: 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:49tbaldridgenot to mention that stuff like alt! is pretty much impossible to do over a connection.
13:50tbaldridgeMy advice? Wrap rabbit-mq or zero-mq, and interop via core.async.
13:51geoffegtbaldridge: 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:52marcopolo2geoffeg: That isn't hard at all, I had to do something similar for the servant library
13:52tbaldridgegeoffeg: that can be done, use web workers and put!/take!
13:53tbaldridge*web sockets
13:53muhooi did something like that with web sockets and edn recently
13:54geoffegthanks, i'll take a look
13:54tbaldridge(inc muhoo)
13:54lazybot⇒ 3
13:54muhooit was long-polling, core.async wasn't out yet so i had a j.u.c queue instead
13:54tbaldridgeyeah if you use http-kit it's about 30 lines of code total
13:54muhooah, right, looking, i migrated from web sockets to long polling
13:55muhoofor backwards compatibility
13:55muhoosockets was easier tho.
13:55marcopolo2muhoo: j.u.c. queue?
13:56muhoomarcopolo2: yep, looking up which one, there was a neat little hack i got from alan that helped
13:59muhoohttps://github.com/flatland/useful/blob/develop/src/flatland/useful/state.clj#L54 i
14:00muhoomarcopolo2: i used clojure.core.cache/fifo-cache-factory
14:00muhoonot sure why
14:01muhooso basically it was a blocking queue
14:01marcopolo2muhoo: That's practically the definition of a channel!
14:02muhooyeah, i was reinventing the wheel
14:02muhoonow i use lamina, and soon i'm sure i'll join the core.async bandwagon
14:08`cbpjustin_smith: :-O I didn't know that
14:09`cbp(inc justin_smith)
14:09lazybot⇒ 7
14:11marcopolo2`cbp: since 1.5 apparently https://github.com/clojure/clojure/blob/c6756a8bab137128c8119add29a25b0a88509900/src/clj/clojure/core.clj#L6139
14:12`cbp:-)
14:24rasmustohow does reduced work with a parallel reduce?
14:30llasramrasmusto: Only `fold` may happen in parallel, not `reduce`
14:30rasmustollasram: ah, okay. And I assume that "reduced" doesn't work there :)
14:30callenllasram: reduce reduce or Clojure foldy reduce?
14:31borkdudesay 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:31llasramrasmusto: I don't believe so, although I think it could sanely end a part of the computation early
14:31rasmustohmm, ok
14:32llasramcallen: 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:32callenllasram: well, by your response, now I know the bit that matters.
14:32callenI should re-read the code in reducers
14:33llasramcallen: fair enough :-)
14:34borkdudesomething like this? https://www.refheap.com/19181
14:35rasmusto,(map (fn [m] (if (= (:name m) "foo") (assoc m :function string?) m)) [{:name "foo" :function nil} {:name "bar" :function nil}])
14:35clojurebot({:name "foo", :function #<core$string_QMARK_ clojure.core$string_QMARK_@1d2d2c9>} {:name "bar", :function nil})
14:35rasmustowhoooo, I matched my parens!
14:35borkduderasmusto ok
14:35rasmustoborkdude: yeah, that seems about right
14:36borkdudeI was wondering, maybe there is something like qpath expressions for clojure collections :)
14:36rasmustoborkdude: I don't know what those are
15:04yediwhat are some good clojure cup entries
15:04muhoolink to the clojure cup entries?
15:05callenmuhoo: http://clojurecup.com/apps.html
15:06muhoohuh, no apps there, in chrome on android anyway
15:06yedicallen, what was yours
15:06`cbpcallen: which one did you guys make
15:06Jardamuhoo: you need to login (with a github id or something)
15:06muhoo:-/
15:07callen`cbp: Simonides
15:07callenyedi: ^^
15:07muhooone day, people will have websites that you don't have to login to see the the content of.
15:07callenmy team was myself, gf3, noprompt, and s4muel.
15:07callenmuhoo: you don't need to be logged in
15:07callenmuhoo: click my damn link I sent you
15:07callenI sent you the link to the clojure cup apps.
15:07Jardacallen: you can't see anything without login there
15:07arrdemdamnit.. we didn't even get a ranking up :/
15:08callenarrdem: er. ranking? what?
15:08arrdemcallen: http://clojurecup.com/app.html?app=cloutjure
15:09callenoh damn.
15:09callenus: http://clojurecup.com/app.html?app=simonides
15:09JardaI don't really like those sites
15:09Jardait seems it's just buggy when you are not logged in
15:09muhooJarda: no anonymity for you!
15:10muhoowe must track everything you do, everything you see
15:10Jardahttp://dl.dropbox.com/u/1815350/Selection_022.png
15:10callenmuhoo: can you put off the 5 minutes of hate for another week?
15:10Jardayeah but as you can see from my screenshot it's not apparent that I should login
15:10Jardano 'Login to see this app'
15:11Jardathat screenshot is from http://clojurecup.com/app.html?app=cloutjure
15:11`cbpJarda: I don't think you have to log in..
15:11callenyou don't have to log in...
15:11callenJarda: please calm down.
15:11Jardacallen: yeah, I just don't see anything :)
15:11muhooanyway, it doesn't matter. i'm sure the good apps will get attention in other ways and all have github repos anyway
15:11TimMcJarda: Not seeing it, here.
15:11gwsi wasn't either, but i went to the main page and then hit the back button and it worked
15:12arrdemso it looks like you have to hit clojurecup.com/ before anything else will render for you :|
15:12callenLOL
15:12Jardaoh yeah
15:12Jardatrue
15:12Jardaif I navigate around there I see the stuff
15:12TimMcNice.
15:12gwsso don't worry about putting a "log in to see this page" just "solve this browser puzzle to see this page" :)
15:12arrdemcallen: anyway. shiny!
15:13Jarda:D
15:13Jardaok, sorry about misleading
15:13callenarrdem: the shinies were gf3's doing :)
15:13callenarrdem: I did the data collection, aggregation, and storage.
15:14mtpi read 'data aggravation'
15:15arrdemcallen: 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:15callennot too far from the truth.
15:15arrdemaand then we didn't manage to get it on the website :/
15:16mtpgood
15:16mtpi hate the web
15:16mtp:)
15:17arrdemI used to hate the web.. then I found clj-http, data.json and clj-tagsoup and the web became data :D
15:17callenarrdem: 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`cbparrdem: sort by lazybot's karma? :-D it surprisingly correlates!
15:18arrdemcallen: aaand this is why systems ppl should not participate in hackathons :|
15:18arrdem`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:19yediarrdem: cloutjure doesn't seem to listing any names
15:19arrdemyedi: yeah that's because gdev hard coded a list and we never got a data connection built
15:20callenarrdem: I think a similar story happened to a lot of teams.
15:20callenstuff got built but not hooked up.
15:20llasramarrdem: 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:20technomancyback in my day we only had 24 hours
15:21callenI spent most of the contest writing JS. I am not happy about this.
15:21llasramarrdem: In the process of not getting it finished, wrote about 2x as much ClojureScript as Clojure
15:21arrdemtechnomancy: get back on your rocking chair grandp
15:21callenllasram: great idea for a project tho.
15:21arrdemllasram: that's cool!
15:21callenllasram: please finish it :)
15:22callenwhen Simonides is made release-ready, people will have an open source analytics option :)
15:22`cbpllasram: is yours the risk one?
15:22llasram`cbp: Oh, no. It's `spellcast`
15:23octe(java.nio.file.Paths/get (into-array String ["/"]))
15:23octeshould that not work?
15:23octeit doesnt seem to find the correct method to match
15:23technomancyhttp://technomancy.us/47 <- didn't finish with 24 hours either
15:24octetwo path methods on the class, one which takes varargs strings, the other which takes a URI object
15:24hiredmanocte: it takes a string, and vararg strings
15:24llasramIf I do a hackathon again, I'll either have a frontend person on the team or just do a library + advertipage
15:25octehiredman: huh?
15:25callenllasram: we had a frontend person, but we needed 1 backend person with 3 frontend people instead of the other way around
15:25arrdemllasram: having UI sketches & shared knowlege of the data backend beforehand should make a real webapp doable.. barely.
15:25hiredmanocte: pull up the java docs and look at the method signature
15:25octeyes, i'm looking..
15:25hiredman get(String first, String... more)
15:26octeoh, doh
15:26octei was reading it wrong..
15:26octethanks..
15:29octethat was kind of stupid
15:43dobry-denyeah, i had to go to homepage first
15:58chouserDoes anyone know how to get simple-check's string generator to generate empty strings along with whatever else it generates? /cc reiddraper
15:59dobry-denClojure 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:59reiddraperchouser: you could use gen/frequency to alternatively generate (gen/return '')
15:59chouserreiddraper: ok, I'll try that. Why aren't empty strings included by default? or are they just unlikely?
15:59reiddraperchouser: (def my-string (gen/frequency [[9 gen/string] [1 (gen/return '')]]))
16:00reiddraperchouser: good question, lemme see
16:00dobry-denWhat's the general solution for when you have a bunch of functions dispatching on a key like that?
16:00`cbpdobry-den: multimethods
16:02dobry-denMultimethods, 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:04dobry-denI'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:04dobry-denI don't really know when to use those kinds of constructs
16:04reiddraperchouser: 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:05llasramdobry-den: Having a group of multimethods which dispatch on the same values is just a matter of application-internal convention
16:05reiddraperchouser: mind submitting a github issue and i'll get it fixed up shortly?
16:05llasramAlthough you can add sugar to make it more obvious
16:05chouserreiddraper: ah, ok. I thought that's what I was seeing, but I wasn't sure.
16:05`cbpdobry-den: Protocols dispatch on type only, multimethods dispatch on a given function
16:06dobry-denIn 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:07llasramdobry-den: I don't really suggest it, but you could always do something like this: https://gist.github.com/llasram/6768951
16:07dobry-denllasram: i'll play with that
16:09dobry-dendoes anyone know of a github repo for a conventional Compojure + relational DB webapp with "users" and other models?
16:09`cbpdobry-den: I don't think there's a conventional way to handle db data
16:10dobry-denfair enough, i really just mean "any"
16:10indigoI'm sure you can find something with Compojure and Korma
16:11`cbpdobry-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:13dobry-deni 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:14indigodobry-den: https://github.com/khanage/clojure-blog-test from a quick github search
16:14indigoActually I should go ahead and write some sort of quick blog/wiki tutorial with Compojure and Korma
16:19noncomhi, 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:19dobry-denindigo: 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:20dobry-denalthough the uncomitted changes have tripled the size of that file
16:23dobry-denI think i've been drinking too much anti-noun koolaid
16:23indigoHaha
16:24indigodobry-den: You could always split up the handlers
16:26indigodobry-den: Hahah... not n*sync with this repo
16:26dobry-denI'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:27rhg135Hello, 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:28glosolirhg135: This is clojure room lol
16:28dobry-denrhg135: like jquery?
16:28rhg135clojurescript is a thing :P
16:30rhg135im trying to rewrite a small program in clojurescript because of the memory usage of the jvm among other things
16:30arcatani can't quite tell, so do i need to have signed the clojure contributor agreement to contribute code to jvm.tools.analyzer? (ambrosebs?)
16:31dobry-denrhg135: why cant you use any of the libs people use on node.js with vanilla js?
16:31dobry-denfor parsing html
16:31dobry-denlike an embedded jquery
16:32rhg135elaborate please
16:32rhg135im new to js
16:32dobry-denrhg135: i just searched "node js parse html" and found https://github.com/MatthewMueller/cheerio
16:33seangrov`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:33mtpi think "prettify" does that
16:33mtpor some other emacs module
16:33rhg135hm, deal with the jvm or learn js
16:34seangrov`rhg135: Learn js before you use cljs
16:34rhg135i think ill just deal with the jvm
16:34rhg135i get js, but not the language itself
16:34dobry-denrhg135: sorry, your "node.js" part of the question threw me off
16:34rhg135i mean not the idioms
16:34dobry-denjust use https://github.com/levand/domina
16:34dobry-denor https://github.com/Prismatic/dommy
16:35dobry-denif you know what $("#content h1") does, in domina it's (sel "#content h1")
16:36icarot2dobry-den: is your name intended to mean "good day"?
16:36rhg135but i don't have a dom to manipulate
16:36dobry-denrhg135: do you have a string of html?
16:36rhg135yes
16:37rhg135well no but ik node.js has a lib to download it
16:37dobry-denhttps://github.com/levand/domina/blob/b8ab7c5a616f059949fd78397636442b91a35882/src/cljs/domina.cljs#L66
16:38rhg135thx
16:38rhg135thats perfect
16:39ambrosebsarcatan: yes
16:39ambrosebsarcatan: do you have a CA?
16:39dobry-denrhg135: (-> (html-to-dom "<h1>Hello</h1>") (sel "h1") (text)) ;=> "Hello"
16:39arcatanambrosebs: no
16:39rhg135mhm
16:40rhg135you read my mind
16:40callenbryanwoods: Gradual type system for Ruby that, if enabled, converts your startup's code base to Scala upon raising a Series B
16:40ambrosebsarcatan: ah. what are you thinking of contributing btw?
16:40dobry-denrhg135: i think you get certain advantages by writing javascript via ClojureScript without much experience with javascript.
16:41rhg135probably
16:41rhg135js has an ideology oposite to clojure
16:41callensorta.
16:42dobry-deni 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:42yedianyone wanna give me strangeloop login credentials for a user who went to strangeloop..?
16:42yedi=D
16:42noncomhi, 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:44arcatanambrosebs: i'd have just submitted a fix for expr-seq, as it's broken and it'd be handy for me
16:44rhg135i'm writing server-side just not on jvm
16:45ambrosebsarcatan: should be the children function instead of :children right?
16:46callenThe important part of AOT is that vars get interned from def decls at compile-time right?
16:46callenare there any wrinkles I am missing?
16:46gfredericks,(letfn [[foo [] :foo]] (foo))
16:46clojurebot:foo
16:47arcatanambrosebs: yeah
16:47ambrosebsarcatan: ok i'll push a release for you
16:47arcatanambrosebs: thanks :)
16:49callenWould AOT affect the behavior of an embedded nrepl in an uberjar?
16:51callenTimMc: ^^ obliquely asking if I need lein-otf.
16:52callen;_;
16:53callenfine, I'll do SCIENCE
16:53TimMcI don't actually know much about AOT *or* nrepl. :-P
16:53dobry-denrhg135: 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:53dobry-dener nvm
16:53dobry-denyou're using node on the server-side
16:53rhg135they're not but it's alearning experiance
16:54rhg135i hear nice things about node and want to learn
16:55callenrhg135: if you hear nice things about node you're talking to the wrong people :)
16:55rhg135prob lol
16:56rhg135well one guy does love perl so you may be on to somn
16:56dobry-denthe nice thing to node for this community is that it's a platform to host cljs on
16:57ambrosebsarcatan: just posted a new version on the clojure mailing list
16:57ambrosebslet me know if it works
16:57dobry-deni'd like to experiment by porting some of my clojure cli tools to node
16:58rhg135hmhm
16:58rhg135thats what im doing
16:58rhg135i tried shell scriipting but there's no nice way too call shell
16:59rhg135clojure.java.shell/sh is nice
17:01chouserreiddraper: got another question for you. Is there a way to prevent gen/return from shrinking?
17:02dobry-denrhg135: 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:02chouserThat 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:06ambrosebsbbloom_: enjoying your opinionated HN responses
17:08ambrosebschouser: what library is that?
17:12chouserambrosebs: https://github.com/reiddraper/simple-check
17:14bbloom_ambrosebs: damn static typing people :-P
17:14arcatanambrosebs: it works. thanks again.
17:15gfredericksdo we have a standard link for when people ask about clojure conventions (whitespace etc)?
17:15ambrosebsarcatan: great
17:15ambrosebschouser: for-all caught my eye, is that way to seed a check?
17:15rasmustogfredericks: this maybe? https://github.com/bbatsov/clojure-style-guide
17:15bbloom_ambrosebs: it's pretty clear to me that "tagless" evaluation is pretty much just an optimization :-)
17:16callengfredericks: batsov's guide is not authoritative or correct.
17:16callengfredericks: do not use batsov's guide.
17:16callenrasmusto: stop linking batsov's guide.
17:16rasmustoreading through it, some seems a little dated, my bad
17:16callenSome of it is outright wrong.
17:17ambrosebsbbloom_: :)
17:17chouserambrosebs: 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:17Jardaanyone familiar with core.async for clojurescript awake?
17:18ambrosebschouser: ok
17:18tbaldridgeJarda: yes
17:18JardaI'd like to implement single page application navigation on top of core.async signals
17:19Jardaso that I would have 'views' that are just loops listening to different view related signals
17:19Jardaone of them would be a 'navigate' signal
17:19Jardathat would tell the view-loop to abort and then initialize a new view loop
17:19tbaldridgeJarda: right, sounds normal
17:19Jardadoes it make sense?
17:19tbaldridgeJarda: yes
17:20Jardaok, cool
17:21Jardajust wanted to make sure I'm on right track before I dive too deep into this :)
17:21Jardathanks tbaldridge
17:22Jardait seems core.async might be the answer how to write client-side apps without these javascript frameworks (like angular or backbone etc)
17:22rasmustocallen: what'd you recommend for a conventions reference? clojure.core source?
17:22gfrederickscallen: okay good to know, thanks :)
17:23gfredericksI saw the thing about not shadowing clojure.core vars. Seemed iffy.
17:24technomancyclojure.core is very unconventional
17:25tbaldridgeJarda: yeah there some research in that area to be done, I'm not sure that anyone knows all the answers
17:25rasmustotechnomancy: I'm reading through it atm, and that's definitely true
17:28technomancyI like riastradh's style guide even though it's focused more on scheme
17:29callenrasmusto: anything official clojure
17:29technomancyhttp://mumble.net/~campbell/scheme/style.txt
17:30glosoliWhat do folks use for debugging Clojure under Emacs ?
17:31callenglosoli: generally, avoid debugging.
17:31glosolicallen: why >
17:31glosoli?
17:31callenit's more time-consuming than better ways of solving most problems.
17:32callendebugging should be reserved for truly insane stuff.
17:32scottjglosoli: people defend the status quo. since there's no kickass debugging in emacs, people claim it's not necessary.
17:32glosoliscottj: I see heh
17:32scottjglosoli: there is ritz, but it's not polished
17:33amalloy(inc scottj)
17:33lazybot⇒ 1
17:33Jarda(dec Jarda)
17:33lazybotYou can't adjust your own karma.
17:33callenglosoli: Ritz is the best way to do it, but learning to solve problems without a stepping debugger is useful.
17:34glosolicallen: Yeah but sometimes solving them without debugger and using println feels kinda weird... in a bad sense
17:34callenglosoli: particularly things like trace and just learning to read your code.
17:34callenI'm not saying use println.
17:34callenWhy does everyone assume the only alternative to debuggers is println?
17:34callenan alternative to Ritz would be something like limit-break.
17:34glosolicallen: Well that's probably because I am novice, not that I am familiar with other stuff
17:34glosolihmm
17:34glosolilimit-break
17:35glosoliNever heard of it
17:35callenglosoli: if you're a novice you should forgo debuggers and learn to use things like trace.
17:35glosolicallen: do you know any good resources on that or smth ? (being lazy...
17:35callenglosoli: https://github.com/clojure/tools.trace
17:35technomancyclojurebot: style?
17:35clojurebotstyle is http://mumble.net/~campbell/scheme/style.txt
17:35technomancysweet
17:36technomancyclojurebot: botsnack
17:36clojurebotThanks, but I prefer chocolate
17:36rasmustocallen: 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:36glosolicallen: thanks! :)
17:36technomancythis is a great guide
17:37technomancyI had totally forgotten that C-x [ and C-x ] let you navigate by page breaks <3
17:40borkdudeWhat is the default way of 'unescaping' html entities when I slurp or clj-http client/get some html?
17:40borkdudefor example &amp; -> &
17:42glosoliHmm one more question anyone using Emacs knows what's required to be able to Jump into Java sources while doing interops ?
17:42callenglosoli: when my nrepl is connected, go to definition works fine for me.
17:43glosolicallen: hmm do you have your config published somewhere so I could try to look the differences ?
17:43callenthere's no config
17:43callenit's just nrepl.
17:43callengithub.com/bitemyapp/dotfiles/
17:43PntBlnkHi 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:44technomancycallen: nrepl.el doesn't do that by default
17:44callenwell. Then either I change something or I've gone crazy.
17:45marcopolo2borkdude: I'm sure there are some Java libraries that will do that for you if there aren't any clojure ones
17:45technomancyusually the java source isn't even downloaded
17:45chouserPntBlnk: you can probably do that inside a macro definition
17:46hyPiRionPntBlnk: robert hooke may hooke your Clojure functions
17:46borkdudemarcopolo2 do you know which java (std?) lib can do this?
17:46PntBlnkchouser: thanks for the tip. Can you think of an example I could try?
17:46PntBlnkto look for that is :)
17:47borkdudeI'm finding StringEscapeUtils on google, but I'm a bit surprised I woudl need a special library for this
17:50borkdudejava isn't a batteries included language in many ways ;)
17:51chouserPntBlnk: 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:51marcopolo2borkdude: I mean you could use a hashmap and just do (get escape-map char char)
17:51borkdudemarcopolo2 yeah I could do that
17:52chouserLike (defonce conn nil) (when conn (disconnect conn)) (def conn (connect ...))
17:59PntBlnkchouser: I'm not certain I understand your question, or for that matter if we're talking about Clojure or Emacs Lisp
18:00seangrov`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:00chouserPntBlnk: heh, sorry. I may not have understood your question correctly. My sample code was meant for your .clj file.
18:02PntBlnkchouser: 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:05callenseangrov`: 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:06callenI'm afraid I haven't used it much, only read the literature.
18:17seangrov`callen: Yeah, it shouldn't affect anyone not using it
18:17seangrov`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:18callenseangrov`: well, it might take some cleanup or modification, but I'm friendly to the idea.
18:21rhg135what do y'all think of objc (if it was more c++ like in availability)
18:29muhoonoprompt: what, you don't like manually figuring out }]})};});}] ?
18:31hyPiRionNo need for a full-blown paredit for that though, just need a balancer
18:31nopromptmuhoo: no i love it. i'm just looking for some sane people to troll.
18:31noprompt:P
18:31technomancydoesn't paredit work for js?
18:31noprompttechnomancy: kind of.
18:32technomancythere's a thing you can do to stop it from inserting spaces where it doesn't make sense
18:32hyPiRionYou can use hl-parens though, and then go full rainbow?
18:32noprompthyPiRion: i do in fact, use rainbow parens for js. :)
18:32hyPiRionnoprompt: ah, nice
18:33`cbpI think i stopped using paredit with js because it would put spaces where i didn't want them
18:33noprompttechnomancy: probably should just dig in to this book on writing Emacs extensions and stop whining. :)
18:33`cbplike foo ()
18:33technomancythe one from the 90s?
18:33mtpstart hacking
18:33hyPiRionhah
18:34technomancy`cbp: (set (make-local-variable 'paredit-space-for-delimiter-predicates) '((lambda (_ _) nil)))
18:34muhooi tried to love paredit, but it made me crazy with not letting me delete things when it screwed up and guessed wrong.
18:34noprompttechnomancy: yes that one. didn't realize it was that old!
18:34`cbp:-o
18:34technomancy`cbp: merry christmas
18:35`cbptechnomancy: =)
18:35noprompttechnomancy: is it not a good book?
18:35technomancynoprompt: I don't know, actually
18:35technomancythe built-in docs are quite good though
18:35muhooso i end up using mark-sexp and C-x C-x
18:36TimMcmuhoo: Select and C-w to delete anything, prefix with C-q to insert anything.
18:36noprompttechnomancy: the emacs rocks guy said he recommends it. also, i do like help as well.
18:36muhooTimMc: i'll have to give it another go. i remember C-w not working. didn't know about C-q tho
18:37rhg135is there anyway to use sockets, in browser side cljs?
18:37muhoorhg135: websockets work ine
18:38TimMc(kill-region and quoted-insert. I should start learning the actual function names.)
18:38rhg135if you have a server
18:38rhg135i dont :c
18:39rhg135so chromium webapp?
18:39glosoliDoes having nrepl-ritz in emacs require some specific lein config to be able to navigate between Java sources from interop ?
18:43amalloyTimMc: select/kill is not really necessary; if you want to delete a single character, C-u C-d or C-u BACKSPACE works
18:47TimMcOh, fair.
18:58davidfstrI 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:58davidfstr(In case it matters, the library is: https://github.com/clojure/tools.trace )
18:59havenndavidfstr: leinhttps://github.com/technomancy/leiningen#readme
18:59havenndavidfstr: Oops, I meant: lein: https://github.com/technomancy/leiningen#readme
19:00glosoliany 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:09akurilinSo 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:09akurilinI think weavejester's recommendation from before was to just use (wrap-content-type) only
19:09davidfstrhavenn: Thanks. I'll take a look at lein.
19:11akurilinHm, 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:13akurilinApparently 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:21noonianakurilin: 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:22akurilinnoonian, 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:22akurilincan't find an option to turn that off in curl
19:22noonianakurilin: ah, thats does sound annoying
19:31mlb-What's the most popular library for doing logging? Using "println" works, but it's beginning to feel a bit hackish.
19:31akurilintimbre
19:32akurilinThere's spyscope as well, but I couldn't figure out what it has over timbre.
19:33rhg135i can vouch for timbre
19:33rhg135tis nice
19:33technomancyI like println
19:33technomancywith tools.trace
19:33rhg135that too
19:33technomancywrap it in a couple macros that check a dynamic var
19:34rhg135mhm
19:41hyPiRionI 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:42hyPiRionBut it really depends on your use case
19:47mlb-akurilin, rhg135, technomancy: Thanks guys, I'll check these out
19:47mlb-hyPiRion: I'm tempted by that route, but I figured "logging things" is a problem possibly solved by some people smarter than me ;]
19:48technomancymlb-: it really depends on how granular you need to be when turning sensitivity up/down
19:48technomancypersonally I think those kinds of granular tweaks are better addressed by tools.trace
19:49hyPiRionmlb-: that, and well, people would reinvent the wheel all the time
19:49technomancysince any logging framework is never going to get close to what tools.trace can offer
19:49technomancymost of the time all you care about is "am I in verbose mode? how about quiet mode? ok, just normal then"
19:50akurilintechnomancy, 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:50akurilindon't want to miss out on anything great in my toolbox when it comes to debugging.
19:51technomancyit logs all args and return values
19:51technomancyfor every call of a given function
19:51seangrov`akurilin: Certainly worth trying out to understand it
19:53akurilinseangrov`, 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:53akurilinI'll play around with function tracking to get started.
19:53indigoWhat do you guys think of liberator
19:53akurilin*tracing
19:53seangrov`akurilin: quickly tracing/untracing functions is pretty nice
19:53seangrov`You can do it from outside of the function
19:54technomancyakurilin: with logging you typically need to redeploy to add it somewhere
19:54technomancywith tools.trace you just M-x turn it on when connected over nrepl
19:54mlb-I'm trying to sell Clojure at $DAYJOB, so... enterprise-tastic here. For better or worse.
19:55seangrov`mlb-: Datomic is apparently a good smuggling point
19:55akurilintechnomancy, 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:55technomancyakurilin: right; typically you toggle tracing
19:55akurilintechnomancy, that scenario does sound nice though
19:55technomancyif you forget to turn it off, it will be disabled next time the process restarts
19:55akurilin*seangrove, not seanaway.
19:56technomancy(vs leaving logging statements in and forgetting to take them out so they stay there for years)
19:56rhg135dont you need to define fns differently?
19:57akurilintechnomancy, 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:57akurilin*running a second time
19:57technomancyakurilin: no, I mean toggling trace
19:57technomancyI've never used deftrace
19:57technomancywould be wary of anything that put actual c.t.trace calls in the source itself
19:59frozenlocktechnomancy: Wasn't even aware of clojure.tools.trace, thanks dad! :D
19:59technomancyhaha
20:00akurilintechnomancy, I see, I found those trace/untrace in the source, thanks.
20:03akurilinBitbucket just died :(
20:07rasmustotrace-ns seems pretty powerful for learning
20:08hyPiRionakurilin: fine here
20:09akurilinhyPiRion, yeah the dashboard just came back up. https://twitter.com/bitbucket/status/384821264965468161
20:09hyPiRionah
20:11rhg135how would you use c.t.t in not-emacs? manual calls?
20:11rasmustorhg135: do you have a repl?
20:12rhg135yes ofc
20:12technomancyrhg135: I wrote a generic wrapper for it here: https://github.com/technomancy/nrepl-discover/blob/master/src/nrepl/discover.clj
20:12technomancyyou can call the calls it makes or you can implement auto-discover for your editor/repl of choice =)
20:12rasmustorhg135: it seemed pretty easy to just call (trace-ns 'my.ns) manually (I'm just learning the tool myself)
20:13rhg135ya
20:13rhg135i think so
20:13rhg135manually then
20:13muhoohow do you UNtrace?
20:13muhoolike, 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:14rasmustomuhoo: there's untrace
20:15muhooah, great, didn't see that
20:15rasmustomuhoo: er, wait
20:15muhooyeah, i don't recall seeing an untrace
20:15rasmustountrace-ns exists
20:15muhoooh, thanks
20:19akurilinAnybody 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:20akurilinOr if you can get away with just one somehow.
20:20mtpakurilin‘ put a symlink in the runsvdir
20:20mtpswitch the symlink around when you want to switch apps
20:20mtpalso i <3 runit and you should convince more people of its utility
20:21akurilinmtp, 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:22mtpwhat no
20:22mtpi'm saying have a symlink to your active version in /etc/service
20:22mtp/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:23akurilinmtp, 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:24mtpokay. it sounds you want to have them both running and handle the changeover some other way.
20:24akurilinmtp, I want there to be no service interruption.
20:24mtp<mtp> okay. it sounds you want to have them both running and handle the changeover some other way.
20:24logic_progdnolen: where can I get a short 1-page description of the unification algorithm used by core.logic
20:25logic_progdnolen: I don't need it to be fast; I just need to understand how it works
20:25akurilinmtp, okay, thanks for clarifying!
20:47callenVote for simonides! http://clojurecup.com/app.html?app=simonides
20:50RaynesFor your entertainment, folks, ScheduledThreadPoolExecutor.setContinueExistingPeriodicTasksAfterShutdownPolicy
20:50indigocallen: Voted!
20:50muhoook, i've got the clojure cup apps to show up in chrome on linux, yay, but where is the code for teh apps?
20:50callenindigo: thank you :)
20:51callenmuhoo: we're not obligated to post the code unless we want to.
20:51muhooRaynes: ThatIsANameOnlyAGermanCouldLove
20:51callenmuhoo: I'm not posting the source to Simonides until things get cleaned up and the fucks per KLOC goes down.
20:51callenmuhoo: if you really want to poke around, I could add you as a collaborator on my private github repo.
20:51muhoohttp://www.vidarholen.net/contents/wordcount/
20:53chordpathfinding problem starcarft
20:53chordwe gotta figure out how to do this
20:53chordok team brainstorm now please
20:53muhoonah, just curious. i thought clojure cup was all open source, didn't know it wasn't
20:54rhg135chord: the fact you're not banned is a testament to #clojure's patience
20:54chordrhg135: hey I'm trying to figure out how starcraft does the pathfinding that is constructive progress
20:55rhg135it is
20:55callenmuhoo: no, it's not obligatory because sometimes people want to do stuff that could turn into a business/startup for the competition.
20:55callenmuhoo: the judges have access to the code though.
20:55chordrhg135: so you've done nothing?
20:55rhg135no
20:55rhg135i dont work for free :P
20:57chordrhg135: so you are clueless and useless at pathfinding in games
20:57rhg135yup
20:57rhg135and damn proud
20:58callenchord: can't you just...go die in a muddy creek or something?
20:58rhg135lol
20:58Rayneslol
20:58rhg135thats a polite version of my thoughts
20:58indigochord: Go bother the Racket people or something
20:58chordif you guys don't know how to do something you all give up thats the difference between me and you guys
20:58Rayneschord: More a testament to the fact that nobody who is a mod pays any real attention to the channel.
20:59RaynesEr, rhg135 ^
20:59FoxboronWOAHWOAHWOAHWOAH
20:59FoxboronClam down people
20:59FoxboronJeez
20:59callenFoxboron: you clam up.
20:59RaynesYeah, clam the hell down.
20:59rhg135that too
20:59Raynescallen: Clam down.
20:59RaynesStahp.
20:59callenRaynes: I can mussel through this.
20:59rhg135...
20:59FoxboronThis is an IRC channel. Winning arguments is like winning paralympics
20:59Foxboronwe are here to spread love and knowledge
20:59amalloyRaynes: technomancy is an op. he gave chord a temporary kick a while ago, i believe
20:59Foxboronnow, be awesome and friendly
20:59rhg135k...
21:00gfredericksare kicks IP-based?
21:00rhg135no
21:00Foxborongfredericks: depends
21:00technomancygfredericks: bans can be
21:00rhg135hostname
21:00mtpkicks are nicked
21:00mtpbans are hostmasked
21:00Foxborongfredericks: usually they follow a set regex pattern, but vhosts etc and nicks can make you avoid the ban
21:00mtpalso i don't see chords's content
21:00gfredericksI still haven't figured out how to ignore on this client
21:00metellusthere isn't any
21:01TEttingercallen, this simonides looks interesting, but it doesn't work for me
21:01chordif you guys know how starcraft 2 does pathfinding please talk
21:01rhg135there
21:01mtpi mean, his words only show up on my screen when i want them to
21:01mtpwhich is "not often"
21:01chordor you guys are useless
21:01rhg135no more chord
21:01mtpfools lists are better than ignore
21:01chordhey you guys are bashing on me its not my fault that you don't want to learn pathfinding
21:01TEttingerhttp://simonides.clojurecup.com/demo/playground/ gives me Not Found
21:02callenTEttinger: go through demo.
21:02TEttingerI did
21:02callenTEttinger: click the demo link?
21:02callenTEttinger: it wfm.
21:02TEttingerand I clicked submit, it took me there
21:02callenTEttinger: http://simonides.clojurecup.com/demo/playground?user-id=tettinger&amp;submit=Submit
21:03rhg135gfredericks: there is
21:03TEttingergives me Not Found when I click Submit
21:03callenTEttinger: I don't know why it does that to you, but it works for me.
21:03TEttingerchrome latest, windows 7, ghostery, adblock
21:03callenTEttinger: are you blocking cookies?
21:03callenyes...ghostery...
21:04TEttingernot that I'm aware of
21:04TEttingerunless you fit the pattern of an existing tracker
21:04callennuts.
21:04TEttingerGhostery found 0 trackers
21:05TEttingerso it's not that
21:05callen;_;
21:05indigoYeah, playground is not found for me as well
21:05indigo:(
21:05callenit worked for all of us
21:05callenwhyyyyyyy
21:06callenit worked for me just now when I tried it too
21:06rhg135not me
21:06TEttingerit stored a cookie even
21:06callenI clicked demo in the top right
21:06TEttingerjust checked
21:06indigoIs defining events supposed to work too
21:06rhg135now its chugging
21:06muhoothere are some really good ideas in these apps
21:06callenindigo: that is not supposed to work
21:06indigoAh kk
21:07callendemo/playground and the raw feed should work.
21:07TEttingerthe cookie goes away when I click submit wat
21:07seangrov`callen: I tried it yesterday, couldn't get the querying to work or see any list of events
21:07indigoOhh
21:07indigodemo/playground works
21:07indigodemo/playground/ doesn't ?
21:07callenoh. that's it.
21:07callenseangrov`: most of that isn't working.
21:07callenwe're not allowed to touch it.
21:08seangrov`callen: Ok, no problem, was just curious
21:08callenclicks aren't showing up in feed.
21:08callenhrm.
21:09indigoThat query builder is pretty slick, though
21:09indigoI remember implementing something like that via Backbone.js
21:09indigo(never again)
21:11chordis anyone working on figuring out how starcraft 2 does path finding
21:11callenevents are definitely streaming in
21:11callenI wonder why feed isn't...
21:13muhoo"because nobody wants to type that crap every time they create an executor." as always, great docs Raynes
21:14TEttingercallen, is clojure cup over?
21:14callenI see events from "rustler"
21:14callenTEttinger: yes.
21:15TEttingerah
21:15TEttingerthat's me
21:15callenI see tet
21:15TEttingerthat's also me
21:15callenyeah so events are streaming in
21:15TEttingerbut I think it's sorted the wrong way in the display
21:15callenI wonder why the feed page is stuck
21:15callenI don't think so.
21:15callenIt's the same thing I'm doing in _plugin/head
21:16callenI'm forwarding the port from the ES server on the DO VPS
21:16callenand querying it directly
21:16callen{"timestamp": {"order": "desc"}}
21:17callen(doc/search events-index events-type :filter {:limit {:value 50}} :sort [{:timestamp {"order" "desc"}}])))))
21:17callenTEttinger: ^^
21:17callenSomething, somewhere is fucking me.
21:17callenbut I don't know what.
21:18TEttingerwhat is doc?
21:18callenES API
21:18callenElastisch
21:19TEttingercould it be fetching 50 and THEN sorting?
21:19callenthere's no way
21:19callenwell
21:19callenit could be
21:19callenbut that would be sadistic.
21:19callenthat's clearly not the intent
21:19callenand 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:20callenTEttinger: but you might be right and it's worth testing.
21:20gf3callen: Is it slow or something?
21:20TEttingergf3, we see your events but nothing newer
21:21TEttingerwell I do
21:21TEttingercallen has god mode on
21:21gf3Awkward
21:21gf3To be fair, I did hardcode my events, sooooo…..
21:22muhooall i see is gf3
21:22TEttingerlast event is at "2013-09-30T07:22:36.531-00:00"
21:22gf3Maybe everyone is just naming themselves gf3?
21:22gf3:D
21:22callengf3: no, that template should be the actual iterator in the template
21:22muhoo /nick spartacus
21:22callengf3: it should be executing at runtime.
21:23gf3muhoo: Heh
21:23callengf3: unless you changed it out from underneath me
21:23TEttingerwhat happened at some hour, 36 minutes?
21:23TEttingerno that's 22 minutes...?
21:24callenI'm opening the jar in emacs to verify the template.
21:24TEttinger,(.getMinutes (java.util.Date. 1380525756531))
21:24clojurebot22
21:25callengf3: http://i.imgur.com/0c8ln4J.png
21:25callengf3: that's runtime yo.
21:25gf3callen: Yeah man, I was kidding
21:26callenhttp://i.imgur.com/sdopxaN.gif
21:26callengf3: I'm just pissed the parts I was sure were going to work don't.
21:27gf3callen: If only we had 2 more hours
21:27callenno joke.
21:27`cbp:(
21:27callenwell the project will get wrapped up regardless
21:28callenand be ready for public consumption soon.
21:28gf3Ja
21:31callenSomething that I thought was going to be slow: Execution time mean : 72.732372 µs
21:31callenFEELS GOOD MAN
21:35chordanyone here familiar with "funnel algorithms"
21:35muhooyou 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:38chordmuhoo do you know about funnel algorithms in path finding?
21:39callenmuhoo: ...success?
21:41indigocallen: Ew, emacs
21:41indigo;D
21:42callenindigo: 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:42callenMake fun of Emacs? That's a paddlin'.
21:43indigoNah, I'm jk
21:44nightflychord: from google http://digestingduck.blogspot.com/2010/03/simple-stupid-funnel-algorithm.html
21:44TonyMontanahello
21:44indigoVim repl support is still kinda lame
21:44`cbpwhat's a good window tiler for mac os? Does xmonad work well?
21:44TonyMontanai am spanish
21:44callen`cbp: I use SizeUp
21:44TonyMontanais it an north american chat?
21:44callen`cbp: I love Xmonad, but Xmonad does *not* work well.
21:44TonyMontanaUSA or united kingdom?
21:44callenTonyMontana: there are Spanish speakers in North America too.
21:45callenalso known as Mexicans, the country your people plundered.
21:45callenTonyMontana: just ask your question in here.
21:45`cbpcallen: aw I'll try sizeup
21:45`cbpim mexican
21:45callen`cbp: then help me arouse racial tensions dating to centuries ago.
21:46TonyMontanamexicans are not spanish. mexicans are monkeys
21:46callen`cbp: also that explains the goddamn cactus on your github.
21:46callen'ho damn. Tony goin' for the gold.
21:46callenTonyMontana: 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`cbpcallen: I couldnt find a sombrero pic i liked
21:47mullr`cbp: I use ShiftIt, which gives me a least a little control
21:47`cbpat least on wikimedia
21:48`cbpmullr: thanks
21:48mullrhttps://github.com/fikovnik/ShiftIt
21:48TonyMontanawhat is the topic of this channel?
21:50TonyMontanaMexico is a very dangerous country
21:50rhg135clojure is awesome, TonyMontana
21:50callenTonyMontana: I believe there was a time 70 or 80 years ago when Spain was not such a safe place. ;)
21:51TonyMontanai agree with you, callen
21:51callenTonyMontana: 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:52muhoowhat is this, the new #clojure theme song now? http://www.youtube.com/watch?v=woySeSNBL3o
21:52callenTonyMontana: 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:52TonyMontanaare you a USA citizen?
21:52callenTonyMontana: it doesn't matter who you are and where you're from - only what you do.
21:53callenTonyMontana: do you have a Clojure question or not?
21:53rhg135muhoo: possibly
21:53TimMctechnomancy: Can we get an op up in here?
21:53TonyMontanai dont know that "clojure" means
21:53muhoo /ignore TonyMontana
21:54TonyMontanaokey, ignore me
21:54callenClojure is a programming language.
21:55callenwell 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:56TonyMontanado you know a chat room for speaking english with others USA citiziens?
21:56callenTonyMontana: this would be the place.
21:58TonyMontanabut you are talking about Clojure programming language" . I dont know this.I only know others languages, for example Java/C++
21:59callenTonyMontana: well, learn Clojure if you like.
22:02TEttingerthis 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:03seangrov`#clojure has been attracting strange people this last couple of months
22:03callenCoconutCrab: love your nick.
22:03calleneven if those creatures are terrifying.
22:05arohnerseangrov`: that's what happens when the channel doubles in size
22:05TimMcCoconutCrab: 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:06TonyMontanawhat the fuck
22:06callenthey are, in a "eats your face" sort of way.
22:06rasmustoit looks like a buff spider
22:06callenarohner: admire CCI for supporting Ambrose btw.
22:06TEttingerthe way they move is freakier http://www.arkive.org/coconut-crab/birgus-latro/video-12.html
22:06TEttingerlunging
22:07callenTEttinger: egads
22:07callenscariest part? not the biggest crab.
22:07callenhttp://en.wikipedia.org/wiki/Japanese_spider_crab
22:08callenleave it to Japan to have the Godzilla crab.
22:08CoconutCrabbiggest land anthropod, IIRC
22:08seangrov`arohner: Hopefully the SNR doesn't get too bad
22:09seangrov`It would be interesting to graph the channel size over time
22:09callenI think arohner has me ignored. Could someone please ask him nicely to unignore me?
22:10chordcallen: I will if you ask the others to unignore me
22:16chordcallen: why do you always ignore me
22:18marcopolo2"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:19callenmarcopolo2: LOL
22:19marcopolo2That's enough of the internet for tonight, good night
22:21seangrov`hah
22:23TimMcWho runs the n01se.net logger? They desperately need NTP.
22:23TimMcCoconutCrab: I kind of want a giant land crustacean as a pet.
22:27muhooTimMc: that's chouser, no?
22:28callenchouser is a giant land crustacean?
22:35muhoo n01se.net is chouser, IIRC
22:36TEttingerarohner: callen admires CCI for supporting Ambrose btw.
22:43amalloyTimMc: it's chouser for sure
22:49chordlets talk about starcraft 2 path finding
23:02chordso how would you implement path finding if you had to
23:13chordPATH FINDING
23:13chordyou guys we can do this together
23:14chordwe are all friends
23:17AimHereWell 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:17AimHereCall that every 2 seconds, you're golden
23:18`cbplol
23:23arohnerTEttinger: thanks!
23:27muhoois 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:28muhoosorry, (if foo (concat bar foo) bar)
23:30OtherRavenmuhoo: not that I know of, though that doesn't mean much
23:30`cbpmuhoo: you could use cond-> i guess
23:32`cbpcond->>
23:33muhooah, good point, thanks.
23:35TEttingerthere's a cond->> ?
23:35TEttinger,(doc cond->>)
23:35clojurebot"([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:35muhoosure, and it's awesome
23:36muhooi didn't know about it until i read the codeq source. then i was like "yeah..."
23:37AimHeremuhoo, if foo returns a nice falsy nil, then doesn't (concat bar foo) work just dandy?
23:38muhooAimHere: no, it concats nil into the list [1 2 3 4 nil]
23:38AimHereThat shouldn't happen
23:38TEttinger,(concat [1 2 3] nil)
23:38clojurebot(1 2 3)
23:38AimHere,(concat '(1 2 3) nil)
23:38clojurebot(1 2 3)
23:38muhoo,(concat [1 2 3 4] [nil])
23:38clojurebot(1 2 3 4 nil)
23:39TEttinger,(concat [1 2 3] (when false [1 2 3]))
23:39clojurebot(1 2 3)
23:39metellusthat's only if foo is a vector containing nil
23:39AimHere(if [nil] (concat [1 2 3] [nil]))
23:39AimHereOops
23:39metelluswhich won't work with if either
23:40muhooi ended up with (cond-> bar foo (conj foo))
23:41muhoostill some duplication there but golf is only fun for so long
23:41AimHere,(conj [1 2 3] [nil])
23:42clojurebot[1 2 3 [nil]]