#clojure logs

2015-02-19

00:00justin_smithwithout the eval it looks OK
00:00justin_smithAHA
00:00justin_smith,((fn [fname & args] (eval (conj () (conj args 'list) (read-string fname) 'apply))) "inc" 2)
00:00clojurebot3
00:00justin_smithsuper-weird
00:00justin_smithhaha
00:01TEttingera ha!
00:01justin_smithTEttinger: it was because you were creating '(2) and passing it to eval
00:01TEttingerahhhhhh
00:01TEttinger,((fn [fname & args] (eval (conj () (vec args ) (read-string fname) 'apply))) "inc" 2)
00:01clojurebot3
00:02sm0ke,((fn [fname & args] (apply (eval (read-string fname)) args) "inc" 2)
00:02clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
00:02justin_smiththe moral is: eval + conj on lists gets confusing when you have had enough vodka
00:02TEttinger,((fn [fname & args] (eval (conj () (vec args ) (read-string fname) 'apply))) "+" 2 3 4)
00:02clojurebot9
00:02sm0ke,((fn [fname & args] (apply (eval (read-string fname)) args)) "inc" 2)
00:02clojurebot3
00:02TEttingerah, clever sm0ke
00:02TEttinger(inc sm0ke)
00:02lazybot⇒ 8
00:02sm0ke:)
00:02TEttinger,((fn [fname & args] (apply (eval (read-string fname)) args)) "+" 2 3 4)
00:02clojurebot9
00:02sm0ke(inc justin_smith TEttinger )
00:03lazybot⇒ 1
00:03TEttingerinc is still unary
00:03sm0kehurmm who is getting all those karma points
00:03justin_smith((fn [fname & args] (apply (resolve (symbol fname)) args)) "inc" 2)
00:03justin_smith(karma justin_smith TEttinger )
00:03sm0ke(inc justin_smith )
00:03lazybot⇒ 6
00:03TEttinger(identity justin_smith TEttinger )
00:03lazybotjustin_smith TEttinger has karma 1.
00:03sm0ke(inc TEttinger )
00:03lazybot⇒ 3
00:03justin_smithTEttinger: it takes arbitrary strings
00:03sm0kethere you go
00:03TEttingerspaces
00:03TEttinger(identity TEttinger)
00:03lazybotTEttinger has karma 42.
00:04justin_smithnotice that "justin_smith " has 1/20th my karma or so
00:04justin_smith(identity justin_smith)
00:04lazybotjustin_smith has karma 189.
00:04TEttingerso you're at 195 abouts?
00:04TEttingerwe're going to need a 200 karma party
00:04TEttinger(identity technomancy)
00:04lazybottechnomancy has karma 162.
00:04justin_smith,(/ 189.0 6.0)
00:04clojurebot31.5
00:04TEttinger(identity Raynes)
00:04lazybotRaynes has karma 55.
00:05TEttinger(identity rhickey)
00:05lazybotrhickey has karma 9003.
00:05TEttingerhahaha
00:05justin_smithoh, only 1/30th!
00:05justin_smithTEttinger: of course it would have to be over 9000 on this channel
00:05sm0ke(dec sm0ke)
00:05lazybotYou can't adjust your own karma.
00:06sm0ke(+ 1000 justin_smith )
00:06sm0ke:P i tried
00:06TEttingeryou know, I've been making gfredericks memes, but any meme I made of myself would involve invisible BOMs so it would probably just be... well just as incomprehensible to outsiders
00:07justin_smithTEttinger: haha
00:07sm0kegfredericks once pm'd me asking not to use offensive language in channel, and all is said was ~sex
00:07sm0kelazybot: sex?
00:07justin_smithTEttinger: panorama picture of a cat so it looks like his head comes out of his tail "invisible BOM"
00:07TEttingerhahaha
00:08TEttinger~sex
00:08clojurebotsex is off-topic and not appropriate for the channel
00:08sm0kesee
00:08sm0keclojurebot: sex |is| never offtopic
00:08clojurebotOk.
00:08sm0keclojurebot: ~sex
00:08clojurebotExcuse me?
00:08TEttingerhha
00:09TEttingerno need to clojurebot:
00:09sm0ke~sex
00:09clojurebotsex is never offtopic
00:09sm0kequick learner is clojurebot
00:09clojurebotc'est bon!
00:09sm0ke~clojurebot
00:09TEttingerclojurebot: sex |is| frequently offtopic
00:09clojurebotAck. Ack.
00:09clojurebotclojurebot has a poetic soul
00:13justin_smithTEttinger: http://i.imgur.com/E5j8fwX.jpg?1
00:14sm0kewhat is BOM?
00:14justin_smith~BOM
00:14clojurebotCool story bro.
00:14TEttinger\ufeff
00:14TEttingerbyte order marker
00:14TEttingeran invisible character that's legal in clojure and java identifiers
00:17sm0keBUT then i ask how do you copy and type something which is invisible!!!
00:17sm0ke:D
00:17justin_smiththat's exactly the problem
00:19TEttinger,(let [bindings "should have an even number of forms" bindings "BETTER HAVE AN EVEN NUMBER OF FORMS" bindings] bindings)
00:19clojurebot"should have an even number of forms"
00:20TEttingerI made that with
00:20TEttinger,(println ",(let [bindings \"should have an even number of forms\"\ufeff bindings \ufeff\"BETTER HAVE AN EVEN NUMBER OF FORMS\"\ufeff bindings] bindings)")
00:20clojurebot,(let [bindings "should have an even number of forms" bindings "BETTER HAVE AN EVEN NUMBER OF FORMS" bindings] bindings)\n
00:20sm0ke,(def a b 1)
00:20clojurebot#<CompilerException java.lang.RuntimeException: Too many arguments to def, compiling:(NO_SOURCE_PATH:0:0)>
00:21TEttinger,(def ab 1)
00:21clojurebot#'sandbox/ab
00:21TEttinger,ab
00:21clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ab in this context, compiling:(NO_SOURCE_PATH:0:0)>
00:22TEttinger,ab
00:22clojurebot1
00:22TEttingerit's tricky business
00:23sm0kei was trying to put a ufefs in between :P
00:23TEttingerand I did
00:23sm0keNO!!
00:23sm0ke,ab
00:23clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ab in this context, compiling:(NO_SOURCE_PATH:0:0)>
00:23TEttinger,(map char ",(def ab 1)")
00:23clojurebot(\, \( \d \e \f ...)
00:23sm0ke,ab
00:23clojurebot1
00:24sm0kenice one!
00:24TEttinger,(map char "ab")
00:24clojurebot(\a \ \b)
00:24TEttingerit doesn't even print the visible character
00:24TEttinger,(map int "ab")
00:24clojurebot(97 65279 98)
00:25TEttingerit gets crazier once you start needing to enter un-enterable, un-copyable characters
00:25TEttingerI believe some of the early, before space ascii characters have that property
00:26sm0keimagine someone quietly sneaking these is clojure source code
00:26TEttingerclojurebot: BOM |is| http://i.imgur.com/E5j8fwX.jpg?1
00:26clojurebotAck. Ack.
00:26TEttinger~BOM
00:26clojurebotBOM is http://i.imgur.com/E5j8fwX.jpg?1
00:26sm0kelike in clojure.\ufeffcore
00:26TEttingeroh man
00:26TEttingerin C# it's even worse
00:26TEttingeryou can overload the empty string
00:27sm0kedoes github shows a diff for bom?
00:29TEttingerit must, it's different text
00:29TEttingerit would be +1 char
00:29sm0kehmm lets hope so
00:31TEttingerah,
00:31TEttingertypeof(string).GetField("Empty").SetValue(null, " ");
00:31TEttingermakes the empty string equal to " "
00:31sm0ke,(= "ab" "ab")
00:32clojurebotfalse
00:32TEttingerand worse, that C# code can be stuck in a static constructor, making it run whenever that class is imported
00:33sm0kei dont know much C# what are you trying to do there?
00:33TEttingerit's from an article on "Code Bombs"
00:33TEttingerthings disgruntled employees could stealthily leave behind in code
00:33TEttingerand horribly break a running program
00:34TEttingerhttp://thedailywtf.com/articles/comments/The-Disgruntled-Bomb in comments
00:34justin_smithoh, the fucked up shit an angry clojurist could do...
00:34sm0keah i see!
00:34sm0kejustin_smith: i guess this can be sneaked everywhere
00:35TEttingerthere's a good reason for it too
00:35TEttingerI actually added a bomb in some code I sent to a previous employer (in a different country), but I told them I had inserted the bomb, and would forward the source, without bomb, once payment cleared. This could be re-purposed.
00:35justin_smithsm0ke: in clojure there is very little you couldn't redefine out from under a running process, as a side effect of just loading your ns
00:35prateekplein deps failed
00:35prateekpcannot find project.cljs
00:35TEttingerprateekp: lein deps :tree
00:35TEttingeroh
00:36TEttingerwell that would be a problem then
00:36justin_smithproject.cljs?
00:36justin_smithis that even a thing?
00:36TEttingerwhere are you putting your deps?
00:36prateekpthe project.cljs is not in the root
00:36TEttingerit should be project.clj I would imagine
00:36justin_smithwait, lein can even use "project.cljs" I have never even heard of that
00:36TEttingerbut I guess it can huh
00:36justin_smithand also why would you not put it in the root
00:36prateekpclj*
00:36TEttingerit needs to be in root
00:37TEttingeror wherever you're executing lein from
00:37prateekpits in the root of the client folder ... but travis cant access it as .travis.yml is in the root of the repo
00:38TEttingeris this on github or something where we can see it?
00:38TEttinger(the code I mean, prateekp)
00:39prateekpi am very sorry, the code is private actually
00:39prateekpbut i can tell you
00:39prateekpthe situation
00:39justin_smithprateekp: if the project.clj can't be in the root, can you tell travis to run lein from a subdirectory containing the lein project?
00:40prateekpohh yeah but while i am doing cd folder/ && lein cljsbuild once in the .travis.yml
00:40prateekpits giving same error
00:41sm0keTEttinger: and how do you know they wont be able to find it?
00:41prateekpjustin_smith: is there other way to do it
00:41sm0keTEttinger: you must have put it differently ? sounds very unprofessional
00:41TEttingersm0ke, it's a quote from that article
00:41TEttingererr, comments
00:42sm0keeh ok lol
00:43TEttingersm0ke, he talks about how it slowly, over the course of 15-30 minutes, got slower and slower to the point of unusability. it let them verify the trial version, but not ship until payment cleared
00:43justin_smithprateekp: if you are having travis switch to the directory containing the project.clj, and lein doesn't find the project.clj, there is clearly something wrong that you haven't described yet
00:43sm0keTEttinger: DRM is hight controvertial
00:43sm0kehighly*
00:44TEttingeryeah, but most people want to get paid, and some unscrupulous buyers won't pay if they think they can get away with cheating a foreigner
00:44sm0kei would just prefer to deal with customers who can be trusted
00:44justin_smithprateekp: I assume the cd / lein commands are in one shell invocation? because usually each command is totally isolated
00:46prateekpi did like this
00:46prateekplanguage: clojure
00:46prateekpscript: cd client && lein cljsbuild once && cd assets && compass compile
00:46prateekpthese are two commands i am using
00:47prateekpin .travis.yml
00:48justin_smithand lein complains that it can't find project.clj?
00:49prateekpjustin_simth: ^^
00:49prateekpyes
00:50justin_smithprateekp: the line "language: clojure" tells travis to run lein test
00:50justin_smithyou should take that out, it is causing your error
00:50justin_smithbecause of course lein test from the top level will fail
00:51prateekpahh
00:51prateekpso i should keep only the script command
00:51justin_smithright, "language: clojure" is just a shortcut for some default things to do with clojure code
00:51justin_smithyou may want to add what it would have done to your script
00:52prateekpahh thanks
00:56TEttinger(inc justin_smith)
00:56lazybot⇒ 190
00:58prateekpwhile i am trying to run a project locally, i am getting an error - Could not locate leiningen/core/main__init.class or leiningen/core/main.clj on classpath
00:58justin_smithwhen using lein?
01:00prateekpyeah when building locally
01:00justin_smithsounds like a messed up config - can you run "lein help" outside your project dir?
01:01prateekpoutside in the home folder, it gives out a list of commands
01:02justin_smithprateekp: yeah, probably something misconfigured in your project.clj
01:02prateekpand a error
01:02prateekp Problem loading: java.io.FileNotFoundException: Could not locate leiningen/core/main__init.class or leiningen/core/main.clj on classpath: (localrepo.clj:1)
01:02justin_smithOK, then disable lein localrepo
01:02prateekpit gives the same error outside
01:02justin_smithlein localrepo is nearly useless nowadays anyway
01:02prateekphow should i do that
01:02prateekpis there a coomad
01:03justin_smithit's a plugin, likely in your ~/.lein/profiles.clj
01:04justin_smithit's probably not compatible with newer lein versions - and AFAIK it isn't needed
01:05prateekpthere is no profiles.clg
01:06prateekpthough there was a plugin localpro tar which i deleted
01:06prateekpbut still the same error persists
01:07justin_smithOK, something somewhere is telling lein to use localrepo
01:07justin_smithusually it would be ~/.lein/profiles.clj that set that up
01:07justin_smithwhat's your $LEIN_HOME setting in your shell?
01:08prateekpahh i did echo $LEIN_HOME
01:08prateekpit says nothing
01:09justin_smithOK, that's normal, but that means I have no idea what would be trying to load localrepo
01:10justin_smithand that error clearly indicates localrepo
01:10prateekphmm
01:11prateekpjustin_smith : regarding the previous problem, it failed again saying lein not found
01:11prateekpshould i write lein: lein in .travis.yml
01:12justin_smithprateekp: you should try to find out what "lang: clojure" does in travis.yml, and recreate that without the part where project.clj has to be at the top level
01:17prateekpjustin_smith : now the error looks different - Could not locate leiningen/core/main__init.class or leiningen/core/main.clj on classpath:
01:18prateekpits not related to localpro
01:18prateekpits subproject.clj:1
01:19justin_smithOK why do you keep getting errors with lein plugins when you claim that you don't have any profiles.clj?
01:19justin_smithsubproject.clj is from lein-sub
01:20justin_smithwhat's your lein version?
01:20prateekp1.7.1
01:20justin_smithOK, do you have any reason to be using a version that old?
01:21prateekpjust did sudo apt-get
01:21justin_smithdon't use the apt-get version of lein, install lein 2.x and let it auto-update. Best place to install it is to ~/bin
01:21justin_smith1.x is bad
01:22prateekpok
01:22justin_smithlein is one of the few programs that manages it's own updates better than apt
01:22justin_smithbecause it is very self contained, and good at handling updates / rollbacks
01:23justin_smithas long as you install it locally / per -user
01:24prateekpwhat path should i choose to install lein
01:24prateekpany path is ok_?
01:24prateekp?
01:24justin_smithyour home bin/ dir is best I think ~/bin
01:24justin_smithbut as long as it's in your PATH it will work
01:24prateekpis /bin ok
01:25justin_smithno, it should be owned by your user
01:27prateekpjustin_simth
01:27prateekphow to run it
01:28prateekpi have saved and chmod 755 the lein file
01:28prateekpin the ~/bin floder
01:28justin_smithyou need to add ~/bin to your PATH
01:28justin_smithsome shells do this automatically when you log in if the directory exists
01:28justin_smithwhich file to edit depends on your current setup / shell
01:29justin_smithlikely .login / .profile / .bashrc
01:29justin_smithone of those
01:30prateekpi have added path
01:30prateekpnow how do i run it
01:31justin_smithlein
01:31prateekpahh
01:31justin_smithif it's in your path, it's just lein
01:31prateekphmm ]
01:31prateekpits running
01:31prateekpand thats it
01:31justin_smithyeah, probably doing a big self-install for its first run
01:32prateekpdo i need any other thing now
01:32justin_smithyou should be able to run your lein commands now
01:32prateekphmm i have started the build
01:33prateekplets see if it passes this time
01:34prateekphmm its working
02:16prateekpi am sorry ... i am, asking the same problem which i asked before ...
02:17prateekpactually i am trying to run travis for clojure project
02:18prateekpfor travis to run, we have to keep the .travis.yml file at the root but the project.clj file in in another folder
02:19prateekpso when i try to do script : cd folder/ && lein cljsbuild test
02:19prateekpthe travis tells cannot find the file named project.clj
02:19luxbockthoughts on using the discard macro (#_) for documentation?
02:20prateekpis the command in travis.yml -- language: clojure is running something that calls project.clj
02:20prateekphow can i know what does this command do
02:21luxbockone could use it a bit like /* ... */ is used in Java, but without having to add *'s for each line
02:31KneivaJava does not require * for each line
02:32TEttingerluxbock: since it's very similar to ; just for forms instead of until-end-of-line, I like #_ in general
02:32TEttingerand since ; is used for comments, I see no reason discard couldn't be adapted to comments
03:26lxsameer_what testing framework is more popular in clojure community ?
03:27slipsetlxsameer_: midje?
03:27slipsetlxsameer_: or even test.check which is property based
03:27slipsetI kinda like midje with its auto-test stuff
03:27slipsetwhenever you save your file, midje runs all your tests
03:28Empperimidje is nice but plain ol' clojure.test isn't that bad either
03:28Empperimidje has this problem about crapping the line numbers when your code throws an exception
03:28Empperiwhen it breaks on assertion then it's great
03:32lxsameer_Empperi: slipset thanks guys
03:38domokatoWhat is a possible reason for a NullPointerException on a java method call during compile time?
03:38domokatoit's on the top-level of a namespace; is that okay?
03:40TEttingerdomokato, one of the arguments or the object that you're calling it ob must be null somewhere
03:40TEttinger*on must
03:41TEttingerstick a println before it, see what the values are
03:41domokatobut this is during compile time
03:45domokatooh, it actually runs the code during compile time...crazy
03:45domokatothere's my problem
03:45domokatothx
03:45TEttingercool!
04:04mnngfltgHas anyone tried persisting Clojure's persistent data structures on disk?
04:09mnngfltgBasically I'd like to keep a PersistentHashMap in an atom and, on swap!, commit changes to the map to disk
04:09slipsetwouldn't that just be to prn it to a file?
04:10slipsetif you add a watcher to the atom?
04:10slipsetbut, you will probably have some problems going that way because you can have several swaps before you finish writing to disk
04:11slipsetsounds like you want a databse
04:12mnngfltgslipset, yes, I bsically want to implement my own embedded database
04:12hyPiRionmnngfltg: This sounds like a subset of Datomic
04:12slipsetmnngfltg: now why would you want to do that?
04:12hyPiRionoh, embedded
04:13mnngfltghyPiRion, I haven't loooked into datomic yet
04:13mnngfltgbut yes, the idea would be to keep things as simple as possible
04:13mnngfltgsort of like sqlite or h2 but with the ability to persisten clojures's maps, vectors and sets
04:13mnngfltgslipset, I think it fills an interesting niche
04:13hyPiRionmnngfltg: I'd love to have something like an embedded datomic. I've looked at it and haven't found anything though
04:14hyPiRionafter it*
04:14mnngfltgslipset, basically you could use it to power a simple multithreaded web server with a very flexible data model
04:15mnngfltgthe whole dataset (app state) is in memory, in an atom, and each to you (swap!) the updates are committed to disk
04:15mnngfltgpresumably using some kind of commit log, so if you restart the app can re-build its state
04:17mnngfltghyPiRion, I've found http://www.mapdb.org/, which might be a nice base for a clojure-centric embedded db
04:55dysfunmnngfltg: i've got something going along those lines myself
04:56dysfunnot using mapdb, doing basically what you described
04:58piranhawhat's the benefit of using ref instead of atom? I have a bit of code which uses ref, and I mostly used atoms (most of my clojure code was clojurescript), so I'm wondering what's the point
04:59kungipiranha: refs are coordinated atoms are not
05:00piranhakungi: and 'coordinated' means that I can change two refs at the same time in 'dosync', right?
05:00piranhathat's the point of using a ref?
05:00piranhaand if I only have a single ref, it could as well be an atom?
05:01kungipiranha: as far as i see. yes and yes
05:01piranhakungi: cool, thanks!
05:01clgvpiranha: yeah consistence of modifications of multiple refs
05:01kungipiranha: when I think about refs I always think about bank accounts. Transfer money from account a to b
05:02piranhaok :)
05:03ianhedoesitthe clojure.org pages on them (http://clojure.org/atoms and http://clojure.org/refs) give pretty good descriptions, I think.
05:03clgvianhedoesit: the books do a better job ;)
05:03ianhedoesitI'd hope so, since the page on atoms is only three short paragraphs!
05:04piranhathat's mainly why I asked :)
05:04ianhedoesitbut for a quick "spot the difference" it's pretty useful, I think.
05:05kungiUntil now I never had to use a ref ...
05:05piranhaoh, I just found out why the code uses refs and it makes sense
05:06piranhait needs to 'return and remove first element of contents', atomically
05:06clgvianhedoesit: I'd say that one serves better for that purpose http://clojure-doc.org/articles/language/concurrency_and_parallelism.html#clojure-reference-types
05:06piranhaand with ref it's wrapped in dosync, which makes it work
05:07ianhedoesitclgv: that is pretty nice! definitely more detailed.
05:07ianhedoesit(well, with a quick glance)
05:08clgvthey gathered a decent amount of clojure knowledge overthere
05:08dysfunpiranha: return and remove is an atomic operation
05:09piranhadysfun: (let [x (first @pool)] (swap! pool rest) x) is not exactly atomic, is it?
05:09clgvdysfun: not really with Clojure atoms, as swap! returns what is written into the atom
05:09piranhadysfun: it makes it possible that two threads will get same item from pool simultaneously
05:10dysfuni didn't say it was the best option, merely that it's atomic
05:10ianhedoesitpiranha: I don't think that's possible?
05:10dysfunand the swap! can be wrapped
05:10dysfunbut yes, using refs here is a better option
05:10piranhaianhedoesit: why not?
05:12ianhedoesitI don't know. give me a minute to be silent until someone else says I'm wrong
05:19julianlevistonIf I want to access a piece of data in a map from multiple keys, is a good way to do that just to assoc the data in (inside a map which includes all the keys) multlpe times, once against each of the keys?
05:19clgvdysfun: you'd need a modified swap! implementation that lets you choose which value to return on successfull modification of the atom
05:20julianlevistonclgv: it’s not being stored in an atom
05:21clgvjulianleviston: I didn't answer you ;)
05:21julianlevistonclgv: oh haha soz :)
05:22clgvjulianleviston: you need to provide some kind of example to explain what you want to do
05:22julianlevistonclgv: ok. I’ll build one.
05:22wagjoclgv: dysfun: something like https://github.com/flatland/useful/blob/develop/src/flatland/useful/state.clj#L43
05:22TEttingera multimap?
05:24clgvwagjo: not really, but could serve as a blueprint how to achieve the desired result
05:24dysfunclgv: actually you need a second atom or a promise :)
05:24clgvwagjo: though it is actually cheating ;)
05:24dysfunclgv: as i said, ref is a better option in this case
05:25clgvdysfun: I guess you cant make a general function for it - it would need to be a macro to be able to select an arbitrary return value and not to do computations twice
05:29julianlevistonclgv: here’s my pastie illustrating what I’m after… it feels a bit messy because I’m duplicating data. On the other hand, in the context I’m using it in, I don’t have to update the data, so perhaps that’s not important: https://www.refheap.com/97520
05:29julianlevistonclgv: also, will there be any problems if the value at :data is a core async channel, do you think?
05:30julianlevistonTEttinger: oh, were you talking to me?
05:30TEttingeryes, sorry
05:30dysfunclgv: i don't think it would need to be. but since refs are a better option in this case, i have no real desire to see if it can be done :)
05:31julianlevistonTEttinger: ah… A multimap is multiple values, isn’t it? I want multiple keys...
05:31julianlevistonTEttinger: as in… two paths into the values…
05:33julianlevistonTEttinger: I mean, my proof-of-concept code there would work, it just feels ugly.
05:33wagjoyou can have multiple keys pointing into the same data in classic hash-map
05:34julianlevistonwagjo: I don’t follow, sorry… what’s classic hash-map ?
05:34ianhedoesit,{:a 5 :b 5}
05:34clojurebot{:b 5, :a 5}
05:34julianlevistonah so just how i’m doing it?
05:34wagjo,(let [data :foo] {:a data :b data})
05:34clojurebot{:a :foo, :b :foo}
05:35julianlevistonwagjo: https://www.refheap.com/97520 <— just what I’ve done, then… but would that work with (chan)s, too?
05:35TEttingeryeah, objects are references anyway
05:35julianlevistonTEttinger: ah ok… I wasn’t 100% sure about that,… now I know that, that completely answers my question… :)
05:35julianleviston(inc TEttinger)
05:35lazybot⇒ 43
05:35julianleviston(inc wagjo)
05:35lazybot⇒ 2
05:35TEttinger(inc wagjo)
05:35lazybot⇒ 3
05:36wagjothanks, but I'm a bit lost what's the problem you are trying to solve
05:36mnngfltgdysfun, sounds great
05:37mnngfltgdysfun, anything public already?
05:37dysfunmnngfltg: nothing yet, sadly. i've been debating how to handle it. i want any number of interesting properties
05:38dysfunand then i got bogged down with the layer i'm going to sit on top
05:38julianlevistonwagjo: In a go-loop, I’m accumulating a map of debounce chans that pass messages off to a worker chan, and they also have an expiration timestamp on them… so I’d like to be able to look them up via timestamp, or via “id” (internal representation)… in the accumulation/message passing part, it needs to look it up via ID, and in the expiry phase it needs to filter by timestamp and then dissoc them. :)
05:38mnngfltgdysfun, I've been having this conversation with myself as well
05:38dysfunmnngfltg: we should collaborate
05:38mnngfltgtotally
05:39dysfuni'll query you in a few once i've done the next item on my todo list
05:39mnngfltgcool
05:39julianlevistonwagjo: if I needed to update the value of these keys, this solution wouldn’t work very well, but luckily I don’t, so it should be ok. Messy as it is.
05:40TEttinger,(let [atm (atom 100) colll {:a atm b :atm}] (do (swap! atm inc) (reset! (:a coll) 5) (:b coll)))
05:40clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: b in this context, compiling:(NO_SOURCE_PATH:0:0)>
05:40TEttinger,(let [atm (atom 100) colll {:a atm :b :atm}] (do (swap! atm inc) (reset! (:a coll) 5) @(:b coll)))
05:40clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: coll in this context, compiling:(NO_SOURCE_PATH:0:0)>
05:40TEttinger,(let [atm (atom 100) coll {:a atm :b :atm}] (do (swap! atm inc) (reset! (:a coll) 5) @(:b coll)))
05:40clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.concurrent.Future>
05:40TEttingerwat
05:40TEttinger,(let [atm (atom 100) coll {:a atm :b atm}] (do (swap! atm inc) (reset! (:a coll) 5) @(:b coll)))
05:40clojurebot5
05:40julianleviston:atm
05:40julianlevistonyeah :)
05:40TEttingerthere you go
05:40TEttingerI'm getting sleepy
05:40TEttingeryou see it's the same atom, referenced by a and b
05:41CookedGryphonHey, I'm trying to redef async/timeout to a mock timeout provider that I have control of in my tests
05:41julianlevistonTEttinger: if you’re talking to me, yeah, I get it. I just think it’s a messy way to do it.
05:41CookedGryphonbut my redeffed function isn't getting used
05:41julianlevistonTEttinger: it’s fine for what I want to do tho...
05:41TEttingeroh sorry yes, julianleviston. I'm getting quite sleepy and I hope that helped
05:42julianlevistonTEttinger: thanks! :)
05:42TEttingertime for another attempt to get more than 3 hours sleep
05:43CookedGryphondoes with-redefs work with async/timeout, or not because of something with the go macro?
05:46wagjojulianleviston: how do you plan to lookup data by the timestamp anyway
05:48wagjojulianleviston: model your incoming messages as {:id "1d43e98a", :expiration 14563213, :payload {...}}
05:48julianlevistonwagjo: yeah, that was my plan.
05:48wagjojulianleviston: that way you can easily filter by timestamp any message you've selected in the previous step...
05:49julianlevistonwagjo: that’s what I’m doing.
05:55julianlevistonwagjo: the main thing I was wondering was whether there was a data structure I wasn’t aware of in some library such as contrib because my googling turned up nothing other than multimaps… but it seems not… all good :)
05:56sveriHi, I remember there was a caching / memoization library that emptied the cache after a given time. But I don't recall the name, anyone knows what I mean?
05:56julianlevistonsveri: core.cached
05:56CookedGryphonCould someone take a look at my attempt to mock core async timeouts for testing and let me know what's going wrong: https://gist.github.com/AdamClements/33ef8d6ac9a65e9361ae
05:57julianlevistonsveri: sorry cache… not cached. https://github.com/clojure/core.cache
05:58CookedGryphoncore.cache is caching primitives, core.memoize uses core.cache to memoize functions
05:58sverijulianleviston: Hm, I think it was a different one
05:59sveriah, it was core.memoize with the ttl function
05:59sveriCookedGryphon: julianleviston thank you both
06:07mnngfltgThis puts the `:end` at the beginning rather than the end: (conj (take 5 (range 10)) :end) -- what's the idiomatic way to fix this?
06:07mnngfltgThere doesn't seem to be a `takev`...
06:08hyPiRionmnngfltg: if you can afford to retain some semantic garbage, then (conj (subvec (vec (range 10)) 0 5) :end)
06:08hyPiRionwhich should be equal to this
06:08hyPiRion,(-> (range 10) vec (subvec 0 5) (conj :end))
06:08clojurebot[0 1 2 3 4 ...]
06:09hyPiRion,(-> (range 10) vec (subvec 0 4) (conj :end))
06:09clojurebot[0 1 2 3 :end]
06:09mnngfltgah so a solution would be replacing take w/ subvec (and use mapv before instead of map I guess)
06:11mnngfltghyPiRion, it is a significant amount of semantic garbage though
06:15CookedGryphonno core.async experts around today?
06:17AeroNotixgive CookedGryphon ask
06:17AeroNotix,ask
06:17clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ask in this context, compiling:(NO_SOURCE_PATH:0:0)>
06:17AeroNotix~ask
06:17clojurebotThe Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.
06:17AeroNotixCookedGryphon: ^^
06:17CookedGryphonAeroNotix: I already asked, see a few lines back
06:18CookedGryphonCould someone take a look at my attempt to mock core async timeouts for testing and let me know what's going wrong:
06:18CookedGryphonhttps://gist.github.com/AdamClements/33ef8d6ac9a65e9361ae
06:42CookedGryphonah, I think I know what's going wrong. With-redefs is putting the var back before it's even been called because the go loop returns immediately and we fall out of the end of the redef scope
06:44CookedGryphonlvh: Just reading your blog post on the fn type of timeout, I'm curious, did you finish your clock implementation? It sounds like you were trying to do exactly what I'm trying to do now
06:45kaplan_Hi, can anyone explain Refs to me?
06:54mnngfltgWhat do you think of this general `constrain` function usable for, say, adding ellipses to a truncated seq? https://gist.github.com/pesterhazy/af12a5f85355f5c80358
07:00wagjomnngfltg: straightforward but not very efficient
08:15sameerynhowhat is the pattern in libraries for getting global values for example api key
08:17mnngfltgwagjo, consise but truthful
08:27Glenjaminsameerynho: generally they should be passed as the first argument to api calls
08:28sameerynhoGlenjamin: thanks
08:28Glenjamin(let [config {:api-key "ASDASDASD"}] (api/call config and other arguments))
08:30ordnungswidrigglenjamin: if you want to enable threading then you might want the config on second position.
08:31ordnungswidrigsameerynho: I think another typical case is to bind a dynamic variable and to provide a `with-foo` macro.
08:31Glenjamini'd say if you want to do a dynamic var, have that as an api which wraps a first-arg internal version
08:31sameerynhothanks
08:32Glenjamini know the clojurewerkz projects are going down the first-arg route: http://clojureelasticsearch.info/articles/getting_started.html#querying
08:33ordnungswidrigGlenjamin: it depend on whether you'll need to pass the argument around a lot.
08:33ordnungswidrigGlenjamin: but on the library-level I'd go with explicity args
08:33Glenjaminyeah, can always wrap that in other API styles
09:02pandeiroanyone using httpkit w/ websockets noticed that the on-close handler isn't called when a browser window refreshes (expected behavior would be to close socket connection and then re-establish)?
09:05ordnungswidrigevery browser?
09:08pandeiroordnungswidrig: no, just chrome yeah
09:08pandeirofound this: http://code.google.com/p/chromium/issues/detail?id=51687&amp;q=websocket&amp;colspec=ID%20Pri%20Mstone%20ReleaseBlock%20OS%20Area%20Feature%20Status%20Owner%20Summary
09:08ordnungswidrigpandeiro: I wonder whether this could be a feature. Is the websocket kept alive?
09:08pandeiroso it's chromium
09:09pandeiroordnungswidrig: yes it appears to be
09:09pandeirofrom that bug report seems only firefox implements the expected behavior
09:09ordnungswidrigpandeiro: which is unfortunate in the case of browser shutdown. you will either lower some timeout or fight the idling sockets on the server.
09:10pandeiroordnungswidrig: yeah it means i have to do more bookkeeping
09:10pandeiroordnungswidrig: even browser refresh presents a problem, i have duplicate entries for the same client id
09:11ordnungswidrigpandeiro: can you drop the old one? Except when you want to support mutliple windows from one browser, then this will fail
09:11pandeiro...and using core.async channels to broadcast events i get errors about exceeding the number of put!s b/c of these 'ghost' connections
09:12pandeiroordnungswidrig: yeah it's just a question of looking for the client-id each time a connection is established
09:12pandeiroand probably implementing some sort of a timeout
09:12pandeirowhich i don't want to do (maybe the browser is just idle)
09:13ordnungswidrigpandeiro: that opens a can of worms, you'd need to make the browser send keep alive requests etc.
09:14justin_smiththis stuff will all change with http/2 right?
09:15pandeirojustin_smith: no idea, will it?
09:16pandeiroi wonder if sente has any logic to clear this up...
09:16ordnungswidrignot sure, http/2 changes are mostly on the "transbport" layer. instead of opening multiple tpc connections it will multiplex over a single connection.
09:16ordnungswidrigwhich allows the server to send out-out-band responses to prefetch resources.
09:17ordnungswidrigI guess websockets will be multiplexed over that connection too and should behave like now
09:23julianlevistonHooray! My debouncing core async chan is working really nicely! :)
09:37AeroNotixordnungswidrig: problem with "just drop the old one" is multiple services
09:38AeroNotixwe are solving a similar problem in Erlang, and erlang has built in tools for stuff like this. I wonder what Clojure has.
09:39AeroNotixThe safest bet is to use Zookeeper or something to manage the connection registration
09:42ordnungswidrigareonotix: not sure but zookeeper might be to slow.
09:42AeroNotixI said "safest" not fastest
09:42AeroNotixIt really depends what you're after
09:43AeroNotixwith our erlang solution we use pg2 (built in Erlang distributed process registry, it's AP)
09:43ordnungswidrigAP?
09:43AeroNotixas in CAP
09:44AeroNotixfavouring availability and partition tolerance
09:44AeroNotixinstead of consistency
09:44AeroNotixwith pg2 after a netsplit, for example, the registry on different nodes is different.
09:44AeroNotixbut it works for us, we have 7k registrations some times and the 95th percentile is 800ms on EC2 with 4 nodes.
09:45AeroNotixa registration needs to do an erlang message to each node
09:45AeroNotixordnungswidrig: I'd love to see what there is in the Clojure space for this.
09:45AeroNotix7k in the space of 1s I mean
09:46AeroNotixAkka probably has something like this right?
09:46AeroNotixI didn't look into it much
09:46julianlevistonAeroNotix: wow
09:46AeroNotixjulianleviston: yeah we handle a lot of websocket connections
09:46AeroNotixwe use Erlang though
09:47AeroNotixit's great for this
09:47julianlevistonAeroNotix: yeah, that’s it’s perfect use case
09:47AeroNotixindeed
09:47AeroNotixI'd really love to use Clojure simply because I hate Erlang otherwise :)
09:47julianlevistonAeroNotix: there’s not really a dist soln for clojure yet is there...
09:47julianlevistonAeroNotix: yeah, it’s a bit GUHHHHHH to code in, isn’t it
09:47AeroNotixI don't know if there's something specifically for Clojure, but I'm sure you could use Akka
09:48ordnungswidrigAeroNotix: I think akka is what is used most likely. maybe hazelcast can be used
09:48AeroNotixordnungswidrig: this could work
09:48AeroNotixwhat are the failure semantics?
09:49julianlevistonAeroNotix: http://joxa.org ?
09:49julianlevistonhehe ;-)
09:49AeroNotixit doesn't mention on the front page whether it's CP or AP
09:49AeroNotixjulianleviston: it's fine, LFE is more popular. But none of them are anything like Clojure.
09:49julianlevistonAeroNotix: yeah fair enough :)
09:50mbaczookeeper seems to have fared well in the call me maybe series
09:50AeroNotixmbac: indeed!
09:50AeroNotixbut it's throughput might be quite bad
09:50AeroNotixI don't see you being able to add/remove keys to ZK in the way we want to for example
09:51mbacmaybe if you could federate the zookeeper namespaces across sub-zookeepers? :)
09:51AeroNotixe.g. 7k add/removes a second
09:51mbacthat's one scaling strategy...
09:51AeroNotixmbac: so you mean sharding an already distributed kv store :)
09:51julianlevistonAeroNotix: Last I heard Rich was still saying distributed computing was “an area of interest” I wonder if he’s hammock’d up anything amazing yet? :)
09:51AeroNotixjulianleviston: I would *love* to see what Rich comes up with
09:51mbacAeroNotix: i don't think i mean sharding
09:52AeroNotixmbac: you mean having different namespaces on different ZK clusters?
09:52ordnungswidrigIs zookeeper AP or CP?
09:52julianlevistonAeroNotix: I really liked that pretty much the first thing you build in the book on erlang that joe armstrong wrote was a distributed bouncing ball… lol
09:52ordnungswidrigor can you configurE?
09:52AeroNotixordnungswidrig: massively CP
09:52mbaci think i mean that you can decide some sections of the zookeeper namespace are delegated to other zookeepers
09:52mbacsort of like dns
09:52mbacthat is, it would be nice if this existed
09:52AeroNotixjulianleviston: ignore Joe Armstrong as much as possible
09:52mbaci have no idea if it does
09:53AeroNotixhe's an out of touch fool that spouts cliches and memes over and over.
09:53julianlevistonAeroNotix: really? haha what in preference? and why? :)
09:53julianlevistonAeroNotix: ah… ok lol.
09:53AeroNotixI've spoken to him a few times, he really has no clue about modern Erlang development at all.
09:53mbacordnungswidrig: according to this https://aphyr.com/posts/291-call-me-maybe-zookeeper it's CP
09:53julianlevistonoh Akka has clojure bindings
09:54AeroNotixmbac: ordnungswidrig definitely CP.
09:54ordnungswidrigfor websocket registration, could you use something like cassandra? would that make sense?
09:54AeroNotixordnungswidrig: AP, massive row mutation, imagine the tombstones/compaction on that.
09:55AeroNotixworth a try but the operational overhead might be massive
09:55ordnungswidrighmm, maybe in a memory only mode :-)
09:55AeroNotixas a SPOF?
09:55julianlevistonoh not really actually.
09:56AeroNotixordnungswidrig: check out pg2 in erlang
09:56AeroNotixthis is a really good way of doing it
09:56AeroNotixit's in-memory, pretty scalable
09:56AeroNotixbut it *is* AP. But it gives you tools to merge similar keys together.
09:57cemerickAeroNotix: cool story re: Joe Armstrong o.0
09:57ordnungswidriggood to know. I actually do not have any needs for such tool right now.
09:57AeroNotixcemerick: Did you ever use Rebar?
09:57AeroNotixthe Erlang build tool
09:58cemerickAeroNotix: I have.
09:58julianlevistonhave any of you used avout?
09:58AeroNotixcemerick: I spoke to him about repeatable builds and the like. He was aware of rebar and said it was fine and I quote "dependencies are easy"
09:59julianlevistonI’m only curious.
09:59AeroNotixjulianleviston: oh yeah I tried that
09:59AeroNotixso cool
09:59AeroNotixthe idea is really neat
10:00AeroNotixit Just Werkz
10:00julianlevistonAeroNotix: reminds me of some kind of precursor to datomic a lot…
10:01cemerickAeroNotix: Okay. Going to have a hard time bootstrapping that into "Joe Armstrong is a clueless fool".
10:01AeroNotixcemerick: clueless about modern Erlang development. There's a lot more to it than that though.
10:02gfrederickswhat? dependencies are easy? hasn't he heard that they're hard?
10:02AeroNotixgfredericks: go use rebar in prod for a while. You'll see what I mean. It's horrifi
10:02AeroNotixhorrific
10:03cemerickso bizarre
10:03AeroNotixa lot of the people you see swooning over Erlang are just using it for trivial projects.
10:04AeroNotixI've met most of those people who go to all the Erlang/Erlang solution gigs
10:04AeroNotixliterally all of them are just making shit up
10:04AeroNotixit's full of posers et al.
10:04cemerickBjarne Stroustrup is an idiot for not saving us from semicolons
10:04AeroNotixExcuse me though, I'm a little burned out on it.
10:04julianlevistonLOL
10:04cemerickGuy Steele is dumb for having helped make Java
10:05julianlevistoncemerick: multiple inheritance!
10:05cemerickdunno, I'll stop now :-P
10:05julianlevistoncemerick: you protest too much ;-)
10:05mavbozoAeroNotix: let's hear more about it in #clojure-offtopic
10:05AeroNotixcemerick: Joe claims to have invented Erlang but he invented JAM which is not BEAM and was vastly different.
10:07cemerickAeroNotix: I don't really have anything to add. The whole thread is absurd.
10:07cemerickSorry for the noise, everyone :-)
10:07AeroNotixyeah^ sorry
10:08mavbozowe need a place to vent our frustation
10:12ordnungswidrigcemerick, AeroNotix: it's interestung noise
10:16mavbozoAeroNotix: thanks for sharing
10:16mavbozo(inc AeroNotix)
10:16lazybot⇒ 8
10:59daniel__clojure.core seems to crash my browser: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj
10:59daniel__or rather github
11:01locksI'm trying to do something like http://stackoverflow.com/questions/10634417/image-resize-to-fit-on-jpanel but I'm getting an empty pane, my code (I'm using seesaw):
11:01lockshttps://www.irccloud.com/pastebin/z5hVQvO8
11:02chrstphrhrtanyone know which of the clojure repl options is most like bpython? don’t need fancy graphical notebook or editor integration, just a solid standalone repl
11:03locksthe backtrace is so big LightTable isn't displaying all of it
11:17mnngfltgchrstphrhrt, bare `lein repl` should get you most of the way there; for colored output, https://github.com/venantius/ultra
11:18mnngfltgwhat exactly are you looking for?
11:18chrstphrhrtmnngfltg: ooh purdy, thanks!
11:18chrstphrhrtmnngfltg: looks like REPLy is nice too
11:19chrstphrhrtmnngfltg: would like completion to help learning.. but prefer in terminal rather than editor
11:30mmitchelljustin_smith: hey sorry to bother again. Re. cider and nrepl... I just can't seem to get "lein ring server" + repl options to work with cider-nrepl. No matter what I do, I get the "wrong version" warning in Emacs. The only way I can get it to work is through "lein repl". This seems to indicate the problem is in the "lein-ring" plugin?
11:30mmitchellwhich is all handled here - https://github.com/weavejester/lein-ring/blob/e0bee845db33e18c020a27fb069bf16a07dcf11c/src/leiningen/ring/server.clj#L54
11:31justin_smithmmitchell: that code makes me think that by adding cider-nrepl to the :nrepl-middleware key in your project you could fix that
11:32mmitchelloh snap, i didn't even see that
11:40mnngfltgchrstphrhrt, I agree, using the repl from the console is easier a lot of times than one integrated in the editor
11:40mnngfltgchrstphrhrt, REPL-y is actually the repl you see when you run `lein repl`
11:41chrstphrhrtmnngfltg: oh ha didn’t realise that
11:44__tim_hi how do you detect a dependency issue with lein deps when using it with a CI server? The return code seems to be the same regardless or any dependency errors, or i'm using it wrong. I've enabled :pedantic true in my project. and running lein deps.
11:47ordnungswidrig__tim_: if the return code is the same then you might be able to grep for a keyword in the output
12:04mmitchelllein-ring :nrepl-middleware for cider support doesn't seem to help at all :(
12:10mmitchelloh wait, latest version of lein-ring doesn't support those options, they're only in master
12:58clintmDo any of you happen to know if we will eventually see support for read macros in clojure?
12:59dnolenclintm: it will not happen
13:00clintmOk, thanks!
13:34bjahaving spent some time in a CL codebase recently, I'm glad I won't see full read macros in clojure anytime soon
14:11moquistdnolen: Wouldn't om/IRender be preferable for professor-view in https://github.com/omcljs/om/wiki/Basic-Tutorial, since professor-view has no state of its own?
14:13moquistdnolen: NM... somehow got the history of my own tutorial code confused. The tutorial doesn't use om/IRenderState like I firmly had in my head that it did.
14:14moquistdnolen: Figured it out. Same comment, but for registry-view. :) Isn't om/IRender more appropriate than om/IRenderState ?
14:19daniel``looking for the clojure or java equivalent of random.SystemRandom().getrandbits(n)
14:19daniel``in python
14:19AeroNotixdaniel``: https://github.com/weavejester/crypto-random
14:20AeroNotixrelevant java classes are java.security.SecureRandom
14:21daniel``SecureRandom :)
14:21daniel``i was looking at Random
14:22daniel``is more or less the same, i need a way to convert a byte-array to a long
14:22justin_smith,(let [rnd (java.util.SecureRandom.)] (.next rnd 8))
14:22AeroNotixdoesn't it have .getLong ?
14:22clojurebot#<CompilerException java.lang.ClassNotFoundException: java.util.SecureRandom, compiling:(NO_SOURCE_PATH:0:0)>
14:23justin_smith,(let [rnd (java.security.SecureRandom.)] (.next rnd 8))
14:23clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: next for class java.security.SecureRandom>
14:23justin_smithhrmph
14:23daniel``justin_smith: i think .next is protected and i can't call it
14:23justin_smithwell that's dum
14:24daniel``AeroNotix: don't think so, it has nextLong but then i can't specify the byte length
14:24justin_smithdaniel``: nextBytes
14:24justin_smithtell it how many bytes you want, turn them into whatever you need
14:25justin_smithyou probably wanted a multiple of 8 anyway
14:25AeroNotixdaniel``: what do you need the random for/
14:25AeroNotix?
14:25daniel``trying to implement an SRP login system
14:26daniel``its for a salt
14:26daniel``http://en.wikipedia.org/wiki/Secure_Remote_Password_protocol im copying this python implementation
14:26AeroNotixI'm just using (random/bytes 20)
14:26AeroNotixfrom crypto.random
14:27AeroNotixthe _first_ thing I linked you to
14:27AeroNotix20 is the number of bytes, obv
14:28justin_smithAeroNotix: a whole lib seems a bit much for what could be two interop calls
14:28AeroNotixjustin_smith: it's a whole lib which does the interop calls :)
14:29justin_smithAeroNotix: that fit in a clojurebot one-liner
14:29AeroNotixand I don't understand that argument either. We have great tooling for managing dependencies in Clojure, use them!
14:29daniel``AeroNotix: yep, thats similar to my implementation
14:29daniel``trouble is the python version returns a long not a byte array
14:29AeroNotixjustin_smith: right, but there's no reason (especially with crypto code?) to do it over and over again
14:29justin_smithAeroNotix: using the class directly is not reinventing the wheel in any sensible definition of the term
14:29AeroNotixdaniel``: byte-array => ByteBuffer => getLong?
14:30daniel``and crypt-random is a good reference though
14:30daniel``AeroNotix: thanks for the tip, ill try
14:30amalloyi think that either using this lib or doing interop directly are both perfectly reasonable approaches, i don't know why you guys are arguing about it
14:30AeroNotixamalloy: shrug
14:30daniel``amalloy: :)
14:30dnolenmoquist: perhaps, the wiki is user modifiable, I'm always happy to see enhancements
14:31AeroNotixno arguments just different approaches and asserting they are the preferred way.
14:31daniel``its useful for me to see the interop because i have no java background
14:31daniel``and like to know whats going on
14:32moquistdnolen: Cool. I'll do that.
14:33AeroNotixuser> (.getLong (ByteBuffer/wrap (random/bytes 200)))
14:33AeroNotix;; => 7805789527915639494
14:33AeroNotixdaniel``: ^^
14:34daniel``yep, thanks AeroNotix, just got to the same
14:34AeroNotixobv you only need 8 bytes
14:34daniel``yeah
14:35justin_smithyou can use bit-and to ensure you don't get more bits that wanted (if it wasn't a multiple of 8)
14:37daniel``it uses 1 or 0 for the remaining bits?
14:38justin_smithdaniel``: it would be for ensuring bits you don't want are zeroed out (but keeping the sign bit intact)
14:38justin_smithif you want a value with a specific non-multiple-of-8 bits
14:39daniel``right
14:39daniel``Error detected while processing function <SNR>64_printop..<SNR>64_opfunc: weird error i get trying to evaluate the long
14:39daniel``its ok if i call it with (prn s)
14:40daniel``think this is a fireplace thing
14:40daniel``can't evaluate a value outside parens
14:40AeroNotixprimitive ;)
14:46daniel``this is where i got to https://gist.github.com/danielstockton/40dd5a9c3bdde35244ea
14:47daniel``can't parse the string digest in the one way hash function to an integer either
14:48daniel``python has hexdigest that MessageDigest doesnt
14:51socksyis datomic the only existing database[-style-project] that supports the clojure philsophy of immutability/persistent data structures, or are there some others out there?
14:52lvhHm. I have a data structure, only passed at runtime, that looks like [{:a :a} {:b :b} {:c :c}]. I want to transform that into (l/run* [q] (conde [(l/featurec req {:a :a})] [(l/featurec req {:b :b})] [(l/featurec req {:c :c})]). The obvious choice for that kind of rewriting seems to be macros, but I can't do that, because runtime (unless I'm supposed to call macroexpand or something).
14:53lvhJust apply won't work; l/run is itself a macro.
14:54amalloyi think you can easily enough write a version of conde that takes a list of goals
14:58amalloy(defn conds [goals] (if (empty? goals) (fail nil) (conde [(first goals)] [(conds (rest goals))]))) or something like that
14:59hiredmanisn't there already one?
15:00amalloyhiredman: probably
15:00hiredmaneveryo or something?
15:00lvhhiredman: Isn't everyo conjunction?
15:00gfredericksyou can write a recursive function too I thinks
15:00amalloygfredericks: that's what i did
15:00gfredericksthat's what amalloy just did
15:01lvhconde is [[a AND b AND c] OR [d AND e AND f]]
15:01amalloyi mean, who knows if it works
15:03AeroNotixdaniel``: do you have the python code you're emulating?
15:03daniel``yeah http://en.wikipedia.org/wiki/Secure_Remote_Password_protocol
15:03daniel``made a tiny bit more progress on the gist
15:07daniel``hmm it actually works, what i have in the gist
15:07lvhamalloy: Thanks!
15:07daniel``im having trouble with reevaluating my file due to my primitive setup
15:07amalloylvh: does it actually work?
15:07lvhamalloy: I removed the inner []s since I still want to be able to specify the conjunctions
15:07lvhamalloy: Yeah, looks like it :)
15:08amalloygreat
15:08daniel``hmm no, sometimes it gives a NumberFormatException Infinite or NaN
15:08lvhwait, maybe not
15:09lvhamalloy: What's (l/fail nil)? I thought you were just supposed to use l/fail to get a failing goal?
15:09amalloylvh: yeah, it's a failing goal. if there are no goals left in the conds, you need to fail, right?
15:10lvhamalloy: OK, cool, as long as it's the same as l/fail I know what it means :)
15:10amalloylvh: i don't really know; i just wanted a failure for my base case, and found l/fail. it probably does what i mean. haven't touched core.logic for at least a year
15:10lvhamalloy: Okay, cool :) Thanks!
15:15lvhamalloy: I can't get the version without []s to work, though: https://gist.github.com/lvh/353d5a5c057a758b7858
15:15lvhnot the bestest error message :(
15:15amalloythat is not how brackets or core.logic work
15:16amalloyin (conde [a b c]), the value [a b c] never exists at runtime: it's just a grouping mechanism for core.logic's macroexpander to use
15:16amalloycreating your own vector and passing it in will never work; you need to use like (l/all a b c)
15:24AeroNotixWhen I am trying to generate a class is it not possible to keep re-evaluating the gen-class ns and have the changes reflected?
15:24AeroNotixbecause it seems that this is the case.
15:25AeroNotixi.e. I add / change the :constructors key, and the changes aren't reflected.
15:25amalloydnolen: a lot of stuff in core.logic is macros that doesn't seem to need to be. like, why is l/all a macro? it expands into bind*, which expands into bind, which is just a function with no funny business
15:25AeroNotixamalloy: I've had similar thoughts when looking at core.logic
15:25dnolenamalloy: dunno, some things are vestiges of history or things brought over from miniKanren
15:25amalloyso it seems to me like bind* could be a function, which would make l/all a function, and then you could just write (apply l/all goals)
15:25AeroNotixthere's a few places that could seemingly be replaced by functions
15:26amalloydnolen: would you take a pull request that changed bind* and all to functions?
15:26ulhi! anybody encountered such error in repl?
15:26ulclojure.lang.Compiler$CompilerException: java.lang.ClassCastException: vfsm.core.Automaton cannot be cast to compile__stub.vfsm.core.Automaton
15:26ulwhat is compile__stub?
15:26amalloyoh, core.logic is a contrib, so i guess it'd be a jira ticket
15:27dnolenamalloy: I don't like changing old stuff
15:27dnolenamalloy: but I'm happy to see the desirable behavior provided by some other route
15:27ulit happens if i try to call function from vfsm.core namespace
15:28amalloydnolen: you mean something like all* that's a function version of all?
15:28AeroNotixdnolen: would the observable behaviour change all that much?
15:28dnolenamalloy: yeah, that's preserved
15:28amalloyAeroNotix: well no, not at all, which is the point
15:28dnolens/preserved/preferred
15:28AeroNotixamalloy: that's why I don't get the fuss about changing it.
15:28dnolenamalloy: I'm happy to assess the change if you do a bit more legwork wrt to verifying it doesn't actually change anything (perf etc.)
15:30amalloyAeroNotix: nobody wants to fiddle with the foundations of their work on a lark. even if it seems like it would obviously be an improvement, it's dangerous
15:31AeroNotixamalloy: isn't this why we have test suites and beta/rc releases?
15:32AeroNotixdo I really need to restart the vm when I change gen-class definitions?
15:32amalloyAeroNotix: when you have a project as large and widely used as core.logic, you can make a policy of accepting any pull request that doesn't break the tests. but since core.logic is dnolen's, i'm happy to live with his policies
15:32AeroNotixamalloy: ok
15:33dnolenAeroNotix: core.logic is just really old now, I'm not quite so cautious with other projects that I maintain
15:33AeroNotixdnolen: rog
15:33amalloydnolen: i don't really want to do a ton of legwork, since i don't even use core.logic; i just noticed this issue while answering someone's question in here. but i can put together and*, a function version of all, and or*, a function version of conde. or do you prefer some other name?
15:34vasSo I want to chain transformations together in enlive using ( enlive/do-> ) ... but i'm not sure how it works. do I need to supply the nodes it operates on to each transform, or are all transforms applied to the same node set?
15:35dnolenamalloy: we do have a simple convention around goal functions, just tack a g onto it. but that's kind of ugly. maybe a new goals namespace?
15:35amalloy"condeg"?
15:35dnolenamalloy: but also happy to take a patch, think on it, and refactor it if I get a better idea
15:35ulis it legitimate to e.g. extend-type clojure.lang.PersistentArraMap with own protocol?
15:35AeroNotixcondegg
15:35amalloyokay
15:35AeroNotixhehe
15:35dnolener apply it, and refactor it
15:35amalloyright
15:36ulfigured out that mentioned above compiler exception happens after i did such extension
15:36amalloyul: yes, if it's your own protocol or your own type it's fine
15:36amalloyextending someone else's protocol to someone else's type is the dangerous thing
15:36ulit is my protocol, but clojure.lang... type
15:37uland it leads to compiler error =(
15:37AeroNotixul: can you show some code friend?
15:37AeroNotixwhat's triggering that?
15:37ulyes, wait a second
15:37AeroNotixjust looks like you're passing something to some java joint that it doesn't like, though
15:38AeroNotixdo I really need to restart the vm when I change gen-class definitions?
15:38AeroNotixjustin_smith: ^?
15:38ulhttps://gist.github.com/ul/a8d61b4372a4e04484e4
15:38ulthis is vfsm.core
15:38ulif i paste its content directly to repl
15:38ulor require — it loads fine
15:39amalloyAeroNotix: probably yeah
15:39AeroNotixamalloy: sadness
15:39amalloygen-class is heavy stuff
15:39ulbut calling any function involving my protocols produces exception
15:39AeroNotixunderstandable though
15:55amalloydnolen: https://www.refheap.com/0383ff71c2b0ad526bd7f9b66 is the outline. anything you want changed before i make a proper patch?
15:56dnolenamalloy: looks good, a few simple example tests would be nice
15:59amalloydnolen: good idea. actually i'll just take a couple example tests from conde, and assert that or*/and* get identical results
15:59dnolenamalloy: nice
16:00dnolenamalloy: you might want to try some of the trickier ones
16:00TimMcsomething something generative tests for equivalence
16:00TimMcThat would be a fun challenge.
16:00amalloyTimMc: well that's the joke, you can't actually do it
16:00amalloybecause the existing features are macros
16:00amalloyyou can't really generate calls to them without eval
16:00TimMcNonsense, there's eval.
16:00TimMcyeah
16:01amalloyand tbh the last thing i want to use eval on is randomly generated code
16:01dnolenugh
16:01TimMcWhat's the point of this fancy-ass language if we don't ever use eval?
16:01dnolenGitHub syntax highlighting is so bad now
16:01dnolenlocks up in every browser
16:02dnolenamalloy: anyways, the divergence tests would be interesting
16:02AeroNotixwould be cool if they just had a profile option to turn it off
16:02dnolenamalloy: search for "divergence" in tests.clj
16:03amalloydnolen: (def f1 (fresh [] f1))? you're a maniac
16:04dnolenamalloy: ha, that's Will's tests actually
16:05locksdnolen: that's quite the big file dnolen :P
16:05dnolenlocks: for some definition of "big"
16:05dnolenlast time I checked the year it was 2015
16:07amalloydnolen: hrm, conde does interleaving? my version probably doesn't
16:07crack_usersomeone knows what is wrong with this tiny code: https://gist.github.com/fariasvp/fae3d6ae4bf5ab083e15
16:07amalloyi wasn't sure if you'd made that the default
16:07dnolenamalloy: oh yeah, it is
16:07dnolenamalloy: sorry for sending you down this direction, didn't realize you were still going off TRS ;)
16:09crack_userhello guys
16:10crack_usersome one can help with this error: https://gist.github.com/fariasvp/fae3d6ae4bf5ab083e15
16:10amalloyyou can't name a function new
16:11crack_userthx
16:15AeroNotixit's weird that it *allows* you to make a function called new but then completely ignores you
16:15{blake}Is there any code lying around to turn a nested JSON into a flat-file or CSV?
16:16TEttinger{blake}, sounds like a recipe for disaster
16:16{blake}TEttinger: Heh. Why?
16:16{blake}It could get very wide, I suppose. But...
16:17TEttingerI just think of CSV as having specific columns, and JSON could have any name for any field, so you would have many columns yeah
16:18{blake}Well, I guess no big deal to roll my own.
16:18boblarrickhttp://konklone.io/json/
16:19boblarrickalso http://csvkit.readthedocs.org/en/latest/index.html
16:19boblarrick{blake}: ^
16:22{blake}boblarrick: Thanks. I guess I steal from here and convert to clojure. =P
16:23boblarrickif you really need to do in-process i guess, maybe just shell out?
16:25{blake}Honestly, I wouldn't want to deal with the bitching from devops. =P
16:32nicferrierhow annoying that clojure is infected with java's private fallacy.
16:33the-kennyOnly with interop. But it sucks, yeah :/
16:33nicferrierI am trying to find where http-kit/client converts { :a 1 :b 2 } to "B=2&A=1" (caps??) but it would be easier if I could get at the internals.
16:33nicferrieras it is, I'm having to read the code and try and guess :-(
16:36the-kennynicferrier: that sounds very strange. Why would http-client do that?!
16:37nicferrierthe-kenny: I presume defn- means "private" of some sort?
16:37the-kennynicferrier: yes, but still accessible via fully-referenced var like #'my.ns/some-private-fn
16:38nicferrierhmmm. ok. can;t seem to reach it from the repl. must be my fault.
16:39the-kennyAccessing it via foo.bar/foo won't work, throwing something like var: foo.bar/foo is not public - accessing it via the var should work
16:39nicferriervia the var?
16:40the-kennyVia #'foo.bar/foo
16:40the-kennyit's a side channel here
16:40nicferrierok. fair enough. thanks.
16:41nicferrierstill a *bit* frustrating though. why do we need privates?
16:41lmohsenihowdy
16:42AeroNotixnicferrier: otherwise you'd have silly naming conventions indicating what's private and what's note.
16:42AeroNotixnot*
16:42AeroNotixnicferrier: with the way it is now, you can at least show the user of the code "hey this is not public"
16:42AeroNotixbut they can easily circumvent it
16:43AeroNotixhttps://gist.github.com/AeroNotix/83a91d08b05ea694abbb
16:43the-kennynicferrier: Distinction between public/private api for example. You don't want to make all utility-fns accessible in case you will remove that later. All such stuff
16:44AeroNotixIt's *a* distinction that causes pause for thought when using it
16:44amalloyokay dnolen, you bastard, i replicated your interleaving for or* and now it behaves exactly like conde in the divergence test. do you need "simple" tests for it too, or is passing the divergence tests good enough?
16:44nicferrierthe-kenny: yeah. but here you go, it's still accessible... so people could break it if they wanted.
16:44the-kennyThat's their fault though. You marked it as non-public.
16:44dnolenamalloy: divergence tests are good
16:44amalloy(ps i guess that kinda sounds like i'm really mad, but i am just playing. the internet is hard sometimes)
16:44AeroNotixnicferrier: except someone clearly knows they shouldn't be doing that
16:44the-kennyElse you would get internal comments or silly naming conventions like AeroNotix said
16:45the-kenny(like in elisp :D)
16:45dnolenamalloy: haha, I read it as "I got nerd-sniped by dnolen"
16:45AeroNotixe.g. in Python or Emacs Lisp you have silly naming convenctions
16:45{blake}amalloy: I was waiting for you to say "DNOLEN YOU MAGNIFICENT BASTARD I READ YOUR BOOK!"
16:45AeroNotixdnolen: you have a book?
16:45amalloydoes he have a book? i read TRS
16:45{blake}lol
16:45xemdetia"dnolen's fishing guide"
16:45AeroNotixoh that one
16:45AeroNotixyeah that's a snoozefest
16:46AeroNotix"Dnolen's guide to having rad hair" is much better
16:46nicferrierthe-kenny: I just think it's silly. there was some xkcd a while ago about it I seem to recall. I think he was right.
16:46AeroNotixnicferrier: what's your alternative?
16:46AeroNotixhow do you convey "hey this is private, dragons"
16:46TimMc^:dragons
16:47AeroNotixTimMc: perfect!
16:47TimMcActually, I'm going to start using that, thanks.
16:47the-kennyI thought ^:private meant dragons
16:47AeroNotixexcept that's exactly what defn- does
16:47AeroNotixdefn- is ^:private
16:48TimMcI've seen ^:internal
16:48{blake}^:infernal
16:48AeroNotixTimMc: does tooling/the language do anything with it though?
16:48AeroNotix^:private is clear, well understood, integrated into the language, and above-all -- Ignorable.
16:48the-kennynicferrier: FWIW: I don't see the behavior in http-kit: @(org.httpkit.client/get "http://localhost:4035&quot; {:query-params {:foo 233}}) works just like xpected
16:49TimMcAeroNotix: :private is annoying because it gets in the way of tests
16:49AeroNotixTimMc: explain
16:49AeroNotixwhy are you testing private functions
16:49TimMcBecause unit tests?
16:49the-kennyAeroNotix: I think that's fine. For granularity.
16:49nicferrierthe-kenny: yeah. I just found the problem and it was me being stupid. and i wasted 10 minutes not finding my stupidity by having to arse around to prove that it wasn't http-kit.
16:49the-kennyTimMc: can't you just use the #'foo.bar/fun workaround?
16:49AeroNotixTimMc: you test private functions?
16:49TimMcAbsolutely.
16:49AeroNotixLol
16:50AeroNotixtest the interface
16:50the-kennyAeroNotix: I do that too from time to time.
16:50xemdetiaif I am relying on it why wouldn't I test it
16:50the-kennyIf there's hairy logic or some widely-used utility-fn why not test its behavior?
16:50TimMcJust because they're not part of the interface doesn't mean you can't or shouldn't pin down behavior.
16:50amalloydnolen: http://dev.clojure.org/jira/browse/LOGIC-167
16:50dnolenamalloy: thanks!
16:50AeroNotixyou should be able to invoke this "hairy" code through regular testing of the interface
16:51AeroNotixalso, if your interface makes it hard to get good coverage, you dun f'd up.
16:51nicferrierin fact, that's the definition of a unit test. unit tests are supposed to test "business value" and not integration.
16:51TimMcAeroNotix: Sometimes I test things that the interface does not *currently* expose but could later if the code is modified.
16:51AeroNotixTimMc: I just delete things the interface doesn't expose.
16:51TimMcThat's your call.
16:52TimMcbut sometimes that is not possible
16:52AeroNotixTimMc: vcs makes it possible to time travel
16:52TimMcThe private fn may be highly general and the public one restrictive. You can't "delete" the generality.
16:53TimMcAnyway, you haven't demonstrated that there is harm in testing private fns.
16:53xemdetiaI like bridges I built to be tested even if we only care about the cars that drive over it :(
16:53AeroNotixthere's no harm, obviously. I'm just saying that it's code that should be easily invoked through normal interface testing and it's code that could be ephemeral in the face of changing requirements
16:54TimMcI do it because it can add robustness against future code changes that I haven't even imagined yet.
16:55AeroNotixmy goal is to usually check the coverage report and see whether these helper/private functions have been invoked and ensure that I write tests to invoke those paths
16:55AeroNotix"branch testing"
16:55TimMcAeroNotix: OK, but many of my tests of non-interface fns are also there because I test as I write and it helps flush out bugs faster. You think I should delete them afterwards?
16:55AeroNotixTimMc: I use a repl for that
16:56AeroNotixbut yeah, when I develop I have snippets of code that work with the internal stuff in the file, when I am doing messing with it, I'll paste it into a test file. If eventually I don't need it and I can invoke that code from just the interface, I'll delete it.
16:57TimMcWhatever floats your boat.
16:57AeroNotixThis is why people end up with test suites which take hours to run
16:57AeroNotixbecause they're testing irrelevant things, or things multiple times.
16:57TimMcNever had that problem.
16:57AeroNotixperhaps not hours
16:58TimMcIf and when I have that problem I'll consider changing things.
16:58xemdetiaI mean this is why you make your test suite configurable so you only run what tests are required and still have them around for a full final build
16:58AeroNotixxemdetia: sure, but you still need to do the full final build for CI.
16:59AeroNotixin fact, I just run tests in the repl too by evaluating the test.
16:59nicferrierpersonally I do change based testing.
17:00xemdetiaI don't mind CI builds taking a while, the point of CI is that nobody is having to watch the stove
17:00AeroNotixxemdetia: it's fine when you've got the infr or the cash to spunk on redundant CI servers
17:00AeroNotixit's actually _really_ fun when you've got N-million CI servers
17:02TimMcyou mean customers?
17:02xemdetiawell I don't know, when something is taking too long I do the sensible thing of take measurements, make changes, measure for improvements like everyone else, even if my CI server is just a vm on my laptop building linux iso's
17:02AeroNotixhaha
17:02xemdetiaif I have to make tests more efficient because it doesn't fit my needs that is just as well a documented problem as code optimization
17:02xemdetiathat doesn't mean I should just purge it
17:02xemdetiaat least to me
17:06TEttingerOpen Build Service from OpenSUSE is pretty nice for linux builds
17:07TEttingernot CI I guess
17:07AeroNotixtravis is sweet
17:12justin_smithTEttinger: does suse stop being super weird? because as a long time debian user I jumped into it recently and it was a major culture shock
17:12TEttingerjustin_smith: I use windows, I stopped fiddling with linux a few years ago tbh
17:12justin_smithOK
17:13TEttingerI still have some VMs I occasionally use for FontForge
17:13TEttingerone is basically only used to build GNU Unifont
17:15sveriHi, I have a string containing some html code. Using selmer I want to get the content from the string and just use that as plain html in the template. {{some.content|safe}} keeps the content from being escaped, but it still is inside a string. How can I do that?
17:15TEttingerhttp://www.unifoundry.com/unicode-utilities.html this stuff is highly linux-specific, but I used clojure to bit-twiddle each line of hex digits (after parsing) into different shapes to make 8x16 glyphs into 16x16 glyphs or 16x16 glyphs into garbage 8x16 ones
19:11jodarohrm
19:11jodaroare there any flambo users in the house?
19:13amalloy~anyone
19:13clojurebotJust 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:14jodaroyeah, i know, but its pretty esoteric
19:15amalloyso? 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:16jodarotrying to figure out the right way to mimic the streaming/scala equivalent of dstream.foreach(rdd=> { rdd.foreachPartition ...
19:16jodaroin a defsparkfn
19:55justin_smithjodaro: wouldn't that just be flambo.api/map ?
19:55justin_smithjodaro: https://github.com/yieldbot/flambo#basics
19:58jodaroi 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:58justin_smithwhat is the difference between a mapping and a foreach?
19:59jodaroso i figured id attempt that first
20:00jodaroseems like the difference between map and doseq
20:02justin_smithjodaro: this mentions support for foreach https://github.com/yieldbot/flambo#rdd-actions
20:03justin_smithlooks like it is just flambo.api/foreach
20:04justin_smith(based on the unit tests that call it)
20:08jodaroyup, that works fine, but I'm in streaming land so my top level is a dstream, not an rdd
20:08jodaroi think i figured it out 3 minutes before commute time
20:08jodarowhich is typical
20:12xapakHello.
20:12jodaromap might still make more sense though because i can collect the results of the action and do something with them
20:13xapakWhat 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:13justin_smithjodaro: 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:14justin_smith$seen sorenmacbeth
20:14lazybotsorenmacbeth was last seen quittingPing timeout: 255 seconds 15 hours and 18 minutes ago.
20:14justin_smithxapak: other programming experience?
20:15xapakjustin_smith, PHP, JavaScript, Ruby, and some Erlang lately.
20:15jodarojustin_smith: yeah, figured he would be the one to ask
20:17justin_smithxapak: you should check out "clojure for the brave and true", the tone isn't to everyone's liking, but it's pretty good
20:17justin_smithxapak: also, programming clojure (the book)
20:18namrai like the clojure for the brave and true
20:18dijkstraculaxapak: aphyr's tutorial is nice imho (though I second justin_smith's suggestion too)
20:18namrafunny and well enough expleined
20:18xapakjustin_smith, nice, thank you. That first suggestion I’m checking. “Looks” like an interesting approach. :)
20:19xapakdijkstracula, I will check that out, thanks.
20:19justin_smithdijkstracula: 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:20dijkstraculajustin_smith: hm, yeah, that's fair
20:35TEttingerdijkstracula: 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:36TEttingermy slower clojure impl is here, I also have one that's optimized but uses hiphip for convenient array handling http://ideone.com/pwiTf2
20:37TEttinger(this is all less than a third the size of a comparable C implementation)
20:44dijkstraculaTEttinger: oh no, putting a roguebasin link in front of me is liable to make my friday night evaporate :)
20:45TEttingerhehe
20:45justin_smith"garlic considered harmful"
20:46TEttinger7 day roguelike challenge march 7, hasn't been a clojure entry yet
20:46justin_smithoooh, interesting
20:46justin_smithI bet you could do nifty things in a 7 day clojure roguelike
20:46TEttingerindeed
20:46TEttingerthen you see what OTHER people have done in 7 days and it's just... how
20:47justin_smithTEttinger: speaking of roguelikes, I think it would be cool to make an algorithm that generates randomized and solvable sokoban levels
20:47justin_smithbonus points if you can parameterize difficulty
20:47dijkstraculathat's v interesting
20:48dijkstracula(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:48TEttingerhttp://7drl.org/2014/03/16/cyberdekay-success/
21:00amalloyTEttinger: dijkstra maps look pretty cool. thanks for the link
21:03justin_smithTEttinger: 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:03justin_smithso it would know whether it is faster to go the long way or dig a shortcut
21:12TEttingeramalloy, no prob, they are used heavily in a game called Brogue, where they lead to some of the craftiest AI.
21:12amalloyTEttinger: i'm just pleased to learn how crawl's autoexplore works
21:12TEttingerlike 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:13justin_smithoh god monkeys are the worst
21:35Blake1Well, shoot, I probably won't be in the 7DRL this year. :-/