2013-09-21
| 00:21 | xeqi | ztellman: is there a predicate that can be used with ridley to only catch function calls? |
| 00:21 | xeqi | might be getting into analyzer territory there |
| 00:24 | ztellman | seq? plus an exclusion of any special form symbol? |
| 00:25 | ztellman | which actually is done for you already |
| 00:25 | ztellman | xeqi: so basically just seq? |
| 00:28 | xeqi | it looks like the handler predicate is checked before the special forms, am I miss understanding the "done for you already" part? |
| 00:29 | xeqi | I was trying to write something to add tracing code to any function calls, finding I have to do some special casing for 'catch, 'finally, 'quote, etc |
| 00:30 | xeqi | host interop in the (. object (method arg1 arg2)) form |
| 00:57 | ztellman | xeqi: no, you're right, I'm only specially handling forms which require pieces to be skipped in order to avoid non-expr forms |
| 00:58 | ztellman | if you come up with a decent 'invocation?' predicate, I can add it to riddley proper |
| 01:14 | mercwithamouth | what in the world is 'defmulti'? ={ |
| 01:15 | egghead | mercwithamouth: polymorphic fns |
| 01:16 | egghead | mercwithamouth: http://clojure-doc.org/articles/language/polymorphism.html |
| 01:17 | mercwithamouth | egghead: thanks, taking a look |
| 01:19 | rishisadhir | Hey guys, Im learning clojure and had a quick question for you guys. I have a list of structs, of which some elements need to be updated. Since this list is immutable, what is 'clojure' way to do something like this? |
| 01:25 | jared314 | rishisadhir: use map and have the function return the updated version of the struct? |
| 01:28 | rishisadhir | Woah jared314, thank you very much. Still getting used to thinking functionally ^_^ |
| 01:35 | coventry | xeqi: This may be useful to you. It's precisely about figuring out which forms should be wrapped because they could return something. Not fully tested, yet. <https://gist.github.com/coventry/6647367>. I intended to redo it in terms of riddley (which I referred to a lot in writing it) when I got there. |
| 01:37 | coventry | Oh, and here are the tests I have so far https://gist.github.com/coventry/6647413 |
| 03:40 | mmarczyk | as of 0.0.3, avl.clj offers sorted maps faster than the built-ins |
| 03:40 | seangrov` | mmarczyk: Very curious about that - is there any rationale for keeping the built-in ones around? |
| 03:41 | mmarczyk | seangrov`: well, I've only just released avl.clj |
| 03:41 | mmarczyk | seangrov`: so there hasn't been that much time to think about making it a replacement for anything :-) |
| 03:41 | mmarczyk | seangrov`: I have however offered it for inclusion in Contrib, see clojure-dev |
| 03:42 | seangrov` | mmarczyk: Yeah, reading through it now |
| 03:42 | mmarczyk | actually I should have said "with faster lookups" rather than "faster", although given transient support it probably is simply "faster" for most typical use cases |
| 03:45 | mmarczyk | next step -- significantly more tests, I guess |
| 03:48 | lordQuas | Hey guys, something Im writing needs to read metadata of mp3 files. Do you all know how to read in bytes from a binary file a'la fread? |
| 03:50 | rishisadhir | I guess my question is, what is the idiomatic way to read x to y bytes of a file? |
| 03:52 | mercwithamouth | a pictures worth a thousand words...can someone tell me what i'm doing wrong here? http://d.pr/i/buzL |
| 03:53 | mercwithamouth | i'm trying to play with URLY...added to my dependencies...ran lein deps...it seems to have pulled it down as expected |
| 03:54 | callen | mercwithamouth: use refheap for sharing code, but you end instantations of classes with a dot. |
| 03:54 | callen | mercwithamouth: so instantiating java.net.URL would be (java.net.URL. "http://refheap.com/use/this/site/to/post/code/next/time/please") |
| 03:55 | mercwithamouth | ahh! |
| 03:56 | callen | mercwithamouth: do you have a book? if not, you might consider getting one. It'll save you from some of these forehead slappers :) |
| 03:56 | callen | mercwithamouth: I heartily recommend Emerick's http://clojurebook.com/ |
| 03:56 | mercwithamouth | callen: ok that works for java.net.URL what about clojurewerks...i'm following their instructions |
| 03:56 | mercwithamouth | yea i have the oreilly book...i'm just jumping ahead and doing some mild fooling around |
| 03:57 | callen | mercwithamouth: also if you find yourself just wanting to snag data from a Java class instance, use bean. Kinda map-ifies it. |
| 03:57 | mercwithamouth | bean? |
| 03:57 | callen | mercwithamouth: if you know a bit of Clojure, clojurewerkz libraries should be pretty easy to follow along with, so it sounds to me like you need to book-up |
| 03:57 | callen | yes, bean. |
| 03:58 | callen | ,(bean (java.lang.String. "you won't be able to read the UTF-16 bytes anyway")) |
| 03:58 | clojurebot | #<ExceptionInInitializerError java.lang.ExceptionInInitializerError> |
| 03:58 | callen | sigh...what? |
| 03:58 | callen | mercwithamouth: well it worked in my local repl. you get the idea. |
| 03:58 | mercwithamouth | callen: yeah |
| 03:59 | callen | {:empty false, :class java.lang.String, :bytes #<byte[] [B@7a3e72>} |
| 04:05 | mercwithamouth | so just going by their instructions this definitely should work... https://www.refheap.com/18864 |
| 04:06 | mercwithamouth | now more than likely it's not exactly as they wrote it down...so i'll have to go through a few more chapters before i can toy with this and any other libraries |
| 04:18 | s4muel | You need to use require, not import |
| 04:18 | s4muel | oh, hello scrollback |
| 04:18 | s4muel | derp |
| 04:20 | mercwithamouth | =P got it |
| 04:20 | mercwithamouth | (use 'elroy.core) |
| 04:20 | mercwithamouth | i was having an issue geting what i wanted through nrepl |
| 04:21 | mercwithamouth | and require...sorry |
| 04:21 | mercwithamouth | s4muel: yes you were right |
| 04:23 | callen | mercwithamouth: still think you need to get a book. |
| 04:24 | s4muel | all without so much as an obscure movie reference? |
| 04:24 | s4muel | pshh. |
| 04:40 | mercwithamouth | callen: i have one, working through it...i just like to step outside of the book from time to time and play and stump my toe on things |
| 04:40 | mercwithamouth | it helps to make things stick |
| 04:40 | callen | mercwithamouth: fair enough :) |
| 04:40 | callen | I'm the same way, if I'm honest. I just like to make certain people at least have the right resources available to them. |
| 04:41 | mercwithamouth | lol no prob, i'm just tinkering |
| 04:42 | mercwithamouth | now....alembic may hvae broken everything....lets go with pomegranate |
| 04:46 | s4muel | alembic uses pomegranate, heh. but there is also some extra magic there |
| 04:54 | mercwithamouth | s4muel: damn...well then. i suppose i'll see what I personally broke first =P |
| 04:56 | s4muel | mercwithamouth: you wouldn't know it unless you looked at the source. i got curious and lo and behold it does some magic with classlojure where it requires pomegranate. |
| 04:58 | mercwithamouth | s4muel: i see... |
| 04:58 | mercwithamouth | i added it and now i can no longer require my core namespace |
| 04:58 | mercwithamouth | newb issues |
| 05:02 | mercwithamouth | ok good to go now |
| 05:17 | t_hash | Hi there |
| 05:17 | t_hash | I'm trying to translate this Java code into Clojure |
| 05:17 | t_hash | https://gist.github.com/memerelics/6648612 |
| 05:17 | t_hash | anybody knows how to write instance initializer in anonymous class? |
| 05:48 | amalloy | i can't really think of many good reasons to use an instance initializer in java, and in clojure i don't think there's anything you couldn't implement with doto |
| 06:08 | sm0ke | How do i remove a prefix from string? |
| 06:14 | Guest75510 | The refrence implementation of clojure will always be JVM, Right? |
| 06:14 | scottj | Guest75510: we can't tell the future |
| 06:15 | Guest75510 | Right. But most likely? |
| 06:16 | sm0ke | ,(clojure.string/replace "jvm" #"^j" "k"); |
| 06:16 | clojurebot | "kvm" |
| 06:26 | s4muel | ,(apply str (rest "somestr")) |
| 06:26 | clojurebot | "omestr" |
| 06:37 | sm0ke | ,(clojure.string/replace "jvmeter" #"^jvm ""k") ;?? (rest (rest (rest ?? |
| 06:37 | lazybot | sm0ke: Uh, no. Why would you even ask? |
| 06:37 | clojurebot | "jvmeter" |
| 06:38 | sm0ke | ,(clojure.string/replace "jvmeter" #"^jvm" "k") ; :) |
| 06:38 | clojurebot | "keter" |
| 06:39 | sm0ke | ,(drop 3 "jvmeter") |
| 06:39 | clojurebot | (\e \t \e \r) |
| 06:39 | sm0ke | weird |
| 06:44 | TEttinger | sm0ke: ##(apply str (drop 3 "jvmeter")) |
| 06:44 | lazybot | ⇒ "eter" |
| 06:45 | hyPiRion | also commonly known as ##(.substring "jvmeter" 3) on the jvm |
| 06:45 | lazybot | ⇒ "eter" |
| 06:46 | s4muel | TIL... |
| 06:47 | sm0ke | i dont understand how clojure swaps code into runtime so seamlessly?? i am doing some web stuff in compojure and all i have to do is cpp in fireplace and changes are reflected on browser? |
| 06:49 | sm0ke | that is just most wasome thing yet i found in clojure |
| 06:49 | sm0ke | awsome* |
| 06:49 | TEttinger | sm0ke, it's kinda the direction a lot of languages are taking. C# will soon make the compiler available at runtime too, clojure (and lisp) just had it first |
| 06:50 | TEttinger | clojure will probably have it be more seamless though |
| 06:50 | TEttinger | (than C#) |
| 06:50 | sm0ke | i dont know..i was working with scala before this..whcih is fairly modern..but didnt have hot swap so seamless |
| 06:50 | sm0ke | i dont know if it had at all |
| 06:51 | TEttinger | the power of lisp? :D |
| 06:51 | sm0ke | and what did you say? compiler available at runtime? wtf is that? |
| 06:51 | TEttinger | ,(doc compile) |
| 06:51 | clojurebot | "([lib]); Compiles the namespace named by the symbol lib into a set of classfiles. The source for the lib must be in a proper classpath-relative directory. The output files will go into the directory specified by *compile-path*, and that directory too must be in the classpath." |
| 06:51 | TEttinger | that's available to clojure at runtime |
| 06:51 | TEttinger | and in the REPL |
| 06:52 | sm0ke | haha i know..i used it on my gen class code..oh i see |
| 06:52 | TEttinger | C# is only now getting close to getting the same kind of feature |
| 06:53 | TEttinger | java may at some point, who knows really. they still don't have first-class functions, waiting on java 8 |
| 06:54 | sm0ke | nice what are the other mind blowing things in clojure? |
| 06:54 | TEttinger | sets are kinda mindblowing when you start using them in novel ways |
| 06:55 | sm0ke | sets? ## #{1 2 2 3} ;? |
| 06:55 | sm0ke | whats mindblowing about sets? |
| 06:55 | hyPiRion | I feel it's more mindblowing that sets aren't the basic data structure we first learn about |
| 06:55 | hyPiRion | It's the simplest one. |
| 06:56 | TEttinger | not unique though. leiningen has a lot of good productivity boosts, I still need to learn macros but there's a lot of power in there... oh, and all the stuff like juxt |
| 06:56 | TEttinger | juxt you need to have your mind blown to use, then it blows everyone's minds when they try to read it |
| 06:57 | hyPiRion | I wish there was an opposite juxt, named aside or something. |
| 06:57 | TEttinger | what would that do? |
| 06:58 | hyPiRion | (map (aside - str) (range 1 10) (range)) -> ([-1 "0"] [-2 "1"] ...) |
| 06:58 | hyPiRion | I just feel I'm commonly iterating over multiple values with map, where the actions are completely unrelated to each other |
| 06:58 | hyPiRion | *update functions |
| 06:59 | hyPiRion | (defn map-keys [f m] (into {} (map (aside f identity) m))) |
| 06:59 | hyPiRion | (defn map-vals [f m] (into {} (map (aside identity f) m))) |
| 07:00 | hyPiRion | etc |
| 07:01 | mmarczyk | (defn map-vals [f m] (reduce-kv #(assoc %1 %2 (f %3)) {} m)) (possibly use transients for more speed, but this should already be faster) |
| 07:02 | mmarczyk | not really a comment on the utility of aside, of course |
| 07:02 | hyPiRion | yeah, sure thing |
| 07:02 | TEttinger | ##(let [aside (fn [& args] (fn [& inner-args] (map #(%1 %2) args inner-args)))] (map (aside - str) (range 1 10) (range)) ) |
| 07:02 | lazybot | ⇒ ((-1 "0") (-2 "1") (-3 "2") (-4 "3") (-5 "4") (-6 "5") (-7 "6") (-8 "7") (-9 "8")) |
| 07:03 | hyPiRion | Also wished that some, every?, not-any? and friends were implemented with reduce and reduced, not with recur |
| 07:03 | TEttinger | hyPiRion, does that do what you want? |
| 07:03 | hyPiRion | TEttinger: yeah, I just wished it was in core :p It's probably not as useful as I'd like to believe though |
| 07:04 | TEttinger | it seems useful |
| 07:04 | mmarczyk | hyPiRion: I guess that's a possible future development; reduce is gaining in importance all the time |
| 07:05 | mmarczyk | and short-circuiting itself is a fairly recent development |
| 07:05 | hyPiRion | yeah |
| 07:15 | sm0ke | guys anyone using fireplace? |
| 07:16 | sm0ke | how do i see stdout ? |
| 07:16 | sm0ke | have started a repl before starting fireplace..but repl gets no logs.. |
| 07:18 | TEttinger | sm0ke, maybe binding? |
| 07:19 | TEttinger | http://clojuredocs.org/clojure_core/clojure.main/with-bindings |
| 07:20 | TEttinger | wait http://clojuredocs.org/clojure_core/clojure.core/with-bindings why are there two |
| 07:20 | borkdude | I tried Gitx as a replacement visual tool for the Github app, but it has these refresh issues, I guess nothing compares with magit and I just have to learn it |
| 08:02 | noncom | hi! how can I use the "multiple projects" leiningen feature on windows? it is said that the "checkouts" folder should be symlinked to other projects, I assume that is Linux, but what is that for Windows? |
| 08:08 | mmarczyk | noncom: you could try and see if directory junctions are still supported |
| 08:10 | borkdude | or use cygwin? |
| 08:18 | borkdude | I like magit, why didn't I check it out before :-) |
| 08:24 | sm0ke | TEttinger: i dont get it? what is binding? |
| 08:33 | TEttinger | sm0ke, sorry, it could maybe be useful in binding *out* (not sure if that's the right name, it's what println prints to) to stdout. I'm not sure how to work it myself |
| 08:35 | noncom | oh, reading wikipedia, there is mklink command line utility that is created for windows-posix compatibility |
| 08:36 | borkdude | noncom switching to a different OS eventually makes life a lot easier ;) |
| 08:37 | seangrov` | This damned pedestal thing sounds really interesting |
| 08:57 | borkdude | no, why… https://github.com/overtone/emacs-live/blob/master/packs/dev/bindings-pack/config/default-bindings.el#L152 |
| 08:59 | borkdude | I wondered, is it possible to see things you copy outside emacs in the kill-ring? |
| 09:02 | mschuene | borkdude: Do you just want to paste it |
| 09:02 | borkdude | mschuene maybe, I want to browse the kill ring first, then think about pasting it or not |
| 09:03 | mschuene | borkdude: I am not sure, but as workaround copy it inside emacs and then kill it to get in in the kill ring |
| 09:04 | borkdude | mschuene I have Alfred which can show the clipboard history, but I wondered if I could just have the same option in emacs |
| 09:13 | noonian | I've created a leiningen plugin and published to my private s3 bucket with s3-wagon-private. I have the repo in my user profile, but when I try to use it with lein new my-plugin name it can't find the template (always looking for release also). How can I tell leiningen to look in my repositories for templates? |
| 09:43 | supersym | is there a non macro way of doing with-out-str? I'd like to use it in comp |
| 09:44 | supersym | I should really just check the source ... >< |
| 09:44 | supersym | got it :P |
| 11:28 | borkdude | what is a good colortheme in emacs that highlights a difference between a docstring and any other string? |
| 11:38 | `cbp | never seen anyone that does it |
| 11:39 | `cbp | oh god english |
| 11:57 | mklappstuhl | CompilerException java.lang.RuntimeException: Unable to resolve symbol: in this context,... |
| 11:58 | mklappstuhl | running into this... but the symbol name is missing - how do I cleverly debug this |
| 11:59 | llasram` | mklappstuhl: no stack trace? |
| 12:00 | mklappstuhl | llasram`: uh, no.. just "in this context, compiling:(NO_SOURCE_PATH:1)" |
| 12:01 | llasram | hmm |
| 12:01 | llasram | mklappstuhl: Is this a result of something you're doing at the REPL, or when compiling a namespace? If the latter, can you progressively delete code to trace down the problem? |
| 12:02 | mklappstuhl | It's a problem when executing stuff from the repl |
| 12:02 | llasram | For another tack, are you writing a macro? This looks like the kind of error you might get by accidentally generating the symbol for the empty string |
| 12:02 | mklappstuhl | llasram: I'm not writing a macro |
| 12:03 | AimHere | What are you doing that's generating this error? |
| 12:04 | mklappstuhl | AimHere, llasram: https://github.com/mklappstuhl/goldman.clj/blob/master/src/mklappstuhl/stock_utils/data.clja |
| 12:04 | mklappstuhl | https://github.com/mklappstuhl/goldman.clj/blob/master/src/mklappstuhl/stock_utils/data.clj |
| 12:05 | llasram | mklappstuhl: So what do you then run at the REPL which produces the error? |
| 12:11 | AimHere | If the yfinance library being loaded is the one from ghoseb on github, it seems to be using clojure.contrib - might this be a symptom of a version mismatch? |
| 12:12 | mklappstuhl | llasram: hm, I don't really know why it's working now but suddenly it does |
| 12:12 | mklappstuhl | I'm having some vim + relading code on the repl workflow ... maybe I did something wrong reloading the code or whatever |
| 12:13 | mklappstuhl | did anyone come accross some good vim + clojure workflow ? |
| 12:13 | llasram | mklappstuhl: the vim people I know use fireplace |
| 12:15 | mklappstuhl | llasram: oh, wow, didn't know about it - always thought vimClojure is The Thing(TM) but was never able to really get it to work |
| 12:16 | llasram | It can be hard to keep up sometimes. If I didn't at least idle in this channel most of the time, I don't think I'd know half of the stuff going on in the community :-) |
| 12:18 | hashcat | why did I get "REPL server launch timed out." when I enter "lein repl" |
| 12:19 | hashcat | should I grant my permission? |
| 12:19 | llasram | hashcat: If you're running some kind of host firewall, `lein repl` does work by launching a (localhost) TCP nREPL server |
| 12:21 | hashcat | llasram: How to launch it? |
| 12:21 | `cbp | if nothing works use lein clean, that's how i roll |
| 12:21 | llasram | `cbp: boo |
| 12:22 | llasram | hashcat: I meant, when you run `lein repl`, that's how the command works -- it starts an nREPL server in the background and then attaches to it |
| 12:22 | clojurebot | It's greek to me. |
| 12:23 | hashcat | llasram: do you know what port do it use? |
| 12:24 | llasram | hashcat: It picks random high ports until one works |
| 12:24 | llasram | hashcat: By default. You can specify the port on the command-line |
| 12:25 | llasram | Check `lein help repl` to the options in your version of lein |
| 12:36 | hashcat | Hi Leiningen, my hair is already on fire |
| 12:38 | hashcat | llasram: Is lein's client connect to 127.0.0.1? |
| 12:39 | borkdude | lol |
| 12:39 | hashcat | I didn't block any connection from 127.0.0.1 |
| 12:39 | ddellacosta | so confused by hashcat |
| 12:42 | llasram | hashcat: What version of Leiningen are you running? For a while it would try to bind to the wildcard address, which your firewall might prevent |
| 12:43 | hashcat | Leiningen 2.3.2 on Java 1.7.0_60 OpenJDK 64-Bit Server VM |
| 12:44 | llasram | hashcat: Ok. What happens if you just run: lein repl :headless |
| 12:45 | hashcat | It hang. waiting for response |
| 12:46 | ddellacosta | huh, really weird…never seen that behavior w/lein before. |
| 12:46 | llasram | hashcat: It should say something like `nREPL server started on port <port>` |
| 12:46 | llasram | hashcat: Does it, or just nothing? |
| 12:46 | ddellacosta | hashcat: does it dump out anything whatsoever, or just sit there? |
| 12:47 | hashcat | llasram: It's still running without any message |
| 12:47 | llasram | hmm |
| 12:47 | ddellacosta | hashcat: whatever it prints out before it starts hanging, it would be useful if you could put it in a gist/refheap/etc. for us to look at…if there is anything at all |
| 12:47 | hashcat | I get "nREPL server started on port 60356 on host 127.0.0.1" now |
| 12:47 | llasram | hashcat: That really sounds like a host-based firewall is preventing it form opening a listening port |
| 12:47 | llasram | Hey! |
| 12:47 | llasram | Cool |
| 12:48 | llasram | So now from another terminal, run: lein repl :connect 60356 |
| 12:48 | ddellacosta | alrighty then, no problems. :-) |
| 12:48 | hashcat | yea, It works |
| 12:49 | hashcat | but why can't I just simply "lein repl"? |
| 12:49 | llasram | I don't know for certain, but it seems like your nREPL server might be taking so long to start that the process times out |
| 12:52 | hashcat | I try "lein repl" again |
| 12:52 | hashcat | work fine now =.= |
| 12:52 | hashcat | It's really weird |
| 12:52 | llasram | New hypothesis -- you had a ton of deps to download to your local repository |
| 12:53 | hashcat | I didn't change any configuration |
| 12:53 | llasram | Well |
| 12:53 | llasram | No hypothesis then :- |
| 12:53 | llasram | :-) |
| 12:54 | hashcat | whatever,it works fine now. thanks for help |
| 12:55 | borkdude | lein repl isn't a pure function ;) |
| 12:56 | hashcat | sometimes failed, sometimes success |
| 12:57 | hashcat | I start playing now |
| 13:06 | samflores | /Users/samflores/Downloads/mame0150-64bit/mame64 ; exit; |
| 13:15 | mklappstuhl | llasram: thanks for the tip with fireplace - its magig. |
| 13:15 | mklappstuhl | magic :P |
| 13:15 | llasram | Glad to be helpful! |
| 13:16 | borkdude | fireplace is the vim nrepl thing? |
| 13:25 | soiitaire | hey , I get a exception when I try to start the repl. |
| 13:26 | soiitaire | Exception in thread "main" java.lang.RuntimeException: No such var: json/Write-JSON, compiling:(clojurewerkz/support/json.clj:19:1) |
| 13:26 | soiitaire | anybody can help me ? |
| 13:26 | AimHere | If you're nrepl-jacking-in, nrepl does have to be able to make sense of the files in the project |
| 13:27 | soiitaire | what's that mean? I use the lein repl, but the same exception in nrepl. |
| 13:28 | llasram | soiitaire: Is this your project or some existing other project? |
| 13:29 | soiitaire | my project |
| 13:29 | soiitaire | http://paste.kde.org/p16d6f6d3/ |
| 13:30 | llasram | soiitaire: Ok. So you've got whatever problem is causing the error, but you're getting the error while launching the REPL because it's AOT compiling your code first |
| 13:30 | soiitaire | yes |
| 13:30 | llasram | You generally don't want AOT, at least not for. I'm guessing it's happening here because you specify a :main in your project.clj |
| 13:31 | soiitaire | here is my project.clj |
| 13:31 | soiitaire | http://paste.kde.org/p86346e4f/ |
| 13:32 | llasram | Ok. So drop the `:aot` line and add ^:skip-aot between `:main` and `fittestite.main` |
| 13:33 | llasram | Oh, and do a `lein clean` to delete any residual AOT class files |
| 13:33 | llasram | That should let you launch your REPL without exceptions |
| 13:33 | soiitaire | you mean ` :main :skip-aot fittesite.main` |
| 13:33 | llasram | You'll probably still get the error when you actually do try to compile the namespace |
| 13:34 | soiitaire | you mean ` :main ^:skip-aot fittesite.main` |
| 13:34 | soiitaire | sure |
| 13:34 | llasram | Yes (assuming you're using the `` just for quoting, not as being in your file) |
| 13:34 | llasram | Anyway, but at least w/ the REPL up, you can debug :-) |
| 13:35 | soiitaire | sure |
| 13:36 | soiitaire | llasram: thanks. repl is running correctly. |
| 13:38 | soiitaire | I just write some IO staff in the main.clj, so i add aot in project.clj |
| 13:51 | BlankVerse | I am using nrepl to connect to a repl server on android (remotely running on android)..when I copy a function and execute it in the nrepl , it works , |
| 13:51 | BlankVerse | whereas when I send the code to repl , by using C-c C-r, it fails |
| 13:51 | BlankVerse | clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: defactivity in this context, compiling:(NO_SOURCE_PATH:1:1) |
| 14:06 | mdeboard | For ClojureScript, is it pretty standard to just have a cljs profile for new projects? |
| 14:07 | mdeboard | What I'm really asking is, I would really like to know how to make a cljs project template for lein |
| 14:07 | mdeboard | can anyone point me to resources on how to do this |
| 14:32 | seangrov` | Where is this aurora that ibdknox showed people at strange loop? |
| 14:33 | seangrov` | I'm very interested in it, but haven't seen it anywhere |
| 14:34 | Jarda | Hi, a newbie question.. (defn- ..) is for defining functions that are only visible inside the namespace? |
| 14:34 | gfredericks | Jarda: yep |
| 14:34 | Jarda | If so, is there a similar way of defining variables that are only visible inside the namespace? |
| 14:34 | gfredericks | it's sugar for (defn ^:private ...), which tends to work on more general def-like things |
| 14:34 | Jarda | (def- ..) didn't work out-of-box |
| 14:34 | gfredericks | ^ looks like I anticipated your question :) |
| 14:35 | Jarda | so (def ^:private my-variable ...) should work for me? |
| 14:35 | gfredericks | yep |
| 14:35 | Jarda | thanks |
| 14:35 | gfredericks | np |
| 14:36 | Jarda | if I'm defining a lot of (private) variables, is that a sign of code smell? |
| 14:36 | Jarda | I'm having a hard time shaking all these years with C-derived languages off my shoulders.. |
| 14:36 | seangrov` | Jarda: Depends on what they're for |
| 14:37 | seangrov` | It certainly isn't very common though |
| 14:38 | Jarda | this module(?) I'm writing does a lot of Java interop so I'm having stuff like http://pastie.org/8344535 in my namespace |
| 14:40 | Jarda | I'm just trying to split my huge functions to smaller ones using a lot of defs |
| 14:40 | Jarda | the functions get a bit verbose because of the Java interop calls.. |
| 14:41 | mdeboard | Jarda: Was that paste an example of verbosity? It's about as terse as it gets? |
| 14:41 | Jarda | mdeboard: no that was something extracted from a bigger function |
| 14:41 | seangrov` | Looks like you're building a facade around the Java stuff? |
| 14:41 | seangrov` | Also, https://www.refheap.com/18871 |
| 14:42 | seangrov` | And even that might be a bit much |
| 14:42 | mdeboard | Jarda: When there's a lot of Java interop and the Java you're using is using mutable data structures, things get kind of gross-looking in terms of Clojure style |
| 14:42 | mdeboard | IME, anyway |
| 14:42 | Jarda | yes I see |
| 14:42 | seangrov` | Jarda mdeboard: Yeah, sadly, a lot of nice stylistic things go out the window with Java interop |
| 14:42 | seangrov` | But this kind of function looks fine |
| 14:43 | Jarda | this project I'm building uses stuff that is sadly best supported in Java |
| 14:43 | seangrov` | It looks like a nice facade around the Java api's that can be composed nicely from Clojure |
| 14:43 | Jarda | and I didn't feel like writing Java |
| 14:43 | jonasen | ambroseb_: is jvm.tools.analyzer able to analyze the clojure.core namespace now? |
| 14:43 | Jarda | so I chose to learn Clojure :) |
| 14:44 | mdeboard | Jarda: Here's me trying to wrap a PDF-processing library in Clojure https://gist.github.com/mattdeboard/79bad31d2769e9f44639 |
| 14:44 | ambroseb_ | jonasen: no, I think the limitation is definline |
| 14:44 | seangrov` | ambroseb_: You're a prolific gentleman sir. Are you in Paris? |
| 14:44 | Jarda | seangrov` mdeboard thanks, then I'll just continue my travel through the wonders of Clojure. Reading Clojure Programming along the way |
| 14:44 | jonasen | ambroseb_: ok |
| 14:45 | seangrov` | mdeboard: Looks like you could use doto in that case as well... |
| 14:45 | ambroseb_ | jonasen: there's an issue where definline hard codes a fn name, so there's some issue with recompiling it. |
| 14:45 | ambroseb_ | jonasen: I don't really know exactly. |
| 14:45 | Jarda | seangrov`: thanks for doto. I'll read up |
| 14:45 | ambroseb_ | seangrov`: I'm not in paris, in Australia :) |
| 14:46 | seangrov` | ambroseb_: Ah, ok, I felt like I missed a chance to meet while I was in Paris, but that makes me feel better :) |
| 14:46 | ambroseb_ | seangrov`: :) |
| 14:46 | Jarda | yes, doto is definitely something I'll find useful. Thanks seangrov` :) |
| 14:46 | mdeboard | seangrov`: Yeah, but `let` to me kind of breaks up the function a little more for me. Like, makes it easier to process because I basically just treat the let block as a black box? It's dumb but it makes reasoning about such things a little easier. Of course that's probably just my institutionalized-by-imperative-languages brain. |
| 14:52 | Jarda | regarding module APIs.. is it allright to have say 'fetch_account' where the caller would give account type as a keyword? Like fetch_account(:github, "username") ? |
| 14:53 | Jarda | no, I mean (foo/fetch_account :github "username") |
| 14:53 | Jarda | the C is strong in me |
| 14:54 | Jarda | if I read the documentation correctly keywords don't belong specifically to any namespace so I should be able to check for the keyword type in my implementation of 'fetch-account' |
| 15:02 | seangrov` | Jarda: Yeah, definitely |
| 15:03 | seangrov` | In fact, that's where multimethods will come in and make your system extensible from the outside later ;) |
| 15:03 | Jarda | reading about multimethods now :) |
| 15:03 | seangrov` | Jarda: Probably best to ignore it for now, it'll make more sense later. Just keep down the road you were headed, it was right |
| 15:04 | Jarda | cool, thanks :) |
| 15:14 | vmarcinko | hello, just a general question - has it ever been mentioned by Rich or other influential developers of clojure.core that storing function source as var metadata would be itnroduced in some future versions of clojrue maybe? |
| 15:15 | seangrov` | I'm using a service where I have to generate a token locally to interact with it. The token expires every 24 hours. I have an atom that holds the token - I'd like to update it every 12 hours in my process. Any thoughts on how to do this? |
| 15:17 | robertfw | got an extremely noob question - i've got the following code in emacs: http://pastebin.com/wQAc2Vae - i realized i put the final line outside of main and want to move it inside. when i try to delete the last paren on line 7, the cursor just goes straight through it...how am i supposed to edit it? |
| 15:17 | seangrov` | vmarcinko: There's been discussion around it, yes |
| 15:19 | seangrov` | vmarcinko: In the meantime: http://clojuredocs.org/clojure_core/clojure.repl/source |
| 15:19 | vmarcinko | seangrov`: thanx, i know about it; more itnerested in how to fetch source from only-REPL defined fns |
| 15:20 | seangrov` | Yeah, I agree it would be cool. I remember there were some hangups somewhere, and that something would allow for it |
| 15:20 | seangrov` | Sadly, that's clearly not a compelling answer :) |
| 15:20 | vmarcinko | and strangely, i cannot find anywhere some todo list for future version of clojure - say 1.6 ? |
| 15:20 | seangrov` | Can't find the post/email that mentioned it |
| 15:21 | seangrov` | robertfw: Do you have paredit mode on? |
| 15:21 | Jarda | http://adambard.com/blog/acceptable-error-handling-in-clojure/ |
| 15:21 | robertfw | seangrov`: yes |
| 15:21 | Jarda | is this a good way of handling "error control flows" |
| 15:22 | Jarda | where one would in Java or like do "throw new ArgumentException("Value of 'foo' is invalid"); ? |
| 15:22 | seangrov` | robertfw: Are you new to emacs/lisp/clojure in general? If so, might want to hold off on paredit. If not, definitely time to learn it :) |
| 15:22 | Jarda | so should I do it like in the blog I pasted |
| 15:23 | robertfw | seangrov`: complete newb to emacs, i've tinkered a bit in clojure...enough to understand syntax and the general approach to things |
| 15:24 | seangrov` | robertfw: Yeah, hold off on paredit for now, learn emacs first |
| 15:24 | robertfw | seangrov`: sounds like a plan! buried in docs right now heh |
| 15:24 | robertfw | thx :) |
| 15:24 | seangrov` | Paredit is really amazing and useful, but it can be frustrating until you "get it". Trying to do that and learn emacs at the same time is going to make it a nightmare |
| 15:24 | seangrov` | No problem! |
| 15:25 | seangrov` | Jarda: I'd use pre/post conditions probably |
| 15:25 | seangrov` | It really depends on the function though... if there are no side effects, I wouldn't throw (generally, outside of pre/post conditions) |
| 15:26 | seangrov` | If you're doing some expensive/dangerous side-effect, I might through |
| 15:28 | mocker | Picked up 'Clojure Programming' on a whim, wish me luck! :P |
| 15:29 | seangrov` | g'luck |
| 15:35 | noncom | seangrov`: did you have any luck on finding info on aurora by ibdknox? |
| 15:36 | seangrov` | noncom: None yet, no. I suppose it'll come out when it comes out. Or ibdknox could be a dear and share it with us. |
| 15:37 | noncom | yeah.. |
| 15:38 | noncom | have you been at strangeloop? |
| 15:38 | noncom | and saw it? |
| 15:46 | Jarda | seangrov`: thanks, preconditions are absolutely suitable for this, thanks! |
| 15:59 | Bracki | How do I implement a Java interface with a void method that mutates a passed in variable? |
| 16:00 | Bracki | e.g. https://code.google.com/p/jsendnsca/source/browse/trunk/jsendnsca/src/main/java/com/googlecode/jsendnsca/encryption/XorEncryptor.java |
| 16:10 | Bracki | Or to reframe it, an interface with a void method and side effects. |
| 16:10 | Bracki | Any hint is appreciated... |
| 16:14 | gfredericks | Bracki: those are two orthogonal questions |
| 16:14 | gfredericks | you can implement an interface named via deftype, or unnamed via proxy |
| 16:14 | gfredericks | mutation on arrays can be done with aset |
| 16:15 | gfredericks | I don't know if special handling is required for the void |
| 16:37 | gfredericks | Bracki: s/proxy/reify |
| 16:47 | Bracki | thanks gfredericks. |
| 16:49 | mdeboard | Is there an idiomatic way of reading a file in clojurescript? I realize that sounds silly, but it's a json file. |
| 16:50 | gfredericks | mdeboard: like on node? |
| 16:51 | mdeboard | gfredericks: No, but I think I found my answer. Im' just working on a little toy project thing, an html game to mess with clojurescript. There's no server component, the browser is the platform. So I guess I need to use Chrome's fs api |
| 16:54 | timgluz | Hi, i need help from native english speaker. I just added additional documentation for Monger library, but i need someone to check grammar for my changes: https://github.com/clojurewerkz/monger.docs/pull/7 |
| 16:56 | lunk | good afternoon |
| 16:57 | lunk | how do I convert a Set<Type> from java collections to a #{} set in clojure? |
| 16:57 | timgluz | thanks, @gfredericks |
| 16:58 | gfredericks | lunk: can you pass it to the set function? |
| 16:59 | lunk | gfredericks: well it's odd, i have a proxy object for a java interface with the method 'public void execute(String g, Set<Type> set)' |
| 17:00 | lunk | ooo, maybe i can convert in the proxy vs in the body |
| 17:00 | lunk | Duck debugging at it's best |
| 17:01 | bruceadams | lunk: what kind of conversion do you need? the clojure repl prints a java HashSet as #{1 2 3} |
| 17:01 | bruceadams | ,(java.util.HashSet. [1 2 3]) |
| 17:01 | clojurebot | #{1 2 3} |
| 17:01 | lunk | let me make a paste, too convluted |
| 17:01 | lunk | one second |
| 17:02 | gfredericks | timgluz: done |
| 17:03 | timgluz | thanks @gfredericks, currently fixing it and going to refresh my grammar |
| 17:04 | gfredericks | timgluz: it was pretty much all articles :) |
| 17:04 | gfredericks | I was going to suggest you just put articles everywhere and might be correct more often, but then I tried it myself and it seemed terrible. |
| 17:05 | timgluz | :D |
| 17:05 | lunk | http://pastebin.com/aSrz2Qch |
| 17:05 | gfredericks | the english: it is worst. |
| 17:05 | lunk | yea, way too much to explain |
| 17:06 | lunk | basically, if i put the class of the two inputs into a vector, i get [String TreeSet] |
| 17:06 | lunk | but if i try to iterate over the treeset, I don't get any values |
| 17:07 | lunk | so i guess the real question, is how do i iterate over a TreeSet? |
| 17:08 | yedi | boo: http://www.infoq.com/presentations/clojure-core-async?utm_source=infoq&utm_medium=QCon_EarlyAccessVideos&utm_campaign=StrangeLoop2013 |
| 17:14 | indigo | What's the best Redis library for Clojure? Carmine? |
| 17:14 | bruceadams | ,(let [ts (java.util.TreeSet. [1 2 3])] (for [i ts] i)) |
| 17:14 | clojurebot | (1 2 3) |
| 17:14 | SegFaultAX | indigo: Probably carmine, yea. |
| 17:14 | indigo | Hm okay |
| 17:15 | lunk | bruceadams: that's what i thought, hah |
| 17:15 | bruceadams | lunk: seems to just work. is there something unusual about your sets? might they be empty? |
| 17:15 | lunk | they're definitely not |
| 17:16 | bruceadams | ,(let [ts (java.util.TreeSet. [1 2 3])] (.size ts)) |
| 17:16 | clojurebot | 3 |
| 17:16 | lunk | maybe the silly thing doesn't have a toString implementation |
| 17:16 | lunk | and it doesn't |
| 17:17 | lunk | wow. |
| 17:18 | bruceadams | lunk: wow. gotta love it! |
| 17:18 | lunk | wow, working great now |
| 17:18 | lunk | beer for all! |
| 17:19 | bruceadams | I'm ahead of you on the beer! |
| 17:19 | bruceadams | (I do put it down to type) |
| 17:21 | lunk | bruceadams: pffft, time to step up your game ;) |
| 17:32 | tupi | hello all. i don't understand what I am doing wrong here, any one available to look at it and kindly give me some hint ? http://paste.lisp.org/display/139088 tx |
| 17:33 | mtp | i don't either |
| 17:33 | mtp | it's helpful to try and answer these questions |
| 17:33 | mtp | "what did I do?" "what did I expect to happen?" and "what actually happened?" |
| 17:35 | lunk | bruceadams: seems to work better when I iterate over the set directly in the proxy instead of handing it off to a separate function. Very weird. |
| 17:35 | tupi | mtp: were you talking to me :) ? |
| 17:35 | gfredericks | tupi: the docs say toEDM taks an argument, and you didn't supply one |
| 17:35 | mtp | tupi: i don't know, were you the one with the problem that you didn't understand? |
| 17:35 | gfredericks | thus the reflector reports that it couldn't find a method matching your call |
| 17:36 | tupi | gfredericks: I do supply, don't I ? (.toEDM (.getProcessor bin-imp)) |
| 17:36 | bruceadams | tupi: this "(.toEDM (.getProcessor bin-imp))" seems like it's getting an instance of a processor object, then invoking toEDM on that. |
| 17:36 | gfredericks | tupi: as bruceadams said, the (.getProcessor bin-imp) is the object the method is being called on |
| 17:37 | gfredericks | in java you have bin_imp.getProcessor().toEDM() |
| 17:37 | Bracki | Can somebody point me to a good example on how to wrap Java builders with idiomatic Clojure? |
| 17:38 | tupi | bruceadams: can i be sure, 1st of all, that clojure finds .toEDM ? |
| 17:38 | bruceadams | clojure is looking for toEDM on the processor object and not finding it. |
| 17:39 | gfredericks | tupi: it's looking for a method called toEDM that takes 0 args |
| 17:39 | bruceadams | the package name (from the comment) suggests that toEDM is a filter thingy, not a processor thingy |
| 17:39 | dobry-den | toEDM? does it add a drop? |
| 17:40 | mtp | that'd be toDubstep |
| 17:40 | lunk | bruceadams: ooo, the interface also has a void return value. Since this method never yeilds anything, the proxy leaves nothing on the stack for the clojure repl. |
| 17:41 | lunk | bruceadams: it's like i'm starting to understand this stuff |
| 17:41 | bruceadams | lunk: neato |
| 17:42 | tupi | i don't understand: what i read is: public void toEDM(ImageProcessor ip) Converts a binary image into a 8-bit grayscale Euclidean Distance Map (EDM) |
| 17:42 | tupi | and public ImageProcessor getProcessor() Returns a reference to the current ImageProcessor. |
| 17:44 | gfredericks | tupi: implicit in toEDM is that it must be called on an instance of EDM |
| 17:44 | gfredericks | so (.toEDM my-edm my-image-processor) |
| 17:45 | tupi | ah,maybe that is. it is terrible to read java doc, because we don't know what 'it really expect' |
| 17:46 | llasram | tupi: Once you get the hang of a little Java, I assure you this case is pretty clear :-) |
| 17:47 | tupi | [never had to face this situation in 25y of programming :) never ever a doc would not tell us exactly what it expect, in arity and 'type'] quite frustrating, since i have to ask stupid quiz :) but ok, let me try to create an EDM ... |
| 17:48 | tupi | all this is because i am trying not to use the fiji command, which works fine, in this case, the fiji command is: (IJ/run bin-imp "Distance Map" "") |
| 17:55 | SegFaultAX | So... the factor pastebin is crazy. |
| 17:56 | tomjack | what does "self-describing" mean in the context of fressian and edn? |
| 17:57 | llasram | tomjack: You don't need a separate scheme to interpret the data, such as you do with protobufs, Thrift, Avro, etc |
| 17:57 | gfredericks | tomjack: self-describing is self-describing |
| 17:57 | llasram | s,scheme,schema, |
| 17:58 | tupi | gfredericks: that was it, thank you. I wonder how i can learn from this: I mean when I read the imagej [java] doc, I always have to assune there is 1 first '1hidden' arg ? |
| 17:59 | tomjack | hmm |
| 17:59 | llasram | tupi: Out of curiosity, what other programming language are you most familiar with? |
| 17:59 | tupi | scheme |
| 17:59 | gfredericks | tupi: this is how object-oriented docs typically work; the keyword "static" alerts you to the exceptions |
| 17:59 | akurilin2 | Has anybody here tried misaki or static? I'm wondering if I should bother trying them for the sake of staying within clojure or if I should be going straight for middleman since it appears to be very well maintained. |
| 17:59 | tomjack | ah right, because extensions are built out of the things everyone can already read, like edn |
| 17:59 | SegFaultAX | tomjack: To put it differently, you can't parse any old protobuff message without knowing the structure. Communicating the structure is an out of band process, separate from communicating the message itself. |
| 18:00 | dobry-den | mtp: we're pretty funny |
| 18:00 | SegFaultAX | Whereas with json, all the information required for reading and parsing the message is already available to you. I don't need any additional out of band transmission to figure how to process it. |
| 18:00 | mtp | dobry-den: i am the cleverest of the clevar |
| 18:00 | mtp | SegFaultAX: hahahaha, good one |
| 18:01 | SegFaultAX | mtp: I didn't say you could derive value from it. |
| 18:01 | SegFaultAX | mtp: But that's an application-level concern. |
| 18:01 | mtp | SegFaultAX: you still have to know the structure of the message from an out-of-band process, so |
| 18:01 | SegFaultAX | mtp: No I don't. |
| 18:01 | mtp | and the exact same thing could be said about protobuff |
| 18:02 | SegFaultAX | No, it couldn't. |
| 18:02 | mtp | "but that's an application-level concern" |
| 18:02 | SegFaultAX | protobuff is structured binary data. I cannot correctly unpack it without the schema. |
| 18:02 | mtp | json is structured text data |
| 18:02 | mtp | you can turn it into structured representation, but you still can't derive meaning from it without knowing what's in there |
| 18:02 | SegFaultAX | mtp: I just said that. |
| 18:03 | SegFaultAX | Like, exactly that. |
| 18:03 | mtp | yes, but it's functionally no different than a binary blob |
| 18:03 | mtp | they're both equally meaningless |
| 18:03 | SegFaultAX | mtp: Ok. |
| 18:03 | tupi | gfredericks: thanks. for your info, CLOS and CLOS doc does not 'work like that', but thanks again. ah maybe i can ask clojure to tell me what a function or imagej method expect ? |
| 18:03 | llasram | mtp: Well, in principle maybe, but not in practice. |
| 18:03 | mtp | a human is a little more likely to be able to intuit structure from the json, sure |
| 18:04 | llasram | mtp: You can see a field named "username" with a value that matches a known username and guess what's going on |
| 18:04 | mtp | but that's a different kettle of worms :) |
| 18:04 | SegFaultAX | mtp: Your argument is meaningless. |
| 18:04 | mtp | llasram: and you can see a thing that looks like a username in the blob and guess what's going on |
| 18:04 | gfredericks | tupi: maybe it's limited to languages that syntactically separate the target object from the other arguments? |
| 18:04 | llasram | mtp: But at a veeeery different bar. |
| 18:04 | gfredericks | i.e., the foo.bar(baz, bang) syntax |
| 18:05 | mtp | llasram: until you spend most of your time staring at binary blobs trying to discern meaning :) |
| 18:05 | SegFaultAX | The point is I /can/ parse json (assuming it's well formed) without any additional knowledge about its contents. You cannot do that with eg protobuffs. |
| 18:05 | SegFaultAX | I literally have no information about how wide the fields are or what they're called, etc. |
| 18:05 | llasram | Exactly |
| 18:06 | mtp | i debug c programs in my day job |
| 18:06 | llasram | So? |
| 18:06 | mtp | and when the stack is fucked, i have no information about the state of the program other than "the stack is fucked" |
| 18:06 | llasram | I used to write kernel module for my day job |
| 18:06 | llasram | Seeing a username at byte offset 17 in one data container means nothing |
| 18:06 | mtp | and so i have to be able to parse random binary crap, possibly ill-formed, without any information about the thing |
| 18:06 | SegFaultAX | mtp: I'm now convinced that you're trolling. |
| 18:06 | mtp | SegFaultAX: ok |
| 18:07 | mtp | but i can still parse random binary garbage without a whole lot of information about its contents |
| 18:07 | mtp | i'm glad that you can do the same with json |
| 18:07 | SegFaultAX | You're really missing the point. |
| 18:08 | mtp | i think you're confusing representation with meaning |
| 18:08 | mtp | json is a more informative representation to most people, sure |
| 18:09 | SegFaultAX | We aren't talking about /to people/ |
| 18:09 | mtp | then why are you talking about your ability to parse it without context |
| 18:09 | tupi | gfredericks: maybe, but as you know, in lisp/scheme/clojure, there is no target object, it is built and return to the caller ... the problem here is imagej, and java of course, not clojure. and it is _really_ difficult, for me, to pass an arg that we be 'affected' by the call ... but i guess i'll get there. i was hoping _not_ to have to learn [almost none of] java :) for a scheme, it is a nightmare. but i really tx you and all people |
| 18:09 | tupi | here, i will surely still ask stupid quiz for a while :) |
| 18:09 | SegFaultAX | mtp: Because I can parse json without context. |
| 18:10 | mtp | and i can parse certain kinds of binary goop without context |
| 18:10 | mtp | congratulations |
| 18:10 | SegFaultAX | I cannot do that with an given binary blob that might also happen to be a protobuff. |
| 18:10 | mtp | i'm sorry for your loss |
| 18:10 | tomjack | "I can parse" -> "I can write a program which parses" ? |
| 18:10 | amalloy | SegFaultAX: it's not entirely true that you can't parse protobuf without context; the protocol is built such that you can at least see the general shape of the data (ie, how wide each field is) without any prior knowledge |
| 18:11 | gfredericks | tupi: to some extent you only have to know how the jvm part of java works. There's a lot of details specific to the language that virtually never come up |
| 18:11 | mtp | tomjack: now that, i'll take |
| 18:11 | gfredericks | tupi: clojure does not try to hide the JVM from you |
| 18:11 | SegFaultAX | amalloy: You haven't helped. That's just a nice detail of protobuffs in particular. But that's confusing the issue. |
| 18:11 | mtp | amalloy: having field widths is immensely helpful |
| 18:11 | SegFaultAX | amalloy: We're talking about what it means for something to be self-describing in the context of eg edn or json. |
| 18:12 | amalloy | i'm not trying to help mtp; the conversation you two are in is clearly a loss. i'm just informing you about protobuf |
| 18:12 | tupi | gfredericks: undertood |
| 18:12 | SegFaultAX | amalloy: Oh yea, that's definitely a useful feature. |
| 18:12 | SegFaultAX | "feature" |
| 18:13 | mtp | with field widths i can sit down and correlate values with tags |
| 18:13 | llasram | Arbitrary plug for representing EDN in Avro via Abracad https://github.com/damballa/abracad |
| 18:13 | tomjack | I'm interested in the specifics of protobuf since if I use fressian I will end up having to answer "why not protobuf?" :( |
| 18:13 | llasram | It's either the best or the worst of both words, depending on how you look at it |
| 18:13 | llasram | s,words,worlds, |
| 18:15 | SegFaultAX | tomjack: Binary protocols are great for performance reasons. |
| 18:15 | SegFaultAX | protobuffs in particular have a lot of nice features (built in versioning, etc.) |
| 18:16 | tomjack | I'm not sure I like versioning |
| 18:16 | SegFaultAX | How could you not? |
| 18:16 | s4muel | Uh, yes you do. |
| 18:17 | SegFaultAX | The whole point of protobuff is it can optimize the packing of your messages because it knows ahead of time of the exact structure of your messages. |
| 18:18 | SegFaultAX | But if that structure needs to change over time (and it will), you need to be able to have different versions of the protocol interoperate. |
| 18:18 | s4muel | I would not want to think about a world in which I had to break all my clients because i added one new optional field to a message |
| 18:18 | tomjack | I get the story, but say I replace my protobuf messages with just maps from keywords in fressian |
| 18:18 | tomjack | I lose some compactness maybe |
| 18:18 | tomjack | but what do I lose wrt versioning? |
| 18:19 | gleag | SegFaultAX: Isn't performance an issue best relegated to dynamic compilation techniques, even in this case? |
| 18:20 | SegFaultAX | gleag: I'm not sure what you're asking. |
| 18:20 | mtp | gleag: careful, he might become convinced that you're trolling |
| 18:20 | gleag | mtp: ? |
| 18:21 | gleag | SegFaultAX: The first time the library after initialization meets a structure definition, it compiles it. Then, it reuses the compiled definition. Sounds natural to me. |
| 18:21 | tomjack | s4muel: I'm not sure my serialization code should be concerned with that.. |
| 18:21 | s4muel | tomjack: i am reading about fressian now. :P |
| 18:21 | tomjack | e.g. in my case, 'required' has been banned from .proto files, and instead applications must enforce required-ness. |
| 18:22 | SegFaultAX | tomjack: If you're using a binary protocol, you absolutely must be concerned with that. |
| 18:22 | tomjack | which seems like the right thing to me |
| 18:22 | robbync | ci |
| 18:22 | gleag | The same thing would apply to interoperability: any conversion between versions of a protocol -to me at least - reminds me of such things as keyword argument defaults etc. |
| 18:22 | robbync | !list |
| 18:22 | mtp | wow i haven't seen a !list in forever |
| 18:22 | gleag | It simpy sounds like an issue for a specialized minicompiler. |
| 18:23 | mtp | what is this, a 1997 xdcc chan? |
| 18:23 | tomjack | what does binary have to do with it? |
| 18:23 | callen | last time I touched protocol buffers was to talk to RethinkDB. Can't say I really enjoyed it. |
| 18:23 | SegFaultAX | gleag: With an out of band protocol like protobuff, that isn't always possible. Sometimes there will be clients using older versions of the protocol. What should I do in that case? Drop them on the floor? |
| 18:24 | gleag | Why would a support of the old protocol be an issue? Because of the need to parse it or because of the need to implement the functions? |
| 18:24 | s4muel | tomjack: that's not a bad idea as required is 'forever', but if you are anticipating those changes to begin with, why not just use a more flexible format like edn, etc |
| 18:24 | callen | protocol buffers isn't really designed for rapid-changing, best effort communication. |
| 18:24 | SegFaultAX | +1 callen |
| 18:25 | tomjack | s4muel: well, yes, my plan is to use fressian :) |
| 18:25 | callen | SegFaultAX: have a pibble puppy: http://i.imgur.com/5vQZ1mf.jpg |
| 18:26 | llasram | tomjack: OOC, did you also evaluate Avro? |
| 18:27 | tomjack | nope |
| 18:27 | SegFaultAX | tomjack: Binary mode protocols trade off speed and overall message size for flexibility of encoding. Text mode protocols typically allow for considerably more flexible encoding at the cost of speed and size. |
| 18:28 | llasram | tomjack: I encourage you to take a look. IMHO it manages to combine the best features of the schema-based binary encoding systems while being friendly to use from dynamic languages |
| 18:29 | llasram | tomjack: It comes with support for most of the popular languages, and I hope to get Abracad rolled into upstream at some point |
| 18:29 | SegFaultAX | tomjack: If I have a message with a name and age field, a binary protocol would be very specific about the ordering and size of those fields in the serialized struct. A text mode protocol (json for instance) doesn't really care if its { name: "Joe", age: 16 } or { age: 16, name: "Joe" }. |
| 18:30 | tupi | any immediate correcponding clojure code for this: (string-split "A11.bin" #\.) -> ("A11" "bin") |
| 18:30 | s4muel | ,(doc clojure.string/split) |
| 18:30 | clojurebot | "([s re] [s re limit]); Splits string on a regular expression. Optional argument limit is the maximum number of splits. Not lazy. Returns vector of the splits." |
| 18:30 | SegFaultAX | ,(doc clojure.string/split) |
| 18:30 | clojurebot | "([s re] [s re limit]); Splits string on a regular expression. Optional argument limit is the maximum number of splits. Not lazy. Returns vector of the splits." |
| 18:30 | SegFaultAX | Heh |
| 18:31 | tupi | great! |
| 18:31 | callen | s4muel - fastest gun in the FreeNode. |
| 18:32 | s4muel | shazam. |
| 18:33 | tomjack | llasram: which features of schema-based binary encoding should I care about? |
| 18:33 | Glenjamin | are you wanting binary for speed or transmissions size? |
| 18:34 | tomjack | I don't feel like I want any schemas |
| 18:34 | llasram | tomjack: Well, depends on what you care about :-). They're compact in size, and efficient to both parse and generate. |
| 18:35 | llasram | tomjack: If those aren't useful for your applications, that's reasonable. I've gotten burned enough finding out I've stored data according to an unintended JSON structure that I've become very much a fan for non-transient values |
| 18:38 | tomjack | "non-transient" means.. with a schema? |
| 18:39 | callen | llasram: if the JSON is somehow leading to storage without cherry-picking, I usually implement some sort of fascist runtime schema checking. |
| 18:40 | callen | then the "liberal in what you accept" goes out the window and paranoia becomes the order of the day :) |
| 18:41 | llasram | tomjack: Non-transient means "stored in a database, HDFS, or other persistent storage system" |
| 18:41 | Glenjamin | the most common error with JSON-esque approaches is typoes in names of optional fields |
| 18:41 | llasram | callen: Yeah, would have been a good idea, but with schemas you get that for "free" |
| 18:41 | Glenjamin | but thats fairly rare |
| 18:42 | callen | llasram: JSON is familiar and easy, and if all I am doing is adding a schema after the fact, not at the conceptual stage, I'm not going to change a bunch of other things when all I wanted was a schema. |
| 18:42 | callen | I don't change the format until something other than schema enforcement speaks for it. |
| 18:44 | llasram | callen: Fair enough. I've currently decided that the benefits of a richer serialization system (tagged types, binary values) and compact encoding (mostly for Hadoop I/O performance) are worth it |
| 18:44 | callen | llasram: yeah I'm talking about a slightly different set of parameters. That makes sense. |
| 18:45 | callen | llasram: I was talking to some Clojurians at a meetup recently, they were stashing JSON in HBase. |
| 18:45 | callen | I haven't done a lot of HBase so I was wondering what the expectations WRT queryability were there. |
| 18:46 | callen | I've done Hadoop and map-reduce, just not HBase. Got close to storing roll-ups in it though. |
| 18:46 | llasram | callen: Hey, if that works for them :-). I'm actually working on migrating a system from CouchDB to HBase right now, and that was an option on the table. |
| 18:47 | llasram | callen: Eh. For HBase it's all about your key design, which pretty much needs to be custom to support whatever queries you want. So serialization and query-ability are pretty much orthogonal |
| 18:47 | callen | llasram: please let me know the outcome of that, I've worked with CouchDB before and hated-hated-hated it. |
| 18:47 | callen | llasram: okay, that's what I suspected. So you just have to roll-up your data into the various keys that match your query strategy, kinda like how many redis users do? |
| 18:48 | llasram | callen: Sure thing. My experience with couchdb has actually been pretty positive -- we're just outgrowing a single node and have already settled on HBase for some other systems |
| 18:48 | callen | llasram: I was working with a large cluster used for analytics. it was pain/hell itself. |
| 18:48 | llasram | callen: I'll say "yes", although I don't have direct experience w/ redis to say |
| 18:49 | callen | llasram: well take it for granted that redis is a straight-forward kv store, has some nice data structures, but you still have to plan ahead for query patterns. |
| 18:49 | llasram | callen: Ah, gotcha. Then un-quoted yes :-) |
| 19:15 | indigo | callen: Working on that clauth thing right now :P |
| 19:21 | sinistersnare | hello, does anyone have any recent examples (and possibly an article, if thats not too much :p) of using libgdx in clojure? |
| 19:21 | sinistersnare | i just finished updating this article on the new libgdx wiki https://github.com/libgdx/libgdx/wiki/Using-libgdx-with-other-jvm-languages and was hoping for some help! |
| 19:23 | mdeboard | I don't really understand core.async, at least in cljs, I don't think. Basically you have to have one god-function that inits all the chans you're going to need, and then passes them to consumer and producer fns that read from them in a while loop or something? |
| 19:24 | mdeboard | Like I want to have a chan for keypress events, so I assume I'll need a fn to put event data onto the channel, and one to pull event data off, right |
| 19:25 | mdeboard | isit just like (def keypress-chan (chan)) |
| 19:25 | mdeboard | and pass that around, I'm probably an idiot |
| 19:26 | Glenjamin | mdeboard: i belive the idea is to have the keypress handler put a "keypress" message on some sort of "application input" channel |
| 19:27 | mdeboard | Right, so is there a channel consumer out there with a `(while true (keypress-handler (<! input-chan)))` loop |
| 19:28 | mdeboard | I'm much more familiar with network asynchrony, where the queue pings the consumer or the consumer polls the queue to check for new stuff |
| 19:28 | mdeboard | Not understanding the equivalent interchange in intraprocess asynchrony |
| 19:35 | chord | anything new in clojure land |
| 19:35 | callen | chord: libraries are awesome. |
| 19:35 | chord | callen MY BUDDY |
| 19:36 | chord | you still not willing to work on starcraft clone? |
| 19:36 | callen | chord: DUUUUUUDE |
| 19:36 | callen | chord: NOT FOR FREEEEEEEEE |
| 19:36 | chord | you're getting paid when we sell the game |
| 19:36 | callen | chord: I'm an expensive companion :( |
| 19:36 | chord | you get half ownership |
| 19:36 | callen | chord: "when we sell the game" don't pay the rent son :) |
| 19:36 | callen | I can't offer my landlord fractional ownership :P |
| 19:36 | chord | you gotta have entrepeneur spirit |
| 19:36 | chord | be a risk taker |
| 19:37 | callen | if it's about entrepreneurialism, I'll just go do things for businesses with money. |
| 19:37 | callen | they will pay very well for you to solve their problems. That sounds nicer. |
| 19:38 | chord | but don't you want all the loser nerds to thank you and spam you with email adoring you for how much they love the game you made |
| 19:38 | callen | No, actually. |
| 19:38 | chord | you're letting down all the nerds :( |
| 19:39 | chord | callen: look if these guys have the confidence to be able to do it then so can you, https://artillery.com/ |
| 19:40 | callen | it's not about confidence, I just find helping people make money a lot more compelling than helping people waste their lives on video games. |
| 19:40 | indigo | Oh man, the troll again |
| 19:41 | chord | indigo I'm not a troll anymore |
| 19:41 | mdeboard | Any idea why 'speedometer' here https://gist.github.com/mattdeboard/c887905c0ee5b095bb70 isn't printing `1` or `-1` to console as expected? |
| 19:41 | mdeboard | (Take it for granted that events are registered properly, that definitely works) |
| 19:42 | devn | w/r/t the EPL -- in Clojure's src I see comments saying (C) Rich Hickey, etc. If I'm going to repurpose someone else's code who is also under the EPL but does not include that comment at the top of their file, is it assumed that it's there? What's proper? |
| 19:51 | chord | Good news I started reading chapter 12 of Learn You a Haskell |
| 19:52 | chord | why isn't there a book called Learn You a Clojure |
| 19:54 | AimHere | Because the Learn-You-A-Haskell guy didn't write it, and anyone else would have trademark problems? |
| 19:55 | chord | so how about you and callen write the book |
| 19:55 | chord | so I can read it |
| 19:55 | chord | its guaranteed to sell |
| 19:55 | llasram | *plonk* |
| 20:00 | callen | I'm actually working on a LYAH-esque Clojure book. |
| 20:00 | callen | but that has nothing to do with the troll. |
| 20:00 | callen | uhhh...have a puppy: http://i.imgur.com/ACkKMZt.jpg |
| 20:00 | sinistersnare | o my god thats so cute |
| 20:03 | indigo | Weird... sometimes clauth's token tests fail, other times they don't |
| 20:03 | chord | callen: send link to github draft of the book please |
| 20:09 | callen | chord: you haven't shown me any of your code yet |
| 20:09 | chord | callen: I want to read your clojure book to LEARN clojure, how can I have any code when I haven't learned clojure |
| 20:10 | callen | I have very little material prepared, I'm not going to start producing content in earnest until after Clojure Cup. |
| 20:11 | chord | omg why are you wasting time on clojure cup |
| 20:12 | callen | because I have a project I want to do anyway. |
| 20:12 | callen | and it's a decent fit for Clojure Cup. |
| 20:12 | chord | does it make money? |
| 20:12 | callen | I'm also kinda competitive. |
| 20:12 | callen | was it with you and money? |
| 20:12 | callen | you have a seriously unhealthy obsession. |
| 20:12 | chord | you're the one that refused to make the game because of money |
| 20:12 | chord | not me |
| 20:12 | chord | AH HA I CAUGHT YOU IN A SELF CONTRADICTION |
| 20:14 | callen | I said I didn't find investing my time in giving other people a better mouse-trap for wasting their lives was compelling. |
| 20:14 | callen | And if you check the back-log, you'll notice I said I was inspired by helping other people make money. :) |
| 20:14 | callen | also it's just a contradiction, a self contradiction is a statement that contradicts itself. Somebody who contradicted themselves is caught in a plain old contradiction. |
| 20:15 | arrdem | callen: I appreciate your picture. greatly. |
| 20:15 | callen | arrdem: good. I appreciate puppies. |
| 20:15 | callen | I choose my friends on the basis of which ones own dogs that I can hang out with. |
| 20:16 | callen | SegFaultAX: :) |
| 20:16 | chord | callen: you know you should be working on the book instead of clojure cup because the book will give people the skills to inspire themself to make money |
| 20:16 | chord | AH HA try to get out of that one |
| 20:16 | callen | the project for Clojure Cup will not only save people money, but help them make a lot more money too. |
| 20:16 | arrdem | chord: that just makes no sense at all |
| 20:16 | arrdem | callen: well played |
| 20:16 | callen | it's a project that I've wanted for my own use, but I want to make it available to others too somehow. |
| 20:17 | chord | callen: whats the project then |
| 20:17 | callen | 'tis secret. You're not part of my elite Clojure Cup team :) |
| 20:17 | chord | arrdem: see he can't tell because he doesn't have one |
| 20:17 | callen | anybody that was at the San Mateo Clojure meetup knows what I'm working on. |
| 20:17 | callen | including... alexbaranosky. |
| 20:18 | callen | it's not actually secret, I just like jerking the troll around :) |
| 20:18 | arrdem | chord: the atx-clj team and I already have our own blackops teams, I'd be amazed if callen didn't too |
| 20:18 | callen | arrdem: most of the people I wanted to recruit refused on the basis of who some of the judges were. |
| 20:18 | callen | I'm a little sad about that :( |
| 20:19 | arrdem | callen: loooooool |
| 20:19 | callen | arrdem: so if you get any people looking for a team, please send them my way. :) |
| 20:19 | arrdem | callen: sorry, we got seven people running two teams. :/ |
| 20:20 | callen | I'd better learn to do visual design then, looks like it'll be just me. |
| 20:20 | arrdem | callen: just throw twitter bootstrap at the wall until it sticks and call it programmer art |
| 20:20 | Glenjamin | be different, use foundation |
| 20:20 | callen | I already use Foundation, actually. |
| 20:20 | callen | It's my preferred frontend framework because it's easier to customize. |
| 20:21 | callen | bootstrap is a PITA to change later on. |
| 20:21 | Glenjamin | mm, i use bootstrap for internal facing / admin interfaces, foundation for anything facing people |
| 20:21 | callen | I use foundation for both. I'm not willing to punish my coworkers with bootstrap. |
| 20:21 | Glenjamin | heh |
| 20:22 | Glenjamin | i just got our guys to change 4 or 5 admin interfaces from "not styled" to bootstrap |
| 20:22 | Glenjamin | its better than what they were doing before |
| 20:23 | callen | o lawd |
| 20:23 | Glenjamin | clojure cup sounds fun, do you reckon the organisers would be annoyed if i sign up then discover i can't fit enough time in next weekend? |
| 20:24 | callen | there, just ordered the domain for my book. |
| 20:24 | callen | Glenjamin: I think they're expecting it. You could join my team as a "maybe"! |
| 20:24 | chord | callen: you afraid that I was going to steal the domain? |
| 20:24 | callen | there is no way you would've guessed what I picked. |
| 20:24 | Glenjamin | i've got an app idea that in theory is doable in a weekend if i don't bikeshed |
| 20:25 | arrdem | I think we've already registered ours... |
| 20:25 | chord | if its not about learn you a clojrue then its no good |
| 20:25 | Glenjamin | but feel free to throw me an invite, i can't promise availability |
| 20:25 | indigo | Wtf... an atom pointing to an atom |
| 20:25 | callen | indigo: http://c2.com/cgi/wiki?ThreeStarProgrammer |
| 20:25 | arrdem | indigo: someone must be blamed for this. |
| 20:26 | callen | ,(:a @@@(atom (atom (atom {:a 1})))) |
| 20:26 | clojurebot | 1 |
| 20:26 | callen | glorious abomination. |
| 20:26 | arrdem | callen: no. wrong. out of the channel. |
| 20:26 | arrdem | :p |
| 20:27 | indigo | More like... a defonce'd atom pointing to a record which uses an atom to store data |
| 20:30 | indigo | Oh I see what he tried to do here... I guess it makes sense |
| 20:32 | chord | callen: i'm going to make learn you a clojure book and kill your book off |
| 20:32 | callen | "kill" |
| 20:32 | arrdem | chord: .... I thought you wanted his book so you could learn in the first place .... |
| 20:32 | chord | I'll learn from another book |
| 20:32 | callen | arrdem: if it means there are two free books for learning Clojure, then whatever. |
| 20:33 | chord | and then ddos your book's website to make it dead |
| 20:33 | callen | right. |
| 20:33 | arrdem | callen: I'm just sitting here with popcorn laughing |
| 20:33 | callen | don't say that, I've been cutting the last month and I'm starving. |
| 20:33 | callen | buttery popcorn *_* |
| 20:34 | arrdem | callen: eep. sry |
| 20:34 | callen | arrdem: oh 'tis fine. :) |
| 20:34 | chord | arrdem: is too lazy he'll never make the book, the only way to get him going is through a race with another book |
| 20:34 | chord | you know i'm right |
| 20:36 | callen | starting to think chord is a karmic punishment for all the trolling I did on twitter. |
| 20:36 | arrdem | callen: this is what you get for abusing mongodb to up your klout score |
| 20:37 | chord | mongodb is horrible |
| 20:37 | chord | why would anyone choose it |
| 20:37 | mdeboard | because they hate their company |
| 20:37 | chord | use postgresql |
| 20:37 | chord | or voltdb |
| 20:37 | callen | arrdem: that's kinda what happened. I also troll Haskell users to up my klout score. |
| 20:37 | arrdem | no, because at scale N=1 it doesn't **** matter |
| 20:38 | callen | I'm a bad person ;_; |
| 20:38 | callen | I think I'm at 45 or so. |
| 20:38 | arrdem | callen: yes, yes you are. but you're witty about it so you fit in well here. |
| 20:44 | chord | callen tell me the project NOW |
| 20:50 | indigo | Oh I see what he tried to do here... I guess it makes sense |
| 20:51 | indigo | Whoops, up arrow fail |
| 20:57 | mdeboard | Can anyone explain to me why https://gist.github.com/mattdeboard/cd6472f952d48ac5673b isn't logging "hello!" to console? |
| 20:58 | chord | ask callen hes the "expert" at clojure |
| 20:59 | callen | mdeboard: are you using the latest clojurescript? |
| 20:59 | callen | mdeboard: there were changes in cljs and core.async recently that broke something. |
| 20:59 | callen | dnolen can say more. |
| 20:59 | mdeboard | callen: ` [org.clojure/core.async "0.1.222.0-83d0c2-alpha"]` |
| 20:59 | mdeboard | 0.1.0 was unavailable. |
| 20:59 | mdeboard | this was the only version I could find on clojars or maven |
| 20:59 | callen | mdeboard: latest clojurescript. |
| 21:00 | mdeboard | oop, copied wrong line |
| 21:00 | mdeboard | [org.clojure/clojurescript "0.0-1889"] |
| 21:01 | mdeboard | So it looks like it from github |
| 21:01 | callen | mdeboard: https://groups.google.com/forum/#!topic/clojurescript/qnRQdmu5yT8 |
| 21:03 | mdeboard | callen: I've noticed some of those issues, mostly around wonkiness wrt compilation artifacts, but I do `lein cljsbuild clean && lein cljsbuild once` and that takes care of most of it. I just straight up can't get even *extremely* simple examples to work with core.async |
| 21:04 | callen | mdeboard: the clojurescript change that I described broke a lot of core.async stuff, dnolen was in here not too long ago explaining how to checkout master. |
| 21:04 | mdeboard | ah I see |
| 21:04 | mdeboard | Well that's a bummer. |
| 21:04 | callen | mdeboard: I strongly suspect you'll need a checked out master of cljs and/or core.async. |
| 21:05 | callen | core.async and cljs are both not stable. |
| 21:05 | mdeboard | Wasted an evening on it :( |
| 21:05 | callen | core.async especially. |
| 21:05 | mdeboard | All fired up after strangeloop & seeing rhickey talk about it. |
| 21:05 | callen | mdeboard: it's a recent blip. |
| 21:05 | callen | mdeboard: normally both work fine, all the time. |
| 21:05 | callen | mdeboard: but cljs changed a bunch of stuff recently. it'll stabilize again soon. I use core.async quite a lot, myself. |
| 21:05 | mdeboard | how earlier was earlier |
| 21:06 | callen | it started breaking when that cljs release was made. it was just unfortunate timing. |
| 21:06 | chord | coffeescript > clojurescript |
| 21:06 | mdeboard | which 1889? |
| 21:07 | callen | mdeboard: did you read the thread I linked? |
| 21:07 | callen | that's the release and that's when core.async issues were first reported. |
| 21:07 | mdeboard | yeah, honestly my brain is smoked atm, seriously been jamming it into this belt sander of a browser |
| 21:07 | mdeboard | for hours |
| 21:08 | callen | new people should come to IRC for help sooner than that. |
| 21:08 | mdeboard | core.async has been broken for two weeks? |
| 21:08 | mdeboard | I asked several times, no one answered. IRC's an asynchronous medium, no point in sticking around for answers |
| 21:08 | callen | it's not broken |
| 21:08 | callen | it works fine in Clojure and Clojurescript, but you need the master of CLJS and/or core.async |
| 21:09 | callen | I must've missed your messages. regrettable. |
| 21:09 | callen | it works fine in Clojure 1.5.1 with any version. |
| 21:09 | chord | just use coffeescript, it is not broken, it works |
| 21:09 | callen | and ignore the troll. |
| 21:09 | mdeboard | Well, that's fine, but the pitch of core.async is literally 50% about clojurescript. |
| 21:09 | mdeboard | I put him on ignore like 20 minutes ago |
| 21:10 | mdeboard | I'm just a little frustrated, shit happens. |
| 21:10 | callen | mdeboard: I am sorry nolen didn't ask Hickey permission to keep making changes to CLJS |
| 21:11 | mdeboard | Like I said, shit happens. |
| 21:11 | callen | the changes in 1887 were fairly major and important. |
| 21:11 | callen | well when it comes to core.async, usually they don't. |
| 21:11 | mdeboard | Just disappointed. |
| 21:11 | callen | this is the first time I've seen it break. |
| 21:12 | mdeboard | And relieved actually |
| 21:12 | callen | there's nothing to be disappointed in, it works fine |
| 21:12 | callen | you're just being impatient and refusing to use the versions that work. |
| 21:12 | mdeboard | :| |
| 21:12 | mdeboard | What? |
| 21:12 | clojurebot | What is 2d6 |
| 21:12 | mdeboard | Wait, who's the troll |
| 21:12 | mdeboard | am I being trolled? |
| 21:12 | callen | I have said repeatedly you need the HEADs of one or the other. I can't remember exactly which. |
| 21:12 | callen | I'm quoting from what I saw dnolen helping other people with. |
| 21:13 | callen | do you want me to do it for you? |
| 21:13 | mdeboard | Right, I just have no idea how to check out a clojure/script module to my classpath |
| 21:13 | callen | I can checkout master of each and test your example. |
| 21:13 | callen | mdeboard: are you using lein-cljsbuild? |
| 21:13 | mdeboard | from github* |
| 21:13 | mdeboard | yeah |
| 21:14 | callen | I am in the middle of a DotA game (alt-tabbing), I'll replicate after. |
| 21:15 | callen | but you're probably going to end up lein installing the git masters. |
| 21:15 | callen | or something. |
| 21:16 | chord | callen add me as friend on warcraft 3 |
| 21:16 | callen | chord: go away |
| 21:16 | chord | why you hurt my feelings |
| 21:17 | callen | you're a troll and constantly harass people on here. |
| 21:18 | mmarczyk | mdeboard: you can just keep using a slightly older version of ClojureScript |
| 21:18 | callen | mdeboard: I get that you're frustrated. I'll see if I can reproduce your problem. |
| 21:18 | mmarczyk | mdeboard: (if I understood correctly that you're trying to get cljs core.async to work) |
| 21:19 | mdeboard | mmarczyk, callen: I used git-dependencies in my project.clj, but it looks like cljsbiuld just added a different (older/known good?) version itself. |
| 21:19 | callen | mmarczyk: that's right. |
| 21:19 | mmarczyk | callen: thanks |
| 21:19 | mdeboard | There we go, goroutines work now. |
| 21:19 | mdeboard | brilliant |
| 21:20 | mdeboard | holy shit it works |
| 21:20 | mdeboard | I'm not an idiot |
| 21:20 | mdeboard | I mean, not that much of one |
| 21:21 | lunk | mdeboard: those 'aha' moments pretty much rule ;) |
| 21:21 | mmarczyk | mdeboard: amazing stuff, no? :-) |
| 21:21 | callen | does this mean I can stop losing in my DotA game? |
| 21:21 | mdeboard | Wasn't really an aha moment, unless you're talking about the "aha" moment I had when callen told me the "recommended" version number was borked |
| 21:21 | mdeboard | no |
| 21:21 | lunk | callen: no, someone will always hate you and get with your mom, on principle. |
| 21:22 | callen | mdeboard: so just so I can tell future troubled programmers, what fixed your problem and what was the broken state? briefly please. |
| 21:22 | lunk | callen: LoL world championship group play has been awesome. I'll stop with the offtopic chat though |
| 21:22 | mdeboard | Removed the clojurescript dependency from :dependencies |
| 21:22 | mdeboard | cljsbuild installed one itself. |
| 21:22 | mmarczyk | mdeboard: that's basically going back to an older one |
| 21:22 | callen | which is fine. |
| 21:22 | mdeboard | Oh, but I also had to delete ~/.m2/repository/org/clojure/clojurescript/ |
| 21:22 | callen | he doesn't need the magical keyword support. |
| 21:23 | mmarczyk | mdeboard: 0.0-1859 currently |
| 21:23 | mdeboard | mmarczyk: Yeah |
| 21:23 | mdeboard | I wonder where I got 1889? I bet I looked at maven |
| 21:23 | mmarczyk | or ggroup |
| 21:23 | mdeboard | since there's not a "do this" thing in the readme |
| 21:26 | mdeboard | Man I really thought I wa smissing something obvious, this is a huge relief. |
| 21:32 | lordQuas | Anyone know how to use the clojure.contrib libraries with emacs nrepl? If I do good old (require 'clojure.contrib.math) I get class not found error. Thanks! |
| 21:33 | mdeboard | lordQuas: Clojure contrib has been deprecated for a long time |
| 21:33 | mdeboard | lordQuas: http://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go |
| 21:33 | callen | we're going to be saying this for years. |
| 21:34 | lordQuas | mdeboard thanks for the heads up, learning clojure and I was trying to find out how to do a simple square root. Stack overflow told me to use clojure.contrib.math. |
| 21:35 | callen | Stack Overflow doesn't work well for things that change. |
| 21:36 | Glenjamin | does it make sense to use core.async only in small isolated areas of code? |
| 21:36 | callen | Glenjamin: that's what I do. |
| 21:36 | callen | Glenjamin: I use it to marshal data from callbacks. |
| 21:37 | Glenjamin | i've got a clojure app, but the only areas of concurrency are the web requests, and i've got one place where i make 3 HTTP calls at once |
| 21:37 | callen | lordQuas: https://github.com/clojure/math.numeric-tower |
| 21:37 | Glenjamin | and i hid that behind a parallel-let which is implemented as a macro to make futures |
| 21:37 | callen | Glenjamin: eh. Yeah futures are usually the way to do that. I'm a little o_O at your parallel let thing |
| 21:37 | callen | generally you want the use of futures to be explicit. |
| 21:38 | Glenjamin | it's basically (plet [a call1 b call2, c call3] (render a b c)) |
| 21:38 | callen | Glenjamin: you can use core.async in the place of futures, but your use-case doesn't sound very compelling. |
| 21:38 | callen | I was in a situation where I was forced to use callbacks, that's why I needed core.async |
| 21:38 | callen | generally that's when you use core.async |
| 21:38 | callen | not when a future by itself would suffice. |
| 21:38 | Glenjamin | mm, not really run into that yet |
| 21:38 | lordQuas | So do I have to use java.lang.Math to do a simple square root? |
| 21:39 | Glenjamin | lordQuas: you could raise to the power of 0.5 |
| 21:39 | callen | lordQuas: and a programming language, and a computer, and a keyboard. and power. and electricity. |
| 21:39 | Glenjamin | oh, thats also Math |
| 21:39 | callen | er, flatten power and electricity to the same thing. |
| 21:40 | callen | mdeboard: http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html |
| 22:00 | chord | lets talk about something |
| 22:01 | mdeboard | callen: yeah, was poring over that earlier. Nothing helps though when there's a library inconsistency |
| 22:01 | mdeboard | chord: I actually like coffeescript :) |
| 22:01 | callen | arrdem: how do you like Austin anyway? |
| 22:01 | callen | CoffeeScript is for muggles. |
| 22:01 | Raynes | You like that word, don't you callen? |
| 22:01 | Raynes | Muggles. |
| 22:02 | chord | coffeescript is good why would anyone want to deal with javascript's syntax |
| 22:02 | callen | Raynes: not my fault it fits so well. |
| 22:02 | Raynes | mmarczyk: How's things, pardner? |
| 22:21 | chord | ok lets talk about cool stuff |
| 22:21 | chord | so that we can pretend we are cool |
| 22:34 | chord | why are you all ignoring me |
| 22:35 | Frozenlock | Because we are already cool. :p |
| 22:36 | Frozenlock | Hmm... I included a nrepl in a little standalone uberjar, but when I connect to it using nrepl.el, I get an error when using tab (autocomplete). ----> java.lang.ClassNotFoundException: complete.core |
| 22:37 | Frozenlock | Is this some components I forgot to include in my project dependencies? :-/ |
| 22:38 | callen | using nrepl in an uberjar is really strange. |
| 22:38 | callen | uberjar compilation won't include stuff from your user/dev profile or anything related to Leiningen plugins |
| 22:38 | callen | when you call lein repl, you're not just getting your project dependencies. |
| 22:39 | chord | callen: what is your favorite game? |
| 22:39 | znusgy | How would you change a map {:a 1 :b 2} to a flat vector [:a 1 :b 2]? (vec (apply concat {:a 1 :b 2})), or is there something better? |
| 22:39 | Frozenlock | callen: OK, so complete.core is most probably a dependency added by Lein that I should add manually. |
| 22:40 | callen | Frozenlock: if you want to persist with this weird uberjar repl thing, then yes. |
| 22:41 | Frozenlock | callen: You say it's weird, but it's actually a described case in https://github.com/clojure/tools.nrepl :-/ |
| 22:42 | callen | Frozenlock: usually you don't embed an nrepl server until you understand Leiningen, dependencies, and nrepl. |
| 22:43 | callen | it's something "advanced" users will do for deployed applications. |
| 22:48 | Frozenlock | You're saying a uberjar is not a deployed application? |
| 22:49 | callen | I'm saying people who don't understand Leiningen, dependencies, or nrepl usually don't need uberjars. |
| 22:49 | callen | or uberjars with working embedded nrepl servers. |
| 22:49 | callen | does anybody know a good flow-charting app on the app store? |
| 22:50 | lordQuas | callen I use touchdraw on the ipad |
| 22:51 | lordQuas | more robust than just flow charts though |
| 22:51 | lordQuas | Does anyone know how to make 'map' keep going if one of the collections is smaller than the other (fillin in with nil or something) |
| 22:52 | Frozenlock | callen: Ok, *assume* for a moment that I understand Lein, dependencies and nrepl. The autocomplete function missing is most probably loaded by Leiningen and I should be able to find from which library it is by looking at Lein source. Correct? |
| 22:52 | chord | callen: how much do you charge for clojure tutorial? |
| 22:52 | callen | Frozenlock: complete/core was missing, yes? |
| 22:53 | Frozenlock | That was the error message, yes. |
| 22:55 | callen | Frozenlock: so, I did some googling based just on your textual description |
| 22:55 | callen | Frozenlock: I'm trying to decide if you should just do the same googling I did, or if I should give you the link. |
| 22:55 | callen | I think if you buy me a blueberry-flavored slushie, we could have a deal. |
| 22:56 | callen | Frozenlock: deal/no deal? |
| 22:56 | Glenjamin | eugh blueberry sucks |
| 22:57 | callen | Frozenlock: fine fine, here it is. https://github.com/clojure-emacs/nrepl.el/issues/318 |
| 22:58 | Frozenlock | callen: Thanks. |
| 22:59 | Frozenlock | Just found this browsing Lein https://github.com/technomancy/leiningen/blob/6853a511f9f68264a9fefd9c706b51faae13fc94/leiningen-core/src/leiningen/core/project.clj#L367 |
| 23:00 | callen | Frozenlock: yes. reading the code. Keep doing that |
| 23:00 | callen | Frozenlock: I will expect my slushie to arrive by flying monkey. |
| 23:01 | Frozenlock | Might be by flying koopa. I'm out of monkeys. |
| 23:02 | callen | koopa works :) |
| 23:03 | Frozenlock | New uberjar done; works like charm. :D |
| 23:04 | callen | Frozenlock: good :) |
| 23:08 | munderwo | Hi all. Im just starting out with clojure. Im updating the dependencies in the project.clj and notice that I can't not put a version number in. I think this is a good idea, but is there a way to just say, give me the latest version of a lib? |
| 23:10 | callen | munderwo: don't do that. |
| 23:11 | munderwo | ok, so how do you find out the latest version? do you just have to look up the project? |
| 23:11 | callen | munderwo: yeah, just google for the github repo or check clojars. |
| 23:13 | munderwo | callen: ok. I understand why you wouldn't just get the latest in a production app. Im just starting out and making faux apps at the moment, and it would be helpful to be able to go "just get me the latest". but thats cool. There i a discipline that I like in it. A tool to do it would be helpful tho. |
| 23:14 | Frozenlock | munderwo: I think there's a 'snapshot' option for that. But I've been out of the Clojure game for a while. :-/ |
| 23:14 | munderwo | Fozenlock: the snapshot is in leon? |
| 23:14 | munderwo | sorry leon? |
| 23:14 | munderwo | GAH! lein? |
| 23:15 | chord | frozenlock you want to make a starcraft clone in clojure? |
| 23:15 | lordQuas | chord: that would be incredible |
| 23:15 | chord | FINALLY SOMEONE THINKS THE IDEA IS GOOD |
| 23:15 | lordQuas | chord: BUT every unit has its own thread with its own ai |
| 23:16 | chord | why is that so critical |
| 23:17 | Frozenlock | munderwo: I really don't remember. I just have a vague idea that there was something for when you are fiddling with your own little dependencies. Perhaps the snapshots in the version number just allows to upload a new version to clojars without changing the version number each time. |
| 23:17 | lordQuas | Im proposing to do something similar in a game design grad school course |
| 23:17 | chord | which is? |
| 23:17 | Frozenlock | chord: I really don't have the knowledge nor the time for that :p |
| 23:18 | lordQuas | War game where each unit is fierciely independent and intelligent, choosing at random (or not) from a personality set |
| 23:18 | lordQuas | Yeah, not a starcraft clone at all actually |
| 23:18 | lordQuas | Either way I love starcraft |
| 23:19 | chord | lordquas rts only |
| 23:25 | munderwo | n00b question: when do you use :require and when do you use :use ? |
| 23:25 | Glenjamin | always use :require |
| 23:25 | carlosgaldino | anyone knows how to get code eval'd on vim? I looked at vim-fireplace and vim-classpath but they require to have lein project or a main function |
| 23:26 | carlosgaldino | I was looking for something that didn't require any of this |
| 23:26 | carlosgaldino | like, if I throw a couple of functions, write some expressions, like a script. I wanted to see that eval'd |
| 23:27 | lordQuas | munderwo: http://stackoverflow.com/questions/7143406/what-are-the-differences-among-require-import-and-use |
| 23:27 | lordQuas | Can somebody explain an idiomatic way to use 'map' with different sized collections? |
| 23:28 | munderwo | lordQuas: thanks. that was the definition of "here let me stack overflow that for you" |
| 23:29 | lordQuas | munderwo: Somebody needs to write a "here let me stack overflow that for you" |
| 23:29 | munderwo | lordQuas: yup, would be totally awsome |
| 23:35 | fkey | Given two vectors, [a b] and [c d], is their a built-in function to combine them to get the result [a b c d] ? |
| 23:37 | metellus | ,(veccat [1 2] [3 4]) ; maybe |
| 23:37 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: veccat in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 23:37 | metellus | ,(concat [1 2] [3 4]) ; maybe |
| 23:37 | clojurebot | (1 2 3 4) |
| 23:38 | lordQuas | (into [] (concat [1 2] [3 4] [5 6])) |
| 23:38 | lordQuas | ,(into [] (concat [1 2] [3 4] [5 6])) |
| 23:38 | clojurebot | [1 2 3 4 5 ...] |
| 23:38 | fkey | ah, just found into right before i alt tabbed. Thanks! =) |
| 23:38 | lordQuas | yup |
| 23:39 | lordQuas | Can sombody please tell me how to use map with different sized collections haha? This has been driving me crazy all day! |
| 23:39 | fkey | metellus: thanks too, going to do some research whats the difference now |
| 23:40 | metellus | concat returns a list instead of a vector |
| 23:40 | fkey | aah |
| 23:40 | metellus | ,(apply vector (concat [1 2] [3 4])) ; this will get you a vector |
| 23:40 | clojurebot | [1 2 3 4] |
| 23:41 | fkey | (into nil [1 2 3]) |
| 23:41 | fkey | oops |
| 23:41 | fkey | ,(into nil [1 2 3]) |
| 23:41 | clojurebot | (3 2 1) |
| 23:41 | fkey | ,(into [] [1 2 3]) |
| 23:41 | clojurebot | [1 2 3] |
| 23:44 | technomancy | heh; from #emacs: "Omit needless forms" -- (and strunk white) |
| 23:47 | carlosgaldino | tpope: is there a way to use vim-fireplace, vim-classpath with a regular clj file that's just a bunch of function definitions, more like a script? |
| 23:50 | carlosgaldino | standalone clj file, not attached to any project or anything |
| 23:55 | lordQuas | technomancy: down with forms! |
| 23:56 | lordQuas | carlosgaldino: I know you dont want to hear this, but emacs evil-mode has come a long way! |
| 23:57 | Glenjamin | oh technomancy, someone told me you have / are working on something to allow multiple versions of the same dependency at the same time |
| 23:57 | Glenjamin | is this true? |
| 23:57 | carlosgaldino | lordQuas: I'm new to this so I don't understand what you're saying |
| 23:57 | carlosgaldino | lordQuas: what does that mean? |
| 23:59 | lordQuas | are you married to using vim? If not, emacs has incredible support for clojure. If you are married to vim, then emacs evil-mode is a way to keep all your vim key-bindings with emacs. |
| 23:59 | carlosgaldino | lordQuas: and in emacs there's a way to eval clojure without needing to have the code inside a leinigen project? |
| 23:59 | lordQuas | Yes |