#clojure logs

2013-10-07

00:00coventrybbloom: I have other output I would like to see in the repl.
00:00bbloomah, hmm
00:00coventryAnyway, thanks for clearing that up.
00:00bbloomis the output from *your* code?
00:00coventrybbloom: yes.
00:01bbloomcan you simply funnel that output through a choke point that you can override for debugging purposes?
00:01bbloomi've done that before, were i replaced println, prn, etc with xprintln, xprn, and then just had each of those rebind *out* to *myout*
00:02bbloomafter i fixed the bug, i ran a find/replace and put them back to the standard clojure.core functions
00:03bbloomit is odd though that https://github.com/clojure/tools.trace/blob/master/src/main/clojure/clojure/tools/trace.clj#L71-L75 is private
00:03bbloomand not-dynamic
00:03coventryHmm, yeah I could do that. If I don't get what I want with (alter-var-root)ing tracer, I might go that way.
00:04bbloomif you're just doing a one-off debugging hack, private variables are no barrier
00:04bbloomif you want a long term option for logging and what not, that's a different story
00:07namccartySo, I've got a question of idioms here. I am trying to represent squaure tiles. They each have their own attributes and are linked to other tiles. By default, they are linked to the other tiles they share sides with, but they can be linked with arbitrary tiles.
00:07namccartyHow should I go about representing a group of said tiles?
00:07bbloomdepends on A LOT
00:08bbloomis it a regular grid (ie all tiles the same size)? is it sparse or dense? what exactly is a "link"?
00:08bbloomcan rows and columns later be inserted?
00:08bbloomdeleted?
00:09bbloomare tiles identified by position? or some other id?
00:09bbloomcan that identity change? eg if a column is inserted
00:09namccartyIt is a regular grid, it is dense. This is basically a gameboard, and the links are tiles that can be reached if you are standing on that tile.
00:09bbloomah, ok, hm
00:09namccartyOnce the set of tiles is somehow created, it wont ever change
00:09bbloomgotcha
00:09bbloomthe simplest thing to do is a map
00:10bbloom{[x y] info}
00:10bbloomif the board size is "small", then don't worry about any representational efficiency: just use the simplest possible representation
00:10namccartyThat is what I am doing right now, with each info being a hashmap storing the proprities of the tile, including the tiles it is linked to that aren't adjacent ones.
00:11bbloomright, as long as the "link" is just an [x y] vector you follow via lookup, you're all good
00:12namccartyAlright, thanks
00:35logic_progI'm working on a clojure DSL that compiles to java. Is there a way in Clojure to take a string (which represents a Java class), without writing the string to disk, to (1) compile the string into a java class and (2) create an instance of the java? If so, can someone point me at a tutorial? I suspect this is related to "Java Reflection" but it's not clear to me how to do it.
00:38coventryI came across a library which does just that just this evening. Can't find it now, though. Was on github. (Maybe not "just that". For all I know, it writes the java strings out to disk.)
00:41logic_progsurely
00:41logic_progsince java has a JIT and a compiler
00:41logic_progwe can do this with standard Java API?
00:41logic_proglisp has eval, why doesn't Java has a "compile_to_class" ?
00:42logic_proghttp://www.java2s.com/Code/Java/JDK-6/CompilingfromMemory.htmj
00:42logic_proghttp://www.java2s.com/Code/Java/JDK-6/CompilingfromMemory.htm
00:42logic_proghere we go, email enough
00:42logic_progs/email/easy
00:49noonianwhere is the proper place for logging configuration for a plugin, its not being picked up for me from the plugin's resources nor the project I'm using it from. am i just missing a dependency?
00:55yeoj___whats the most efficient way to write a large text file? Talking a few million rows into csv/tab delim.
02:04udoprogyeoj___: I would guess (assuming linux): calculate the exact file size beforehand, ftruncate, mmap, write then munmap. Not clojure specific and you'd be hard pressed to implement it on top of the jvm. :)
02:51shoshinping
02:52shoshini have a question pertaining to tests written using clojure.test
02:52shoshinshould the last statement in a deftest block always be an assertion?
02:53shoshincan i have something like (deftest something…(is <condition>) (something more))
03:12amalloyshoshin: (is ..) is just a side effect like any other. you can have as many of them as you like wherever you like
03:14amalloyudoprog: it's not hard to mmap on the jvm
03:14amalloyjava.io.RandomAccessFile can get you a java.nio.Buffer, which is an mmapped file handle
04:16wei_what's the best way to trigger a function in an app that's running as an uberjar? i.e. not through a repl
04:18wei_my particular use case is I want to periodically update an atom in my webapp using a cron job
04:19wei_i thought of curling a hidden url but I there's a better solution
04:19udoprogamalloy: you get unnecessary copies with that interface
04:20amalloyudoprog: even with a direct buffer?
04:22udoprogamalloy: I would be happy to be proven wrong, my last ventures into this area have a couple of years on its neck
04:32TEttingerwei_: is this something a timer would work for? have you seen atat?
04:32TEttingerhttps://github.com/overtone/at-at
04:34wei_TEttinger: looks useful
04:35wei_though, I'd like to be able to trigger manually too
04:36wei_the important part is to be able to invoke a function server-side
04:36TEttingerthat's an RPC kinda thing right?
04:37TEttingerI imagine you could do it by listening on a socket, but I don't know how to do that myself
04:37wei_ah right, I could open a socket
04:38wei_good idea, will think on it some more
04:38TEttingerok then
05:23ro_stambrosebs - you're on fire, dude :-) well done. you're doing awesome stuff!
05:30ambrosebsro_st: thanks!
05:31ro_sti'm really looking forward to playing with typed. so many new toys, so little time
07:32CommandBotGreetings! Send me a PM and I'll echo it back to you. If it contains the word 'die', I'll die as a bonus!
07:56javeis there some blog-like kind of system built with clojure?
07:57Pupnik_blojure
07:57Pupnik_(its not real, but has a nice ring)
07:57javelol ok
07:57vijaykiranhttps://github.com/briancarper/cow-blog < 3 years ago
07:58vijaykiranif you want something as a exercise to build yourself - https://github.com/vijaykiran/clog
07:59javeI would like a simple blog system as part of another system. I thought it would be nice if clojure.
08:00noidiI need to update the fields :a, :b, :c of a map using functions fa, fb, fc. Is there something like (update-with {:a fa, :b fb, :c fc} m) in the standard library?
08:02algernonjave: there are a few static site builders in clojure (misaki, madness, and probably a whole lot more), which are useful for blogs too.
08:03noidiI know I can just do (merge-with #(%1 %2) fs m), but if there's a standard function, I'd like to use that
08:04algernonjave: there's also yuggoth
08:05pepijndevosclojure startup time is in the order of minutes on the LEGO EV3 :P
08:06javealgernon: thanks
08:10pepijndevosbut once it gets going, Clojure on the EV3 is pretty neat.
08:12pepijndevosI guess clojure-slim.jar would actually be slower, right? My understanding is that it's jusy smaller in size because all clojure code is in source form.
08:26sm0kewhat are clojure programmers called? clojurenauts?
08:26llasramsm0ke: I've seen "Clojurians". But mostly "Clojure programmers."
08:27`cbpclogodites
08:27sm0keclispers ?
08:27llasramsm0ke: Those would be Common Lispers :-p
08:27sm0keoh no clisp is for common lisp
08:27sm0keclojispers
08:28Pupnik_clojocks
08:28sm0keclojurers
08:28pyrtsaClojurians!
08:29pyrtsaFWIW, http://londonclojurians.org/
08:29sm0kethat doesnt sound very cool
08:41AimHereClodjers.
08:44Viestihmm
08:53rurumate_clojays and clojanes
09:03pepijndevosHow do I guard my math routing agains NaN and Infinity correctly?
09:19clgvpepijndevos: use the static methods Double/isNaN und Double/isInfinite
09:20pepijndevosah, I did find Double/POSITIVE_INFINITY, which I'm just comparing to atm.
09:20pepijndevosIn my case negative infinity never happens
09:32h3x3d1Hi guys
09:32h3x3d1Is it possible to select profile for dependency in leiningen?
09:33xeqih3x3d1: do you mean specify a dependency's classifier?
09:33h3x3d1for example - https://github.com/davidsantiago/clojure-hbase
09:33h3x3d1has some profiles in project.clj
09:33rkneufeldh3x3d1: You can add a dependency *to* a specific profile, if that is what you mean.
09:33h3x3d1is it possible to select cdh4 ?
09:34rkneufeldlein with-profile cdh4 some-task
09:34xeqior `lein with-profile +cdh4 some-task` if you want the builtin profiles as well
09:35h3x3d1hmm.. thaks
09:39ro_stwhen is it fair to say that we could have started using immutability in our sofware?
09:39ro_stthanks to the sharp increase in CPU RAM Disk
09:39ro_st15 years ago? 10?
09:40ro_stgosh. i asked that question just at the wrong time :-). stuartsierra, i just asked: when is it fair to say that we could have started using immutability in our sofware, thanks to the sharp increase in CPU RAM Disk. 15 years ago? 10?
09:40stuartsierraro_st: I'm sure I have no id.a
09:40stuartsierra*idea.
09:41ro_stah, ok :-) java was pretty slow even back then
09:41stuartsierraWhenever AWS started. ;)
09:42mdrogalisAWS is keeping a tight grip on new sign ups. I made an account last night and turned on an EC2 micro instance and got a call 10 minutes later from a human to make sure no one jacked my credit card.
09:43stuartsierrawow
09:43mdrogalisIt was weird because it was like 11 PM. My reaction was "Aw man, what did I do? :/"
09:44h3x3d1rkneufeld: it seems, that your solution does not work =(
09:45rkneufeldh3x3d1: my invocation may not have been correct. I'd check https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md for more info on profiles, as my own understanding is cursory.
09:46h3x3d1rkneufeld: i already read this.. There is nothing about dependency profiles :)
09:46h3x3d1and with this command lein with-profile +cdh4 deps-tree
09:46h3x3d1i see that package version id "0.92.2" and not "0.92.1-cdh4.1.2"
09:47h3x3d1maybe i need manually rebuild this package with +cdh4 profile?
09:48rkneufeldPossibly, I'm at the limits of my knowledge on the subject, just thought I'd try to help ;)
09:48h3x3d1Thx, anyway)
09:52xeqih3x3d1: does lein print out the list of profiles it is using before the tree?
09:53h3x3d1xeqi: Performing task 'deps-tree' with profile(s): 'cdh4'
10:00xeqih3x3d1: ah, are you trying to use clojure-hbase as a dependency, and then trying to use a profile from your project to change what clojure-hbase brings in?
10:01h3x3d1xuqi: yep. And now i think - that's impossible :)
10:01xeqih3x3d1: yep, doesn't work that way
10:02h3x3d1xeqi: thx :)
10:03xeqih3x3d1: however, you can fork clojure-hbase, change the group/artifact name, and then `lein with-profiles +cdh4 install` to get a version with those deps
10:04h3x3d1xepi: Thanks a lot, will do so
10:06CommandBotGreetings! Send me a PM and I'll echo it back to you. If it contains the word 'die', I'll die as a bonus!
10:10hyPiRionI am still not sure what one would use such a bot for.
10:10CommandBotGreetings! Send me a PM and I'll echo it back to you. If it contains the word 'die', I'll die as a bonus!
10:11xeqihyPiRion: every bot has to start somewhere
10:12hyPiRionyeah, I guess
10:18nDuffxeqi: ...true, but they don't need to be tested in public.
10:19pepijndevos / join #botwar
11:42silasdavishow would you check if a string is a valid UUID in clojure
11:43silasdavisI could catch an exemption from UUID/fromString but that feels a bit wrong
11:43silasdavisas does writing my own regular expression at the application level
11:43silasdavisexception*
11:43bbloomunfortunately, that's the best java offers
11:44bbloomwrap it in a function that returns a boolean & carry on
11:44silasdavisbbloom: better to use regex or exception do you think?
11:44wedrwrong UUID is definitely not an _exception_
11:45bbloomsilasdavis: http://blogs.msdn.com/b/oldnewthing/archive/2006/05/22/603788.aspx
11:45silasdaviswedr: I'd catch the exception at source
11:52mdrogalissilasdavis: And what would you do if it's not a UUID?
12:00TimMcsilasdavis: Under what circumstances do you need to know if something is a UUID? I'm curious about this because I usually treat them as opaque strings once they're issued, and it only matters if they match something in a DB.
12:08silasdavismdrogalis: return false, probably a regular expression is best
12:10silasdavisTimMc: I suppose I think it's nice to let the consumer of my API know that it's not just that it can not find an item with string id foo, but it never will because it's malformed
12:13augustlTimMc: I've needed it once for datomic. UUIDs is a type in datomic, and when querying for it I need UUID instances, but the UUID comes from user input so it can be any valid or invalid value :)
12:14augustlI did a middleware that checks for "-id" in any URL parameter and does the try/catch thing.
12:32dnolenjonasen: thanks for the all the patches! :)
12:42jonasendnolen: np.. They were not from the Major list though
12:44jonasendnolen: in general, does it make sense to do (throw (error ...)) instead of (assert ..) in the analyzer?
12:44jonasenfor example here https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L276
12:45jonasenwith (assert ..) there is no info where the error actually happened, right?
12:53dnolenjonasen: yes, anywhere we assert we should replace with exception with more information
12:53dnolenjonasen: if you want to submit a patch that does that comprehensively, more than willing to take it
12:54jonasenok, that'll be next on my list then
13:03dnolenjonasen: thx much
13:24noncomhi if i want a range 5 .. 15 how do i get it, idiomatically? (range 5 15) gives range 5 .. 14
13:24noncomi can't write 5.. 16 as it will mislead readers
13:24`cbp(range 5 (inc 15))
13:25mdrogalisnoncom: It's just the way range works. Its last parameter is exclusive
13:25mdrogalisIt works that way in a lot of languages, so your readers might not be as misled as you think.
13:25noncom`cbp: nice! i have a lot of these ranges so i will write a function for that!
13:25noncommdrogalis: yeah, i know, but wanted to know how clojure deals with it idiomatially
13:36Pupnik_i hope you give it a useful name, otherwise it will confuse people who know how range normally works
13:38scriptorperhaps "interval"
13:42rasmustowhat should whitespace look like for a function call with no arguments on the same line as the function? 2 spaces? 1 space? emacs and clojure-vim-static do it differently
13:45bbloomrasmusto: not sure what you mean… example?
13:45rasmustobbloom: I think it's lisp-indent-offset
13:45rasmusto(prn
13:45rasmusto "foo")
13:46bbloomoh, if it's a data list (ie like it's quoted) then treat it like a vector with 1 space
13:46rasmusto^ (these spaces), emacs has it set to 1 by default
13:46bbloomotherwise, when formatting code: two space indent
13:47rasmustobbloom: okay, that makes sense. I don't know how to set that up in emacs though, since lisp-indent-offset changes both data literals and code
13:47bbloomliteral lists that aren't code-as-data are pretty rare
13:47bbloomjust use 2 space indents
13:49rasmustobbloom: idk, I have some pretty gnarly literal lists in my code :p
13:49bbloomprefer vectors for that :-)
13:49rasmustobbloom: oh, they are vectors in my case too
13:49rasmustoThis emacs setting makes those want to use the two-space indentation
13:52Pupnik_eclipse plugin does 2 space
13:53rasmustohm, lisp-indent-offset just smashes everything together, I probably don't want to use it
13:57rasmustothese are the forms that I'm wondering about (?) https://www.refheap.com/19499
13:58scriptorrasmusto: have you taken a look at http://mumble.net/~campbell/scheme/style.txt yet?
13:58scriptorI'm not sure why you're frequently putting the arguments on their own lines so oftne
13:59rasmustoscriptor: I don't generally, I just had a few cases where indentation would get way deep if I don't
13:59scriptorah
14:00rasmustoscriptor: I see the section on lists, looks like emacs was right all along
14:00Pupnik_Rationale: The parentheses grow lonely if their closing brackets are
14:00Pupnik_ all kept separated and segregated.
14:00Pupnik_i like this guy's style
14:02rasmustoI guess I was confused about the 2-space indent for def* forms
14:02rasmustoer, *fn* forms
14:02Morgawrwhat would be the equivalent of using the ~~ operator (double not?) in javascript but in clojurescript?
14:02Morgawrit's usually used in javascript instead of Math.floor() for performance because it's much much faster
14:07Morgawrokay nvm, looks like I can use bit-not twice
14:08Morgawrnot sure how better that will be for performance
14:08Morgawrbut doens't matter
14:09Morgawrlooks like bit-not uses ~ under the hood for clojurescript so it's all good
14:11scriptorwhat was the trick for http://clojurescript.net/ to view the equivalent js for when you enter an expression?
14:15dnolenMorgawr: if you use bit-not twice it will compile to ~~
14:16dnolenscriptor: just wrap your expression in (fn [] ...) note that clojurescript.net is going to be out of date and also it won't reflect differences that only take effect under whole program optimization
14:16Morgawrdnolen: thanks :)
14:16scriptorah, makes sense, thanks
14:17dnolenscriptor: also clojurescript.net is not the official CLJS compiler, it's the CLJS-in-CLJS fork
14:17scriptorhmm, how far behind is it usually?
14:18devntechnomancy: Did you happen to see Aria's presentation at Prismatic about multi-project support in leiningen?
14:18devnhttp://blog.getprismatic.com/blog/2013/10/7/clojure-community-night
14:19coventryI have no idea about that presentation but damn, the checkouts/ feature is useful.
14:19dnolenscriptor: it doesn't keep up to date at all as far as I know
14:19technomancydevn: no; didn't see that
14:19technomancylooks ... long.
14:20scriptordnolen: yep, looks like the last commit was 8 months ago, oh well
14:21dnolenscriptor: you could of course just use ClojureScript REPL directly for this :)
14:23aaelonyhas anyone made use of https://github.com/nicolaskruchten/pivottable from clojurescript?
14:23xeqitechnomancy: relevant part starts at https://www.youtube.com/watch?feature=player_embedded&amp;v=9JxE_ve__VM#t=1606
14:24Morgawrhttp://www.morgawr.eu/stars/ this is obviously the best usage of clojurescript ever
14:24Morgawraka I have nothing to do with my life and why am I even doing this
14:25dnolenMorgawr: nice
14:26coventryCould someone with a mac please post a pdf of Aria's slides?
14:26nollidji have looked through the core.typed docs, and i haven't found anything that shows how i might use type signatures (inferred or otherwise) at runtime
14:26nollidji'm interested in composing functions at runtime and am wondering if core.typed would let me check whether they can be composed statically
14:27technomancyxeqi: thanks; I'll take a look
14:29benmosscoventry: https://dl.dropboxusercontent.com/u/14411407/ClojureNight.pdf
14:29technomancyxeqi: is it just that 2 or 3 minutes?
14:29xeqitechnomancy: seems like it, just passed along a time stamp whne I found it
14:29coventrybenmoss: Thanks very much.
14:29technomancyI wish people would actually be specific about what they want; he doesn't really say what things he wants to do with multiple projects.
14:30jonasendnolen: http://dev.clojure.org/jira/browse/CLJS-614
14:31jonasentests pass, but I have not checked every error condition
14:31jonasenhopefully I have not made any copy/paste errors
14:31dnolenjonasen: not necessary, I'll proof-read ;) thanks this is awesome!
14:41`cbpDoes anyone here know how does racket compare to clojure when it comes to start up?
14:41`cbpstart up time
14:41indigo`cbp: Way faster :P
14:41`cbpindigo: so racket is ok for command line apps?
14:41mtphow often do you start up applications?
14:41mtpah
14:42technomancy`cbp: much better than clojure, yeah
14:42indigoYep
14:43indigoAlthough I'd probably write my cli scripts in bash or ruby ;P
14:43`cbptechnomancy: if you don't mind me asking. Is there any particular reason you chose ocaml over racket?
14:43indigoWell, if you have an nRepl running in the background...
14:46coventry`cbp: http://clojure-log.n01se.net/date/2013-10-04.html#19:25
14:46technomancy`cbp: mostly because I learned a lot more from it. racket would have been easier; it's more like learning to drive a car where the steering wheel is on the opposite side from what you're used to; learning OCaml was more like learning to fly a helicopter.
14:46`cbptechnomancy: oh ok ty
14:46technomancymostly I learned to hate nil
14:47`cbpthanks everyone
14:49technomancydevn: do you know what he's actually talking about?
14:51devntechnomancy: i didn't watch it, but i think attention to what prismatic feels they need in the clojure ecosystem is important
14:52devntechnomancy: err i didn't finish the talk -- at work right now
14:52technomancydevn: I mean specifically the multi-project part you pointed me at
14:52devnno, i just saw that he was going to bring it up, and figured the end of his talk would be of interest to you, and clojure.core
14:52devnerr clojure/core
14:53technomancyhe doesn't really say anything of substance about Leiningen
14:54technomancyor maybe what he's saying is obvious to anyone who works on "big" projects and I'm just missing something?
14:55coventryI'm curious what he means when he says that maven has projects as first-class object.s
15:02makuDoes this irc channel pertain to Clojurescript and the Clojure ecosystem (lein, etc.)? Or is it just pure Clojure language discussion?
15:02dobry-denboth
15:02dobry-denone language, one love
15:02dobry-denjah
15:02ToxicFrogmaku: all of the above.
15:03wakeupHi
15:03wakeupany ideas if/how I can build multiple stand-alone jar's in one
15:03wakeupproject using leiningen?
15:03wakeupe.g. I have two -main
15:03wakeup's
15:03wakeupand would like to build two executables.
15:04technomancywakeup: you can set a separate :main in different profiles
15:05technomancy:aliases {"uberjars" ["do" "with-profile" "+p1" "uberjar," "with-profile" "+p2" "uberjar"]} ; or something
15:06dobry-deni spent a couple hours last night (total java noob) trying to get a compiled clojure class to run on https://cowlark.com/luje/doc/stable/doc/index.wiki - if anybody tried it after seeing it on HN, id like to know how you did it
15:06wakeuptechnomancy: ok, thanks!
15:09wakeuptechnomancy: Do you also know by any chance how I can specify different names for the outputted jars?
15:10nenorbothas anyone had any luck deploying apps to heroku?
15:10devnnenorbot: sure
15:11nenorbotdevn: i keep getting ClassNotFoundException: clojure.main, buy my classpath looks right
15:11wakeuptechnomancy: this isn't critical though, I already have some shell build scripting.
15:18dobry-dennenorbot: i never encountered that error before using heroku. what part of the process does it appear?
15:20devndo you need to (:gen-class) on that ns?
15:20devnin the ns macro?
15:25nenorbotthanks guys. I didn't pass an argument to main in Procfile, that seems to have fixed it
15:38piranhais anybody with knowledge about cljs compiler (especially part about closure compiler) here?
15:39mdrogalisping dnolen ^
15:39piranhaoh, right :)
15:40piranhadnolen: hi, I'm trying to get a foreign library compiled with all of my code (and this library is - at least I think so - prepared for closure compiler). But then 'goog.provide("ThisLib")' is added to the top of the library
15:40piranhathis library by itself consists of quite a bit of modules and has this 'goog.provide("ThisLib")' already
15:40piranhaso I have a conflict there... and am not sure how to proceed
15:42piranhaah, damn, so foreign lib is when a library does not have goog.provide statement...
15:43jonasenpiranha: have you compiled React successfully with advanced optimizations?
15:43piranhajonasen: almost :)
15:44piranhaI've compiled react from commonjs to google closure modules
15:44piranhaand it seems that advanced compilation is ok, but I need to join it properly with cljs code
15:44piranhaand if :libs will work for me right now, then... ;)
15:44jonasenthat's great news! Can't wait to try react+cljs
15:45piranhaI discovered only single incompatibility with advanced mode in react yet, and it was simple to fix
15:45piranhathey really were careful
15:45piranhalinkState though breaks all the stuff, but I think we'll find out what to do later :)
15:45piranhait's not widely used yet anyway
15:48piranhadamn... it's not joined in with :libs :(
15:48piranhaI wonder if I can debug what cljsbuild is doing somehow...
15:55Raynesbitemyapp: Let's make it happen.
15:56Raynesbitemyapp: We need to add some dynamic version stuff you can embed in your READMEs to clojars.
15:56Raynesbitemyapp: A travis-ci-like image or *something*.
15:58antares_happy to finally announce Machine Head http://blog.clojurewerkz.org/blog/2013/10/07/introducing-machine-head/
15:59antares_Raynes: http://badge.fury.io Clojure support would do (not sure if that stuff is open source)
16:00danielszmulewiczhowdy
16:01Raynesdanielszmulewicz: sup
16:01Raynesantares_: Looks closed. :(
16:01Raynesy dey do dis
16:02antares_massive $$$ opportunities in providing badges for open source projects
16:02antares_yeah, that must be a project from silicon valley, only there people would consider that's a worthy idea
16:02sritchiehaha, but I would like clojars integration
16:02sritchieit is annoying keeping that shit in sync
16:03antares_agreed
16:03antares_Clojars should provide something like this
16:03antares_so should rubygems, npm and so on
16:03sritchieyeah
16:03sritchieyeah, just an embeddable js thing
16:03antares_and no, I'm not volunteering to make that happen
16:03scriptorwhat do you mean by badges in this case?
16:03technomancyRaynes: I think xeqi just deployed that?
16:03sritchiemuch like travis does for its builds
16:03Raynestechnomancy: Oh. Really?
16:03antares_scriptor: a small images that display the most current version, dynamically
16:03sritchiescriptor: see this guy: https://travis-ci.org/twitter/summingbird
16:04coventryIn his Clojure Night talk, the primary use-case Aria mentions for a debugger is dropping a breakpoint on a production system. Is that most people's interest. (I'm working on a debugger which wraps all forms in the target code with tracing instrumentation, which would obviously be a bit awkward to apply to that case.)
16:04sritchiethat little "build passing" note in the top right?
16:04sritchieyou can embed that in a github README
16:04technomancyRaynes: https://github.com/ato/clojars-web/pull/167
16:04sritchiebeing able to embed the version of the most recent clojars jar would be great,
16:04sritchieso releases wouldn't have to go bump READMEs, etc all the time
16:04xeqitechnomancy, Raynes: I thought he was being sarcastic
16:05technomancyhah
16:05Raynestechnomancy: https://hatchery.bytopia.org/clojars/lein-droid.svg
16:05Raynestechnomancy: Spacing.
16:05RaynesCan't take it.
16:05technomancyit's a thing: https://clojars.org/leiningen/latest-version.svg
16:05RaynesOkay, good, fixed the spacing.
16:05technomancyRaynes: patches welcome?
16:05dnolenpiranha: got no idea, might want to ask on the mailing list
16:06dnolenpiranha: the CLJS one
16:06sritchietechnomancy: no way
16:06Raynestechnomancy: Well, this looks just fine.
16:07dnolenprip: did you try :libs option?
16:07dnolenpiranha: oops that was for you ^
16:08antares_ohhhhhhh
16:08antares_technomancy, xeqi: that's an awesome feature
16:09xeqithanks to alexyakushev for putting together the inital commit
16:09technomancyyeah, it's pretty cool
16:09antares_I wish there was a way to exclude pre-release versions (e.g. betas), though
16:11technomancydoes it exclude snapshots though?
16:11xeqitechnomancy: yes
16:12technomancyantares_: "-beta" is technically just a convention; I don't think non-snapshots are treated any differently
16:12danielszmulewiczI would like to convert a datomic entity map to its edn representation. I'm confused as about where to look for that utility function.
16:12tbaldrid_danielszmulewicz: explain, that doesn't quite make sense
16:13tbaldridgedanielszmulewicz: you mean, convert it to a string?
16:13danielszmulewicztbaldrid_: I run a diatomic query on the server and returns it as end to the client (clojurescript)
16:13danielszmulewicz*datomic*
16:13danielszmulewicz*edn*
16:13danielszmulewiczdamn spelling
16:14TimMcAre you on Mac OS X by any chance? :-P
16:14danielszmulewiczTimMc: asking me?
16:14technomancymac users have the most hilarious typos =)
16:14danielszmulewiczI run colloquy, yes :-)
16:14benkay_diatomecious query...
16:15danielszmulewiczit's doing auto-spelling, should look into turning that off
16:15technomancyclojurebot: leon?
16:15clojurebotleon is a good sign it's time to turn off auto-"correct"
16:15tbaldridgedanielszmulewicz: then look into d/touch to fetch all the attributes, and then just use pr-str to create a string to send to cljs.
16:16danielszmulewicztbaldridge: will it turn the db attributes into keywords?
16:16tbaldridgedanielszmulewicz: db attributes are keywords.
16:17danielszmulewicztbaldridge: right, but I mean will the entity map be converted to a regular map with keyword/value?
16:17tbaldridgedanielszmulewicz: so assuming you have an id then this works: (->> id (d/entity db) d/touch pr-str)
16:17danielszmulewicztbaldridge: ok, thanks, i'll try that one out
16:51danielszmulewicztbaldridge: works nicely, thanks. Regarding wrapping the edn results in a collection, does this looks acceptable: https://www.refheap.com/19506
16:54tbaldridgedanielszmulewicz: yeah, that will work, you might think about moving the pr-str to be the last thing you do (return a string instead of a coll of strings). But that's up to how you plan on using this in your app.
16:55danielszmulewicztbaldridge: exactly my hesitation.
16:55danielszmulewicztbaldridge: maybe one string like you say. Thanks.
17:42piranhadnolen: yes, tried :libs, and it didn't include the file... I'll play a bit more with compiler and see what's going on inside, don't understand yet. I already tried asking on mailing list and nobody answered :) though I might have formulated question poorly because of lack of understanding
17:43dnolenpiranha: huh, http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html, make it seem like it should work and I haven't heard any bug reports about :libs
17:44piranhayeah, maybe I'm not using them right
17:44piranhadnolen: what do :libs expect? list of directories with js files, right?
17:44dnolenpiranha: no idea read the blog post
17:44piranhaok :)
17:47arrdemis there a clojure flymake mode I can slap elein-test onto?
17:58rasmustowhat's a good way to check that the maps I pass to functions have values for the keys that I'm destructuring, and that those values are in some set? Are :pre/:post a bit verbose?
17:59arrdemrasmusto: the :pre/:post semantics do indeed suck ass and ideally you would do data validation first, but if you must :pre and :post do work nicely.
18:01rasmustoarrdem: I was looking at making a macro to inject :pre/:post into my defines, probably a bad idea?
18:01arrdemrasmusto: hang on digging for my shitty type system macros
18:02arrdemrasmusto: not bad but not awesome either
18:02stuartsierrarasmusto: There are many tools to help with this. https://github.com/clojure/core.typed for compile-time checks. https://github.com/prismatic/schema for run-time checks. And many others.
18:02rasmustoarrdem: I googled around a bit and found prismatic.plumbing/defnk, but I'm not sure if their take on destructuring works for me
18:02augustlwhat's the magic word in emacs to indent the 2nd argument one level instead of below the first argument? Like it does for "if", "when", "doseq" etc
18:02arrdemstuartsierra: oh cool! I didn't know schema was a thing...
18:03arrdemrasmusto: I suggest you go with stuartsierra's links. he knows way more about what he's doing than I do.
18:03rasmustostuartsierra: I'll take a look, I actually don't know if my checks can all happen compile-time, though they might be able to...
18:04rasmustostuartsierra: I'll give schema a look, I think plumbing uses it
18:04arrdemrasmusto: the schema library does run-time
18:04stuartsierraarrdem, rasmusto: Prismatic/schema is opinionated in a way similar to their `defnk`, but if it works for your style it could be helpful.
18:05rasmustoI'm wondering if I should go full-blown core.typed, since I have a lot of maps with a :type field...
18:06arrdemstuartsierra: so care to comment on how core.typed interacts with evolving type representations?
18:06arrdemstuartsierra: I understand that c.t provides static proof with respec to typedefs, but I'm concerned about what happens when those change.
18:06stuartsierraarrdem: No idea, never used it. :)
18:07arrdemstuartsierra: :/ yeah I was struggling to find c.t examples two weeks ago when I went to use it.
18:07arrdemrasmusto: I suspect that :pre and schema is your fix TBH.
18:07stuartsierraarrdem: There have been several interesting core.typed examples in blog posts recently.
18:08rasmustoarrdem: okay, thanks. I feel more comfortable using something like this than rolling my own macros
18:08rasmusto;o
18:08arrdemstuartsierra: haha yeah and then two days later we get R/B trees and the Game of Life in typed :/
18:09danielszmulewiczrasmusto: FYI, defnk allows you to declare a keyword as optional and provide a default value
18:10rasmustodanielszmulewicz: Yeah, I was playing around with it. Seems useful, but I'm not sure if I want to change to their form of destructuring
18:13ToBeReplaceddependency creep is weirding me out... if i require incanter-charts, i get clatrix, core.matrix, jblas, parallelcolt, junit, jplasma, opencsv, clojure-json, etc
18:13augustlI need a doseq-indexed. Should I write a macro, or should I just create a new data structure with map-indexed?
18:13technomancyaugustl: I recommend against customizing indentation rules unless you are the only one who will be working on a project
18:13rasmustoaugustl: maybe a (doall (map-indexed ...)) ?
18:14augustltechnomancy: thanks for the advice! Was hoping there was some kind of convention for creating your own functions that takes "arguments" in the form of a vector and have it indent like defn, fn, let, etc
18:14augustlrasmusto: yeah I guess that's easiest
18:18augustlrasmusto: (doseq [[idx value] (map-indexed vector values)] ...body..) works great :)
18:18technomancyToBeReplaced: eep; clojure-json
18:18rasmustoaugustl: cool
18:18arrdemy u no data.json...
18:21technomancywow, clojure-json is the 5th hit on github for "clojure json"
18:21makucemerick:
18:28SegFaultAXtechnomancy: Too high or too low?
18:29technomancyI would have expected an exact match in the project name to count for more
18:30technomancyoh, but the repo it's pointing to is not the original; it's someone else republishing it
18:30technomancylooks like danlarkin deleted the original, huh
18:30danlarkinoh did I?
18:30hiredmanhe opensource and then took it back
18:30danlarkinyeah I guess I did
18:31hiredmanopensourced it
18:31danlarkinjenn would be proud
18:31technomancyhiredman: "pulled a prismatic" is how we call it
18:31danlarkinIma let you finish but cheshire is the best json library of the year
18:32technomancyhow will future historians trace the development of early-to-mid 21st-century JSON parsing on the JVM without this crucial repository?
18:32danlarkinhaha
18:32danlarkinI'm a bad internet citizen :(
18:33hiredmanyou forced github to change urls, which isn't cool
18:33danlarkinnow I'll never get into the hall of fame
18:33technomancy3 years ago https://github.com/technomancy/clojure-json/commit/7a7612803
18:34technomancyI forgot that 1.2 wouldn't complain if you used a class that didn't exist in a type hint
18:34technomancythat was great
18:34Bronsa*awful
18:34danlarkinlong live clojure-1.2
18:34technomancydanlarkin: great clojure version or greatest clojure version?
18:35technomancyback when we had reify but no one had actually figured out how to use defrecord yet; those were the days
18:36ro_stquick. think of an image that represents "functional programming"
18:36ro_stsourcing imagery for slide decks is hard :-(
18:37technomancyhttp://p.hagelb.org/erlangs.png
18:37rasmustoro_st: http://colescuts.files.wordpress.com/2011/03/lamb1.jpg duh
18:37`cbpwhen in doubt use john mccarthy
18:37danlarkinimagine a world in which not every slide needs its own cute image
18:37ro_sti totally don't get that, rasmuto. then, its way past my bed time
18:38ro_stdanlarkin: already used my quota of that copout on other slides :-)
18:38scottjro_st: lambda :)
18:38danlarkinI think you've got it backwards, filling your sides with pictures is the copout
18:38technomancyhttp://p.hagelb.org/exist-as.png
18:38gfredericksI was watching a presentation the other day and realized that having a meme on each slide is now so common that I don't even notice they're there
18:39ro_stnot using memes. using high quality full-frame photography as much as possible
18:39technomancyMFW I use juxt http://p.hagelb.org/power.gif
18:39ro_stdanlarkin: and use what instead? bullets? yuck
18:40ro_sthaha
18:40technomancyro_st: takahashi
18:40danlarkinfalse dichotomy! the opposite of "stupid memes" isn't "boring"
18:40gfredericksI've always liked lawrence lessig's style of putting 3ish words from each sentence on one slide and nothing else
18:40mtpin fact, the definition of 'stupid memes' is "boring"
18:41rasmustogfredericks: what about 3 words on one slide with transitions that make them pop into view?
18:41rasmusto(so the pdf is unreadable)
18:41technomancyI had one slide in my last conj deck that was just "正名" in a huge font
18:42hiredmanit is an important principle
18:42ro_stso tempted to use the half-life lambda. but that's going to confuse people
18:42technomancyhttps://en.wikipedia.org/wiki/Takahashi_method
18:42ro_stit's a general tech conf. not a everyone-gets-the-in-jokes programmer conf
18:43seangrov` technomancy: Wow, that's the style I use. Often have ~150 slides
18:43technomancyseangrov`: see, we shouldn't be shy about stealing ideas from ruby people =)
18:44Raynestechnomancy: Why do we have the latest version thing but no links to it from project pages and stuff?
18:44RaynesLike, how could someone even know this exists?
18:44seangrov`technomancy: Only if you beat them up and call them wimps afterwards
18:45technomancyRaynes: because it has only existed for like ten hours maybe?
18:48Raynestechnomancy: Sure.
18:49technomancyalso because clojars doesn't get a lot of love these days
18:49rasmustois there a way in prismatic.schema to have it generate a predicate based on one of the other required keys in a map? Or do I have to know the predicates all ahead of time
18:51indigoYayyy
18:51indigoI convinced my coworkers to drop their custom ORM and go with Mongo instead
18:52noonianwhy does clojars feel neglected?
18:53RaynesBecause nobody contributes to it and everybody complains about it, I expect.
18:53noonianah
18:53seangrov`technomancy: What does clojars need? It seems awesome to me
18:53RaynesI imagine that technomancy is a little annoyed that I've been complaining about things all day instead of submitting pull requests.
18:53Raynes:p
18:54frozenlockI use clojars daily, what's wrong with it? o_O
18:54RaynesWell, it's great in general.
18:54RaynesBut there are things that could make it better.
18:55RaynesThis new lastest-version thing is one of them that has been requested for ages.
18:57solussdindigo: using Monger (the library)? it's awesome. :D
18:58RaynesCongomongo is also nice.
18:58technomancyseangrov`: it's kind of in the middle of a big transition off sqlite that I haven't had the time to wrap up
18:59technomancyit's also inherently more difficult to contribute to a service than a program, I think
18:59indigosolussd: No... PHP ;_;
18:59indigosolussd: Custom ORM on EAV tables in MySQL
19:00seangrov`technomancy: Would be happy to help out a bit if there's some low hanging fruit
19:01indigoI would rather check out Datomic for my personal projects though
19:01seangrov`Makes for nice weekend recreational work, I'm sure
19:01technomancyseangrov`: how about linking to the svgs from project pages?
19:01seangrov`Sure, I could send some pr's around
19:02frozenlockIs Datomic FOSS yet?
19:02technomancythat would be great
19:02gwsfrozenlock: "yet"?
19:02solussddatomic is what I really want to use for stuff at work, but mongo was a hard enough sell. :)
19:03frozenlockgws: Well I've been waiting for it to become open source :D
19:03gwsi didn't know there were plans for that
19:03frozenlockI don't know if there is any.
19:03frozenlockI'm just hoping.
19:07indigosolussd: What are you guys building
19:30coventryfrozenlock: If you were in cognitect's shoes, would you open-source it?
19:30coventry(I think it would be a crazy thing to do.)
19:33frozenlockcoventry: depends ont their business model, but yes. Look at MongoDB, or MySQL.
19:33technomancyright; there's no way you could run a company around an open source database product; can't be done =)
19:33frozenlockI do know that unless it's FOSS, I'm not even trying it.
19:33technomancy^ inc
19:38nDuff...well, the downside to services income is that it's harder to scale -- you need actual people providing actual services. :)
19:38nDuff...if you're already maxed out on what you can provide there, forgoing room to expand your services business at the expense of the licensing end makes sense.
19:40nDuff...though MySQL's approach (GPL + paid commercial license) seems like a pretty good compromise. *shrug*. Not my business, thus not my call, but I wouldn't say it's clear-cut in either direction.
19:41technomancyI'm down with profiting from unfounded paranoia around the GPL
19:41akurilinbitemyapp, is an atom of a map the general approach you take to storing configs for your apps? I've been using a memoized function, but having to remember to call it rather than use it as a map is getting annoying.
19:41technomancythough it wouldn't work here due to EPL incompatibilities
19:42nDufftechnomancy: wouldn't it? Copyright holder can grant exceptions to the license, after all.
19:43technomancynDuff: oh yeah, true
19:44technomancyprovided they did it without pulling in 3rd-party libs
19:54coventryWhat is clojure.lang.IType for? I would like to add a print-dup multimethod which catches (deftype) classes, and the two ancestor classes I have to choose from are Object and clojure.lang.IType.
20:03logic_progwhere is the documentation describing when go blocks / go channels are gc-ed ?
20:19logic_progin core.async, is ther a while to use <! and while together?
20:19logic_progi.e. ideally I wnat to do somethig like (while (value = <! from channel) .... )
20:19scottjAnyone know who is behind Cursive, the new IntelliJ IDEA plugin? Is it the guy who a couple of months ago had a big thread on the mailing list asking if people were willing to pay for an commercial intellij plugin?
20:20logic_progso I do a read from the channel, and if the value is not nil, I execute the body of the loop with the binding of val to (<! channel)
20:21ToBeReplacedlogic_prog: (loop [] (when-let [x (<! channel)] ... (recur))
20:21logic_progToBeReplaced: did not know about when-let -- thanks!
20:28coventryIs the sabot library publically available? (It's mentioned in the recent netflix/clojure talk.)
20:31namccartyI hate to ask little questions like this, but is there a real clojure idiom for representing colors in clojure code when that code doesn't have to play nice with java?
20:32namccartyAnything other than integers that is
20:35TEttingercoventry: https://github.com/Netflix
20:35TEttingernamccarty: there's SColor. hang on a sec...
20:36TEttingerhttps://raw.github.com/SquidPony/SquidLib/master/src/squidpony/squidcolor/SColor.java
20:36TEttingerit's just a massive list of static color constants.
20:36TEttingerit's java but easily usable from clojure
20:37TEttingeryou know, it's probably not hard to just convert that to clojure with a good regex...
20:37namccartyIt's a bit overkill for my needs right now
20:38namccartyI only need to deal in 11 predefinied colors
20:39ianeslickIs there a canonical method for creating custom exceptions in Clojure these days? I know things have moved a bit since I last needed to do this (!) and for clojure-to-clojure exceptions there is the slingshot library. Thoughts?
20:41bbloomianeslick: ##(doc ex-info)
20:41lazybot⇒ "([msg map] [msg map cause]); Alpha - subject to change. Create an instance of ExceptionInfo, a RuntimeException subclass that carries a map of additional data."
20:42ianeslickbbloom: that means I have to catch, check then rethrow any exception that is not the one I'm looking for?
20:44coventryTEttinger: Yeah, I guess if it were available, it would be there.
20:46ianeslickRe: earlier discussion on Datomic licensing. Building and supporting an open source database is an _extremely_ expensive prospect because the # of non-paying users dwarfs paying users for a long time (see total VC raised by Mongo, Couch, etc) and generally databases are harder to get a good developer community around because design concerns have such broad implications. Plenty of recent, new databases have been closed source
20:46ianeslick (Vertica, Aerospike, etc). It's one area where I'm willing to invest in non-open source because databases are so damn hard to do well and I'd rather have a small, well-paid, sustainable team than a big hairy open source DB like Mongo (check out the bug list in JIRA for replication bugs, it's terrifying).
20:47ianeslickI found a production bug in MongoDB about a year ago which only occurred when you wrote the same record many, many times and it was hard to find a reproducing case for; I switched to Datomic then and never looked back.
20:47ianeslick(Disclosure: I'm a Datomic Pro customer)
20:48technomancymongodb isn't exactly the apex of OSS databases
20:49ianeslicktechnomancy: amen. Just meant to say that OSS, FOSS, and closed-source is a more nuanced choice in DBs than in other areas of software
20:49namccartyMongo is sort of that one database that knows it is on fire but instead of quenching that fire, it plans on utilizing it as a heat source to generate power
20:49namccartyNot the best example
20:49ianeslicknamccarty: lol
20:49namccartyBut yeah, I do get what you are saying
20:51namccartyBut I'm not really one to have qualms over licenseing
20:52ianeslickI'm a pragmatist. If I'm not going to invest the time to fix bugs in software myself, and I need support and will pay for it, then the only question in my mind about closed source is longevity of the vendor. In the case of Datomic I'm willing to trust that if Cognitect went under it would open-source Datomic rather than letting it die.
20:52technomancysingle-vendor reliance is more of an issue than the cost
20:53ianeslickI might change my mind if they took on venture capital financing.
20:53technomancyafter you've already written your code around it you mean?
20:54ianeslickFor future projects probably. I'm moderately addicted to it now. :)
20:54namccartyIn the buisnnes I help run, we are currently working on two major projects (and a few contracts we took on unrelated to games that we took on to get some money to get off the ground)
20:55ianeslickI still use SQL, Solr, Hadoop, Cassandra, etc for storage/processing where appropriate.
20:55namccartyboth of them will eventually be open sourced, but only after those products are no longer our focus
20:55namccartygranted games are a diffrent field entirely then databases
20:56namccartybut i still think that mindset is a good way to go
20:57ianeslickI like the Open Source Eventually model that Fred Trotter is running through OSI. Even Stallman isn't miltant about it. (e.g. restrict use for N months/years, then turn it into FOSS -- as long as you innovate and produce new versions with reset clocks, you get the protection of proprietary with the long-term comfort by users that they can sustain the project on their own later.
20:57ianeslickThat solves the single-vendor reliance rather neatly and with less confusion/hair than open core models.
20:57ianeslick(Thinking about these issues for my own project)
20:58technomancyit doesn't really solve anything
20:58technomancyyou're still at the mercy of one vendor
20:58technomancyand their promises aren't backed by anything you can actually bet against
20:58technomancytwitter promised their Android client would be OSS years ago
20:59namccartyI sort of like the drug patent type model, where you are granted a monopoly for x ammount of time in exchange for releasing source code
20:59ianeslickThe point about open source eventually is you release the source now, but it is proprietary for a fixed period of time. Built into the license is a date at which you can do whatever you want with it (fork, etc)
20:59TEttingernamccarty: https://gist.github.com/tommyettinger/6877456
20:59technomancyianeslick: ah, if it's part of the license that's different. I haven't seen that before.
20:59AimHereOpen source now, proprietary later is the smarter move
21:00namccartyI think it is new zeland that does that for software patents
21:00namccartyrequires the release of source code
21:00namccartyyou dont release the source, tough luck, you dont get exclusive rights to sell it
21:00AimHere"Here is code you're not allowed to write"
21:01namccartyYeah that is the one thing I don't like about the drug patent model
21:02namccartyTEttinger: Thanks, this will come in handy a litle further down the road than I am right now
21:02ianeslickhttp://comments.gmane.org/gmane.comp.licenses.open-source.general/12884
21:02namccartyor one major thing i should say
21:03namccartyThe drug patent model clearly does work to some extent, at least for drugs
21:04namccartyBut I think there is currently insufficent data to tell its effect on software
21:04TEttingerit works even better there IMO. drugs are a hard market because R&D is so expensive
21:04namccartythere being software or drugs>
21:04namccarty*?
21:04clojurebot* is just for when you are lazy and sloppy
21:04TEttingersorry software
21:05TEttingertech is easier to innovate in
21:05AimHereWell labour intensive tech is
21:05TEttingerdrugs could kill someone!
21:05namccartyYeah, I think it does have its merits, and I think it would be a good thing to have in the software world
21:05riley526software could kill someone
21:05namccartyBut I don't have anything to really go past "I think" with
21:05riley526but not most uses of it
21:05TEttingerriley526, skynet?
21:06AimHereriley526, Does comp.risks digest still happen?
21:06riley526AimHere: never heard of it
21:06AimHereIt's been around since forever on things like usenet. A periodical thing that gave out instances of things going wrong with computers. Old school internet folklore.
21:07riley526Sounds fun actually
21:07AimHereDiscovered it's still going
21:07namccartyOne of the things we are considering doing with our games is, since they both use simmilar concepts of "tiles", is to pull out the code that expresses these tiles and make that OSS
21:08namccartyAnd then keep the lid closed on the rest of the game until we see fit to let it go
21:08TEttingerrec.games.roguelike.development is still going. granted, the roguelike genre is about as old as usenet...
21:08AimHereWell I remember when it was just rec.games.hack and rec.games.rogue
21:09technomancynamccarty: like id software does?
21:09TEttingernamccarty, I'd be interested in your tiles lib
21:09AimHereRoguelike genre is older than usenet by about 3-5 years I think
21:09technomancythe engines are Free; the data files are licensed
21:09namccartythat is sort of what we are going for right now
21:09namccartythe id style thing that is
21:11namccartywe hope to have a working prototype of our smaller game by the end of the week, by that time i'll have a better feel of how it is shaping up
21:11TEttingerI could probably contribute a half-decent dijkstra pathfinding/AI routine to it. I have an array-based "dijkstra map" implementation thanks to kaw
21:12namccartyIf it looks like the code for the tiles can be seperated from the game rules without causing multiple uncontainable wildfires, we'll look into moving it into its own library and opensourcing it now
21:13TEttingerI should ask first:
21:13TEttingerdoes it use arrays or vectors or what, internally?
21:13namccartyThe short answer is we haven't decided yet
21:13TEttingerfavor arrays for performance.
21:14TEttingerthe difference is fairly significant
21:14TEttingersee hiphip
21:14TEttingerhttps://github.com/Prismatic/hiphip
21:15namccartythe notebook i have filled up with ideas about how to repusent an abstract world made of tiles uses something like a 2d array in my little notation
21:15Rayneshttp://clojurecup.com/app.html?app=codenotes What the hell.
21:15RaynesHow do you end up with a team where 3/4 are named some variation of "Alexander"?
21:15namccartyAlex is my middle name, brb, joining that team
21:16namccartyBut yeah, one of our goals is for tiles in a map to be able to contain entire maps
21:17namccartywe haven't quite worked out how we are going to do that in the code
21:17namccartybut its not the hardest task in the world
21:18TEttingerwhat I would maybe recommend is having lots of related arrays of primitives for performance-heavy stuff, and for things like linking you want maybe a hashmap of positions to other sets of hashmaps/arrays
21:18TEttingers/sets/groups/
21:19xeqiseangrove, frozenlock : there isn't alot code wise that clojars needs. The bigger thing it needs a revenue stream to support a real operations person. Next would be a registered DMCA agent, a UI refresh
21:20TEttingerclojure is not quite fast enough to do near-instant large board updates when using vectors, at least on one thread. with arrays it's easy
21:21namccartyi am going to bring the idea of making the tile library oss now and he is going to be like "Back in my day, we didn't have open source, we had to use EULA's uphill both ways. In a snow storm. In hell. In Jail"
21:21namccartybring up the idea to the other owner of this startup that is
21:21TEttingerheh
21:22TEttingerwell, I might use it, if it's easy enough to port my existing algos.
21:22TEttingerI've been meaning to revamp my code a bit
21:22TEttingerit uses 1D arrays because they're much easier to work with in clojure
21:22TEttingerbut I never did the utility functions
21:23namccartyive got like 30 pages in this notebook that just seek to answer the question "What is a tile?"
21:23namccartyI'm pretty sure the answer to P=NP? is hiding in there somewhere
21:24TEttingerhaha
21:24TEttingertiles do vary a lot depending on the game
21:25TEttingerhttp://www.roguetemple.com/z/hyper.php
21:25TEttingerexcellent weird tiles
21:25namccartywe are trying to do something simmilar with our big game
21:26namccartywe are attempting to lie to the user and present them with a geometry in which hexes can be used to make a sphere-ish shape
21:26namccartythat is mostly a rendering trick though
21:27namccartyi should say, a geometry in which they can be used to me a sphere-ish shape without distorting the hexes
21:28namccartyand there are a few other fiddily endgame things that mess with the conceptions of space
21:28namccartybasically what we want to do is have something that could be used to play all games that could be played on a board
21:28namccartythe space that board is in doesn't have to be eudlician
21:29TEttingerhttps://www.shapeways.com/model/455240/light-purple-d60.html?li=user-profile&amp;materialId=26 this is a good board for imitating spheres/
21:30namccartywell, the thing is, we don't want the player to be able to tell they are on a sphere for the first part of the game
21:32namccartyour big project is sort of our own unique take on a 4x game
21:33namccartyWe want the user to become the pre-science humans that think the heavier an object is, the faster it falls, that the earth is flat, and that the sun goes around it
21:44namccartyhmmm, on the tiles being able to contain maps composed of tile. I think one way to do it is have a type of link that you must follow if the tile you are on has one
21:44namccartyand make the tile that "contains" the sub-map unable to actually contain anything other than this link
21:44dnolenBronsa: hey I couldn't apply that try* -> try patch to CLJS master
21:45Bronsadnolen: I saw the comment, I'm making another patch
21:51Bronsadnolen: updated
21:54dnolenBronsa: applied to master, thanks!
21:56Bronsadnolen: it's awesome to contribute a patch to cljs and watch it get merged in less than 24h, thanks!
21:56dnolenBronsa: np
22:01TEttingernamccarty, have you seen ultima ratio regum?
22:01namccartyno, no i have not
22:02TEttingerhttp://www.ultimaratioregum.co.uk/game/info/
22:02namccartyneat, it appears to share a lot of the features we are trying to go for
22:04TEttingerhis isn't open source, but you could probably glean something from his postings
22:28`cbphum
22:28`cbpcan I prevent evaluation of a fn with a macro and turn it into a list? preferably with qualified symbols
22:28`cbpI feel like I'm missing something :P
22:28bitemyapp`cbp: not unless the form is available to you
22:29bitemyapp`cbp: function objects are opaque in all lambda calculi.
22:29seangrov`bitemyapp: My mind started wandering about thinking what it would be like if macros could modify function bodies in a way limited to themselves...
22:29bitemyapp`cbp: this is actually a trade-off made against a whole different way of thinking about programming, but I don't know how much you want me to start babbling about higher kinded type systems.
22:29seangrov`Don't know what it would be good for though
22:30TEttingerwat?
22:30TEttinger$google wat programming language
22:30lazybot[Wat — Destroy All Software Talks] https://www.destroyallsoftware.com/talks/wat
22:30`cbpbitemyapp: np
22:30`cbpI have this but I feel silly https://www.refheap.com/19510
22:30bitemyappTEttinger: I'm contrasting lambda calculi with "black box" function objects as opposed to turing machines fed godel numbered strings.
22:31bitemyapp`cbp: yes, that only works because it's an anonymous function and you're suspending eval of the "fn"
22:32bitemyapp`cbp: typically when you pass functions as "arguments" it's just a reference to a black box function. Conceptually, a glorified pointer to an object that executes over its lexical scope.
22:32bitemyappthis where we take a detour into the "objects are bad closures! Closures are bad objects!" c2 wiki vacation.
22:32TEttingerbitemyapp, I meant to find http://axisofeval.blogspot.com/2011/09/kernel-underground.html
22:32TEttingerwhich has a link to wat
22:32bitemyapp`cbp: but, within the expansion of a macro, the rules change can you have access to the enclosed forms such as they exist at macro-expansion time.
22:33seangrov`bitemyapp: That was a moment of enlightment for me when I first came to the same conclusion, re: c2 story
22:33TEttingerwat is like lisp with fexpr s instead of sexpr s
22:33bitemyapp`cbp: obviously this doesn't work if f is the name of a defn'd function.
22:33`cbpbitemyapp: yeah. I just wanted to do this because rethinkdb allows "lambdas" into their queries which have to be turned into protobufs which means turning the fn inside out. At least if I wanna keep the construction of these fns with familiar syntax
22:33bitemyappseangrov`: understanding it certainly improved my faculties :)
22:34bitemyapp`cbp: you probably want a custom fn[a-z] macro or function.
22:34TEttinger`cbp, have you seen Prismatic/Plumbing ?
22:34bitemyapp`cbp: this is not an unprecedented thing, and TEttinger makes a good point by pointing to Prismatic's libraries.
22:34coventry`cbp: Have look at the source for clojure.test.deftest or technomancy's serializable functions.
22:35`cbpokies
22:35`cbpI havent seen plumbing no
22:35TEttingerhttps://github.com/Prismatic/plumbing
22:35bitemyapp`cbp: Prismatic's libraries are always interesting.
22:35bitemyappCan't say that I necessarily want to leap into writing Prismatic-jure instead of Clojure though :)
22:36seangrov`bitemyapp: There was a proposal somewhere to potentially attach a function's source code as metadata, so you could possibly write a function that did some crazy stuff
22:36TEttingerI'm kinda a contributor to hiphip, which is cool beans.
22:36seangrov`Scope would be a problem, but that might not be an issue for some use cases
22:36bitemyappseangrov`: I could do great and terrible things with that, hahahaha
22:36seangrov`TEttinger: hardcore :)
22:36TEttingeras in I submitted a pull request that was awful
22:36bitemyappTEttinger: hiphip is also one of the more library'ish libraries they released.
22:37seangrov`ztellman and the prismatic people are imposingly impressive
22:37TEttingerbut it inspired w01fe to fix my code
22:37bitemyappI get the point of plumbing and graph but I'm still a bit o_O about it.
22:37bitemyappTEttinger: the best kind of PR.
22:37amalloyseangrov`: if you're interested, technomancy's serializable-fn does allow you to attach a function's source code and lexical closures as metadata
22:37bitemyappthe, "where's my broken toy, please fix" PR
22:37amalloyi haven't followed the discussion closely enough to know whether that's relevant
22:38seangrov`amalloy: Ah wow, that's pretty crazy. I don't remember what I wanted it for anymore, but I feel like it could be fun
22:38TEttingerbitemyapp, haha. really my PR actually did work, it AOT compiled where hiphip master didn't, but it had awful style.
22:40`cbpbitemyapp: so what do you think I should do? Have a serializable fn macro?
22:41coventry`cpb: It's just an example of how to pull the fn form out. Where you stick depends on your application.
22:41TEttingerhis answer was (load-string (impl/slurp-from-classpath "hiphip/type_impl.clj"))
22:41bitemyapp`cbp: is it a feature needed for an initial release?
22:41amalloyseangrov`: yeah, i think it's mostly not that useful, but pretty neat. (let [x 1] (serializable/fn [y] (+ x y))) prints as exactly that, and has metadata available for inspection if you want to do more than round-trip it through pr-str/read-string/eval
22:41bitemyapp`cbp: if you've already gotten down to the lambda stuff it seems like the library could cut a release soon and then people could start testing.
22:41TEttingerwhich uses an agh, (slurp (.getResourceAsStream (clojure.lang.RT/baseLoader) file))
22:41bitemyapp`cbp: or is it more fundamental than I am imagining?
22:42`cbpbitemyapp: well considering lambdas are required for things like map, filter, create-index, etc. I think its pretty fundamental yeah
22:42bitemyappoh, well then.
22:42coventry`cbp: What's the app you're working on?
22:42`cbpcoventry: a clojure driver for rethinkdb
22:42bitemyappserializable-fn seems the most "baked" way to do this. It's unclear to me whether you actually want arbitrary serialized fns or just a DSL.
22:43bitemyappcoventry: he's picking up the abortive experiment I performed and doing the actual work to make a library.
22:43coventryCool.
22:43`cbpcoventry: https://github.com/bitemyapp/revise still pretty amorphous at this point
22:44bitemyappamorphous is doing it more credit than it deserves.
22:44bitemyappit's a blast zone of some REPL snippets poking at a local rethinkdb instance.
22:44`cbp:P
22:44bitemyappI already do stuff with Datomic and Korma (SQL), a third batch of db tooling is a bridge too far.
22:45bitemyappluckily, the protocol buffers tooling for Clojure is decent.
22:54seangrov`bitemyapp: I'm wondering the same things as this user https://github.com/korma/Korma/issues/137
22:55seangrov`Somehow using maps doesn't seem to work - I thought I remembered it working before
22:59seangrov`Ah, nevermind, where seems to work, I was using where*
22:59seangrov`When in doubt, read the source... then read the tests.
23:02yeoj___does anyone know why clojure.java.jdbc with-connection doesn't work with :as-arrays? true ?
23:03yeoj___it seems like it only works with jdcb/query , but not with with-query-results or anything
23:06`cbpyeoj___: as-arrays? is an option for query
23:06`cbpyeoj___: https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L630-L649
23:07yeoj___`cbp: ok, but it doesn't work on "with-query-results"
23:07yeoj___`cbp: sounds good. i need to get use to looking at the source more.
23:08TEttingeryeoj___: the other options are here https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L144
23:08yeoj___i'm just trying to dump a giant database table to a text file output, and trying to understand the most efficient/correct way to do it with lazy seqs
23:09TEttingerwhat kind of hardware is this running on? I'm wondering if parallel writes make sense on SSDs but not on HDDs.
23:09`cbpyeoj___: I would use the dbms for that but to each his own i guess :P
23:10yeoj___`cbp: well, ideally, someday, is to build a sort of etl layer in clojure.
23:11yeoj___`cbp: i have to start somewhere. Pentaho did it with kettle. It seems to me clojure would have more potential for doing things in parallel
23:13TEttingerI wonder if datamic has support for some of this already
23:14TEttingeryeoj___: http://michakurt.blogspot.com/2011/01/minimalistic-etl-with-clojure.html
23:14yeoj___TEttinger: ohhh cool.
23:14yeoj___thanks.
23:15TEttingerI like searching!
23:15TEttingernp
23:17yeoj___TEttinger: i want to use it, and maybe extend parts to use bulk loaders with named pipes.
23:17TEttingerhttps://github.com/kyleburton/clj-etl-utils
23:17yeoj___TEttinger: i have lofty dreams for a not good programmer.
23:17TEttingerthis looks like a more finished version of that post
23:17TEttingerheh
23:20coventryIs there a way to pull out all of the data in a general (deftype) instance? Like (deftype a [b]) (gimme (user.a. 5)) should give me back [5]?
23:22gfrederickscoventry: probably just reflectively?
23:23coventrygfredericks: Sounds plausible. Do you have any suggestions for where to look in the (reflect) map? It's huge.
23:24coventryOh, wait, that was for a defrecord. Let me try a deftype.
23:26coventryYep, still huge. Maybe I can read it out of the builder in Compiler.java.
23:38gfrederickscoventry: (deftype Foo [a b c])
23:38gfredericks(->> Foo .getFields (map (memfn getName))) ;; => ("a" "b" "c")
23:39gfrederickslooks like there's more noise if you start adding protocols
23:40gfredericksmaybe add a (remove #(re-matches #"const__\d+"))
23:40yeoj___TEttinger: that was such a great blog post. :) I have to figure out how that entire library works... i'd love to be able to contribute.
23:41coventrygfredericks: Thanks, that is a huge step forward. Is there also a way to pull out the values of a b and c from (Foo. [1 2 3])?
23:42coventryAlso, memfn is very cool.
23:42gfrederickscoventry: (clojure.lang.Reflector/getInstanceField foo "a")
23:45coventryAwesome. Thanks a lot.
23:48gfredericksmemfn and partial: two great ways to use more characters but fewer octothorps and generated classes.