#clojure logs

2013-03-28

00:07kligonin clojure script externs file, what should be be the location of externs file :externs ["lib/raphael-min.js"] what is the location of lib with respect to project.clj
00:08alex_baranoskyany good libraries for actor model in Clojure? Has anyone tried to use Akka from Clojure?
00:12tieTYT2does anyone know how I can use enlive to find an anchor that contains text that says something?
01:01devntieTYT2: use laser or if you're *really* lazy, yokogiri
01:02RaynesAta boy.
01:02Raynesdevn be representin'
01:02devnword up
01:02devnhttps://github.com/devn/yokogiri
01:02devnthe cheapest thrill ever
01:03devnhttps://github.com/devn/yokogiri/blob/master/src/yokogiri/core.clj
01:03devn^-simple
01:05Raynesdevn: If you ever want something to do go ahead an implement a subset of CSS selectors on top of laser's selectors.
01:05RaynesThis might be a full time job so prepare as such.
01:07devnRaynes: so much to do already :L)
01:07devnRaynes: i just wanted dead-simple scraping so i stole Yoko Harada's deps for nokogiri for JRuby and used a subset of them to sculpt yokogiri
01:08devnhence the name
01:08devnit's mostly centered around: give me the attributes for an element, give me the text for an element
01:09devnno fancy pants action to it
01:47TheBusbytechnomancy: lein repl :headless no longer takes port number as an argument at the command line or from project.clj or profile.clj?
02:02tieTYT2check out this stack trace. I actually do know what code is causing this: https://www.refheap.com/paste/95e5f0d72f409e9f2a179fe4a
02:02tieTYT2but it doesn't have anything related to clojure in it. Does that prevent me from catching it?
02:03tieTYT2i guess only one way to find out
02:14tyleris it just me or does cljsbuild ignore lein profile Xmx?
02:48ambrosebsThis is weird, it looks like defrecord's macroexpansion qualifies all the implicit methods in clojure.core. e.g., (entrySet [...]) becomes (clojure.core/entrySet [...]). Can someone confirm this? https://gist.github.com/frenchy64/5261196
02:52RaynesMy doctor says I can't use gist.
02:52RaynesSays it's bad for my teeth.
02:54Raynesambrosebs: Confirmed that it does that in my repl too.
02:54ambrosebs:D
02:57ambrosebsYet another oddity of the JVM compiler :)
03:03ambrosebsheh, but the AST node doesn't have the clojure.core prefix! Weird :)
03:42m00nlightHi, everyone, how can I use the latest clojure 1.5 using "lein" to create new project? It seems that the lein still use the version 1.4
03:48nightflyAt least in CL package resolution is done in the reader, maybe similar here
03:55m00nlightIt seems that I just change the dependency in project.clj and lunch clojure repl, it will automatically get version 1.5.0, sorry for trouble
04:02DaReaper5how do i return an output stream in a ring response?
04:03DaReaper5so far i have been converting the output stream to a byte array then an input stream
04:03DaReaper5but i think ZipOutputStream does not allow it
04:04DaReaper5basically i have created a zip file in memory and i now want to return it
04:04DaReaper5i dont want to have to save it to a file
04:08DaReaper5hello?
04:08clojurebotBUENOS DING DONG DIDDLY DIOS, fRaUline DaReaper5
04:14mduerksenDaReaper5: have you tried to just pack it into your ring response?
04:14DaReaper5i cant return an output stream in a response can i?
04:15DaReaper5:body (io/input-stream zipIOutStream)
04:15DaReaper5?
04:15mduerksenyes, just like that. as far as i know, you can return an inputStream in your body
04:16mduerksenat least thats what i'm guessing, never tried it actually
04:16DaReaper5 Cannot open <#<ZipOutputStream java.util.zip.ZipOutputStream@f00ab7>> as an InputStream.
04:17DaReaper5is there any ways of directly retreiving ring's output sream?
04:18DaReaper5that has been the popular java solution
04:18mduerksenlook at this: https://github.com/ring-clojure/ring/blob/master/ring-servlet/src/ring/util/servlet.clj#L81
04:18DaReaper5http://stackoverflow.com/questions/5516922/returning-zipoutputstream-to-browser
04:18mduerksenit seems an inputStream can be used, but not an outputstream. ironically, the code calls .getOutputStream ...
04:19mduerksenah wait, i was wrong
04:19DaReaper5ya i saw that
04:19DaReaper5only inputstream can be returned
04:19mduerksen.getOutputStream is on the HttpServletResponse, my bad.
04:20DaReaper5which i dont have access to
04:20mduerksenyup. doesn't look good
04:21DaReaper5this is stupid :/
04:21DaReaper5i need to return the zip file
04:21DaReaper5i shouldnt need to save it to file just to open again
04:22DaReaper5if i could get the byte array of the outstream i would be fine
04:22DaReaper5but i dont think i can
04:23mduerksenthe right way would be to create an inputstream from your outputstream
04:23DaReaper5how would i do that
04:23DaReaper5am i just being super tired? :P
04:24kalasjohnny2000Maybe some food for thought: http://code.google.com/p/io-tools/wiki/ConvertOutputStreamInputStream
04:25DaReaper5on there right now lol
04:27DaReaper5i dont think i can use pipes
04:27DaReaper5if you look at pipes they require the output stream to specify the inputstream
04:28DaReaper5i have to use zipoutstream
04:29mduerksenyou could of course always do something like this: new BlablaInputStream(out.toByteArray()), but i guess you would like to avoid byte copying
04:30kalasjohnny2000It feels like you could do something like (while (not (empty? in-stream)) (.write out-stream (.nextThing in-stream)))
04:31mduerksenkalasjohnny2000: thats converting an inputstream into an outputstream, DaReaper5 wants the opposite direction
04:35DaReaper5i cant do out.toByteArray
04:35DaReaper5not on xipoutputstream
04:36mduerksenhmm
04:36DaReaper5is the only solution to write to file!?
04:36mduerksendoes a ZipInputStream class exist?
04:37DaReaper5yes
04:37DaReaper5http://docs.oracle.com/javase/6/docs/api/java/util/zip/ZipInputStream.html
04:38mduerksenhow can you construct one? only from file? seems so: "...input stream filter for reading files in the ZIP file format..."
04:40kalasjohnny2000Use http://docs.oracle.com/javase/7/docs/api/java/io/PipedOutputStream.html but remember to use two threads.
04:41kalasjohnny2000or a http://docs.oracle.com/javase/6/docs/api/java/io/PipedInputStream.html if it was that way round.
04:44DaReaper5kalasjohnny2000 it seems that pipedinputstream need to be paired with a pipeoutputstream
04:45mduerksenDaReaper5: the constructor of ZipOutputStream takes an outputStream. thats the actual output stream. you could use the PipedOutputStream like kalasjohnny2000 is saying
04:48Glenjamin_it seems like this should be easier.
04:48tomojDaReaper5: did you not see my refheap?
04:49tomojhttps://www.refheap.com/paste/80bad6da903cc2e6542b33d3d
04:49tomoj..if you're OK with a byte array
04:49DaReaper5looking now
04:50DaReaper5you are creating a bytearrayoutstream and then using it to create the zip stream
04:50DaReaper5which afterwards you use the bytestream to get the byte array?
04:51tomojyep
04:51DaReaper5nice
04:51DaReaper5ill try that
04:52DaReaper5omg yes
04:52DaReaper5now i need to fix a few other things
04:52tomojlike mduerksen said, could put a PipedOutputStream there instead of the baos, I guess
04:53DaReaper5... like that the fiel within the zip are empty without a type
04:53DaReaper5file*
04:54DaReaper5and fixed
04:54DaReaper5omg this is awesome
04:54DaReaper5i can now generate 100 individual agent commission reports
04:54DaReaper5now for probably making it more effient
04:54DaReaper5since creating 200+ jasper reports is slow
04:54DaReaper5...
04:55DaReaper5i use a loop to create the reports and conj them to an array
04:55DaReaper5is there a more efficent approach that would use multiple threads?
04:55DaReaper5i am only ever adding to that array
04:56DaReaper5[]
04:57Glenjaminsome sort of parallel map?
04:57DaReaper5ya
04:58DaReaper5pmap?
04:58clojurebotpmap is not what you want
04:58DaReaper5lol?
04:58DaReaper5does the bot speak the truth?
04:58Glenjamini *think* clojure.core.reducers is what you want
04:59Glenjaminbut i have no experience with it, only seen a few mentions
05:07ejacksonDaReaper5: you have a bunch of options
05:07ejacksonpmap could well be the bot you are looking for
05:07ejacksonyou also have agents, which are quite flexible
05:07ejacksonand reducers
05:24DaReaper5pmap seems ok for now
05:26DaReaper593 reports in 36seconds down from 49seconds
05:27DaReaper5if i reimplement my java code in clojure would i get a speed increase?
05:27DaReaper5(i am calling a java class to create part of the report)
05:27Ember-depends completely on the algorithm you would use in clojure
05:27Ember-clojure is *not* faster than java as a language
05:28Ember-it cannot be
05:28Ember-it can be as fast though
05:28DaReaper5they are basic method calls
05:28Ember-your method calls form an algorithm
05:28Ember-that algorithm and it's complexity is all that really matters
05:28DaReaper5but wouldn't taking otu a bit of interop with my java class help with speed?
05:28DaReaper5or does the compiler take care of that
05:29DaReaper5complexity is always 1 per report
05:29Ember-it's negligble to say the least
05:29DaReaper5n complexity for all reports
05:29Ember-and imho when calling java methods there is no performance penalty since java methods always have static types thus no reflection needed
05:30Ember-in fact if you're making a LOT of calls then your performance could get a whole lot worse by rewriting everything with clojure
05:30Ember-by providing proper type hints you'd get identical performance with clojure than with java assuming the algorithm would stay the same
05:31Ember-but with clojure you have the functional power behind you
05:31Ember-thus if you rewrite your algorithm with clojure and are able to take advantage of lazy sequences and so on then yes, your performance could improve
05:31Ember-but really, just by changing the language you will not improve performance
05:32Ember-well written clojure will beat the crap out of not so well written assembler in performance
05:32Ember-it's all about algorithms
05:34Ember-DaReaper5: hope I didn't confuse you :)
05:34Ember-but that's the cruel reality - understand algorithms
05:34Ember-it's the only way to make your program run faster
05:35clgvwhat was the original question?
05:36Ember-11:29 < DaReaper5> 93 reports in 36seconds down from 49seconds
05:36Ember-11:29 < DaReaper5> if i reimplement my java code in clojure would i get a speed increase?
05:37Ember-11:29 < DaReaper5> (i am calling a java class to create part of the report)
05:37Ember-that
05:37clgvah ok.
05:38clgvI'd say reimplementing java code in clojure for speed if no parallelization is involved wont work
05:38Ember-well it might. But then there would be a lot of room of improvement in the java code too
05:38Ember-for example, looping many times through large collections and so on
05:38clgvah ok thats true. I assumed a pretty good java implementation in terms of speed ;)
05:39Ember-lazy sequences could give a large performance boost just due to that reason
05:39Ember-but it all depends
05:40Ember-but since the business logic in this case is actually generating reports then I'd guess one could pretty easily beat the java code performance wise
05:40Ember-since generating reports is all about handling data and that's where clojure really shines
05:41Ember-you can achieve the same level of performance in java too but it's a lot harder
05:41clgvdepends how the data is represented.
05:41Ember-yes
05:41Ember-it all depends :)
05:41Ember-just thinking
05:41clgvif it's something map like the clojure code could be pretty simple :)
05:41clgv*map-like
05:42Ember-and if there's multiple transformations applied before the actual report is generated then lazy sequences and map operations could really help
05:42Ember-assuming those operations are done at java side one after another
05:42clgvah I read about pmap in the log. better dont use pmap. there is core.reducers in clojure 1.5.1^^
05:42Ember-pmap is an easy way out and it's great for certain situations
05:43Ember-but it's really not THAT hard to do equal functionality in java too...
05:43Ember-by using ExecutorService
05:43Ember-reducers are more like fork/join (and they use fork/join under the hood if I'm correct)
05:43clgvhmm no pmap is awful and will disappoint you as soon as it can - the proble is its semi-lazy nature
05:44Ember-well yes. True
05:44clgvthe problem arises immediately if not all tasks have about the same time consumption
05:44Ember-I've used it in parallelizing several operations which have side effects
05:44Ember-makes it so easy :)
05:45TEttingerok uh... so I wrote some really poorly formatted Clojure in jEdit, and I am looking to clean it up as an open source project. It definitely has a use -- it's a simple Swing app that lets a user look up whether a food is OK on the user's restricted diet (such as the weak-kidney diet or diabetic diet)
05:45TEttingerI can't seem to find an editor that handles whole-file auto-indentation
05:46TEttingerand I am not a fan of emacs
05:50clgvTEttinger: sadly afaik there is none. you could try to read the files and pretty print them with clojure.pprint/pprint
05:50clgvbut it is not really the same as an IDE would do it
05:50TEttingerpretty sure I could re-insert comments where they exist
05:51clgvTEttinger: another option is to got through the files and use tabulator on each line -- works in emacs and counterclockwise
05:51TEttingerI do have (an old version of) CCW installed
05:51clgvyou can update that one^^
05:52TEttingerdoes it still have rainbow parens?
05:52clgvyes. why?
05:52TEttingerlove em.
05:52clgvit has leiningen support since some time now^^
05:53TEttingerI actually contributed a tiny bit of code to CCW so it wouldn't use the same color for parens as certain syntactical elements
05:53TEttingerit used fancier colors
09:29MikeSethanybody here uses Sublime/SublimeREPL for clojure development? I'd like to hear your impressions
09:30nDuffMikeSeth: The consensus, IIRC from last discussion, is that it can be done, but the tools aren't nearly as mature as what you'll find for emacs.
09:31nDuffMikeSeth: IIRC, the paredit mode there does strict enforcement and expand-to-selection and not much else, so you end up having to use cut-and-paste for operations that would be a single motion with a "real" paredit implementation.
09:31MikeSethnDuff: I absolutely agree, emacs is my primary working environment as well, I am currently hacking on sublime repl plugin which is why I am asking
09:32MikeSethI didn't even realize sublime *has* paredit ;)
09:32nDuffMikeSeth: https://github.com/masondesu/sublime-paredit
09:33MikeSethooh, nice
09:33nDuff...though, heh, it actually _does_ have a slurp
09:34MikeSethwell, nothing can compete with 30+ of lisper contributions
09:35MikeSethyears, that is
10:03jcromartiehsqldb or h2?
10:04jcromartieshould I go with HSQLDB or H2?
10:04kalasjohnny2000datomic uses h2, h2 is also newer I think
10:10devnI can't kill the association in my mind between the oversized vehicle and H2 the DB
10:11devnhttp://content.worldcarfans.co/2009/2/medium/hummer-h2-cabriolet_1.jpg
10:11devnIs that H2?
10:13kalasjohnny2000Reliable, a Choice of Independence, Self Contained, Practical, Strong, Fast... some many things equal. Keep the association in mind.
10:35jcromartieI get a better feeling from H2
10:35jcromartiealso, Hummer drivers are 5 times more likely to get a traffic ticket than the average motorist
10:35jcromartieand that's accounting for bias
10:40tbaldridgekalasjonny2000: Datomic uses H2? Where'd you here that from?
10:46kastermaI have some reducer behavior I don't understand. In the code at https://gist.github.com/anonymous/5263706 as it stands it runs through the list in order, when I increase the length of the list to say 1000 it just hangs never giving any output after the initial trace.
10:46gfrederickstbaldridge: the free version seems to
10:46kastermaThe r/map finishes, but the r/fold gets nowhere.
10:46kastermaAny advice.
10:47tbaldridgegfredrericks: ahhh...that's probably for the SQL store backend.
10:47gfredericksright
10:47kastermaOhhh, the output goes to the repl in the terminal, not to my nrepl.
10:48tbaldridgeI thought someone was saying datomic was built on top of H2. Which I don't think is true. It just supports H2 as a backend.
10:48gfredericksah yes
10:54pellishello
10:54pellisi'm looking for advice about how to structure my project in a healthy way
10:55pellisi don't want to bring things from my Java or Scala or even Ruby experience, I'd like to do it the clojure way
10:55pellisi.e. when to just use a function, when a structure, and when does a function or a set of functions go in a module
10:56pellisobviously I can think in OO way and model everything that way.. but surely I assume this is less preferred in the 'clojure way'
10:56pellisbut given all that, I haven't bumped into a book that tips about actual file structure or module structure
10:57S11001001pellis: Plenty of existing projects to look at, see how they do it
10:57kalasjohnny2000pellis, take a look a clojurescriptone, I think that's a good project to start with (it looks very complicated to begin with, but everything has it's reasons)
10:57pellisi see. so looking at existing open source projects was an idea i had. just that when I do that - i don't even know if the author is doing a best practice or just getting away with it
10:58kalasjohnny2000tbaldrige: exactly, it supports H2 (as opposed to HSQLdb) as backend.
10:58clgvpellis: always start with functions and see if you can solve your problem with functions only in a simple way
10:58pellisso i'd look at clojurescriptone - any other easy to read project out there? that are precepted to use good clojure idioms with regard to project structure?
10:59pellisalgernon, thanks
11:00clgvpellis: do you want to write in Clojure or ClojureScript?
11:00pellisClojure actually
11:01leif-pdakrone: hi. I was wondering why clj-http still uses commons-codec 1.6. Is it for backwards compatibility with Java 1.5?
11:01technomancyclojurescript one is abandoned, right?
11:01pellisif I can talk specific, then I have a service (Web). this service will compute some value based on parameters. then it will persist to database.
11:01pellisso basically i have a "controller", "core logic" and "persistence layer" if i'm looking at it from an OOP view
11:01pellisin clojure, this whole thing can be 3 big functions in the same file
11:02pellishowever that looks to be messy
11:02nDuffpellis: Encouraging breaking down the logic into tiny functions is one of Pedestal's strong points.
11:03pellisah. I had Pedestal open in a tab one day, forgot all about it.
11:03rkneufeldnDuff: with emphasis on *pure*
11:03pellissurely I need to look into it
11:04pellisnDuff, this will actually be an infrastructural api-only service. think about it as a trackingpixel for analytics
11:05pellisi worry that Pedestal is an overkill?
11:05nDuffpellis: If it's not stateful-client, pedestal indeed sounds like overkill then.
11:05nDuff...though some of the server-side parts could be handy if you needed long-polling or such.
11:06nDuffthat's one place where the interceptor model has some rather compelling advantages over traditional ring middleware
11:07kalasjohnny2000then maybe start with some tutorial on how to build a webapp with compojure, ring and some database lib (if SQL maybe checkout Korma, mongo: congomongo, etc etc)
11:07rplacatechnomancy: are you guys having a seattle meetup next thursday?
11:09kalasjohnny2000pedestal is probably not overkill, btw. The tutorial with ordering and verification and stuff is maybe exactly what you want? Then your web service is done in like 40 lines of code. crazy times.
11:13pellisrkneufeld, oh, you're one of the authors :)
11:13rkneufeldpells: yeah i should have said that.
11:14yogthospellis: I'm also trying to document good parctices here http://www.luminusweb.net/
11:14yogthospellis: much less ambitious than pedestal, but has lots of docs and base project setup in a reasonable way
11:14jcromartiethe moment when you are trying to solve a problem and read a helpful stack overflow answer… that was written by yourself…
11:14jcromartieO_o
11:14yogthoslol
11:15yogthosthe past you was helping the future you :P
11:16rkneufeldpellis: don't hesitate to ping the pedestal-users google group. I'm in charge of making sure things get attention, so if you had specific questions about how pedestal might fit for your application I would be compelled to help you ;)
11:16jcromartieyogthos: you are sticking with noir?
11:16yogthosjcromartie: I'm maintaining lib-noir with Raynes
11:16jcromartieah ha :)
11:17yogthosjcromartie: I'm kind of using it as a catch all for utility functions and such
11:17jcromartieyeah
11:17dakroneleif-p: I just hadn't bumped it yet, it should work with common-codec 1.7, thanks for the reminder though, I'll look into bumping it
11:20Driadanhi
11:24leif-pdakrone: Cool. Thanks for all your work on it.
11:33alandipertpiranha: https://github.com/priornix/todoFRP/tree/master/todo/javelin
11:33piranhaha!
11:33technomancyrplaca: yeah, definitely. this one should be downtown.
11:33piranhaalandipert: thanks, I'll look at that :)
11:34technomancyso is lib-noir basically flatland/useful for ring? =)
11:37yogthostechnomancy: sort of :)
11:37shriphanihi guys. How do I map over the k,v pairs in a hash-map? I want to check if a particular value exists in the table. Thanks.
11:38shriphaniI tried (map (fn [k v] …)…) but that didn't work.
11:38hyPiRionshriphani: (map (fn [[k v]] ...) ...)
11:38yogthostechnomancy: I've been adding stuff like this to it http://yogthos.github.com/lib-noir/noir.io.html
11:39hyPiRionnotice the double square brackets: You're destructuring the first element
11:39yogthostechnomancy: and my preference is to use existing libs when possible instead of rolling my own :)
11:40TimMcHow do you define dynamic programming?
11:40nDuffsi14: Are you familiar with the concept of higher-order functions?
11:40nDuff(though... err, yes, need a high-level description of what you want)
11:41si14TimMc: let's say Viterbi algorithm.
11:41si14nDuff: of course.
11:41nDuffAhh; wasn't expecting a question about dynamic programming in the formal sense.
11:42si14the problem is that we need to somehow reuse X_{i,j} (like in X_{i+1,j}=argmax_by_y(f(X_{i, y}))
11:42hyPiRionI tend to use memoize quite heavily for DP
11:42clgvsi14: recursion with memoization can suffice.
11:43hyPiRionWhen recursion blows the stack, I tend to use doseq or dotimes to iterate over smaller values first
11:43hyPiRionsi14: yeah
11:45dobladezpiranha
11:45piranhadobladez: ?
11:45clgvanother option is to write a macro that expands into nested loop-recurs which fill the table up to the given argument
11:45dobladez(oops sorry)
11:45clgvwould be pretty reusable^^
11:46dobladezpiranha: was opening alandipert's link and somehow pasted here by mistake
11:46si14clgv: just hoped that some seq-lazy-[handwaving] magic will solve this problem for me :)
11:46rboyd_can always count on #clojure to make me feel like an idiot
11:47rboyd_come on osmosis, feel free to kick in any time
11:47clgvsi14: not for general DP since you usually have recursions with multiple recursive calls e.g. like f(x,y) = min( f(x-1,y), f(x,y-1), f(x-1,y-1))
11:48si14clgv: there was some way to explot ML
11:48si14oops, sorry
11:48ystaelrboyd_: my experience is that one doesn't stop feeling like an idiot - the definition of idiocy just changes :)
11:48si14clgv: there was some way to exploit Haskell's laziness to implement dynamic search of Levenshtein distance in O(n) in "sufficiently good" case. Can't remember the details though.
11:49si14so that [handwaving] :)
11:50clgvsi14: humm but that distance uses a 2d matrix so do you access the values in a prvious row when using a lazyseq?
11:50clgvsi4: oh laziness in general could help.
11:51clgvsi4: but not lazy sequences
11:51si14clgv: yeah, I just hoped that I don't understand something and there is a way :) seems like a good chance to try shiny matrix-api lib.
11:53hyPiRionWell, if you want to do repeated levenshtein distances on, say L(x, y1), L(x, y2), ... L(x, y_n), then you can generate a Levensthein NFA for x
11:54hyPiRionUsing the NFA (or was it DFA? I don't remember) takes O(n), so it's going to be faster
11:54hyPiRionNonDeterministic Finite Automaton
11:55hyPiRionYeah, here it is: http://blog.notdot.net/2010/07/Damn-Cool-Algorithms-Levenshtein-Automata
11:55hyPiRion(Well, it's kind of not related to DP, but I think it's cool :p)
11:57clgvsi14: you could build something declarative with delays
11:59clgvsi14: put the whole vector or vector of vertors in a `promise` but after the cells are constructed. the cells are delays that use the promise to access other cells and deref those cells to get the values. thus, every cell is only calculated once
12:00clgvthe only advantage from memoize is that no hashing is used... might be not worth it
12:00hyPiRionYeah, a vector of vectors is usually slower than a single map with vectors as keys
12:03clgvif you have interger params you could just build a specialized memoize to avoid hashing if it turns out to be a performance problem
12:05si14hm, maybe that's a way to go. thanks!
12:08TimMc&(.getPort (java.net.URL. "http://google.com:-1/&quot;))
12:08lazybot⇒ -1
12:08TimMc&(.getPort (java.net.URL. "http://google.com:-2/&quot;))
12:08lazybotjava.lang.IllegalArgumentException: Invalid port number :-2
12:08TimMcGood times in parser-land.
12:10hyPiRionwhut
12:10TimMcjava.net.URL has some interesting ideas about parsing URLs.
12:11Gonzih&(slurp "/etc/resolv.conf")
12:11lazybotjava.security.AccessControlException: access denied (java.io.FilePermission /etc/resolv.conf read)
12:11Gonzih:)
12:13hyPiRion&(slurp "~/.bashrc") ;?
12:13lazybotjava.security.AccessControlException: access denied (java.io.FilePermission ~/.bashrc read)
12:13hyPiRionI think everything is denied
12:15Gonzih%(slurp "project.clj")
12:15Gonzih&(slurp "project.clj")
12:15lazybotjava.security.AccessControlException: access denied (java.io.FilePermission project.clj read)
12:16Gonzihhm, how is it done?
12:16Gonzihsome java io restrictions? or just os permissions?
12:17MikeSethchrooted jvm?
12:17mpenetit's clojail doing its thing
12:18hyPiRionjava access restrictions
12:36tylerdoes anyone know if cljsbuild obeys Xmx limit in project.clj? it doesn't appear to
12:38ppppaullast night i dreamt about atoms
12:41lpetitclgv: hello
12:41clgvlpetit: hi
12:41lpetitclgv: how are you ?
12:42clgvlpetit: good but a lot of work to do ;) and you?
12:42lpetita little exhausted today, did not sleep enough
12:42lpetitanyway, I'm experimenting with a little "lein command line" gadget integrated in CCW
12:43lpetitclgv: Currently, it's a little one-line modal prompt, you enter a leiningen command line in there, and it executes it and the result is output in the Console
12:44lpetitThe initial content of the input area is
12:44lpetit- if say you issue the command from project fooproj: "fooproj $ lein <task>" and <task> is already selected so you can start typing the real task immediately. And typing Enter automatically sends the command
12:46lpetit- if say there's no particular project the command is launched from, the command line says: "<no project> $ lein <task>" ; <task> is selected also, and you can leave <no project>, the command will be executed outside any project. Or you can replace yourself <no project> with a project name of your choice
12:46lpetitclgv: question, what could I use as a "not so bad" default for invoking this command line utility ?
12:47lpetitclgv: the current binding is (on a Mac) "Cmd + Option + L L" (Ctrl on Win/Lin), note the "double" L
12:47clgvlpetit: it is no standard eclipse view/editor?
12:48lpetitclgv: what ?
12:48clgvclgv: the leiningen command line tool is not implemented as standard Eclipse View/Editor?
12:48lpetitclgv: not that I'm aware of :-)
12:49clgvclgv: if it were you could just put it beneath the REPLView or so. ;)
12:49clgvs/you/the user/
12:50lpetitclgv: please explain. What do you mean ? You want a View ? What would it look like ?
12:50clgvleptit: is it currently some kind of popup after a shortcut combination was pressed?
12:50lpetitclgv: Is Cmd+Option+L already bound to something in your Eclipse ?
12:51lpetitclgv: yes, I've tried to prototype something leight weight, but maybe I'm heading the wrong way.
12:51lpetits/leight/light/
12:51clgvlpetit: that combination is bound in my window manager and logged me out ;)
12:51lpetitclgv: crap :-(
12:52clgvlpetit: luckily only "lock screen" mode^^
12:52lpetitWhat about only Alt+L ?
12:53clgvleptit: Ctrl+Alt+L is not bound in my eclipse - thats Cmd+Option+L right?
12:53lpetitCmd for Mac, Ctrl for Windows / Linux
12:53clgvAlt+L is leiningen
12:54clgv"Alt+L R" and "Alt+L U"
12:54lpetitI wonder if it was something else before I used it :-)
12:54lpetitSo "Alt+L L" could invoke Lein command line
12:55lpetitThen later, some common tasks could be pre-bound to e.g. Alt+L R : "lein run", "Alt+L T" : "lein test", "Alt+L D" "lein deploy", etc.
12:55lpetitleaving for ~20 mins, BBL
12:57clgvlpetit: sounds good
12:59grebusalexbaranosky: the clj-schema github page seems not to be there anymore
13:05bartonhwhen running nrepl in emacs using the paredit-mode, how is a multi line function entered? if i turn off paredit-mode i can use RET.
13:06Driadanhave you tried ctrl-j?
13:07shriphaniHi. I have this one line: (def db {:classname "org.sqlite.JDBC" :subprotocol "sqlite" :subame "db/monitor.db"}) and the repl complains about it : ArityException Wrong number of args (0) passed to: PersistentHashMap. What am I doing wrong ?
13:08bartonhctrl-j works perfect. thanks.
13:08Driadan:)
13:08ejacksonshriphani: that evals fine over here
13:08shriphaniejackson: heritrix-monitor.core=> (heritrix-monitor.db-layer/db)
13:08shriphaniArityException Wrong number of args (0) passed to: PersistentHashMap clojure.lang.AFn.throwArity (AFn.java:437)
13:09hiredman:( sqlite
13:09shriphaniis that the wrong way to use it ?
13:09shriphanihiredman: should I use something else?
13:09hiredmanuse a jvm embedded sql
13:09nDuffshriphani: you're trying to call it as a function
13:09nDuffshriphani: so, yes, that's the wrong way to use it.
13:09ejacksonshriphani: yes, you can do (db) as thats calling it as a function
13:09nDuffshriphani: if you want to look at its value, just db, not (db)
13:09shriphanioh wow. I am an idiot
13:09ejacksons/can/can't/
13:09technomancy"from the JVM" is the wrong way to use SQLite though unfortunately
13:10ejacksonfrying pan -> fire.
13:10shriphanihmm… what are these jvm embedded sqls? Can I run simple sql queries on them outside of clojure (say from Python which colleagues use ?)
13:12nDuffshriphani: Ahh; if you need compatibility with non-JVM-based languages, then you have a compelling reason for SQLite-from-Java.
13:13shriphaninDuff: yea. I want something to look at things quickly and "select * …." at a prompt is still faster than lein repl blah blah.
13:14shriphanialso. lein repl is sort of slow-ish for me. Is there any trick to make it run faster? I am loading up incanter (only heavyweight lib I can see) and it takes about 10 seconds to start
13:15nDuffshriphani: See https://github.com/technomancy/leiningen/wiki/Faster
13:15nDuffshriphani: ...in particular, perhaps, the link from there to https://github.com/flatland/drip/
13:16shriphaninDuff: docs for making lein use drip ?
13:17ppppauli didn't find that drip makes lein faster
13:17lpetitclgv: do you use leiningen ? If so, what are the command line tasks you use most with it ?
13:17nDuffshriphani: *shrug*. Not speaking from personal experience there; I just follow the "throw lots of hardware at it" approach to startup times.
13:18tieTYThttp://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Rich-Hickey-and-Brian-Beckman-Inside-Clojure
13:18shriphaniheh
13:19clgvlpetit: lein repl, lein clean, "lein do clean, install", lein deps :tree, (lein checkouts uberjar <- my own plugin)
13:19clgvlpetit: ah "lein run" sometimes...
13:20lpetitclgv: so do you think you would use such gadget (since you're a power user and not a newbie anymore), or still the command line ?
13:22clgvlpetit: yeah. it'll be pretty usefull to be able to install altered libs and a second later to update a second CCW project to use it without switching to command line
13:23lpetitclgv: and what do you think about the idea of using a "simple" text input. If everything works well, I intend to then provide intelligent content assist for the task part, the project part, etc. (fuzzy completion for the tasks + task help message, etc.)
13:24lpetitI think this could be more useful than a vertical form with "project", "task", "task arguments" fields
13:25clgvlpetit: I would try it on the beta channel to see how it feels. I am not sure if the simple text input will suffice... ;)
13:26lpetitclgv: since it's a totally independent feature, I intend to release it, as is, on the stable version.
13:26clgvlpetit: yeah content assits would be great ^^
13:26lpetit(on the beta also)
13:26clgvah ok. no problem then^^
13:26lpetitclgv: and also UP / DOW arrows for history, of course
13:27tieTYTanyone here use CCW? How do you "compile all files in my project"?
13:28clgvlpetit: did you see bug #556
13:28tieTYTor load, rather
13:28clgvlpetit: http://code.google.com/p/counterclockwise/issues/detail?id=556&amp;start=100
13:30lpetitclgv: hopefully will be solved in next stable ; I now ship with leiningen-standalone and not just leiningen-core
13:30lpetittieTYT: what for ?
13:33Sonderbladeany suggestions on what tools to use to develop with clojurescript efficently? the cljs compiler is to slow to be used from the command line
13:34bbloomSonderblade: lein-cljsbuild
13:35lpetittieTYT: there's a global option for automatically loading namespaces when you start a REPL. See Preferences > Clojure > General > Automatic namespaces load on start and save
13:39tieTYTlpetit: sometimes I've made changes in like 3 files
13:39tieTYTand I am ready to try them out. I just want to say, "load teh current state"
13:40tieTYTlpetit: that would require restarting the repl, which is what I already do
13:40Sonderbladebbloom: do you mean lein cljsbuild auto? that doesn't reduce the recompilation time really
13:40tieTYTso maybe I have that option on already (it would have to be a default)
13:40tieTYTalso, does CCW have a way to format the text?
13:40lpetittieTYT: and you didn't "Ctrl+Enter" or "Ctrl+Alt+S" the changes ?
13:40tieTYTlpetit: not at the time
13:40bbloomSonderblade: it should eliminate recompilation of cljs.core on each edit, which should dramatically reduce iteration time
13:41tieTYTespecially because I changed file 1 which would break file 2 until I updated file 2
13:41patchworkIf I decompiled the class files generated from a clojure project back into java files and recompiled it, would it run?
13:41tieTYTthat's just the way I (currently) think
13:41lpetittieTYT: maybe the flag I mentioned above is for you then. Make your changes without saving the files. When ready, "Save all editors" and there you go
13:41tieTYTlpetit: did you mean to say this option loads files on save? You said it loads them on repl start
13:42lpetittieTYT: does both
13:42tieTYToh cool, good to know
13:42technomancypatchwork: no, clojure emits bytecode that is impossible to express as java source
13:42tieTYTanotehr thing
13:42tieTYTmy-proj.core has the (-main)
13:42technomancyparticularly for locals clearing
13:42lpetittieTYT: less used these days. People prefer more control over what's (and when) sent to the REPL.
13:43lpetittieTYT: yes ?
13:43Sonderbladebbloom: it does, but it still takes a few seconds to compile a single file which is kind of slow
13:43tieTYTi noticed that if I ctrl+alt+s another file and it changes my NS
13:43tieTYTthen I ctrl+alt+n back into core
13:43tieTYTif I try to run (-main) it says it doesn't exist
13:43tieTYTthis may be a repl thing or a clojure thing
13:43tieTYTbut i always have to restart my repl to be able to run (-main) again
13:43lpetittieTYT: not sure I'm following you
13:43patchworktechnomancy: How does that work? Shouldn't java be able to generate any possible byte code sequence?
13:43ToBeReplacedfavorite clojure path manipulation library?
13:43tieTYTok let me restart
13:43technomancypatchwork: nope
13:43patchworkThat is valid running code
13:44patchworkInteresting
13:44technomancythere is no way to express locals-clearing in Java
13:44lpetittieTYT: yeah, slowly, few neurons there, today ;)
13:44patchworkCrazy, I had no idea
13:44technomancylots of things are possible in bytecode that aren't expressable in the Java language
13:44technomancyI mean, Java is not at all an expressive language to begin with.
13:44tieTYTlpetit: If I go to file2 and start the repl with ctrl+alt+s
13:44patchworkHow did it get written then?
13:44tieTYTthen go to core and do ctrl+alt+n
13:44patchworkI thought clojure was written in java?
13:44tieTYTthen try to (-main)
13:44tieTYTit says (-main) doesn't exist
13:45technomancypatchwork: the compiler is written in java
13:45tieTYTand the only way I've been able to figure out how to run main is to restart the repl from the core namespace
13:45lpetitdoes file1 contain a namespace that is a dependencies (required or transitively required) by file2 ?
13:45technomancythankfully the people working on the JVM are a lot more imaginative than the people working on the language
13:45tieTYTheh, there's no file1 :P
13:45patchworktechnomancy: Aha! wow, thanks for the insight
13:45tieTYTjust core and file2
13:45patchworkSo it really is better than java
13:45lpetits/file1/core
13:45patchworknot just a skin
13:45tieTYToh
13:45technomancypatchwork: faint praise, but yes
13:45jcromartieand this is what I'll say when they ask me why I wrote this backend service in Clojure instead of Rails http://www.techempower.com/blog/2013/03/28/framework-benchmarks/
13:45patchworkHahaha
13:46jcromartiebecause yes I need to serve K's of JSON responses per second
13:46tieTYTdoes file2 depend on core? no
13:46tieTYTdoes core depend on file2? yes
13:46tieTYTi couldn't figure out which of those you were asking
13:46tieTYTso i answered both
13:47lpetittieTYT: so you should Ctrl+Alt+S core, then Ctrl+Alt+N and type (-main)
13:47tieTYTwhy?
13:47clojurebotWhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
13:48lpetittieTYT: I assume that it's when there is no REPL started yet, right ?
13:48tieTYTthe repl is started because the first step is ctrl+alt+s in file2
13:50tieTYT1) ctrl+alt+s in file2 2) ctrl+alt+n in core 3) (-main) result = error, could not find that function
13:50lpetittieTYT: if file2 is to be launched from core (since it is required by core), and since you ultimately intend to run core/-main, then, provided that you didn't yet start a REPL: go to core, Cltr+Alt+S it (it will load core and require file2), Ctrl+Alt+L into core, and (-main)
13:51lpetittieTYT: that's to be expected. ctrl+alt+n does not load core, just emit a "(in-ns 'core)"
13:51tieTYTso how do I fix this? Ctrl+Alt+S in core before/after I ctrl+alt+n into it?
13:52lpetittieTYT: did you try what I suggested above ? 1/ open core, Ctrl+Alt+S ; 2/ Ctrl+Alt+N ; 3/ (-main) (in REPL)
13:53tieTYTnot yet
13:54lpetittieTYT: just do it :-)
13:57tieTYTah ok that works
13:57tieTYTi assumed that starting the repl loaded the whole project
13:57tieTYTthanks for the help
13:57lpetityou're welcome.
13:58tieTYTand is there a way to make it so that if I type ( it completes the ) for me and puts my cursor on the inside?
13:58lpetitNote that with the flag I mentioned, I think it should indeed load the entire project. It may take some time, tho. In that scenario, only doing a Ctrl+Alt+N in core & then (-main) should work
13:58tieTYTcool
13:59lpetittieTYT: yes, that's called the "strict / paredit" mode. This mode comes bundled with some extra features (e.g. when you type a closing paren) which are, at first, a little bit surprising to newcomers. That's why it's not the default mode.
13:59lpetittieTYT: You can try it by switching back and forth default / strict mode via Alt + D
14:00lpetittieTYT: When you feel comfortable in the strict mode, you can definitely open your editors in it via Preferences > Clojure > Editor > … don''t remember the wording … option
14:01lpetittieTYT: pro-tip. When in the strict/paredit mode, you can "escape" from it, for the duration of the next keystroke, by hitting "Esc" key before the key you want to type
14:01lpetittieTYT: pro-tip 2: the whole list of keyboard shortcuts is here: https://code.google.com/p/counterclockwise/wiki/EditorKeyBindingsFeatures
14:02tieTYTthank you
14:02tieTYTi'm an intellij guy normally
14:03lpetittieTYT: not too lost in Eclipse? How come you had to switch?
14:08tieTYTlpetit: I didn't like the La Clojure plugin
14:08fractasticalHey everyone, I'm a total Clojure n00b
14:09tieTYTi'm lost in eclipse. I don't like how it doesn't help you learn. There's tons of shit you can't access from the menu, and tons of shit in the menu it doesn't tell you the shortcuts for
14:09fractasticali've been playing with a few web apps in Clojure
14:09hyPiRionfractastical: hello there
14:09fractasticalbut i'm constantly getting java.lang.ClassNotFoundExceptions
14:09tieTYTbut i'll learn
14:09Driadanglad to hear I'm not the only one starting with Clojure :D
14:09fractasticalsometimes I suspect that they are actually errors in something else
14:11hyPiRionfractastical: hmm, care to elaborate a bit further about when you get these exceptions?
14:11fractasticalis this a common clojure problem when debugging?
14:11fractasticalwell, at this moment I've added a controller and a view to my app
14:11fractasticali'm booting it up with foreman
14:11TimMcThose usually mean I've forgotten to import a class.
14:12fractasticaland then it tells me: java.lang.ClassNotFoundException: fractastical-service.server
14:12TimMcOh, hypens!
14:12fractasticalbut it was working just before i added the controller / view
14:12fractasticaland there is no explicit call back to the server in any of the new code as far as I'm aware
14:12hyPiRionTimMc: Yeah, I get them when I forget to import a class, refer to a nonexisting class or generally try to jar a swearjure program
14:13TimMcfractastical: I bet you've got a - vs. _ problem. Where namespaces have hyphens, the file and directory names (packages) have underscores.
14:13fractasticalyep, i noticed that
14:13jcromartiefractastical: if you haven't require'd the fractastical-service.server namespace then "fractastical-service.server" will be treated as a class lookup
14:13fractasticalbut like i said, it was working
14:13fractasticalhmm
14:13TimMcThat would do it as well.
14:13hyPiRionWell, that's strange
14:13fractasticalmaybe i need to require the namespace on every subclass (i.e. the controller/view)
14:14fractastical?
14:14TimMc,clojure.string/split
14:14clojurebot#<string$split clojure.string$split@1ebf394>
14:14fractasticalI actually had the same problem the other day when I was attempting to rename my whole webapp
14:14fractasticaland I did a project-wide find/replace
14:14fractasticaland got exactly the same error
14:14hyPiRionAh!
14:14fractasticalwent from working, to constantly not finding the main class
14:14hyPiRionin your project.clj, have you replaced the :main function?
14:14fractasticalcouldn't figure out why so I abandoned it...
14:15fractasticalno, I haven't touched the :main function
14:15hyPiRionnamespace*
14:15fractasticalit is the same as before
14:15hyPiRionso the symbol is equal to the namespace of the main namespace?
14:16fractasticalyes
14:16hyPiRionhmm
14:16fractasticalhere are the actual values
14:16fractasticalproject.clj -> :main liberator-service.server
14:17tomojI've been getting that too on `lein run` lately for at least one project
14:17hyPiRionand the name of the program is liberator-service.server, I suppose
14:17technomancyfractastical: foreman is fairly redundant when using Leiningen
14:17fractasticalyeah, i figured that
14:17technomancyyou already enumerate your project's entry points in project.clj
14:17fractasticali was using leon run
14:17fractasticallein run
14:17technomancyright
14:17fractasticalI assumed that foreman used trampoline if I had it specified in a Procfile
14:17tomojhmm, but in a new test project, it works fine.
14:18fractasticalnot quite sure what that does when I am running it locally, probably nothing useful
14:18fractasticalbut the heroku people seemed to think it was a good idea, so i thought I'd try it
14:18fractasticali think it is more to keep their dynos from being used when not necessary
14:18fractasticalthat was my take-away anyways
14:18fractastical:p
14:19lpetittieTYT: yeah, it shows in Eclipse that the main "classic" plugins one expects to see are not sufficiently coordinated and tightly integrated into a coherent "whole", thus the feeling of being lost at first.
14:19fractasticalanyways, it is good policy from the heroku standpoint to not have us running dynos for no reason
14:19fractasticalso I support it ;)
14:19lpetittieTYT: it' s a little bit too "open" : lots of possible customizations, but poor defaults
14:20hiredmanpjstadig: instead of creating projects it will kill them
14:20fractasticalha
14:20fractasticaldeploy to trash...
14:21fractasticalanyways, the problem with this error: "Exception in thread "main" java.lang.ClassNotFoundException: liberator-service.server" is that I have no idea where it is from in the code
14:21TimMcpjstadig: Will it turn off autocorrect, download lein, delete itself, and symlink to lein?
14:21TimMcBecause that would be cool.
14:21danlarkinrf -rf /
14:22hyPiRionls -a
14:22lazybotdata home lost+found media opt proc root sbin selinux swap tmp
14:23technomancy"Of course, on the system I administrate, leon has been replaced by a shell script which Generates a syslog message at level LOG_EMERG, reduces the user's disk quota by 100K; and RUNS ED!!!!!!"
14:24danlarkinahahh
14:24S11001001ed is the industry best practice text editor
14:25hiredmanit also replaces replaces your prompt with "C:\Documents and Settings\home>"
14:25technomancy!!!
14:25shriphanihello. I have a jdbc question. What parameter is missing in this list? I am working off an example on github but it doesn't seem to be right : db-spec {:subame "db/monitor.db", :subprotocol "sqlite", :classname "org.sqlite.JDBC"} is missing a required parameter clojure.java.jdbc.internal/get-connection
14:26technomancyhiredman: necessarily
14:26hyPiRiontechnomancy: huh, where is that from? Or did you just made that up?
14:26technomancyhyPiRion: https://www.gnu.org/fun/jokes/ed.msg.html
14:27thalassios_xelonhelo room:) is there an easy way to limit availible time for evaluation of an expression? example: (limit-time 1000 (.....)) if its takes more than 1000ms cancel the evaluation
14:28lynaghkping: dnolen
14:28dnolenlynaghk: pong
14:28lynaghkdnolen: you wrote a blog post about using ClojureScript protocols to do neat stuff with strings and regexes
14:28hyPiRiontechnomancy: I should've known once I saw Ed, really.
14:29dnolenlynaghk: yes a long while ago
14:29lynaghkdnolen: is that still around somewhere or did you take down the old blog for your new github one? I'd like to link to that post
14:29dnolenlynaghk: it's probably on posterous sadly
14:29dnolenlynaghk: which is going away soon so I wouldn't like to ti
14:29TimMchyPiRion: You should have known once you saw all those exclamation points.
14:29lynaghkdnolen: my google skills are failing me.
14:29lynaghkdnolen: oh, okay.
14:29thalassios_xeloni found the way to limit time .... bye room
14:30TimMc...thanks for telling us.
14:30Driadanthat was fast...
14:30TimMcI would have liked to know the answer, actually.
14:30ToBeReplacedin the clojure.java.jdbc docs, it says with-query results is "Deprecated since JDBC-based SQL Interface version 0.3.0" ... what is the JDBC-based SQL interface?
14:31technomancyToBeReplaced: I don't think 0.3.0 is out yet
14:31hyPiRionTimMc: I should have known everything really. Would've made IRC life so much easier.
14:31ToBeReplacedyeah latest on maven is 2.4
14:37fractasticalso apparently the ClassNotFound problem was from sort of mismatch between liberator and compojure.route
14:37fractasticalwhich weirdly declared that my main class file could not be found
14:39hyPiRionOh, ooh. May be that either liberator or compojure grabs *ns* somehow.
14:39hyPiRionthough I can't understand how that would crash.
14:39technomancyhoping to do a bugfix release of Leiningen today or tomorrow; anyone got some issues they'd like to make it in?
14:40n_bI'm currently working on enhancing the Clojure bindings to the Boilerpipe library (an HTML content extraction lib) and am trying to determine why the original author used protocols rather than just slurp'ing in the source and passing it to the lib; anyone mind taking a quick look here and possibly enlightening me? https://gist.github.com/nickbarnwell/28992b89bc3e0c925416
14:40ppppaultechnomancy, lein is too pretty and easy to use. fix this please
14:40n_bOr would a question like this be better suited to the mailing list
14:41amalloyppppaul: that would make it more familiar to some of the mainstream-language programmers...
14:41technomancywhat's that? xml-based project.clj replacement, you say? it's so crazy it just might work.
14:42tomojn_b: I don't think you're missing anything
14:42yaziriantechnomancy: you should be able to work some m4 in there somewhere
14:42mknoszligTimMc: here's a pretty ad hoc solution for that timeout thing icusc: https://gist.github.com/mknoszlig/5265744
14:42hyPiRionppppaul: Leiningen is a pretty guy, true that. It's hardly we can anything we could do about that though. Except maybe shave his moustache.
14:43ppppaulthe only issue i have with lein is start up time. i do lein test a lot and it takes seconds to boot
14:43pellisplease don't replace lein with XML
14:43ppppaulusing drip too
14:43n_btomoj: First guy just overcomplicated it, right? The entire file has to be read in to be parsed, so the *only* advantage I could see with the protocol method was being able to optimise, e.g. HTTP fetching, with clj-http or such
14:43noncomHey what is the library to use if i need to make an HTTPS client? Google only says there are HTTP libraries for Clojure... will neotyk's http.async.client work with HTTPS?
14:44n_bclj-http works with HTTPS for me
14:44hyPiRionnoncom: I think clj-http/compojure + Friend can do HTTPs stuff
14:44tomojI don't see any advantage of having a protocol there at all
14:44tomojit looks like the author was just confused
14:44ppppauli tried to use friend and found it hard
14:44ppppaulmoved to liberator
14:45yazirianever since i started using clj-http, my bread started landing butter side up when i drop it.
14:45n_bOK, cool cool. Will just write some tests and then make a pull request then. Thanks tomoj
14:45tomojI mean, a TextExtractor protocol could maybe make sense
14:45noncomthank you good people!
14:46tomojbut it should be a protocol over text extractors, not over URLs and bodies..
14:47amalloytomoj: i think that protocol is just clojure.java.io/reader
14:47amalloy(should be, that is)
14:47tomojand that only would make sense if you wanted to be able to swap boilerpipe for something else..
14:47tomoj"extractor" means something different here
14:47ppppaulcan i talk about pedestal here?
14:47rkneufeldSure.
14:47technomancyman... lein ring launching a browser by default
14:47ppppauli'm really curious about how it will scale
14:47technomancywhat is up with that =(
14:47rkneufeldWe have #pedestal too
14:47tomojamalloy: oh, right
14:48ppppaulfrom my understanding, scaling is easy to do if i can cache my data. the easier i can cache the better i can scale. i don't see this being possible with pedestal
14:49hyPiRiontechnomancy: lein ring :headless
14:49hyPiRionor something
14:49ppppaulrkneufeld,
14:49devinuswhat do you guys think are the coolest clojure libraries being developed right now?
14:49rkneufeldppppaul: one sec
14:50technomancyhyPiRion: like you, I always forget the exact invocation
14:50noncomlein ring server-headless
14:50technomancyit's just a silly default for ring
14:51technomancymaybe a website-specific plugin could assume that, but ring is low-level and shouldn't make assumptions
14:51ppppaulshouda put a ring on it
14:51hyPiRionyeah, I remembered first time I was going to check if I could access a webpage through ring on my server, and lein ring crashed
14:52hyPiRion"oh, I'm missing X11 on my server?"
14:54hiredmantechnomancy: the `lein ring` plugin also always aots the whole project https://github.com/weavejester/lein-ring/issues/52
14:54hiredmanand needless generates new servlet classes for every project
14:55blrmdevinus: its not exactly a library, but overtone is pretty awesome
14:55devinusblrm: that's the music generation one, right?
14:55hiredmanpedestal has a single ClojureVarServlet class that you just slot the vars you want in to
14:56n_bcore.logic is pretty great, probably decidedly less cool to the prolog fans though ;)
14:56blrmdevinus: yeah, if you wanna see what its capableof, sam aaron did a great presentation on it: http://blip.tv/clojure/sam-aaron-programming-music-with-overtone-5970273
14:56hiredmanhttps://github.com/pedestal/pedestal/blob/master/service/java/io/pedestal/servlet/ClojureVarServlet.java but defined in java, which is also gross
15:00technomancyhiredman: huh; not seeing that here
15:01hiredmantechnomancy: have you built a war?
15:01technomancyno
15:01technomancyI would never do that =)
15:02hyPiRionmake peace, not war.
15:02fractasticalovertone was what first got me interested in Clojure
15:02fractasticalor at least, was the first thing I used to experiment in Clojure
15:02fractasticalunfortunately i could never get it to do the cool things that were in the video
15:02technomancyhiredman: the issue says it comes from running `lein ring server` though
15:03fractasticalundocumented features...
15:04hiredmantechnomancy: try running `lein clean` first
15:04hiredmannope, hmmm
15:04blrmfractastical: did you ever use any of the midi mapping features? I've never messed with that part of it
15:04fractasticalnot really, i just went through whatever tutorial there was at the time
15:05fractasticaldon't even remember exactly what i did anymore, was awhile ago
15:05fractasticala few beeps that sounded a bit like music ;)
15:05blrmfractastical: haha :)
15:06fractasticalis it possible to have a single page clojure web app?
15:06amalloyfractastical: just play a bunch more beeps at once, layered over each other, and it's real music
15:06fractasticalamalloy: yeah, that's what they told me, but it sounded more like a bunch of beeps colliding into each other
15:07fractasticalmore like the bumper cars of music than a trip to the local philharmonic
15:07fractasticalstill fun though ;)
15:09hiredmantechnomancy: it looks like lein doesn't print out the "compiling ..." lines when lein-ring creates an uberwar, even though it definitely aot compiles
15:10technomancyyeah, I'm just using this to throw together a dummy "500 on every request" app; I don't use it for real projects.
15:16fractasticalis Midje the preferred way to do testing in a clojure web app?
15:17ppppaulno fractastical
15:17fractasticalis there a preferred way?
15:17Ember-clojure test is the preferred way, but midje is great and I like it more
15:17Ember-it all depends on what you like
15:17Ember-try em both, then make your choice
15:18ppppauli don't see midje being more than a renaming of stuff from test. please enlighten me Ember-
15:19technomancymidje has a number of questionable design decisions
15:19technomancystart with clojure.test and if you don't like it you can look for alternatives
15:20fractasticalok, thx
15:20Ember-ppppaul: for example metaconstants, top-down testing and so on
15:20Ember-there is only one thing that *really* bugs me in midje
15:20Ember-and it's the stacktraces
15:20technomancythe great thing about clojure.test is that you only have to learn 2 macros and you're good to go. (plus one function if you want to get fancy)
15:20Ember-midje f**ks them up in case of an exception
15:20technomancyso it's not a big investment
15:21ppppaulclojure test also integrates into cat nip
15:21borkdudeI like clojure.test for its simplicity
15:22borkdudemocking can be done with binding or with-redefs
15:22amalloysimplicity is such a strong word, borkdude. i'd say clojure.test has minimalism :P
15:22technomancyyeah, most people who think they need midje for mocking just don't know about with-redefs
15:24borkdudeamalloy ok =)
15:24hyPiRionoh man
15:25hyPiRionwith-redefs makes me so angry when I have to write tests or try out code in other languages
15:25hyPiRionIt's too useful
15:25hiredmanvars are sweet
15:25technomancyI wrote with-redefs for ruby when I was young and foolish
15:26technomancyhttp://technomancy.us/94
15:26borkdudetechnomancy how old are you now? ;)
15:26technomancywow, the formatting on that broke pretty badly
15:26hiredmanevery var is a dependency injection point, which it turns out, having those everywhere is super useful
15:26technomancyborkdude: now I'm just foolish.
15:26hyPiRionborkdude: still young, not so foolish anymore though
15:26technomancyheh
15:26technomancyI'm 29
15:26hyPiRiontechnomancy: hah,
15:26hyPiRion< 30
15:26hyPiRionstill in your twenties
15:28hq1hi, coming from Erlang, what would you say is the best resource to start with Clojure?
15:28borkdudehq1 ClojureBook and 4clojure
15:28pjstadigfunctions that call other functions through vars are not pure
15:28hyPiRiontechnomancy: Oh, now I just realized where I stole the CSS for my code blocks for my blog :)
15:29technomancyhyPiRion: hah... mine is stolen from htmlize.el
15:29hq1borkdude: ty
15:29hyPiRionhq1: http://www.clojurebook.com/ is a good one
15:29hq1thanks
15:30hyPiRionhq1: While you're here, can you tell me about a valuable place to learn OTP properly? :)
15:30borkdudetechnomancy htmlize.el uses css? it's inlined css I think then?
15:30ppppaulanyone play with simulant?
15:30technomancyborkdude: it is, yeah
15:30hq1hyPiRion: LYSE - http://learnyousomeerlang.com/
15:31hyPiRionhq1: ah, good to get that confirmed, thanks!
15:31hq1hyPiRion: np
15:32borkdudehq1 there are some other great clojure books as well: … wtf, my clojure books question on SO got removed: http://stackoverflow.com/questions/2578837/comparing-clojure-books
15:32hq1haha
15:32fractasticalheh, i was searching for that earlier today and got the same removal notice
15:32Driadanwhat's the name for the <- thing? I can't google it :/
15:32rkneufeldthreading macro?
15:32clojurebotmacro are macros
15:32amalloy$google symbolhound
15:32lazybot[SymbolHound: Search Better. Code Better.] http://symbolhound.com/
15:33borkdudehq1 it's stll in cache: http://webcache.googleusercontent.com/search?q=cache:onOQFehkNQIJ:stackoverflow.com/questions/2578837/comparing-clojure-books+&amp;cd=3&amp;hl=nl&amp;ct=clnk&amp;gl=nl
15:33Driadanthanks :D
15:33amalloyborkdude: it's really off-topic for SO. it'd be fine on programmers.stackexchange.com, i imagine
15:33hq1borkdude: ah, I think I've been there like year ago or so ;). cool, thanks
15:34amalloythough i dunno, maybe it'd be closed as non-constructive there
15:34borkdudeamalloy maybe, I don't like these categorizations
15:34hyPiRionamalloy: wow, thanks
15:34hyPiRion(inc amalloy)
15:34lazybot⇒ 45
15:34amalloyhyPiRion: for what, symbolhound?
15:34hyPiRionamalloy: yeah
15:34rcgany idea why *ns* evaluates to user when being used after the (ns ...) definition in a .clj file?
15:34amalloythey don't index github at all, so i find them pretty useless personally
15:42pjstadigrcg: i'm guessing because *ns* is set to your ns during compiling, but when the code is finally loaded and the static initializer for the class runs (which is where the evaluation of *ns* happens) the value of *ns* is back to user
15:43jamescarrusing the viterbi algorithm to send concurrent network requests?
15:43rcgpjstadig, hmm ic
15:43rcgany idea how to circumvent the issue?
15:44SegFaultAXamalloy: Do they only index StackOverflow and the SE network because at least the first page of results from symbolhound was just SO links.
15:44pjstadigrcg: i'm not sure exactly what you're trying to accomplish, but ... maybe
15:44rcgpjstadig, am trying to write junit style test output into a file named as the namespace
15:45rcgusing a fixture for this, applied with (use-fixtures :once)
15:46pjstadigin clojure.test there is a way to hook in and produce different output
15:46pjstadigthere is a junit XML output, if that's what you're interested in
15:46pjstadigbut i've heard maybe it isn't perfect
15:47rcgpjstadig, no, i already get the junit output via with-junit-outpu
15:47rcgt
15:47rcgand i can also write it into a file via a writer
15:47rcgi just wanted to name the file according to the namespace name automatically
15:47pjstadigit seems like decisions about output should be made by the code that is running the tests, not necessarily the tests or fixtures
15:48rcgsounds sensible
15:48pjstadigthere's a look somewhere that is looping namespaces and vars to tests and hooking into that, if you can, would be the place to worry about file names and output formats
15:48rcgthat would be my next try then
15:48pjstadigloop*
15:48rcgright
15:52jcromartieI am not digging the data migration libs out there
15:53jcromartiedrift looks better than Lobos
15:53jcromartiebut I don't want to set up special paths and all that nonsense
15:53jcromartiewhy not just a namespace for migrations?
15:53jcromartieinstead of a file per migration?
15:59Driadanif the file exists, what does the "Exception in thread "main" java.io.FileNotFoundException: Could not locate cloturas/model/schema__init.class or cloturas/model/schema.clj on classpath" could mean?
16:00Driadan$ ls src/cloturas/models/schema.cls does find it
16:01nDuffDriadan: err, .cls?
16:01Driadan:O
16:01DriadanT_T
16:01nDuffDriadan: Driadan and models vs model
16:01Driadanthanks
16:01nDuff(singular vs plural)
16:02Driadanthat'll teach me to double check
16:02supersymClojure scares me a bit now and then... is that normal?
16:02Driadanmmm the cls was a typo, but the models
16:03Driadanwas the problem
16:04nDuffsupersym: Took a pretty significant while for me to grok it.
16:04Driadansupersym, it scares me always ;) I'm fighting against going to any other language I know
16:05supersymglad to hear :)
16:07DriadanI suppose it's expected, I'm only a couple of weeks into the language, and everything seems alien to me
16:07fractasticaldo people use liberator for serving REST responses? or can you get by fine with simply compojure?
16:07fractasticali'm struggling to figure out exactly how liberator is working
16:08fractasticalin general so far with Clojure there are a lot of things I would expect to grok immediately
16:08supersymDriadan: I imagine you came here like me because those languages you knew most, if not all to learn
16:08fractasticalthat instead I end up staring at for awhile
16:08supersymwhere is the fun in that
16:08supersymnDuff: I have my little moments of insight, I consider ending up here and recognizing its awesomeness a case of enlightment :)
16:09nDuffDriadan: I spent a few months rereading The Joy of Clojure, a few years playing with the language on and off, and one year actually writing Clojure in production.
16:10nDuffDriadan: It's only about halfway through that year that I'd describe myself as comfortable, and there's a big gap between "comfortable" and mastery yet to traverse.
16:10winkthere's even a big gap between baby steps and comfortable usage :P
16:11winkthen again I found the start easier than in other functional languages
16:11rplacatechnomancy: is there a seattle meetup next Thursday?
16:14tieTYTi have a function that I want to wait a random amount of time each time I call it. Do i have to learn about concurrency in clojure to do this?
16:14hyPiRiontieTYT: Not really, you can do (Thread/sleep (rand-int some-number))
16:15hyPiRion,(Thread/sleep (rand-int 2000))
16:15clojurebotnil
16:15hyPiRion,(Thread/sleep (rand-int 2000))
16:15clojurebotnil
16:15supersymnDuff: thanks for sharing, I can imagine it will take myself about the same time and a lot of wikipedia reading up on the mathematic behind many subjects
16:15tieTYTah so I gotta reach out into java? K
16:15tieTYTthanks
16:15hyPiRiontieTYT: np
16:15supersymmy nomenclature fetish will send me right back at those anyway
16:20DriadannDuff at least I know some of the stuff from functional languages, I'd be completely lost otherwise, but i never used it except for small stuff
16:21Driadantrying to build a webpage seems like a big deal right now (since I could do it easily in some other language)
16:21antares_Driadan: do you know about http://clojure-doc.org?
16:21danneuDriadan: http://clojure-doc.org/articles/tutorials/basic_web_development.html
16:21supersymheh
16:22antares_Driadan: Web development in Clojure is not really that mature yet, most people (my impression) use Clojure for data processing, stream processing, UI-less services, machine learning, …
16:22antares_but not Web apps that have to render HTML
16:23nDuffantares_: I'd agree that there are still lots of improvements being made, but disagree that it's not in a thoroughly usable state.
16:23fractasticalantares_ what about serving a rest API?
16:24danneuClojure's basic web stack feels 1:1 with Ruby's Sinatra stack to me (and actually better).
16:24antares_fractastical: that is pretty trivial with Compojure and Cheshire
16:24fractasticalnDuff: I'm in a similar situation right now
16:24fractasticalantares_: Cheshire keeps everything in memory though, no?
16:25antares_Clojure is my favorite language for HTTP services but I don't have to generate HTML :)
16:25antares_fractastical: I'm not sure but it is built on top of Jackson
16:25fractasticalrighto
16:25antares_which I think has streaming support
16:25supersymantares_: true
16:25dakronefractastical: depends on how you use it, it does have streaming support
16:25fractasticalok, interesting
16:25fractasticali already hooked up postgres+jdbc to my app
16:25supersymatm I just generate static HTML using coffee,stylus,jade,md and docpad on node.js
16:26danneuI frankly love generating HTML with Hiccup. It's an ultraterse Haml.
16:26supersymmany dynamic engines/solutions or 1-page apps blow when its about SEO
16:26antares_nDuff: sorry, I did not imply that it's not useable, just that it may be pretty rough around the edges and there are no good conventions yet
16:26nDuff*nod*.
16:26nDuffThat's fair.
16:26fractasticalantares_: how much throughput do you have in your HTTP services?
16:26supersymbasically just kills it and most customers care.. so glad I spent much time perfecting that toolset so I can render pages in no-time because of code-cutting and short-hand notation
16:27fractasticalI'm a bit worried about high load stuff, haven't seen too much documentation about that floating around
16:27jcromartiefractastical: you can test it w
16:27antares_fractastical: about 10K with absolutely no tuning with Jetty 7. I bet Jetty 9 is noticeably higher, they did impressive performance work there.
16:28fractastical10K req/sec ?
16:28supersymDocpad is really nice and I can easily create many native web stuff with livereload so that works great for me now in terms of productivity
16:28antares_this is with some warm-up time and a very straightforward endpoint
16:28jcromartiefractastical: with ab or weighttp
16:28antares_fractastical: correct
16:28jcromartienetty is a real beast if you wanted to make that ork
16:28jcromartiemake that work
16:29antares_fractastical: it highly depends on your concurrency levels, Jetty fairly transparently uses multiple cores
16:29supersymI long for the day I master clojure, LT and Clojure are mature and I can develop for web/desktop/? in those, but it will take some time :)
16:29jcromartieantares_, fractastical: I will be deploying a web service for up to 300K mobile users soon
16:29jcromartieit's Compojure right now
16:29danneusupersym: are you trying to build something that's out of your reach or something?
16:29fractasticaljcromartie: how have you been testing that?
16:29jcromartieab
16:29antares_jcromartie: I'm just saying it's a good baseline, ~10K with absolutely no tuning and even more with Jetty upgrade
16:29jcromartieyeah
16:30jcromartiebut I can't get ab to make 10K requests per second
16:30antares_if you want 50K/s you will have to tune the hell out of anything
16:30fractasticaljcromartie: how fast are you?
16:30antares_jcromartie: I used two powerful machines and Linux. ab on OS X is badly broken :(
16:30jcromartieyeah it is
16:32jcromartiefractastical: I honestly have no idea right at the moment… I have made a mess of the API for the moment :P
16:32fractasticaljcromartie: maybe we can have a longer private discussion then, we are doing something very similar
16:33fractasticala bit in the beginning stages, but i want to make sure we can scale out to >300K users
16:33Driadanantares_, danneu thanks, I know both resources, but thanks
16:33jcromartiesure! I love the opportunity to bounce ideas off of others
16:34Driadanantares_, currently I'm using web development because I have a small project to develop, that way I can start using it to learn
16:36antares_Driadan: by all means start with what sounds interesting or relevant to you
16:36antares_Driadan: but Web development with UI is a relatively weak point for Clojure right now, compared to data processing
16:36DriadanIt's nothing fancy, mostly crud
16:37DriadanI'm doing it with luminus, following the tutorial and adjusting to my needs, seems good so far
16:37Driadanmade me look for a couple of functions, read a lot, and stuff like that
16:37Driadan:)
16:39danneuDriadan: are you coming from another language/web stack?
16:39Driadanyep
16:39danneuDriadan: from where?
16:39Driadanmostly python with tornado and flask, but I've had my share of other stuff
16:51danneuIf your library is expressed in macros that define functions, what's the general way to incorporate docstrings? do i refactor the macros to accept a docstring and then pass it on to the resulting defn?
16:52rplacadanneu: the the resulting functions define an API, then yes
16:55Driadantime to get some dinner
16:55Driadansee you guys later, have fun :)
16:55danneutake it ez
16:57technomancyrplaca: yeah, seajure is next week
16:57pbostromhi y'all, I have a two pieces of information that I want to use as map key, a string and an id, e.g. ["abc" 123] and ["abc" 456] would be two different keys, I'm wondering what is the best way, just use the vectors as is, or convert to strings "abc_123", or keywords :abc_123
16:57pbostromI always feel weird when I use anything other than keywords
16:57antares_pbostrom: just use a vector
16:59danneuif applicable you could create a nested hashmap if "abc" represents the same thing in both of those sample vectors
17:07pellisanyone knows what clojure course this is ? https://github.com/dbushenko/clojure_course_task01
17:10OlegYchyeah that's by a friend of mine
17:10astevewhat is the purpose of name?
17:11SegFaultAX,(type (name :foo))
17:11aaelonyextract "a" from "a
17:11clojurebotjava.lang.String
17:11aaelony:a
17:12asteveso it converts a symbol or keyword to a string?
17:12aaelony, (name (keyword "a"))
17:12clojurebot"a"
17:13SegFaultAXasteve: Try (doc name) at your repl.
17:13asteveSegFaultAX: I'm reading the clojure doc on it, but I don't understand the purpose
17:14SegFaultAX,(map name [:foo 'foo "foo"])
17:14clojurebot("foo" "foo" "foo")
17:14SegFaultAXasteve: ^
17:15aaelonyasteve: suppose you read in some data that has a :foo key but you want to have "foo" not :foo.
17:18turbofail,(name 'foo/bar)
17:18clojurebot"bar"
17:18turbofailit gets rid of the namespace too
17:18turbofail,(str 'foo/bar)
17:18clojurebot"foo/bar"
17:25danneui vaguely remember seeing a way to do (doc xyz) but for the clojuredoc (incl examples) as well. but i couldn't seem to google it. am i just making it up?
17:26TimMccdoc
17:26TimMcBut I don't know if you need a plugin.
17:26technomancyit ships with lein repl but might be made optional soon
17:27TimMc&(apropos 'doc)
17:27lazybotjava.lang.RuntimeException: Unable to resolve symbol: apropos in this context
17:27TimMc&(use 'clojure.repl)
17:27lazybot⇒ nil
17:27TimMc&(apropos 'doc)
17:27lazybot⇒ (defdocument document build-doc find-docs doc* find-doc doc doc *clojuredocs-root* doctype javadoc-url *javadoc-base-url*)
17:27TimMc...but what namespace, apropos? What namespace?
17:27hiredman~apropos namespace
17:27clojurebotOpen Library Author Namespace is a Namespace. (http://www.freebase.com/view//m/04sty07)
17:28hyPiRionclojurebot: wat
17:28clojurebotFor Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
17:28TimMc:-D
17:28TimMcJS-wat
17:28hyPiRionoh, thanks
17:28hyPiRionj-SWAT I suppose.
17:38jcromartieI am absolutely loving the in-memory H2 for development and testing
17:38jcromartielike, there's literally *nothing* to do to test database operations… they are totally contained to a single connection
17:38jcromartiewhen the last connection closes the in-memory DB is gone
17:40winkugh
17:40winkI had huge problems last I tried to use it
17:40winkthen again, I'm a little java-ecosystem-illiterate
17:47kwertiiCan nREPL be made to deal with very large returned results nicely, by e.g. truncating them or just not printing them?
17:51amalloykwertii: (do big-computation nil)
17:51kwertiiamalloy: Yeah…. but sometimes I forget to do that, or something unexpectedly returns something huge …. :/
17:52kwertiiis there anything in nrepl-mode, maybe, that will just truncate after the first x characters?
17:56TimMckwertii: You can set *print-length* and friends.
17:56chawlsdoes anyone know if cgrand's enlive tutorial is out of date or if hackernews changed their layout? his scrape1/scrape2 examples aren't working for me.
17:56TimMc&(apropos "*print")
17:56lazybot⇒ (*print-radix* *print-miser-width* *print-pprint-dispatch* *print-suppress-namespaces* *print-right-margin* *print-pretty* *print-base* *print-level* *print-length* *print-dup* *print-readably* *print-meta*)
17:57TimMcWhoa, *print-suppress-namespaces*. Cool. I wonder if that's part of pprint...
17:58azkanechawls: i remember having to change the url to https
17:58amalloyTimMc: apparently so
17:58amalloyneat
17:59kwertiiTimMc: Cool. Thanks
17:59chawlsazkane: that didn't work for me
17:59kwertiiCan you make nrepl-mode run Clojure code at startup?
18:01finishingmovecan i write this shorter? (map (fn[x] (* x 2)) '(1 2 3))
18:01TimMcSure, [2 4 6] :-P
18:02TimMc(map #(* 2 %) [1 2 3]) would be reasonable
18:02SegFaultAX,(map #(* 2 %) [1 2 3])
18:02clojurebot(2 4 6)
18:02finishingmovethe anonymous function part
18:02SegFaultAXOr even ,(map (partial * 2) [1 2 3])
18:02finishingmovehm i see
18:02SegFaultAX,(map (partial * 2) [1 2 3])
18:02clojurebot(2 4 6)
18:05lpetitBodil: hi
18:06finishingmove,(map (fn[x] (* x 2)) '(1 2 3))
18:06clojurebot(2 4 6)
18:06finishingmovehm
18:06finishingmovewhen i write that in LightTable i get something like
18:06finishingmove3 3 (2 4 6)
18:06lpetitHello, any CCW (Counterclockwise) user here, using from the beta update site ?
18:09algernonfinishingmove: the 3 3 are the intermediate params of the fn
18:10algernonfinishingmove: the first 3 is the input param, the second is the x in (* x 2)
18:10finishingmovealgernon so why just 3 ?
18:11finishingmoveis it something like when you loop in javascript
18:11TimMcIt's the last value seen for that binding, presumably.
18:11algernonfinishingmove: because it displays the last thing going in (it probably queues displaying all, but only shows the latest)
18:11finishingmoveand then the iterator retains value
18:11finishingmoveah
18:11TimMcfinishingmove: Like that, but intentional, and it's an aspect of Light Table, not Clojure.
18:11finishingmoveah i understand
18:17TimMcI'm going to use java.nio.charset.CoderMalfunctionError for all my throwable needs from now on.
18:17TimMcbecause it's probably true
18:18TimMcHas anyone made an illustrated guide to Java exceptions?
18:19TimMce.g. LinkageError and a picture of a busted linkage on a car
18:19bosiei am using vimclojure in vim and i am wondering if there is another plugin that would properly reformat my code?
18:20Bodillpetit: Hi yourself :)
18:20lpetitBodil: Seems like you did an impression today @ DevoxFR, congrats !
18:21Bodillpetit: Thanks, it was a good crowd. :)
18:21lpetitBodil: Seems like it was all yours even before beginning :-p
18:23Bodillpetit: I guess there was a bit of hype up front. :)
18:23lpetitBodil: Will we see you at Mix It ?
18:23Bodillpetit: No, wish I could go, but I'm organising three conferences in Oslo around that time...
18:24lpetitBodil: Wow
18:26lpetitBodil: Good luck then, organizing & all. Save some time for Catnip, tho!
18:26antares_Bodil: looking forward to "what every hipster needs to know about organizing a conference"
18:27Bodillpetit: Thanks. Don't worry, I've promised too many people paredit in Catnip to let it just sit there now...
18:28Bodilantares_: I can do that in one slide - "find other people to do the boring stuff." :)
18:29lpetitBodil: yeah, but nobody like you does find the right picture to illustrate it ;) /cc antares_
18:29lpetitOk, enough flattery, and it's alsy time to rest a little bit, good bye all ;)
18:30Bodilnn!
18:31hyPiRionTimMc: You should see what I did in a project once. Every single method was a void, and I passed values around by extending Throwable
18:32TimMchyPiRion: You should see what C did once. There were no exceptions, so it passed around error conditions as return values. :-P
18:32hyPiRionYou know, I should probably keep all these insane projects for myself. At this pace noone would hire me if I lose my current job.
18:32TimMcWhich is worse?
18:32amalloyTimMc: c'mon, that's a totally viable approach. it's how haskell does it
18:32TimMcheh!
18:32amalloythere's just...much nicer machinery to deal with it
18:32hyPiRionMonads man
18:33hyPiRionWell, the idea was to jump several steps on the stack to avoid handle special cases
18:33amalloyhyPiRion: worst superhero name ever?
18:33hyPiRionMonads, man*
18:34antares_Bodil: yeah but tell it me with ponies
18:48lpetitNew #Counterclockwise Beta with paredit slurp / barf & Leiningen (2.1.1) Integrated Command Line: https://groups.google.com/d/msg/clojuredev-users/8ay-3eterYA/YMzXoBqA1eoJ
18:48hyPiRionlpetit: Oh, "bad timing"
18:49hyPiRionLeiningen 2.1.2 was just released
18:49hyPiRionbut sweet
18:49technomancythe curse of everyone choosing Thursday as their open source hack day
18:49lpetithyPiRion: Ah ! :-) Anyway, it's just a beta, will roll out a new one in a few days
18:50rplacatechnomancy: is there a seattle meetup next Thursday?
18:50lpetitI would not have had time to test CCW integration with Leiningen 2.1.2 anyway
18:50hyPiRionI suspect it's more due to Easter, unless you guys don't have holidays
18:50hyPiRionlpetit: just bugfixes, actually
18:51technomancyrplaca: for the third time, yes =)
18:51lpetithyPiRion: Yeah, and one or two internal API changes as well, he ;)
18:51rplacatechnomancy: sorry, I didn't see your answer so I thought you didn't see my question :)
18:51hyPiRionlpetit: ah, yeah, I suspect it's a bit more critical for CCW
18:51technomancymust be a pretty unstable connection =)
18:51hyPiRion,(repeat 3 'yes)
18:51clojurebot(yes yes yes)
18:52rplacatechnomancy: looks like I'll be in town - I'll try to join up
18:52lpetittechnomancy, hyPiRion : I was able of the risk, no regret :-)
18:52technomancyrplaca: cool. this one will be down in the pioneer square location.
18:52lpetitI already said that 1/2 hour earlier, good bye all, cu
18:53moredogmeathello
18:53rplacatechnomancy: that's perfect since that's where I'll be working
18:53moredogmeatdoes anyone know how to get rid of #<core$read_line clojure.core$read_line@4e68e6bf> when I use read-line?
18:53technomancyrplaca: it's a fun part of town
18:53technomancyas long as you don't have to park down there
18:54rplacatechnomancy: it is - I've been wandering in and out of there the past 8 months or so
18:54technomancyoh yeah, with the consulting gig; nice
18:54rplacaan easy trip from SF with the light rail and all
18:54rplacawell, barring client crisis, I'll see you then
18:57technomancycool
18:58moredogmeathello, sorry, is this the correct channel for asking clojure questions?
18:59hyPiRionmoredogmeat: it is indeed the correct channel to ask clojure questions, yes :)
18:59supersym:D
19:00moredogmeatcool thanks, I have a somewhat "stupid" question: :)
19:00moredogmeatI'm using read-line but I keep on getting #<core$read_line clojure.core$read_line@4e68e6bf> when I run the program
19:00moredogmeathow do I get rid of it?
19:01moredogmeatI'm using something like (loop [line read-line]
19:01hyPiRionmoredogmeat: ah, that's the problem
19:01hyPiRionread-line is a function, and in Clojure, you can return functions
19:01hyPiRion,read-line
19:01clojurebot#<core$read_line clojure.core$read_line@18ef813>
19:01hyPiRionbut if you call it
19:01hyPiRion,(read-line) ; (will crash here)
19:01clojurebotExecution Timed Out
19:02nfisherSorry to interrupt what's the best way to run a test suite in the repl?
19:02moredogmeatI thought loop [line read-line] is similar to (let [line read-line]) no?
19:02nfisher(or individual test set)
19:02TimMc(sh/sh "lein" "test") :-P
19:02nfisherhaha TimMc thanks! :P
19:02hyPiRionmoredogmeat: yes, but here's the thing, you don't call the function, you just return it
19:03hyPiRionSee the difference here:
19:03hyPiRion,+
19:03clojurebot#<core$_PLUS_ clojure.core$_PLUS_@13a55c>
19:03hyPiRion,(+ 1 2)
19:03clojurebot3
19:03nfisherTimMc I have a (run-tests 'etl.core-test)
19:03moredogmeatnod hyPiRion
19:03nfisherat the bottom of my test but, I suspect that isn't the best of ideas.
19:03nfisherbrb
19:04hyPiRionmoredogmeat: What you'd like is most likely (loop [line (read-line)] ...
19:04moredogmeatwhat's the idiomatic way to use read-line to process user input until I either Ctrl-D or say 'q'?
19:04TimMcnfisher: I've never tried. You're trying to test new code in the repl?
19:04moredogmeatoh ok thanks hyPiRion
19:05moredogmeatwoot, you are right! thank you
19:05nfisherTimMc yeah I've been writing unit tests.
19:05nfisherTo verify it parses correctly
19:06Driadanhi
19:06hyPiRionmoredogmeat: no problem :)
19:37jcromartiebleh, people PMing me to ask me to to homework for them
19:37muhoojcromartie: O_o
19:37jcromartie"homework"
19:38jcromartiethere's one guy who asks for JavaScript help once in a while but now he's just like "hey can you do this too: ..."
19:38muhoowho has homework in javascript?
19:39cdh473"homework"
19:39jcromartieI don't mind looking at something and giving comments or a little refactoring
19:39jcromartiegive a man a fish, and all that
19:51bytechunkyis there a way to undo the effects of 'def'?
19:52bbloombytechunky: ##(doc ns-unmap)
19:52lazybotjava.lang.SecurityException: You tripped the alarm! ns-unmap is bad!
19:52bbloom(doc ns-unmap)
19:52clojurebot"([ns sym]); Removes the mappings for the symbol from the namespace."
19:52bytechunkyah very good. thanks
19:57bytechunkyi am having trouble trying to obtain an AST of a form from a source file
19:58bytechunky(i am using clojure.tools.analyzer)
20:06st3fanyou can see it in action at http://192.81.214.162:3000/
20:08bytechunky@st3fan: what does it do? showing subway information?
20:10st3fanbytechunky: streetcars :)
20:10st3fanit talks to the nextbus.com api to get predictions for routes
20:11RaynesI wish LA buses had GPS. :(
20:11bytechunkyst3fan: so i guess this is live data of ... departure times?
20:11jcromartienice
20:11amalloyRaynes: they don't?
20:11Driadangood night
20:12Raynesamalloy: If they do they don't report to anything I've tried on my phone or laptop. They give estimates based on when they're supposed to run.
20:12RaynesWhich is more or less entirely useless because of traffic.
20:12st3fanRaynes: there is a mention of LA on http://www.nextbus.com/predictor/agencySelector.jsp#California-Northern
20:12st3fanoh estimates suck, you really want gps yes
20:13Rayneswat
20:13st3fanbytechunky: the code is at https://github.com/st3fan/clj-transit .. i'm cleaning it up now and writing some insturctions on hwo to get it going
20:13Raynesst3fan: Well, this says METRO buses have this technology.
20:14RaynesSo either this technology is always wrong, or...
20:14st3fangive it a try on the nextbus site . maybe it works better than you think :)
20:15Raynesst3fan: http://www.smartrideapp.com/ is what I've been using, and I assumed it pulled from nextbus.
20:15RaynesI'll see about getting something that explicitly mentions nextbus.
20:16st3fanyeah it probably does
20:16st3fani'm working on a mobile app too, that uses your current position to find the nearest stops
20:16RaynesI'll try it tonight.
20:16RaynesOn my way home.
20:17Raynesst3fan: The one I was using does that. I think all of them do.
20:17RaynesI've used at least 2 apps on the iPhone that detect nearby stops.
20:17st3fanyeah i know there are plenty .. i'm just doing it to learn some new technologies
20:17RaynesOh, I wasn't dismissing your project.
20:17st3fanmy target is Firefox OS
20:18RaynesAre you using clj-transit to do this?
20:18st3fanyup
20:18st3fanclj-transit is what runs on http://192.81.214.162:3000/
20:18RaynesCooool
20:20st3fanthat app just uses predefined stops but i actually also load all the routes and stop positions into a geo db so that i can find stops nearby (the nextbus api does not do that)
20:20st3fanit has been a good clojure intro project :)
20:21RaynesAhhhhhh! XML!
20:22st3fanyeah :-(
20:22st3fani'm looking at ways to make the xml parsing code better .. i'm not super proud of it
20:23cornotahtiRaynes: I had a nightmare that you hated me
20:23cornotahtiYou don't really ate me do you.
20:23cdh473anyone here start programming with clojure as a first language?
20:24st3fancdh473: i envy you :)
20:24cdh473st3fan: you shouldn't, i started with batch
20:24st3fanoh ok haha
20:24cdh473st3fan: i'm experimenting with the idea of teaching it as a first language, clojure, and so far it has been extremely successful
20:24st3fanyeah i can't see why that would not work
20:25st3fansee SICP
20:25cdh473indeed
20:25cdh473i would have taught scheme, were it more "relevant"
20:25cornotahtiScheme is probably better as a first language.
20:25hyPiRioncdh473: There was this guy who did it, he was on the channel for about 2 months ago I think.
20:26cornotahtiThe point about teaching people good languages as a first language is that even though they program well, they aren't like 'omfg, cheme is so elegant' when they first encounter it, they are like 'wtf, ava is fucking nonsenstical garbage' when they first encunter it
20:26hyPiRionI think he had the usual "startup" issues related to any programming language, but extrapolating anything useful out of one datapoint is always scary.
20:26cdh473cornotahti: i agree, yet i would like to at least experiment with it
20:27cornotahtiNothing wrong with experimenting on human beings that way, I'm teaching my barely speaking daughter higher maths to see if I can breed a maths super genius
20:27cdh473lol
20:27cdh473i hope that's sarcastic
20:27cornotahtiThey say you can breed a super genius just by exposing them to a specialized subject early on because brain will wire itself to accomodate that ubject then
20:27cornotahtiNo it's not.
20:27cornotahtiIT's been done before.
20:27cornotahtiTErrance Tao was such an experiment, as were the Pólgár sisters
20:28hyPiRionoh, there was this psychologist doing the same with chess to his sisters?
20:28cdh473wouldn't it end up damaging other cognitive development?
20:28hyPiRion*daughters
20:28supersymlol
20:28cornotahtihyPiRion: well, he wasn't a psychologist, he was a chess player
20:28st3fancornotahti: wat what age can i teach my daughter clojure you think? (she is 3 weeks now :)
20:28cornotahtiThey are basically the three best female chess players by a vast margin now. The youngest one in particular.
20:28supersymI plan to teach my gfs little neice
20:28cornotahtiI assume talking is on the first order of business.
20:29supersymI was thinking to slip in TuxMath :)
20:29st3fanhehe yeah
20:29hyPiRioncornotahti: ah
20:29cdh473maybe i should implant a C64 into the mother's womb
20:29cornotahtiThe theory is that human beings can accomplish such vastly complex feats like walking upright talking, recognizing faces purely because they were introduced to it at a young age.
20:29hyPiRionClose enough :)
20:29cornotahtiIf you look at it objectively, speaking a language surely is harder than advanced maths.
20:29amalloyst3fan: get her some parenthesis pillows today
20:29supersymno it isnt
20:30cdh473cornotahti: depending on how the brain develops, yes. yes it is.
20:30supersymkids see language not like we do
20:30cornotahtiTell that to AI programmers
20:30supersymto them, they are streams of words
20:30cdh473supersym: because they have been around it
20:30cdh473supersym: if they grow up around advanced math, they will accomodate that better
20:31cornotahtiIt's a lot harder to make a program that outputs coherent sentences of ENglish than a program that outputs coherent maths.
20:31cornotahtiThe grammatical rules for English are vastly more complicated
20:31supersymyea and the path has been paved... there is a reason to the order of subjects in math
20:31hyPiRioncornotahti: speaking a language is harder than advanced math?
20:31cornotahtiWell, the rules of any natural language are infinitely more complex.
20:31hyPiRioncornotahti: What is more likely, that a PhD in maths manage to do a masters in French or vice versa?
20:32cornotahtiThe only reason we can actually do it is because our brains were wired to it from an early age is the theory. Basically if a kid that is 9 year old is only accustomed to the concept of language then, they can't even develop a native language.
20:32supersymthe rules may be a bit more complex, but given a vocabulary of about 2500 words you can express any concept
20:32cornotahtiThey can master little more tan a chimp
20:32supersymand it becomes harder to distinguish if someone "masters" a language
20:33supersymthe thing is,...kids dont "think" about language too much
20:33cdh473supersym: a child can either develop the language portion of the brain during the critical period, or be without full development in that area forever.
20:33cornotahtisupersym: okay, say I give you this ultimatum, you will either write a program that checks if a formal mathematical proof is correct or not or if an English sentence is, and I will shoot you if there are false positives or negatives.
20:33supersymand both calculus and language are parts of the entire package in education... but say extra-curricular scholarship in the secrets of math is bound to help anyone
20:33cornotahtiWat would you choose?
20:34cornotahtiI'd go with the proof checker myelf, much easier.
20:34cornotahtiFor one, they already exist, language checkers not so much
20:34cdh473likewise, a child can develop natural math abilities early-on, or not.
20:34cdh473by the time the child gets into schooling, it's already too late
20:34cdh473most of that part of the brain is already formed if it's going to be
20:34supersymthats not the point :)
20:34cornotahtiYeah
20:34cornotahtiTHat _is_ the point
20:35cornotahtiThat kid's brains are wired towards language becaue they were accustomed to it from an early age.
20:35cornotahtiAnd if they don't, then they can't even learn a native language later.
20:35cornotahtiAfter a certain age, people lose the capacity to learn a language by imitation only.
20:35cdh473they can't even learn it the way a native english speaker learns spanish
20:35cdh473they don't have anything to relate the words to
20:36supersymbut its more or less done now and we can build on the work of others... but with math, you have to understand, like really understand the basics to get any further... while language is greatly a subconcious process I think... not many people think in mathematical terms
20:36cdh473err... not enough
20:36cornotahtiI mean, babies teach themselves to speak fluent English simply from watching it around them while they do't even have another language to compareit with, how sick is that
20:36supersymperhaps a few rainmen here and there
20:36cornotahtiNo one explains it to them
20:36supersymhttp://www.cruxbot.com/
20:36cdh473supersym: part of the problem with math is that the english language does not allow natural math discussion and thought
20:36cornotahtisupersym: you don't ave to understand it if you get taught at an early age is the theory.
20:37cornotahtiSame with the polgar sisters
20:37cdh473there are languages more accustomed to math discussion
20:37cornotahtiTHey all claim they play chess on an intuitive level, they don't really understand what they are doing either and have a hard time explaining what they are doing
20:37cdh473and you'll notice that the children there have greater capacity for learning math
20:37supersymcdh473: true i guess :)
20:37supersymi see
20:37cornotahtiThey don't actually consciously think about it because they acquired it from such an early age it becomes second nature, like chess, or addition of numbers.
20:38cornotahtiLike ehh, know the Pirahã tribe in South AMerica?
20:38cornotahtiWhich famously does not have a concept of numbers
20:38cornotahtiYou cannot teach the adults to even count to 4.
20:38cdh473i'd like to see someone do that with Go
20:38cornotahtiBut the kids, just fine
20:38cdh473as opposed to chess
20:39cdh473another interesting thing to do would be to teach math to children using finger binary
20:39cornotahtiYou know people have learnt something early enough when they can't explain why it is so, they just know it si.
20:39cornotahtiLike ask a 7 year old what 8+3 is, they will say 11, they cannot explain why though.
20:39amalloycan we move this to #babychessprodigies? if someone has a clojure question it will get lost in this stream
20:39cornotahtiThey certainly do not need to understand it, as in apply peano arithmetics, to arrive at 11.
20:40cornotahtiamalloy: if you give me a cuddle.
20:40cdh473lol, #babychessprodigies
20:42cdh473i should point out that i'm actually teaching the subject clojurescript rather than clojure, may be a difference there
20:43cdh473i just can't bear to see anyone have to use javascript ;)
20:43supersymclj, cljs all the same in that respect :P
20:44supersymcdh473: yeah I never liked it from aesthetical perspective, so I often just use coffee but implicit is often something you'd want to avoid
20:45supersymand thats the same problem with cljs for that matter: if other people have to work with it, it needs to be readable
20:45cdh473perhaps he will have an easier time then, coming from such a background
20:45supersymshame so few people eventually end up with lisp-like languages in that respect that it holds back the potential in community development
20:46supersymdefinitly
20:46cdh473i have a feeling haskell may catch up to clojure eventually, where clojure excels, but something about it feels off
20:47cdh473i have faith clojure will succeed more than previous lisps, due largely to the fact that it's so widely usable
20:47cdh473it is literally the java of lisps :P
20:50cdh473I saw a text editor for clojure a while back, but I can't remember the name of it. It reminded me a bit of sublime text, anyone know what it might have been?
20:53supersymdunno... I use LightTable
20:53supersymalmost exclusively now
20:53cdh473that looks like it. oooooh yes.
20:53cdh473thanks.
20:53supersym:)
20:54supersym<3 instarepl feedback + doc
20:54cdh473holy sweet jesus, this is fantastic
20:55supersymnow thats about what I think every time... that and "how could we have missed this"
20:55supersymtruth is, of course as often, things with emacs had already evolved in that direction
20:56supersymyou might want to take a peek at github.com/overtone/emacs-live
20:56supersymsame guy
20:56cdh473i just can't get myself to use emacs anymore
20:57supersymthere are 2 lighttables btw
20:57supersymplayground (on github) and that from the website
20:57ted_I am new to clojure. I am working with Korma and h2. When I insert a record a record, I get {:SCOPE_IDENTITY() 1} as the result. How do I get the number out of there?
20:57cdh473supersym: is it stable?
20:58supersymthey are really a bit different in the sense that, I believe, the lighttable-playground is to get structured feedback+metrics on
20:58supersymits pre-alpha but very workable already...stable yes
20:58supersymnever crashed with me but it runs on chrome
20:58supersymand that has been giving me problems with flash on linux lately...
20:59supersymfreeze etc.. but fixed now, its still as stable as chromium is
20:59supersymdynamically linked chromium packed with clojure(script), jquery and a few node.js modules
21:00supersymthen hook any java/lein project you want...the repl can connect to it
21:00tieTYTi'm sort of into testing
21:00cdh473supersym: what if i want to use CLR?
21:00tieTYTi know in ruby you don't really need DI frameworks because you can just open up a dependency and replace it's new() method. Can clojure do things like this?
21:01tieTYTlike i'm writing this program that uses an http client. I'd like to test it without actually hitting the web
21:01supersympeople have done it,..with .net
21:02supersymi believe one of the visualstudio core developers is a frequent visitor here and used it with CLR/.NET
21:02supersymnot sure who it was tho
21:02st3fani really like lighttable but i got frustrated by its limited functionality atm
21:02supersymor you ment LightTable itself, that is language agnostic
21:03supersymor supposed to become tho
21:03st3fanalso the instarepl turned out to be not that useful for more complex things
21:03cdh473does the repl let you call functions defined in your program?
21:03st3fanyes
21:03st3fanor change those functions
21:03cdh473sweet
21:04st3fanthe repl is one of the best things in clojure imo
21:04st3fanbut you might need some time to get used to that style of coding
21:05st3fans/style/way/
21:05cdh473i am
21:05st3fani'm trying to turn my app into a .war now, so that i can drop it in tomcat
21:08supersymtrue
21:08supersymlarge projects, I found visual studio to be a dream
21:08supersymmuch better than eclipse
21:09supersymbut it becomes a pain, all the options, when you want to focus
21:09supersym20 windows dont help
21:09cdh473yeah
21:09cdh473i'm a big C# guy myself
21:10cdh473originally coming from java, i found VS really nice
21:10supersymlike you have writer mode for text editors, I like the repl for 'larger' snippet works, but either it would become a full fledged IDE, or someone/thing else would fill that neice eventually... fact is that this kind of IDE are complex beasts
21:10supersymand it takes a $$$ company or tons of ppl to get it done
21:10supersymI bet
21:11cdh473which is why you focus on 1 language
21:11cdh473http://www.codinghorror.com/blog/2005/01/its-the-ide-dummy.html
21:11supersymand some plugins really make it even better where they left off, and I only worked with VS2010, 2012 is supposed to be even better
21:12cdh473it is.
21:13supersymgood topic there cdh473..thanks
21:13cdh473:3
21:14supersymi find it a bit dualistic in nature tho
21:14supersymi worked so hard to rid myself of windows, mouse, went to a tiling window manager (now xmonad)
21:15supersymonly to go back to x, y GUI
21:16supersymalthough the alternatives arent great either
21:17cdh473indeed
21:17supersymideally a code editor would distinguish between any programming language, and the (literate) text that goes with it
21:18supersymbut emacs/babel/org-mode I think has everything you'd need on that level...its the plugins/generators of a IDE that really add value to it
21:20supersymoften I found it to be a delicate balance between cleaness, readability and expressiveness e.g. you have to explicitly tell emacs babel what code is in the blocks, (implying it is near impossible and undesirable) but you can make it run anything that has an interpreter
21:22supersymthere is only so much you should want to cut away
21:23supersymbut back to the IDE though, I found also after seeing it all and ending up here, that a lot of stuff I did in the .NET environment, to be either added weight
21:23supersymor easily done with any basic UNIX tool since a lot of it were repeating patterns of stuff
21:24supersymimho...intellisense and VS like tools make for dumber programmers
21:24cdh473or people who can work without an internet connection :P
21:25cdh473(yes, it was a jest)
21:25supersym:)
21:26supersymregardless how you take it, everything has atleast a certain amount of learning curve
21:27supersymjust once you been through many programs and code often enough, you get better and faster at it..looking up information.
21:27supersymIt helps if you know how/where to look...
21:28supersymthen again I get why only a small amount of web programmers actually "get" the DOM
21:28supersymthose w3org documents are unreadable :P
21:29cdh473client-side web programmers don't even count :P
21:29cdh473most of the time, anyways
21:29supersyma good question is if you have to "get it"...you can work with it without understanding too much and html is friendly, forgiving of mistakes
21:30supersymhaha :)
21:30supersymyeah ur right
21:30st3fanwow travis-ci is awesome .. https://travis-ci.org/st3fan/clj-transit
21:30st3fantook 2 minutes to setup .. really cool
21:31hyPiRionst3fan: yeah, it's very Clojure friendly
21:31cdh473i feel like html is a terrible language now for the purpose it serves
21:31supersymanyway they are tradeoffs as well, the hypertext languages are designed like that for a reason too, not always, with enough common sense but also loose rules because the whole world will have to comply (or not if they dont feel like it) and then there is Microsoft/IE
21:31MikeSethanybody here who is a nrepl wizard? I am looking at bencode responses I get and I am not sure if I am missing something
21:31supersymgood thing they choose Java for clj
21:32cdh473supersym: i did an html/css replacement based on s-expressions
21:33supersym:)
21:34supersymI make my money atm as front-end development mostly...I just nearly perfected my code-cutting skills at it so Clojure like that is a next logical step
21:34cdh473that, and whitespace syntax (only as sugar, of course) and a few other features like hierarchical style sheets and advanced types for markup elements
21:34supersymyeah mixed feelings on significant whitespaces
21:35cdh473it's entirely optional
21:35MikeSethobligatory python joke
21:35supersymand thats really great
21:35supersymeverything is optional, so its up to the programmer to understand what to do when
21:35st3fanhyPiRion: do you know if it is possible to see nice test overviews in travis?
21:35cdh473the elements were represented as they are in the DOM
21:36supersymit involves some 'thinking' about it though and fact is, a lot more web developers feel comfortable with JS probably also because the web is literally crowded with examples to cut and paste
21:36cdh473for instance, instead of doing <p id="foo" class="bar"></p>
21:36cdh473you just did [p#foo.bar]
21:36cdh473oh, it has no closing tags either ;)
21:36supersymppl tend to be lazy or build on work of others which is a good thing.. but past it? I dont see a web without HTML/JS at the moment,
21:37supersym:P
21:37cdh473no, it compiles to html/css
21:37cdh473very cleanly, in fact
21:37supersymyeah
21:38supersymso thats to it then... and which is why cljs is such as well,...a stage where nearly everything and anything can (trans)compile to JS
21:38supersymand its good I guess, a tad too verbose for me but it works
21:39cdh473i thought the cool thing was how well the styling language was the same as the markup language; that was an accident that it came out so seamless
21:39supersym:)
21:39cdh473http://cdh473.com/vanguard/standard.php if you are interested
21:40supersymcool
21:40supersyminteresting
21:41cdh473(still not done with it due to school)
21:41supersymI've been thinking about these things as well lately
21:43hyPiRionst3fan: hmm, well, I think the interface is okay-ish, albeit a bit laggy at times
21:43hyPiRionYou could probably hit up the docs and check it out though
21:44cdh473http://snipt.org/zhfjf3
21:44ToBeReplacedwhat's the right way to compare two maps to see if they have the same keys? (= (set (keys m1)) (set (keys m2)))?
21:44cdh473that was a comparison between a snippet of vanguard and CSS
21:47hyPiRionToBeReplaced: keys perhaps?
21:48hyPiRion,(= (keys {:a 1 :b 2}) (keys {:a 3 :b 6}))
21:48clojurebottrue
21:48hyPiRionwaittt
21:48hyPiRion,(keys {:a 1 :b 2})
21:48clojurebot(:a :b)
21:49hyPiRionDo something like (-> {:a 1 :b 2} keys set) instead, and compare those
21:49hyPiRionoh wait
21:49hyPiRionI'll go to bed, ignore me.
21:50ToBeReplaced:) i was wondering if there was something more idiomatic or efficient... i have a sequence of maps, and i want to guarantee as i iterate through that they all have the same keys
21:51hyPiRionToBeReplaced: So you need to check that all have the same set of keys?
21:52hyPiRionYou could probably compare the map sizes first, that's constant time
21:52hyPiRion(the size lookup)
21:55tomoj(= (.keySet a) (.keySet b)) ?
21:55tomojlooks to be ~6x faster than (comp set keys)
21:56tomoj..on a big map
21:57hyPiRion(and (= (count a) (count b)) (every? #(contains? b %) (keys a))) should be fast too
21:58supersymcool
22:02supersymI need a bit of help too if only pointers
22:03cdh473on what?
22:03supersymI work on a board game we play here in the Netherlands called trictrac, its played on a backgammon board
22:03supersymtwo players working in oposite directions towards eachother
22:03supersym4x6 pigeonholes
22:05supersymsince its only two players with 15 game pieces each, and 6x4 slots, I figured I could use pos and neg integers where field is -5 to +5 because each player can have a max of 5 pieces on a slot/field
22:05supersymI was just wondering about the datatype to use for the playing field, a array or list
22:06supersymI have 2-dices (rand int) and with the outcome you can move the pieces forward and hit someone when they only have 1 piece inside a slot
22:07cdh473well if the playing field is a constant size, i'd use an array
22:08supersymok and 4x6 or 24 one-dimension?
22:08ToBeReplacedtomoj: hyperion: thanks
22:09tomojhyperion's answer is better
22:09supersymbecause there are rules like: you can only move to the second section of 6 slots once all pieces are in play, you can only move to the last section once every piece is out of the begin section
22:10cdh473what advantages do arrays give you?
22:10cdh473(asking you to self-evaluate)
22:10supersymI guess one is easier and just neglect any outside its range that is limited in dynamcs
22:10cdh473then, what advantages does a list give you?
22:10cdh473oops
22:10supersymgood question :P
22:10cdh473disregard that
22:11cdh473or not
22:11supersymI'm not sure :)
22:11cdh473i am too tired lol
22:11supersymwell same here and I could be overthinking tho
22:12supersymI geuss the board is its state to persist and it can be a sequence of integers in a element range -5 to 5 with 24 slots and take peek/pops
22:12supersymthat would be a lispy way I guess... yeah its mostly learning to think in the clojure/lisp way of doing things now
22:15supersymyeah same here being tired and I should know these things ... or refactor later.. premature optimization anyway
22:18cdh473indeed
22:19dnolensupersym: I would use a vector
22:21tylerin datomic im running a query and it throwing an error on IllegalStateException Attempting to call unbound fn: #'clojure.core/mapv
22:21tieTYT2i've read about the clojure concurrency support, but it didn't explain how the separate threads get started. Do I just start them myself with the Thread class?
22:21tylerits mapv a function in clojure.core?
22:21tyleror is it some how 'monkey patched', please excuse my ignorance
22:24dnolentieTYT: that's one way yes. you could also use an agent or a future too.
22:25tylerhrm now its throwing it when i try to start repl, maybe i got a bug somewhere
22:26tyleroh had that query run on require
22:26tylerso same error
22:26tieTYT2an agent would be for a slow task to do asynchronously that you don't care about, right?
22:28dnolentieTYT2: I think agents are really about uncoordinated changes.
22:31MikeSethis lein's cli repl a full implementation of nrepl client? can I e.g. switch repl sessions in it?
22:32MikeSethsupersym: this is more or less the problem I've been playing with and the answer is vectors
22:38supersymI knew it
22:38supersymshould have trusted my gut feeling
22:38supersymthanks :)
22:39ivanMikeSeth: yes, it uses reply which is an nREPL client
22:45tieTYT2http://stackoverflow.com/questions/15696574/does-clojure-need-dependency-injection-to-make-code-more-testable
22:46hyPiRiontieTYT2: with-redefs
22:47hyPiRionNot sure if I can do this in the clojurebot repl, but an attempt
22:47tieTYT2let me google that
22:49tieTYT2ha the examples there show my case
22:50tieTYT2thanks
22:51hyPiRion,(with-redefs [class (constantly :what)] (class {1 2 3 4}))
22:51clojurebot:what
22:53tieTYT2ha
22:57supersymcan struct keys be any data type?
22:58supersymit doesnt seem to like a range, Java heap exception after a while
22:58dnolensupersym: best to avoid structs, deprecated
22:58supersymgreat.. thanks
22:59supersymI guess a protocol would be a suitable replacement?
22:59dnolensupersym: maps work just as well, and the keys can be arbitrary
22:59supersymah ok
23:00amalloywell, (range) is still not a good key for a hashmap :P
23:00supersymtrue
23:00supersymit was a very naive writedown of something :P
23:09xumingmingva silly question: why *clojure-version* is declared as a dynamic binding? what's the purpose?
23:18tyleri have a datastructure that looks like (([foo] [foo] [foo])([foo] [foo])) how do i turn it into ([foo] [foo] [foo] [foo] [foo] [foo]) ?
23:18`arrdem,(doc concat)
23:18clojurebot"([] [x] [x y] [x y & zs]); Returns a lazy seq representing the concatenation of the elements in the supplied colls."
23:18tyler`arrdem: thnx
23:20tyler,(concat '(([] [] [])([] [])))
23:20clojurebot(([] [] []) ([] []))
23:20tyler...
23:21`arrdem,(apply concat '(([] [] [])([] [])))
23:21clojurebot([] [] [] [] [])
23:21tylerahh
23:21tylergood ol apply
23:21tylerthnx
23:24supersym,(+ (rand-int 6) 1)
23:24clojurebot5
23:24supersymwould that be proper use or mess up the (pseudo) 'randomization' :)
23:27supersymi dunno why i ask/look at these things... i never do that :S guess it seems a bit hacky but I couldn't think of another way to get random 1-6 values :P
23:28`arrdemhow is that hacky? that's obvious...
23:28`arrdemtake a distribution and shift it by a constant into your desired range
23:29supersymhaha ok... so thats just me still uncomfortable with prefix notation
23:29supersymyeah it seems valid :D
23:29`arrdemI mean I could be picky and demand that you use (inc) rather than (+ 1)..
23:30supersymright ;)
23:31`arrdem(def integer (conc (opt sign) integer)) yeah that'll work -_-
23:31supersymthat looks a lot cleaner anyway
23:32`arrdeminc? yeah usually does.
23:32tieTYT2what is rich hickey's stance on automated testing? I've gathered he doesn't like TDD, but I haven't heard him say anything else
23:32supersymyup.. see didnt know that function but should have guessed there would be one
23:33`arrdemyeah other lisps call it things like 1+...
23:33`arrdemdon't think it's +1 anywhere tho.
23:33supersymlol
23:33`arrdemclojurebot: +1 is ,(doc inc)
23:33clojurebotYou don't have to tell me twice.
23:34`arrdem~+1
23:34clojurebot+1 is ,(doc inc)
23:34`arrdemclose enough.
23:34supersym*grin*
23:35thm_proverIs there a variant of cons that owrks with with the maybe monad? i.e. I want somethign which takes a list of Maybe's, and drops the Nothings, and takes the value out of the Justs
23:36tieTYT2clojure has a maybe and a monad?
23:39dnolentieTYT: it does not
23:40thm_proverdnolen: https://github.com/clojure/algo.monads
23:40dnolenthm_prover: well, as a lib sure
23:40thm_proverdnolen: patched match yet? :-)
23:41dnolenthm_prover: nope, waiting for you to send me a fix ;)
23:41tieTYT2this is weird. Hard for me to see the advantage without static typing
23:41dnolentieTYT2: monads are a control abstraction, static types make them a bit easier to work w/
23:41thm_proverdnolen: unlikely, my copy of "The Book of Shen" just arrived today
23:42dnolenthm_prover: hehe, fun
23:42thm_proverI feel like if we could merge Rich Hickey's ability to create practical language with Mark Tarver's ability to create powerful languges, I'd be happy.
23:45thm_proverhttp://hpaste.org/84800 <-- I want to know how to write this piece of code as a domonad
23:45supersymok I should rarely use lists,...vectors are for random access, assoc-in is what I seeked. Getting the hang of it :)
23:51tylerI have something that looks like (["tyler" 23] ["tyler" 34] ["don" 64]["don" 82]) how to i translate to (["tyler" [23 34]] ["don" [64 82]])
23:52tylers/how to/how do/
23:52`arrdem,(doc group-by)
23:52clojurebot"([f coll]); Returns a map of the elements of coll keyed by the result of f on each element. The value at each key will be a vector of the corresponding elements, in the order they appeared in coll."
23:52tyler`arrdem: thanks
23:52supersym,(assoc [0 0 0 0 0 0] 0 0 1 0 1 0)
23:52clojurebot[0 0 0 0 0 ...]
23:53supersymwhy doesnt that work though
23:54metellussupersym: what do you expect from it?
23:54supersymthese are pidgeon hold/counters
23:54supersymvector [0 0 1 0 1 0]
23:55supersym*hole
23:55metellus,(doc assoc)
23:55clojurebot"([map key val] [map key val & kvs]); assoc[iate]. When applied to a map, returns a new map of the same (hashed/sorted) type, that contains the mapping of key(s) to val(s). When applied to a vector, returns a new vector that contains val at index. Note - index must be <= (count vector)."
23:55metellusit's treating 0 0 1 0 1 0 as pairs of index, new value
23:55metellusso it's putting 0 at index 0, then 0 at index 1, then 0 at index 1
23:56supersymahhh
23:56supersymi see
23:56metellus,(assoc [0 0 0 0 0 0] 3 1)
23:56clojurebot[0 0 0 1 0 ...]
23:56supersymi have them mixed up
23:57supersym,(assoc [0 0 0 0 0 0] 3 1 5 1)
23:57clojurebot[0 0 0 1 0 ...]
23:57supersymthanks
23:59tyler,(group-by first '(["tyler" 23] ["tyler" 34] ["don" 64]["don" 82]))
23:59clojurebot{"tyler" [["tyler" 23] ["tyler" 34]], "don" [["don" 64] ["don" 82]]}
23:59tylerheh
23:59technomancytyler: you could use merge-with too