#clojure log - Feb 20 2015

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

19:11 jodaro: hrm

19:11 are there any flambo users in the house?

19:13 amalloy: ~anyone

19:13 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

19:14 jodaro: yeah, i know, but its pretty esoteric

19:15 amalloy: so? nobody is going to volunteer, sight unseen, to answer an unknown esoteric question about whatever flambo is. but if you ask a specific question, someone might know the answer

19:16 jodaro: trying to figure out the right way to mimic the streaming/scala equivalent of dstream.foreach(rdd=> { rdd.foreachPartition ...

19:16 in a defsparkfn

19:55 justin_smith: jodaro: wouldn't that just be flambo.api/map ?

19:55 jodaro: https://github.com/yieldbot/flambo#basics

19:58 jodaro: i think i can do it with map, yeah, but the action i want to perform is something along the lines of what the streaming docs suggest using the foreach pattern

19:58 justin_smith: what is the difference between a mapping and a foreach?

19:59 jodaro: so i figured id attempt that first

20:00 seems like the difference between map and doseq

20:02 justin_smith: jodaro: this mentions support for foreach https://github.com/yieldbot/flambo#rdd-actions

20:03 looks like it is just flambo.api/foreach

20:04 (based on the unit tests that call it)

20:08 jodaro: yup, that works fine, but I'm in streaming land so my top level is a dstream, not an rdd

20:08 i think i figured it out 3 minutes before commute time

20:08 which is typical

20:12 xapak: Hello.

20:12 jodaro: map might still make more sense though because i can collect the results of the action and do something with them

20:13 xapak: What do you suggest as the “best” (in your opinion) Clojure learning resource for someone without 1) Lisp background and 2) Java Virtual Machine background?

20:13 justin_smith: jodaro: sorenmacbeth is around here sometimes, but hasn't been around today I don't think. He'd likely be in a better position to answer your questions than anyone else.

20:14 $seen sorenmacbeth

20:14 lazybot: sorenmacbeth was last seen quittingPing timeout: 255 seconds 15 hours and 18 minutes ago.

20:14 justin_smith: xapak: other programming experience?

20:15 xapak: justin_smith, PHP, JavaScript, Ruby, and some Erlang lately.

20:15 jodaro: justin_smith: yeah, figured he would be the one to ask

20:17 justin_smith: xapak: you should check out "clojure for the brave and true", the tone isn't to everyone's liking, but it's pretty good

20:17 xapak: also, programming clojure (the book)

20:18 namra: i like the clojure for the brave and true

20:18 dijkstracula: xapak: aphyr's tutorial is nice imho (though I second justin_smith's suggestion too)

20:18 namra: funny and well enough expleined

20:18 xapak: justin_smith, nice, thank you. That first suggestion I’m checking. “Looks” like an interesting approach. :)

20:19 dijkstracula, I will check that out, thanks.

20:19 justin_smith: dijkstracula: aphyr's series is especially good for someone who is new to programming, but could be a little slow for someone with experience for the first few chapters at least

20:20 dijkstracula: justin_smith: hm, yeah, that's fair

20:35 TEttinger: dijkstracula: your nick reminds me of this, which it turns out is very easy to implement in clojure http://www.roguebasin.com/index.php?title=The_Incredible_Power_of_Dijkstra_Maps

20:36 my slower clojure impl is here, I also have one that's optimized but uses hiphip for convenient array handling http://ideone.com/pwiTf2

20:37 (this is all less than a third the size of a comparable C implementation)

20:44 dijkstracula: TEttinger: oh no, putting a roguebasin link in front of me is liable to make my friday night evaporate :)

20:45 TEttinger: hehe

20:45 justin_smith: "garlic considered harmful"

20:46 TEttinger: 7 day roguelike challenge march 7, hasn't been a clojure entry yet

20:46 justin_smith: oooh, interesting

20:46 I bet you could do nifty things in a 7 day clojure roguelike

20:46 TEttinger: indeed

20:46 then you see what OTHER people have done in 7 days and it's just... how

20:47 justin_smith: TEttinger: speaking of roguelikes, I think it would be cool to make an algorithm that generates randomized and solvable sokoban levels

20:47 bonus points if you can parameterize difficulty

20:47 dijkstracula: that's v interesting

20:48 (I once did a similar thing with Intelligent Qube puzzles that never turned out the way I wanted; always hoped smarter people than me could do a thing like that and have it work out well)

20:48 TEttinger: http://7drl.org/2014/03/16/cyberdekay-success/

21:00 amalloy: TEttinger: dijkstra maps look pretty cool. thanks for the link

21:03 justin_smith: TEttinger: looking back at that dijkstra map thing, very cool - one obvious extrapolation would be a monster that knows how to dig, changing the cost function for diggable routes based on their stamina / digging speed

21:03 so it would know whether it is faster to go the long way or dig a shortcut

21:12 TEttinger: amalloy, no prob, they are used heavily in a game called Brogue, where they lead to some of the craftiest AI.

21:12 amalloy: TEttinger: i'm just pleased to learn how crawl's autoexplore works

21:12 TEttinger: like monkeys that steal an item and then run away, with knowledge of the dungeon layout (since they live there), and intelligently sidestep around you to get to doors and such

21:13 justin_smith: oh god monkeys are the worst

21:35 Blake1: Well, shoot, I probably won't be in the 7DRL this year. :-/

Logging service provided by n01se.net