2011-12-19
| 03:19 | wei_ | has anyone experienced a java.lang.OutOfMemoryError: Java heap space when trying to start a browser repl using (cljs.repl/repl (cljs.repl.browser/repl-env)) ? |
| 03:19 | wei_ | also doing this through nailgun so I'm not sure if that's the issue |
| 03:45 | accel | is there a clojure library that provides a gui repl? i.e. something like "java clojure.main", but wrapped inside some gui elements |
| 03:54 | accel | Is there a standard clojure lirary for pattern matching (or the lisp match macro) ? |
| 03:56 | pyr | i think you're looking for core.match |
| 03:57 | accel | yep just found https://github.com/clojure/core.match |
| 03:57 | accel | and reading its docs |
| 03:57 | accel | examples are nice |
| 04:08 | kral | namaste |
| 04:22 | Blkt | good morning everyone |
| 04:23 | cmdrdats | good morning :) |
| 04:32 | Blkt | :D |
| 04:33 | Scriptor | morning! |
| 05:14 | accel | is there a way in the clojure repl to get documentation. i.e. i wnt to type something like "? map" in the clojure repl; and get the function arguments + short description of how each arg is used |
| 05:14 | kasper | (doc map) |
| 05:14 | clojurebot | "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & ...]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments." |
| 05:14 | accel | (inc kasper) |
| 05:15 | accel | ha! map is lazy? nice |
| 05:15 | accel | oh shit; i need side effects |
| 05:15 | accel | how do I force lazy args ? |
| 05:15 | Vinzent | dorun\doall |
| 05:15 | Vinzent | or just use doseq |
| 05:16 | accel | clojure.core/dorun |
| 05:16 | accel | ([coll] [n coll]) |
| 05:16 | accel | why does this function have two args, i..e [coll] [n coll] |
| 05:16 | accel | rather than just [coll] ? |
| 05:16 | Vinzent | (doc dorun) |
| 05:16 | clojurebot | "([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. dorun can be used to force any effects. Walks through the successive nexts of the seq, does not retain the head and returns nil." |
| 05:17 | accel | It is not obvious to me from the documentation what the 2nd argument does. |
| 05:17 | Vinzent | accel, I don't know, but probably it forces only first n elems of the coll |
| 05:18 | kasper | (source dorun) |
| 05:18 | kasper | accel: will give you the source |
| 05:18 | accel | holy shit |
| 05:18 | accel | mind blonw |
| 05:18 | accel | I can't even spell correctly after taht. |
| 05:19 | accel | Is there a list of cool functions in the repl I should become familiar with besides load-file, doc, and source ? |
| 05:21 | kasper | accel: dont know really |
| 05:22 | Vinzent | maybe bean can be helpful sometimes... Also, there was very handy fn in the old contrib that prints all methods and fields of the given class |
| 05:24 | accel | what is the point of the "chunk-buffer) in (source range) ? |
| 05:28 | accel | is there a way in clojure.main to kill the last command, w/o killing the repl? For example, I load up clojure.main, I type in (range) -- now, I just want to kill the last command, but not the entire repl. |
| 05:31 | Vinzent | in emacs it's C-c C-c |
| 05:32 | accel | hmm; perhaps it is time I read up on vim-gorilla |
| 05:33 | antares__ | hi. I have a problem: I am trying to implement an interface and then pass Class of resulting class around to Quartz. Both proxy and reify result in exceptions that lead me to believe that Quartz cannot instantiate my class (it uses Class#newInstance). defrecord with custom methods does work (but does not let me capture context). What I may be missing? |
| 05:33 | accel | Is Quartz Objective-C or java? |
| 05:33 | antares__ | Java, the scheduler library |
| 05:45 | accel | Is there any relation between IPersistentList and ISeq? |
| 05:55 | raek | antares__: iirc, proxies have one shared class per "signature" (base class and interfaces) |
| 05:56 | raek | and every call to proxy returns an instance of that class |
| 05:56 | antares__ | raek: that's fine with me, I can use (class …). What about constructor visibility? |
| 05:57 | raek | I think the constructor for the proxy class is something internal to the proxy feature of java |
| 05:57 | raek | antares__: when you need a named class you generally ned to use gen-class |
| 05:58 | cemerick | Or deftype or defrecord. |
| 05:59 | raek | antares__: if your usecase is simple enough, maybe you could use cron4j. it is very easy to use from Clojure |
| 06:00 | antares__ | raek: well, Quartz has everything I need and I have a library that makes it easy to use from Clojure, I just cannot figure out this last step :/ |
| 06:01 | antares__ | I guess I will go with defrecord for now |
| 06:01 | raek | antares__: example with cron4j: https://gist.github.com/1496650 |
| 06:02 | antares__ | raek: I need "execute this until date X" kind of feature which cron4j probably does not have |
| 06:02 | antares__ | raek: thanks for the help either way! |
| 06:36 | accel | alright |
| 06:36 | accel | I now need to thread state through a bunch of clojure functions. |
| 06:36 | accel | What is a good example of monads inclojure? |
| 06:38 | Vinzent | accel, https://github.com/clojure/algo.monads |
| 06:58 | AWizzArd | accel: The lib “Pallet” is now also using Monads. In the code repo you can find pratical use cases: https://github.com/pallet/pallet/blob/develop/src/pallet/monad.clj |
| 07:07 | accel | Vinzent , AWizzArd : thanks |
| 07:08 | lnostdal | is "error in process filter: Wrong number of arguments: nil, 0" happening for you guys? this pops up from time to time here |
| 07:10 | Vinzent | yes |
| 07:19 | lnostdal | ..the restarts needed because of it really ruins any collaboration going on with other devs.. i'm not using slime from git or anything, hmm |
| 07:27 | Vinzent | for me it pops up only in a few cases, very rare |
| 07:28 | Vinzent | I do use slime from git, so maybe you should try it too |
| 07:30 | lnostdal | ok, it happens only in rare cases here too .. seemingly at random; or perhaps when my code generates "weird exceptions" -- kind of hard to tell |
| 07:31 | Vinzent | yeah, same symptoms |
| 07:32 | Vinzent | looks like such exceptions' stacktrace is nil |
| 07:32 | raek | lnostdal: what is your slime-net-coding-system set to? |
| 07:33 | raek | if you don't use clojure-jack-in, you need to set it to utf-8-unix manually |
| 07:33 | lnostdal | it is utf-8-unix, raek |
| 07:33 | raek | good. |
| 08:30 | duck1123 | If I want to update my copy of the Closure Library for use with clojurescript, do I just need to replace ./closure/library in the clojurescript project, or are there other considerations I need to take into account? |
| 08:32 | duck1123 | I want to make use of goog.new.Webfinger it looks like it's now part of the released library, but the goog-jar artifact and the one with clojurescript are behind |
| 09:01 | lnostdal | ,(:%answer {:%answer 42}) |
| 09:01 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: :> |
| 09:02 | lnostdal | |
| 09:02 | lnostdal | hum, is combining : and % like that not valid? |
| 09:02 | lnostdal | ,:%test |
| 09:02 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: :> |
| 09:03 | lnostdal | ,:test |
| 09:03 | clojurebot | :test |
| 09:04 | duck1123 | ,(keyword "%answer") |
| 09:04 | clojurebot | :%answer |
| 09:04 | duck1123 | although, if you can't type it out, it's a good indication that you shouldn't be using it as a keyword |
| 09:05 | lnostdal | i'm curious why though |
| 09:05 | lnostdal | it doesn't matter much of course; there are other characters i can use here |
| 09:50 | cmdrdats | O.o clojurebot evaluates clojure code in the channel? |
| 09:50 | cmdrdats | that's awesome :D |
| 09:50 | elderling | seconded. |
| 09:51 | cmdrdats | i'm guessing there's some kind of limitations though? |
| 09:52 | elderling | I think it uses clojail. Can anyone confirm? |
| 09:55 | Vinzent | as far as I know it's written by Raynes |
| 09:57 | cmdrdats | nice - that's useful to know about :) |
| 10:00 | joegallo | you're confusing clojurebot and lazybot |
| 10:00 | joegallo | i think |
| 10:01 | elderling | Agreed. |
| 10:01 | elderling | clojail is the library used by lazybot. |
| 10:01 | elderling | https://github.com/flatland/clojail |
| 10:03 | TimMc | lnostdal: Symbols and keywords have a restricted character set. Some characters will work that are not formally supported, but you shouldn't use them. |
| 10:03 | TimMc | I guess just stay away from any ASCII that isn't explicitly mentioned in http://clojure.org/reader -- I think other Unicode is fine. |
| 10:39 | fdaoud | wow, I didn't know there were these online "try<language>" for every language that wants respect :) |
| 10:43 | choffstein | Hey all. Quick question: is there a way to get leiningen to pull a dependency from a private github repo? If not, does anyone know a place that does private maven repo hosting? |
| 10:44 | dmansen | if you clone the repo and run lein install, it should get installed to your local maven repo (in ~/.m2 |
| 10:44 | dmansen | and then other projects should pick it up |
| 10:45 | raek_ | choffstein: you can push your private version of a library (assuming it's an open source lib) to clojars by changing the group name to org.clojars.<username> |
| 10:45 | choffstein | raek_: Okay, thanks |
| 10:46 | choffstein | Well, actually, no, that doesn't help me. It's not opensource :D |
| 10:46 | raek_ | the version you push will be public, though |
| 10:47 | choffstein | Yeah. Looks like cemerick has an article about (ab)using github as a maven repo. I might try that |
| 10:47 | raek_ | choffstein: if you need to collaborate with other, it's probably best to set up a private maven repo |
| 10:47 | choffstein | raek_: No need to collab -- just need somewhere that heroku can pull the deps from |
| 10:49 | raek_ | hrm... |
| 10:49 | choffstein | Yeah. I'm going to try this bastardisation of github. If that doesn't work, I'll try a more robust solution |
| 11:33 | choffstein | cemerick: you around? |
| 11:55 | choffstein | anyone have any success using leiningen to deploy to a local maven repo? |
| 11:56 | licenser | choffstein: yap |
| 11:56 | licenser | did a lein install and it worked fine |
| 11:57 | choffstein | licenser: Anyway I can take a peak at the relevant config info? I'm having a devil of a time getting this to work |
| 11:57 | choffstein | sorry -- should have specified -- not just a lein install. Through lein deploy to another local maven repo |
| 11:57 | licenser | choffstein: you could but there is none, I just simply did lein install |
| 11:58 | licenser | ah play |
| 11:58 | licenser | ah okay, sorry can't help there |
| 11:58 | choffstein | no worries |
| 12:15 | choffstein | Anyone know how to get maven to work with absolute directories? I can only seem to get it to work with relative directories… e.g. "file:../my-repo vs "file:/Users/choffstein/dev/my-repo" |
| 12:16 | hiredman | you need more slashses at the start of file urls |
| 12:16 | hiredman | http://en.wikipedia.org/wiki/File_URI_scheme |
| 12:16 | choffstein | idiot … idiot … idiot |
| 12:17 | choffstein | hmm. file:///Users/choffstein/dev/my-repo doesn't seem to work either |
| 12:19 | choffstein | Just kidding. User error. |
| 12:27 | krey | Hey, why is clojure struct obsolete and record the way to go? |
| 12:27 | krey | See Clojure Homepage @ StructMaps: Note: Most uses of StructMaps would now be better served by records. |
| 12:29 | krey | Tried to migrate my example application using memcached to records,... have problems with serializing/deserializing |
| 12:29 | krey | binding [*print-dup* true] << works to serialize the record. But it is not evaluated if I read it back from memcached |
| 12:35 | technomancy | choffstein: I have a thing |
| 12:35 | technomancy | in which you may be interested |
| 12:35 | technomancy | https://github.com/technomancy/s3-wagon-private |
| 12:36 | choffstein | technomancy: awesome. I'll take a look. Thanks |
| 12:36 | technomancy | lightly tested; very much interested in feedback |
| 12:36 | technomancy | it's based on an s3 deployer from spring, but theirs is hard-coded to be public |
| 12:37 | choffstein | I'll take a gander. my biggest issue is giving heroku access to the repo. init.clj doesn't float over, unfortunately. |
| 12:37 | technomancy | yeah, probably want to use environment variables for that |
| 12:39 | choffstein | I think so |
| 12:40 | krey | technomancy << wow, he is really there |
| 12:41 | Vinzent | krey, what do you mean? (-> (Foo. 1 2 3) pr-str read-string class) returns user.Foo here |
| 12:41 | technomancy | choffstein: working on getting better documentation for that whole story, but making sure it's well tested is a good first step |
| 12:42 | krey | I'm using spymemcached to store my k,v pairs |
| 12:43 | krey | (item-store (binding [*print-dup* true] (pr-str (entity))) << it looks like this |
| 12:43 | krey | After I look to my memcached instance the value is there... |
| 12:43 | krey | But I can't read it back to a record |
| 12:45 | choffstein | I hate when something seems like it works perfectly … but somehow you don't get the results you are looking for. lein deploy keeps telling me it is running successfully, but none of the files seem to be showing up where I expect them to. |
| 12:46 | technomancy | on s3? |
| 12:46 | Vinzent | krey, is it throws exception or something? what the string looks like? |
| 12:46 | krey | I can not connect to the computer where I stored the example... |
| 12:47 | krey | it looks like the default definition starting with # class { param map } |
| 12:47 | simard | is there a function to return a sequence after skipping n elements ? |
| 12:48 | krey | When I print it to stdout, the output is escaped, ... But when I enter it without escaping to the console it gets evaluated |
| 12:48 | krey | I get it back as a string,... |
| 12:49 | Vinzent | simard, ##(drop 3 (range 5)) |
| 12:49 | choffstein | technomancy: nah, locally. also, I think I am just confused about how lein deps expects to find data compared to my maven repo. I deploy to a maven repo and get files like: gears-1.0.0-20111219.172346-1.pom, then lein deps says it is trying to get gears-1.0.0.pom and fails. |
| 12:49 | Vinzent | ,(drop 3 (range 5) |
| 12:49 | krey | technomancy, what is the s3 wagon? |
| 12:49 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 12:49 | choffstein | I can't tell if lein is just pretty-printing debug info and cutting the cruft, or if I am deploying to my maven repo wrong |
| 12:49 | simard | Vinzent: drop, thank you |
| 12:50 | krey | A place to store versions of the software in a S3 bucket? |
| 12:50 | technomancy | choffstein: the numbers after the 1.0.0 mean it's a snapshot version |
| 12:50 | mrb_bk | Design question: If I'm working on a binary data parser, and I want to store and refer to certain pairs of byte lengths and contents by name, would records be a good fit? |
| 12:50 | technomancy | it means you haven't deployed 1.0.0 but 1.0.0-SNAPSHOT |
| 12:50 | choffstein | technomancy: I am trying to do a snapshot version though. My deps is 1.0.0-SNAPSHOT |
| 12:51 | mrb_bk | i.e. I want to have a [5 :magicnumber '(0 0 0 0 1)'] data structure that i can refer to by the name :magicnumber |
| 12:51 | technomancy | choffstein: you said it's trying to get gears-1.0.0.pom? |
| 12:52 | choffstein | that's because I am stupid and can't type. gears-1.0.0-SNAPSHOT.pom is what I meant. |
| 12:52 | choffstein | Which should work, right? |
| 12:53 | choffstein | Ohhh … I bet it is failing because heroku doesn't have my ssh key. *doh* |
| 12:54 | technomancy | choffstein: feel free to take it to /msg if you're having trouble |
| 12:54 | Vinzent | krey, well I don't know what to say without knowing exception that has been thrown |
| 12:54 | choffstein | yeah, this isn't general banter. my bad. just venting. sorry |
| 12:55 | technomancy | heh; no worries |
| 12:55 | krey | Vinzent: I'll be back here when I've access to the sourcecode |
| 12:55 | krey | No exception is beeing thrown |
| 12:56 | krey | the problem is, that the data comes back as string, and I can not find a way to make it behave like data |
| 12:58 | Vinzent | krey, ah! use read-string, as I've showed earlier |
| 12:59 | dmansen | silly question, but...how is "leiningen" pronouced? |
| 12:59 | krey | awhhhh,... damn haven't seen it cause I've excepted it to take a stream or something as argument |
| 13:00 | technomancy | dmansen: 'laɪnɪŋən |
| 13:00 | technomancy | (LINE-ing-en) |
| 13:00 | dmansen | aha! thanks |
| 13:00 | technomancy | if you've seen the movie "The Naked Jungle", they get it wrong. |
| 13:01 | technomancy | dmansen: would it be possible to just bind *color-support?* rather than storing it in a reference type? |
| 13:02 | Vinzent | hm, lein is also pronounced as LINE? |
| 13:02 | technomancy | or do we have threading issues? |
| 13:02 | technomancy | Vinzent: yeah |
| 13:02 | dmansen | technomancy: will the exception function always be called within the same thread? |
| 13:02 | technomancy | dmansen: I was hoping you'd know. =) |
| 13:03 | dmansen | i'm a bit fuzzy on how many / what threads are in swank |
| 13:03 | dmansen | ahaha |
| 13:03 | technomancy | I bet hugoduncan would know. |
| 13:03 | krey | What do you think about defrecord2 ? |
| 13:04 | technomancy | dmansen: I'll give it a try |
| 13:06 | dmansen | technomancy: yeah, no point in using a ref if it isn't necessary |
| 13:08 | technomancy | dmansen: yeah, looks like that happens in a different thread |
| 13:08 | technomancy | I'll switch to using an atom instead |
| 13:10 | dmansen | technomancy: ah, makes more sense. i'm still getting a handle on when to use the different concurrency types |
| 13:10 | technomancy | dmansen: well to be fair the swank codebase is a terrible place to learn that |
| 13:10 | technomancy | considering most of it was written before atoms had been implemented |
| 13:10 | dmansen | ah! i see |
| 13:11 | dmansen | i'll refresh my memory tonight from joy of clojure |
| 13:11 | technomancy | also doesn't need to be dynamic |
| 13:17 | dmansen | technomancy: this is my first open source contribution ever, haha |
| 13:17 | dmansen | probably should have gone with something less ridiculous.. |
| 13:17 | technomancy | not too shabby! |
| 13:17 | dmansen | ty! |
| 13:17 | simard | I have a function that builds a tree, in which there are lazy sequences. When I eval the expression in slime, there is no problem, but when I try to walk it with some function of a Protocol I defined, it says my function cannot take a lazy sequence for input. Where should I force the evaluation of the tree so that no lazy sequences remain ? |
| 13:18 | hiredman | technomancy: is there some mechanism to load lein hooks without having to put them in project.clj? |
| 13:18 | simard | by eval with slime, I mean slime's printer forces the evaluation. |
| 13:18 | technomancy | hiredman: you could load them from ~/.lein/init.clj |
| 13:18 | technomancy | you could also set :hooks to :auto to have it search the classpath, but that's slow |
| 13:19 | technomancy | simard: (doto my-seq str) will force every level of it |
| 13:19 | hiredman | so I could plugin install the hook, and then do (require 'lein.some.hook) in init.clj? |
| 13:19 | technomancy | hiredman: precisely |
| 13:19 | technomancy | hiredman: recommended if it's a convenience-type hook |
| 13:20 | samaaron | oh yeah clojurebot - spoil the announcement before it's made... |
| 13:23 | raek_ | samaaron: "it says my function cannot take a lazy sequence for input" - why? |
| 13:23 | raek_ | sorry, simard |
| 13:25 | simard | raek: No implementation of method: :output of protocol: #'kiwiz.core/Library-Printer found for class: clojure.lang.LazySeq |
| 13:25 | simard | this shouldn't happen anyway. |
| 13:25 | simard | wait :) |
| 13:26 | raek | if you're extending you protocol to clojure data, you should have an implementation for ISeq |
| 13:26 | raek | ISeq includes PersistentList and LazySeq |
| 13:26 | simard | oooh wait I found why.. no I didn't mean to do that. |
| 13:27 | simard | I did a (list (map ..) (map ..)) where I meant to do (concat (map ..) (map ..)) |
| 13:29 | raek | is the "defonce-ness" of defmulti actually documented anywhere? |
| 13:38 | cemerick | choffstein: hi :-) |
| 13:38 | choffstein | cemerick: Hello! I was reading your lovely blog post about setting maven up on github and had a few questions. I left them as comments to the post. |
| 13:53 | amalloy | raek: i don't think so, unless you count "you can figure it out if you happen to read the source" as documentation |
| 13:55 | amalloy | simard: (str some-lazy-seq) doesn't force any levels at all, right? sounds more like pr-str |
| 13:56 | amalloy | hm, and i meant that one to go to technomancy |
| 13:56 | simard | good for me .. :) |
| 13:56 | technomancy | amalloy: aha, you are correct |
| 13:57 | cemerick | choffstein: you trailed off without asking your first question in your comment :-) |
| 13:57 | choffstein | cemerick: no, that's just my writing style ;) |
| 13:57 | choffstein | Hold on, I'll edit |
| 13:58 | technomancy | dmansen: I wonder if clj-stacktrace could be taught new patterns to colorize |
| 13:58 | dmansen | technomancy: how do you mean? and i'm sure that's possible |
| 13:58 | technomancy | right now swank frames are colored the same as your own program's, which isn't too helpful |
| 14:00 | dmansen | clj-stacktrace.repl is explicit in the docs about how it colors things |
| 14:00 | dmansen | so i'm sure i could fix that |
| 14:00 | technomancy | just deployed the colorization stuff to clojars |
| 14:01 | raek | amalloy: IIRC, (str some-lazy-seq) actually forces the outermost seq. the default implementation of .toString uses .hashCode, which forces the seq |
| 14:01 | amalloy | hah |
| 14:01 | amalloy | &(str (range)) |
| 14:02 | technomancy | dmansen: actually hang on; I have some code to allow it to pass in frames to omit that I haven't pushed yet |
| 14:02 | technomancy | we could base the new colorization rules on that |
| 14:02 | amalloy | oh, lazybot isn't here anyway. not going to learn much from him |
| 14:02 | amalloy | ,(str (range)) |
| 14:02 | clojurebot | Execution Timed Out |
| 14:03 | dmansen | technomancy: okay. it seems super easy to add in any case |
| 14:05 | raek | anyone know where I read about the Jira workflow? I remember having seen a nice flow diagram. |
| 14:05 | raek | duh. found it under Clojure Design -> JIRA usage proposal |
| 14:15 | TimMc | amalloy: What did happen to lazybot? |
| 14:15 | TimMc | &(print "I'm back!") |
| 14:15 | lazybot | ⇒ I'm back!nil |
| 14:15 | TimMc | oh good |
| 14:16 | amalloy | TimMc: i dunno. some sysadmin-related thing that we're no good at, usually. Raynes restarted him |
| 14:17 | Raynes | Sometimes bad things happen to good bots. |
| 14:17 | amalloy | Raynes: put lazybot on heroku? |
| 14:17 | Raynes | No. |
| 14:17 | technomancy | getting shuffled around all the time would give him motion sickness. |
| 14:18 | amalloy | &(shuffle (range)) |
| 14:18 | lazybot | Execution Timed Out! |
| 14:20 | TimMc | It would be cute to have a system load graph as a sparkline, like $load -> ___,-'\__ |
| 14:20 | technomancy | TimMc: I would totally use that |
| 14:21 | technomancy | I've got a key bound to pop up a notification bubble with the load average numbers, but something visual would be way better |
| 14:21 | TimMc | I was thinking of one for the bot. |
| 14:22 | TimMc | For my desktop I just have a graph in gnome-panel. |
| 14:22 | technomancy | why should bots have all the fun? |
| 14:22 | technomancy | TimMc: yeah, but that wastes screen space when you're not interested in it |
| 14:23 | technomancy | nicer to have it bound to a key so you just see it on demand |
| 14:23 | TimMc | A few years ago I actually discovered a worm had infected my laptop when I noticed the graph was wonky. |
| 14:23 | technomancy | would be better to have a key binding to toggle the visibility of the panel, but considering the panel is going away in gnome 3 it's not worth investing the time in implementing such a thing. |
| 14:24 | TimMc | Ugh, GNOME 3... let us speak no more of it. |
| 14:25 | jhirn | I like conky for system metrics on the desktop |
| 14:26 | jhirn | little bit of LUA ftw. |
| 14:26 | tscheibl | TimMc: what's your problem with GNOME 3 .. respectively the GNOME Shell? |
| 14:26 | TimMc | tscheibl: I bought a laptop, not an iPad. |
| 14:26 | TimMc | It feels like I'm using a toy. |
| 14:26 | tscheibl | I appreciate the much cleaner UI |
| 14:27 | tscheibl | it took me a few hours to get used to it |
| 14:27 | tscheibl | .. and it definetely improved my workflow |
| 14:27 | technomancy | it looks nice, but they just stripped out everything I actually use in the panel |
| 14:27 | jhirn | yes, and the new panel is early beta at best. |
| 14:27 | tscheibl | ..especially with a multimonitor setup |
| 14:27 | technomancy | it's a huge pain to get the system monitor plugged back in, you can't make it vertical, and you can't autohide it. |
| 14:28 | jhirn | but conky is so much better than system monitor. |
| 14:28 | technomancy | jhirn: isn't conky designed to run as a desktop background? |
| 14:29 | jhirn | yeah. I just switch to a seperate desktop if somethign is covering it. |
| 14:29 | technomancy | hm. I wouldn't want something that required a context switch like that. |
| 14:29 | jhirn | works for me since i don't use more than one |
| 14:29 | technomancy | the libnotify bubbles are perfect for that, but they're limited to text |
| 14:29 | technomancy | well, text plus a static icon anyway |
| 14:29 | jhirn | Most of the times I don't maximize my runnign apps. 1920 res |
| 14:29 | jhirn | so I can deal with 200px chopped off. |
| 14:30 | jhirn | especially if I want to know current drain of battery in mW. |
| 14:32 | tscheibl | I converted to running everything maximized now... thanks to the dynamic workspaces |
| 14:33 | tscheibl | Windows are bad anyway |
| 14:33 | jhirn | Emacs is the only thing that gets full screen, but that's transparent so conky shines though =) |
| 14:33 | tscheibl | ..at least floating and overlapping ones |
| 14:33 | weavejester | technomancy: Do you know yet how lein 2.0 is going to handle project-specific plugins? |
| 14:33 | technomancy | tscheibl: did they ever add the ability to jump straight to workspace N, or is it still O(N) to get to a workspace? |
| 14:34 | tscheibl | you can add a plugin |
| 14:34 | technomancy | jhirn: doesn't that wreck the readability? |
| 14:34 | tscheibl | that gives you a selector in the upper panel |
| 14:34 | technomancy | tscheibl: with the mouse? =( |
| 14:34 | jhirn | technomancy: readability of emacs or what's underneath? |
| 14:34 | technomancy | jhirn: was thinking the former, but I guess it would mess up both. |
| 14:34 | jhirn | I use just a shade of transparency. |
| 14:34 | tscheibl | I believe there are shortcuts.. I will find out... |
| 14:35 | jhirn | I think I use 89/80 for active/inactive |
| 14:37 | sorenmacbeth | technomancy: fyi, latest swank-clojure 1.3.4-SNAPSHOT errors out on ansi-color-apply not being defined. If I do an M-x ansi-color-for-comint-mode-on, then I get very pretty colored stacktraces |
| 14:37 | technomancy | sorenmacbeth: ah, so something needs to be required first on the Emacs side? |
| 14:37 | sorenmacbeth | technomancy: yeah |
| 14:38 | technomancy | sorenmacbeth: hadn't occurred to me that there could be an emacs instance without ansi-color.el loaded. thanks for the heads-up. |
| 14:38 | tscheibl | technomancy: you can add that keyboard shortcuts in system-settings->keyboard->shortcuts->navigation |
| 14:39 | tscheibl | I've put them to alt-ctrl-1 2 3 4 ... |
| 14:39 | tscheibl | set them |
| 14:39 | technomancy | tscheibl: good to know. hopefully by the time gnome2 goes away entirely all these panel fixes that are currently manual will have been mainlined. |
| 14:40 | sorenmacbeth | technomancy: np. I added this to my init.el for now: (add-hook 'slime-repl-mode-hook 'ansi-color-for-comint-mode-on) |
| 14:40 | technomancy | weavejester: we have some plans. no concrete impl yet. |
| 14:40 | weavejester | technomancy: Ah, okay :) |
| 14:41 | technomancy | weavejester: the idea is to fold dev-deps into just another profile that's applied by default, but that means the deps will all be commingled, so lein can't look in a specific place for plugins |
| 14:41 | technomancy | so plugins will have to be in a separate list in project.clj |
| 14:41 | weavejester | technomancy: I think I might suggest to Mark that they use "lein deps" rather than "lein deps :no-dev" in Heroku for the time being. |
| 14:41 | tscheibl | technomancy: you can use these plugins http://intgat.tigress.co.uk/rmy/extensions/index.html to get almost the same look&feel as in gnome2 |
| 14:41 | technomancy | weavejester: which is better anyway, since the current dev-deps complects stuff that runs in leiningen and stuff that runs in the project process. |
| 14:41 | weavejester | technomancy: I thought it might be something like that. |
| 14:43 | technomancy | weavejester: the majority of lein plugins are intended for development-time only; and some of them could even be considered harmful in production. |
| 14:43 | weavejester | technomancy: Hm, true... |
| 14:43 | technomancy | so it's unlikely to ever be the default on lein1, but it should be opt-in |
| 14:43 | weavejester | technomancy: I guess opting in on Heroku is just "heroku lein deps" |
| 14:44 | weavejester | technomancy: I guess I'll have to wait until lein 2.0 for it to be the default. |
| 14:45 | technomancy | yeah, this is exactly the kind of problem that comes from mixing dev-deps and plugins |
| 14:45 | technomancy | I'm surprised it didn't cause problems eariler |
| 14:46 | weavejester | Has any work been done on a Cake-style persistent JVM for Lein? |
| 14:47 | technomancy | been delegating that to jark |
| 14:47 | technomancy | they've started on it; I don't know if it's working yet. |
| 14:47 | technomancy | last I checked over the summer I couldn't get it to build. |
| 14:47 | weavejester | Does Jark support loading new deps? |
| 14:48 | cemerick | weavejester: new jars, yes, not deps yet |
| 14:49 | weavejester | cemerick: Ah, thanks |
| 14:52 | sorenmacbeth | technomancy: forgot to mention I am on emacs 24, so ansi-color.el isn't loaded by default there. also using starter-kit and the eshell, bindings, and lisp packages (thanks!) |
| 14:52 | technomancy | cool =) |
| 14:54 | weavejester | Time to see if these new ATI drivers will let me run Gnome 3... or screw up my computer :) |
| 14:59 | brehaut | weavejester: popular opinion suggests that running gnome 3 is screwing up your computer |
| 15:00 | Raynes | brehaut: Popular opinion suggests that Vim is tainting your mind. |
| 15:00 | francium | http://shootout.alioth.debian.org/u32/compare.php?lang=clojure |
| 15:00 | brehaut | Raynes: as long as it also includes emacs in that category, its right ;) |
| 15:00 | francium | ^seems like you write the same amount of java code as clojure code? |
| 15:00 | brehaut | francium: the shootout isnt a very good measure of anything except for shootout code |
| 15:00 | technomancy | francium: alioth benchmarks are nearly worthless |
| 15:01 | Raynes | francium: I imagine that that is on purpose. To get Java-like speed you tend to want to write Java-like code. |
| 15:01 | Raynes | technomancy: Do you actually use slamhound for anything? |
| 15:02 | francium | why are the benchmarks worthless? |
| 15:02 | francium | i'm just trying to get a rough idea of what would be a good lang to use for a new project |
| 15:02 | brehaut | is that a rhetorical question? |
| 15:02 | francium | no |
| 15:03 | technomancy | Raynes: I'm still kinda blocked on two things: pretty-printing the ns form, and supporting non-obvious :require :as alias names |
| 15:03 | francium | i'm just trying to get a rough idea of code written /speed |
| 15:03 | amalloy | francium: because everyone uses the same C libs, and because who really cares about performance on benchmarks like these when you spend most of your time thinking? |
| 15:03 | Somelauw | ,(get '(()) 0) |
| 15:03 | clojurebot | nil |
| 15:03 | Somelauw | Shouldn't that be ()? |
| 15:03 | amalloy | no |
| 15:03 | amalloy | lists are not random-access |
| 15:04 | ibdknox | (get ['()] 0) |
| 15:04 | ibdknox | ,(get ['()] 0) |
| 15:04 | clojurebot | () |
| 15:04 | technomancy | Raynes: someone mentioned taking a shot at fixing the ns pretty-printer yesterday, but I forget their nick |
| 15:04 | Raynes | ibdknox: YOU! |
| 15:04 | Somelauw | Oh, get doesn't work at all on sequences. |
| 15:05 | Somelauw | Then why not make it throw an error or something? |
| 15:06 | ibdknox | ,(doc get) |
| 15:06 | clojurebot | "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present." |
| 15:08 | TimMc | &(indexed? (range)) |
| 15:08 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: indexed? in this context |
| 15:08 | hiredman | technomancy: that would be neat, I've been fiddling a little bit with rewriting ns forms to conform to "sonian style" (alphabetizing, etc) |
| 15:08 | TimMc | Hmm, what am I looking for? |
| 15:08 | hiredman | and pretty printing the form is the hardest bit |
| 15:09 | TimMc | &(associative? (range)) |
| 15:09 | lazybot | ⇒ false |
| 15:09 | hiredman | steve wants a tool to refactor :use :only to :require :as |
| 15:09 | TimMc | Somelauw: get only works on associative data structures. I guess it really should throw there. |
| 15:10 | TimMc | ,(println "hiredman: Is alphabetizing imports done to make merges easier?") |
| 15:10 | clojurebot | hiredman: Is alphabetizing imports done to make merges easier? |
| 15:11 | Somelauw | Thanks, I get that it works on at least Map and Vector. |
| 15:11 | TimMc | Somelauw: You'll want nth on seqs, I think. |
| 15:12 | Somelauw | TimMc: Yes, that is right. |
| 16:06 | weavejester | I've discovered that proprietary ATI drivers for Linux still suck. |
| 16:08 | cemerick | video cards have drivers? ;-) |
| 16:10 | raek | this is a very compelling reason to get a Mac... |
| 16:12 | Scriptor | macs have video cards? :p |
| 16:13 | Raynes | No. They ship the macs with an employee manually lighting pixels behind the screen. |
| 16:13 | cemerick | I dunno, there's some stuff in there that makes these glass panels light up. |
| 16:14 | cemerick | There was some hair on my keyboard this morning; I'm not sure if it was from my cat, or the squirrels in the computer pumping signals out the monitor cable. |
| 16:14 | Raynes | cemerick: I read that as "There was some noir on my keyboard this morning;" |
| 16:15 | tscheibl | and some korma... |
| 16:15 | cemerick | ibdknox needs to stay away from my keyboard from now on. |
| 16:16 | tscheibl | does anyone have any insight on what's going on with clojureql? the clojureql.org website went down yesterday I believe |
| 16:17 | cemerick | hrm, that's no good. |
| 16:17 | Raynes | afaik, it is still being worked on. |
| 16:17 | cemerick | domain expired on 12/14! |
| 16:18 | ibdknox | cemerick: I was just installing some software on there ... |
| 16:18 | tscheibl | I'm using it quite heavily at the moment... with my own extensions which I will eventually push to a new fork... |
| 16:18 | mcrittenden | absolute clojure newbie here, wondering how I can create a list from within a doseq call, so each time, a new item is added to the list. do I use (conj list-name item)? |
| 16:19 | tscheibl | mcrittenden: use reduce |
| 16:19 | TimMc | or map |
| 16:19 | ibdknox | mcrittenden: or take a look at for, the result of each iteration of the list will go into a seq |
| 16:19 | TimMc | mcrittenden: Are you just trying to produce a new list based on some existing list? |
| 16:19 | ibdknox | lol |
| 16:19 | mcrittenden | awesome, thanks all |
| 16:20 | TimMc | mcrittenden: conj returns the new collection, it doesn't alter an existing one. |
| 16:20 | mcrittenden | TimMc: yes, I'm creating a list of directories within a specific directory, so this is what I have so far https://gist.github.com/1498926 |
| 16:20 | mcrittenden | ah |
| 16:20 | mcrittenden | I'll take a look at reduce vs. map vs. for |
| 16:21 | Raynes | Yeah, that's definitely an imperative solution you're going for there. You don't do that in Clojure. |
| 16:21 | TimMc | mcrittenden: You can write that with a filter and a map. |
| 16:21 | mcrittenden | awesome. yeah this is my first experience w/ FP, just started an hour ago :D |
| 16:21 | mcrittenden | thanks guys |
| 16:21 | TimMc | (map #(.getName %) (filter #(.isDirectory %) (.listFiles d))) |
| 16:21 | Raynes | mcrittenden: It's totally cool. We're here to help. |
| 16:22 | TimMc | mcrittenden: ^ |
| 16:22 | ibdknox | I'm here to complain, actually. :D |
| 16:22 | raek | mcrittenden: this is another solution: (for [f (.listFiles d), :when (.isDirectory f)] f) |
| 16:22 | mcrittenden | any info on what the # and % do there, TimMc? |
| 16:23 | ibdknox | (inc raek) |
| 16:23 | lazybot | ⇒ 13 |
| 16:23 | mcrittenden | ah nice raek |
| 16:23 | TimMc | mcrittenden: Sure. #(...) is reader syntax for an anonymous inline function. |
| 16:23 | Raynes | #(foo) = (fn [] (foo)), #(foo % %2) = (fn [x y] (foo x y)) |
| 16:23 | TimMc | raek: oooh, I like that |
| 16:23 | Raynes | It's a shortcut for anonymous functions. |
| 16:23 | raek | mcrittenden: ah, you're the guy whose question I just answered on stackoverflow... :-) |
| 16:23 | tscheibl | ibdknox: you killed clojureql... ;) |
| 16:23 | brehaut | ,'#(inc %) |
| 16:23 | mcrittenden | yup raek, that's me :) |
| 16:23 | clojurebot | (fn* [p1__27#] (inc p1__27#)) |
| 16:23 | ibdknox | tscheibl: whoops |
| 16:24 | mcrittenden | small (clojure) world I guess |
| 16:24 | ibdknox | knocked it clean off the internet :p |
| 16:24 | krey | Hey ;) read-string worked |
| 16:24 | Raynes | It tends to do that. |
| 16:25 | krey | It works now. I'm really happy with clojure |
| 16:26 | raek | mcrittenden: also, think of 'def' as way to define global *constants*. you should not normally alter the value of a var (what def creates) at runtime |
| 16:26 | brehaut | krey: do you know about *read-evai* ? |
| 16:26 | krey | Does anyone know how to get the value off clj-time (now) formatted ? It tells me that it can not be casted to a string if I try to. Maybe (now) is the wrong thing |
| 16:26 | TimMc | &(:a (read-string (pr-str {:a [3 4 'b]}))) |
| 16:26 | lazybot | ⇒ [3 4 b] |
| 16:26 | krey | no brehaut , never heard about it |
| 16:27 | brehaut | (doc *read-eval*) |
| 16:27 | clojurebot | "; When set to logical false, the EvalReader (#=(...)) is disabled in the read/load in the thread-local binding. Example: (binding [*read-eval* false] (read-string \"#=(eval (def x 3))\")) Defaults to true" |
| 16:27 | tscheibl | I was about learning a new programming language each year.. last year it was scala... now it's clojure... but I don't want to move away from clojure any more... |
| 16:27 | TimMc | ,(read-string "#=(+ 1 2)") |
| 16:27 | clojurebot | #<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.> |
| 16:27 | dmansen | tscheibl: i used to like scala, until i moved to clojure and noticed it has all the goodness of scala at a tiny fraction of the size... |
| 16:27 | TimMc | tscheibl: Is the full year up? |
| 16:27 | tscheibl | ..yep... scala was too much syntax |
| 16:28 | brehaut | krey: from memory you want unparse |
| 16:28 | krey | too much syntax ack |
| 16:28 | dmansen | tscheibl: i tried many times to write scala code. but every time i just got hung up on the tooling |
| 16:28 | tscheibl | TimMc: yeah on 31. of Dec ;) |
| 16:28 | dmansen | i could never get anything done |
| 16:28 | devinus_ | technomancy: have you had a chance to see https://github.com/technomancy/swank-clojure/issues/88 ? |
| 16:29 | tscheibl | dmansen: I even did spring-osgi with scala on spring dm-server... |
| 16:29 | dmansen | damn |
| 16:29 | krey | yes brehaut , is there a way to work without the binding instruction when serializing records? >> (binding [*print-dup* true] (prn-str data)) |
| 16:29 | tscheibl | .. but got bitten by a nasty annotation bug when using enums |
| 16:30 | raek | mcrittenden: https://gist.github.com/1498952 |
| 16:30 | tscheibl | .. which they still havent't fixed |
| 16:30 | mcrittenden | raek awesome! i was almost there |
| 16:30 | brehaut | krey: are you still talking about clj-time data? |
| 16:30 | mcrittenden | thanks a ton |
| 16:31 | krey | brehaut: I want to get a timestamp of the current time to assign it in my record |
| 16:31 | krey | I save the record to memcached, the field is called "created" |
| 16:31 | brehaut | krey: because clj-time doesnt use records. It is built on JodaTime. you want to use clj-time.format/unparse if you want it as a string |
| 16:32 | brehaut | krey: see also https://github.com/seancorfield/clj-time/blob/master/src/clj_time/format.clj#L143-147 |
| 16:33 | brehaut | krey: calling clj-time.format/show-formatters in your repl will list all the available built in formats. if none match what you want, then you can define your own too |
| 16:33 | krey | okay... can you suggest one? |
| 16:33 | mcrittenden | raek what's up with that :when? I would have never discovered that, with the colon, and can't find docs on it |
| 16:33 | raek | mcrittenden: another beginner advice: try to write your functions so that they only return whatever they compute and so that they don't do any side-effects (setting variables, etc) |
| 16:33 | brehaut | krey: no because that depends on your needs |
| 16:33 | krey | ;) |
| 16:34 | ibdknox | amalloy: jfw = juxt for the win. |
| 16:34 | ibdknox | use it wisely. |
| 16:34 | amalloy | ibdknox: C-f juxt - no results? |
| 16:35 | raek | mcrittenden: 'for' is a relatively complex macro, but it allows you to write very succint code. when you are learning the language maybe it's better to stick with the underlying 'map' and 'filter' functions |
| 16:35 | mcrittenden | raek I know :whatever is a keyword, but I thought that was mostly for use in map keys |
| 16:35 | ibdknox | amalloy: twas a side conversation, thought you might enjoy the use of this acronym |
| 16:35 | mcrittenden | raek ok, thanks |
| 16:36 | raek | mcrittenden: yes, that is the most common usage. you can also use it for keyword arguments to functions (or macros) |
| 16:36 | mcrittenden | gotcha |
| 16:36 | mcrittenden | interesting stuff |
| 16:36 | krey | clojurestack.core=> clj-time.format/show-formatters #<format$show_formatters clj_time.format$show_formatters@19c7c21> mhhh |
| 16:37 | tscheibl | mcrittenden: I'm doing clojure for about a year now and have never needed 'for' |
| 16:37 | ibdknox | tscheibl: for is fantastic |
| 16:37 | dmansen | tscheibl: i used for the other day for a process that generated a large tree of results that needed to be collected |
| 16:37 | ibdknox | in several cases for leads to much more readable code than (map ...) would |
| 16:38 | dmansen | otherwise, i normally would just use map / filter |
| 16:38 | tscheibl | that's what I do... and a good deal of reduce |
| 16:39 | kotarak | ibdknox: Hi. Does korma have to depend on log4j and ship with a log4j confirugation? |
| 16:39 | technomancy | hiredman: slamhound already does a lot of that ns stuff |
| 16:39 | technomancy | the hard part is figuring out where the line breaks go |
| 16:39 | amalloy | for is just so much more concise for manymany kinds of sequence transformation |
| 16:40 | amalloy | i'm actually in the middle of my very first time using the :while clause in for. exciting times |
| 16:40 | hiredman | technomancy: right, that's where I stopped to think about it, and haven't continued |
| 16:40 | dmansen | for is just the list monad, yes? |
| 16:40 | ibdknox | kotarak: does it have to, no |
| 16:40 | technomancy | an automated tool to go from :use :only to :require :as would be slick. |
| 16:40 | brehaut | dmansen: yes |
| 16:40 | ibdknox | kotarak: I was just trying to get rid of the incredibly annoying c3p0 messages that shouldn't be there for people who are just starting |
| 16:40 | raek | mcrittenden: more variations using simpler building blocks: https://gist.github.com/1498952 |
| 16:40 | brehaut | dmansen: minus the generality of a monadic definition |
| 16:41 | technomancy | might need a lossless reader for that though =) |
| 16:41 | dmansen | brehaut: right, i was really happy when i found that construct |
| 16:41 | dmansen | very helpful |
| 16:41 | hiredman | orly |
| 16:41 | hiredman | man, where could we get one... |
| 16:41 | mcrittenden | raek wow, very helpful, thanks a lot |
| 16:41 | kotarak | ibdknox: Ah. Ok. Logging seems to be an annoying part of the Java world. |
| 16:41 | brehaut | technomancy: i have one of those. but its in javascript |
| 16:41 | ibdknox | kotarak: yeah :( I mean it's really, really bad with c3p0 |
| 16:42 | ibdknox | I spent a couple hours trying to find another way to fix it |
| 16:42 | hiredman | (oh, right, I started one of those and never finished it) |
| 16:42 | ibdknox | kotarak: is it causing you problems? I recently made the properties file less stupid |
| 16:42 | tscheibl | ibdknox: have you had a look at BoneCP? |
| 16:43 | brehaut | dmansen: (do-monad seq-m …) in algo.monads is for implemented monadically |
| 16:43 | ibdknox | tscheibl: no sir, what's that? |
| 16:43 | kotarak | ibdknox: In theory, it sounds easy: use slf4j and leave the rest to the end application. It doesn't cause problems, I hope. At least I seem to managed to exclude log4j. But I haven't done much work, yet. |
| 16:43 | tscheibl | ibdknox: a connection pool that claims to be the fastest |
| 16:43 | krey | ,(clj-time.format/unparse (formatters :basic-date-time) now) |
| 16:43 | raek | mcrittenden: also, the function should probably named "list-directories", since it filters away all files from the seq. :-) |
| 16:43 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clj-time.format> |
| 16:43 | tscheibl | ibdknox: I've been using it for quite a while now |
| 16:44 | dmansen | brehaut: i took a look at that package but haven't played with it yet |
| 16:44 | mcrittenden | raek I actually changed the .isDirectory to .isFile, that's what I actually needed. I had it backwards |
| 16:44 | krey | clj_time.core$now cannot be cast to org.joda.time.ReadableInstant clj-time.format/unparse (format.clj:147) <<< ??? |
| 16:44 | lazybot | krey: How could that be wrong? |
| 16:44 | kotarak | ibdknox: I remember someone having conflicts with the configuration due to the one shipped with korma complaining on the clojure google group. |
| 16:44 | devinus_ | ,(.start (new Thread)) |
| 16:44 | clojurebot | nil |
| 16:44 | technomancy | devinus_: I'll do an issue round-up sometime this week; going to make a release of 1.3.4 soon |
| 16:44 | technomancy | (for swank) |
| 16:45 | krey | don't know much about jodatime |
| 16:45 | devinus_ | technomancy: nice! thanks, i just thought i'd point it out. it's weird tho (regarding that issue) Clojure Box on widows seems to work just fine with the default hook |
| 16:45 | devinus_ | technomancy: not sure what's so special about emacs 24 on ubuntu -.- |
| 16:46 | kotarak | krey: clj_time.core$now is a clojure function. |
| 16:46 | devinus_ | but i'm just glad to know it wasn't just my problem |
| 16:46 | kotarak | krey: use something like (now) instead of just now. |
| 16:46 | krey | ahhhh |
| 16:46 | brehaut | krey: now is a function, not a value |
| 16:46 | TimMc | brehaut: sniped again! |
| 16:47 | kotarak | krey: for obvious reasons. ;) |
| 16:47 | krey | thought it was part of jodatime |
| 16:47 | brehaut | TimMc: of course :P |
| 16:47 | kotarak | krey: Joda has good documentation. |
| 16:47 | devinus_ | technomancy: also, slightly off topic, but why does the version of slime used by swank so old (2010)? |
| 16:47 | ibdknox | tscheibl: can you log an issue against korma to tell me to go check it out? lol |
| 16:47 | mcrittenden | oh ibdknox just realized you're the noir guy. I've been following that project for months and it's part of what prompted me to start looking at clojure today. thanks |
| 16:48 | ibdknox | mcrittenden: you are quite welcome :) |
| 16:48 | technomancy | devinus_: because it works, and upgrading it to a newer version would be a lot of work for very little benefit. |
| 16:48 | ibdknox | kotarak: I think the new properties file should fix that |
| 16:48 | brehaut | TimMc: im partly and idiot, and partly suffer from NZ internet latency |
| 16:48 | devinus_ | technomancy: ah ok, jw |
| 16:48 | tscheibl | ibdknox: sure ;) |
| 16:48 | TimMc | brehaut: I was wondering how much latency contributed. |
| 16:48 | technomancy | devinus_: I could rant if you want more details |
| 16:48 | TimMc | I don't know much about the IRC topology, either. |
| 16:49 | amalloy | TimMc: re latency: brehaut just had this great idea: maybe we could write a compiler that converts clojure to javascript |
| 16:49 | devinus_ | technomancy: if you don't mind, i'd love to hear it :) |
| 16:49 | TimMc | amalloy: hehe |
| 16:49 | dmansen | technomancy: i am curious too |
| 16:49 | TimMc | There's a way to send an IRC ping, yeah? |
| 16:50 | technomancy | devinus_: basically the slime developers want everyone to run from CVS, and they are not interested in making stable releases |
| 16:50 | brehaut | amalloy: ive heard of this javascript. its that thing from sun that runs applets right? |
| 16:50 | amalloy | TimMc: /ping |
| 16:50 | TimMc | OK, gonna try that. |
| 16:50 | devinus_ | technomancy: i got that feeling too when i was working with quicklisp |
| 16:50 | TimMc | brehaut: Did that notify you? I seem to recall that pings generate a notification. |
| 16:51 | brehaut | TimMc: err. not that ive seen? |
| 16:51 | TimMc | OK, cool. |
| 16:51 | brehaut | could just be slow though :P |
| 16:52 | TimMc | Ah, it depends on your client. I get notified when I ping myself -- and it takes 3.43 seconds to ping myself?! |
| 16:54 | technomancy | that's not going to work for people with production code, but nobody uses CL in their day jobs, so presumably they don't care much about that. but anyway, for swank-clojure I just picked a revision that was stable and packaged that, but the slime devs have introduced incompatibilities in CVS so you can't use the newest slime with the stable swank. |
| 16:54 | technomancy | anyway, it causes problems when people want to use Clojure and CL from the same Emacs instance, but most people doing Clojure lose interest in CL, so it hasn't proven to be terrible in practice. |
| 16:54 | technomancy | it's too bad that rant is too long for a single clojurebot factoid since I could save a lot of time with that |
| 16:55 | amalloy | technomancy: gist.github.com |
| 16:55 | TimMc | Not a bad idea. |
| 16:55 | devinus_ | technomancy: i'm sure you've had to reiterate it a few times :P |
| 16:56 | devinus_ | technomancy: i'm one of the unfortunately that would like to get CL and Clojure working from the same emacs instance at some point |
| 16:56 | devinus_ | for now i'm fine (just working with Clojure) |
| 16:59 | dmansen | technomancy: do you have any idea how much has changed since you last updated slime? i'd be willing to take a look |
| 16:59 | technomancy | dmansen: scottj would know |
| 17:00 | dmansen | i'll probably try it out tonight...i've just been having so much fun i can't stop :) |
| 17:01 | devinus_ | technomancy: do you work at heroku? |
| 17:01 | technomancy | devinus_: yeah |
| 17:01 | devinus_ | technomancy: i've gotta say, deploying my clj app to heroku with lein… that was the most pleasant experience of my life |
| 17:01 | technomancy | devinus_: awesome =) |
| 17:11 | kotarak | Ah! Korma is case-sensitive! How do I get rid of this in SQL? |
| 17:11 | clojurebot | Titim gan éirí ort. |
| 17:12 | ibdknox | kotarak: you have two options, you can either tell it not to use quoted identifiers, or change the naming functions |
| 17:13 | fridim_ | devinus, do you use a Clj framework ? |
| 17:13 | kotarak | ibdknox: If I have just simple :keyword -> table/column translations. Is it then save to turn of these quoted identifiers? |
| 17:13 | kotarak | s/of/off |
| 17:14 | ibdknox | kotarak: quoted identifiers are only there to save you from name collisions within sql itself, like "user" which is reserved in postgres |
| 17:14 | ibdknox | so yes, it's safe :) |
| 17:14 | kotarak | Ah. Ok. Then how do I do it? |
| 17:15 | ibdknox | (defdb prod (postgres {:delimiters "" ...})) |
| 17:15 | ibdknox | or whatever DB you're using, just provide the :delimiters key |
| 17:15 | ibdknox | kotarak: that only works in 0.3.0-alpha5+ (it's at alpha8 now) |
| 17:16 | kotarak | And does this also mean that response maps from eg. a select us lowercase keywords? |
| 17:16 | kotarak | ibdknox: using alpha8 with h2 at the moment. |
| 17:16 | ibdknox | depends on the db manufacturer |
| 17:16 | ibdknox | kotarak: if you want you can force everything to be lowercased by setting the :naming key |
| 17:17 | ibdknox | :naming {:fields string/lower-case :keys string/lower-case} |
| 17:17 | ibdknox | :keys sets the keywords you get back in maps |
| 17:18 | ibdknox | :fields modifies what goes into the db (many db's, for example, uppercase all identifiers |
| 17:19 | kotarak | ibdknox: Ok. Thanks. (I just don't want to SHOUT everywhere IN my CODE.) I find lowercase easier to read. H2 at least copes with lower-case input. |
| 17:19 | ibdknox | kotarak: definitely, it's annoying :) |
| 17:20 | krey | clojurestack.core=> (str (binding [*print-dup* true] (clj-time.format/unparse (formatters :date-hour-minute-second) (now)))) "2011-12-19T22:18:58" |
| 17:21 | krey | But the result saved in memcached is like: #=(clojurestack.memcache$gen_timestamp. ) |
| 17:22 | hiredman | krey: looks like a bad print dup method is defined for whatever type that is |
| 17:22 | krey | okay, forgot () again. mhhh |
| 17:22 | krey | Can I get rid of all taht *print-dup* stuff? |
| 17:23 | kotarak | ibdknox: I can't redef an existing defdb? |
| 17:23 | brehaut | krey: yes i think so; unparse generates a string anyway |
| 17:24 | ibdknox | kotarak: I made them defonce's because terrible things happened if you constantly recreated those connections (you would kill your db) |
| 17:25 | amalloy | so if i have a string like "foo/bar/baz", anyone have a clever way to get out the stuff after the last /? i could do a regex, or a .lastIndexOf or something, but neither of those seem very nice |
| 17:25 | krey | yes, works |
| 17:26 | kotarak | ibdknox: I see. Maybe a shutdown command or something like that should be available? One does this in development only, anyway, I would suspect. |
| 17:26 | kotarak | ibdknox: One ns-unmap later everything works perfectly, btw. :) |
| 17:26 | krey | Is there a nice way to print records to stdout ? like they appear in the repl ? |
| 17:26 | brehaut | ,(last (.split "foo/bar/baz" "/")) ;; amalloy ? |
| 17:26 | clojurebot | "baz" |
| 17:27 | kotarak | ,(subs "foo/bar/baz" (.lastIndexOf "foo/bar/baz" "/")) |
| 17:27 | clojurebot | "/baz" |
| 17:27 | ibdknox | kotarak: yeah, should be a dev only issue. There might be something better for that though, I'll see if I can come up with something :) |
| 17:27 | kotarak | plus an inc... |
| 17:27 | ibdknox | brehaut's is probably the shortest |
| 17:28 | brehaut | ibdknox: and slowest ;) |
| 17:28 | ibdknox | yes :p |
| 17:28 | amalloy | brehaut: nahhhh, re-seq would be slower |
| 17:28 | brehaut | ah good point |
| 17:28 | krey | makes it sense to encapsulate the binding [*print-dup* true] ? maybe into "escape [exp]" |
| 17:29 | ibdknox | I assume lastIndexOf would be the fastest |
| 17:29 | kotarak | ibdknox: Maybe just a warning or so. I was simply surprised that it ignored my setting. After manually defing to nil, it wouldn't switch to the given definition, Then it rang a bell. :) |
| 17:29 | amalloy | yeah, i was going to do lastIndexOf/subString but hoped someone knew of a prettier built-in |
| 17:32 | kotarak | ibdknox: one more question: How do defdb things relate to java.jdbc's with-connection? Can I use them there also? (I suspect, no) |
| 17:33 | ibdknox | kotarak: if you call korma.db/get-connection, you sure can :) |
| 17:34 | kotarak | ibdknox: Ok. Thanks. :) (Nice support. :D) |
| 17:37 | krey | What is happening to defstruct / structs ? Are they removed when records are the way to go? Or do they stay for any reason? |
| 17:39 | technomancy | krey: they may be removed at the next backwards-compatibility-break, but that is very far off in the future. |
| 17:39 | technomancy | people are still licking their wounds from the last one. |
| 17:40 | kenth | Hi, does anyone own the Joy of Clojure book? I have trouble understanding a piece of code on page 85 |
| 17:41 | technomancy | clojurebot: slime cvs rant is http://p.hagelb.org/slime-cvs-rant.txt.html |
| 17:41 | krey | Ahhh thx technomancy ... |
| 17:41 | clojurebot | 'Sea, mhuise. |
| 17:41 | brehaut | kencausey2: listing 5.1 ? |
| 17:41 | brehaut | sorry, kenth: listing 5.1 ? |
| 17:41 | krey | What has been excluded in the last release? Is there a list of items? |
| 17:41 | kenth | Yep, on the last line (map #(map + yx %) deltas) |
| 17:42 | kenth | I have never seen anonymous functions used that way |
| 17:42 | brehaut | kenth: its reader shorthand |
| 17:42 | brehaut | ,'#(map + yx %) |
| 17:42 | clojurebot | (fn* [p1__27#] (map + yx p1__27#)) |
| 17:43 | brehaut | kenth: see page 28, 2.3.4 In-place functions with #() |
| 17:43 | raek | there: http://dev.clojure.org/jira/browse/CLJ-900 |
| 17:44 | TimMc | &`#(map + yx %) |
| 17:44 | lazybot | ⇒ (fn* [p1__9130__9131__auto__] (clojure.core/map clojure.core/+ clojure.core/yx p1__9130__9131__auto__)) |
| 17:44 | TimMc | brehaut: There are two levels of gensym there! |
| 17:44 | brehaut | TimMc: lol true |
| 17:45 | brehaut | kenth: is the anon function syntax that only thing you are having trouble with in that piece of code |
| 17:46 | kenth | I was trying to understand why + and yx are not in brackets, I'm looking at page 28 now.. |
| 17:48 | kenth | two functions map, and + followed by 2 arguments yx and %, is that part of infix notation? |
| 17:48 | kenth | prefix I mean |
| 17:49 | Chousuke | the + is an argument to map |
| 17:49 | brehaut | and map over two lists is like zip in some functions |
| 17:49 | brehaut | s/functions/languages/ |
| 17:49 | brehaut | s/lists/seqs/ |
| 17:50 | Chousuke | kenth: in this case, #(map + yx %) expands to a function of one argument (the %) that maps + over yx and the argument |
| 17:50 | TimMc | &(map + [1 2 3] [300 200 100]) ; kenth |
| 17:50 | lazybot | ⇒ (301 202 103) |
| 17:50 | kenth | Ok I see, is yx a vector? |
| 17:50 | Chousuke | yx can be any seqable thing |
| 17:50 | kenth | Ok got it, thanks |
| 18:24 | sjl | Anyone know what this exception is trying to say? Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.RT.keyword(Ljava/lang/String;Ljava/lang/String;)Lclojure/lang/Keyword; |
| 18:30 | seancorfield | sounds like you've called keyword with two arguments? |
| 18:31 | akhudek | any clojureql experts around? I'm having trouble figuring out if what I'm trying to do is possible. |
| 18:31 | akhudek | basically a conj! where one of the values is an aggregate result of a select |
| 18:31 | akhudek | in a single transaction |
| 18:31 | seancorfield | sjl: &(doc keyword) |
| 18:31 | seancorfield | darn, where's the bot? |
| 18:31 | seancorfield | ,(doc keyword) |
| 18:31 | clojurebot | "([name] [ns name]); Returns a Keyword with the given namespace and name. Do not use : in the keyword strings, it will be added automatically." |
| 18:31 | sjl | seancorfield: hmm, I ran lein clean and lein deps again and now it doesn't happen, so it must be something in a lib I'm using... |
| 18:32 | seancorfield | oh ok... |
| 18:32 | accel | is using Dynamic Vars (binding) an acceptable way to simulate the State Monad in clojure? |
| 18:33 | sjl | weird that lein deps alone didn't fix it |
| 18:33 | raek | sjl: could be due to old .class files from a compilation to a different clojure version |
| 18:33 | sjl | raek: ah, that must be it. I tried 1.3 but something in the libs I'm using didn't like it, so I switched back to 1.2.1 and got that |
| 18:34 | seancorfield | did the signature of keyword change between 1.2 and 1.3? |
| 18:35 | seancorfield | i find it a bit confusing that ns in some docstrings means a namespace object and in others means a namespace name (a string) |
| 18:43 | akhudek | I'm guessing this is not possible, looking through the source. |
| 18:48 | akhudek | I find I'm often fighting clojureql due to it's lack of transactions that combine selects and inserts. :/ |
| 18:49 | pandeiro | anyone know what happened to https://github.com/bobby/trail ? ClojureScript MVC-like thing? |
| 18:51 | accel | does load-file not automatically reload all? |
| 18:51 | accel | i'm getting weird problems of running old code |
| 18:51 | technomancy | certain forms cannot be reloaded at runtime |
| 18:51 | accel | are defmulti one of them? |
| 18:51 | accel | *is* multimethods one of them? |
| 18:52 | technomancy | you can do it, but it takes a little trick |
| 18:52 | technomancy | basically (def x nil) (defmulti x [...]) |
| 18:52 | accel | URL? I'm clearly not doing such trick |
| 18:52 | accel | hmm |
| 18:52 | accel | that's it? |
| 18:52 | technomancy | "it's a feature" |
| 18:52 | technomancy | yeah |
| 18:52 | technomancy | you just have to redef it to nil before loading the defmulti |
| 18:53 | accel | since you understand this and I do not; what is the intended benefit of this feature? |
| 18:53 | technomancy | if you have defmethods in a separate file from the defmulti, it's easy to reload the defmulti and lose all your methods without this behaviour. |
| 18:54 | technomancy | (not defending it; I think it's bad design, but that's the logic behind it.) |
| 18:55 | accel | it kind of makes sense; part of the coolness of multimethods is that they can be defined over different files |
| 18:56 | technomancy | yeah, but you can get into crazy circularity issues if you split up a defmulti and its methods |
| 18:56 | accel | I'll jot down your nick and bother you when I get into those. :-) |
| 18:57 | pandeiro | why is it that 'doc' isnt available when i clojure-jack-in to a lein project from emacs? is that normal? |
| 18:57 | technomancy | pandeiro: try C-c C-c C-d instead |
| 18:57 | brehaut | pandeiro: clojure has multiple entry points (for lack of a better term), and only the repl one includes the repl tools by default |
| 18:57 | technomancy | doc was moved out of the clojure.core namespace |
| 18:58 | pandeiro | i see, C-c C-c C-d, cool |
| 19:01 | accel | can I attach member methods to defstruct, defrecord, or deftype? |
| 19:11 | aaelony | I'm wrapping my head around the examples here (http://clojure.org/concurrent_programming) and hungry for more clojure examples of java.util.concurrent. Any good links are most welcome... |
| 19:24 | accel | how do I create something mutable taht I can call set! on? |
| 19:25 | hiredman | why? |
| 19:25 | clojurebot | hiredman: because you can't handle the truth! |
| 19:25 | hiredman | clojurebot: it's true |
| 19:25 | clojurebot | Titim gan éirí ort. |
| 19:25 | lancepantz_ | hehe |
| 19:25 | accel | does let create thread local vars? |
| 19:25 | accel | (thread local vars is what I wnat) |
| 19:25 | hiredman | accel: why? |
| 19:25 | accel | i'm keeping track of a cursor |
| 19:26 | accel | I understand clojure is all abou being functional |
| 19:26 | accel | for this particular case, I have to maintain state |
| 19:26 | accel | else I have to use amonad |
| 19:26 | hiredman | what kind of cursor? |
| 19:26 | amalloy | pandeiro, technomancy: C-c C-d C-d, right? not C-c C-c C-d |
| 19:26 | accel | x + y location no the screen |
| 19:27 | technomancy | amalloy: oh right |
| 19:27 | accel | *on* |
| 19:27 | technomancy | well, that or C-c C-d d |
| 19:27 | hiredman | accel: can you not just ask the cursor where it is? |
| 19:28 | hiredman | if you are doing gui stuff in java, you are dealing with multiple threads, so threadlocals are kind of "meh" |
| 19:29 | accel | Note - you cannot assign to function params or local bindings. Only Java fields, Vars, Refs and Agents are mutable in Clojure. Hmm |
| 19:29 | hiredman | if you don't have a cursor object you can just ask "where are you?" then most likely you are getting cursor information as a serias of events |
| 19:29 | hiredman | what you'll want to do is give that series of events a single identity via a reference type |
| 19:30 | hiredman | most likely a ref or an atom |
| 19:31 | hiredman | http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey |
| 19:33 | accel | I reallyw ant vars. |
| 19:33 | accel | Question: is there a way to create vars besides (def x ... )? |
| 19:33 | hiredman | why? |
| 19:33 | clojurebot | hiredman: because you can't handle the truth! |
| 19:33 | lancepantz_ | lol |
| 19:33 | hiredman | clojurebot: knock it off |
| 19:33 | clojurebot | I don't understand. |
| 19:34 | accel | ah; with-local-vars |
| 19:35 | accel | that is what I want |
| 19:35 | technomancy | clojurebot: with-local-vars |
| 19:35 | clojurebot | It's greek to me. |
| 19:35 | hiredman | accel: no it isn't |
| 19:35 | technomancy | clojurebot: with-local-vars is not what you want. |
| 19:35 | clojurebot | c'est bon! |
| 19:35 | technomancy | (for all values of you ≠ rhickey) |
| 19:36 | hiredman | accel: why do you think you want a var? |
| 19:36 | hiredman | for all values of you where you can't answer the question "why do you want a var?" |
| 19:37 | accel | because I know for certain that these set of variables are only being modified in this one thread |
| 19:37 | hiredman | so? |
| 19:37 | accel | So why can't I use local vars? |
| 19:37 | accel | What do ou have against vars? |
| 19:37 | accel | Did you buy stocks of atoms/refs/agents ? |
| 19:38 | brehaut | vars are more about language plumbing than mutation (at least for non-experts) |
| 19:38 | accel | I don't understand what you mean by "language plumbing." Can you explain? |
| 19:39 | technomancy | accel: the only reason vars are mutable is to allow you to modify your program at runtime. |
| 19:39 | hiredman | if you can say just say (MouseInfo/getPointerInfo) and get the info when you need it, why are you mutating anything? |
| 19:39 | technomancy | otherwise you'd get into situations like ml where redefinitions only affect functions defined after them. |
| 19:39 | accel | hiredman: the cursor is NOT managed by java; it's a virtual curosr I am amnaging in clojure |
| 19:40 | hiredman | accel: ok, so you have a pair that represents an x and y? |
| 19:40 | accel | hiredman: yes |
| 19:40 | accel | hiredman: and this is also a very very short lived cursor |
| 19:40 | accel | hiredman: it's basically a virtual cursor that helps me keep track of where to draw text |
| 19:40 | brehaut | accel: 'plumbing' as in the stuff under the surface that does important stuff that you dont need to understand just to use the sink |
| 19:41 | accel | i.e. y = tracks # of new lines; x = tracks number of "indents" |
| 19:41 | accel | brehaut: so basically, vars were never meant for mortals to use? |
| 19:42 | brehaut | mortals is too strong |
| 19:42 | brehaut | they have a specific purpose that is not blanket 'state' |
| 19:42 | hiredman | accel: no vars are very useful, and you should know what they do, and what you can do with them, but you should also know that if you managing mutation you should use a ref or an atom |
| 19:42 | brehaut | well. purposes |
| 19:42 | akhudek | oh nice, I think transactions are working in clojureql 1.0.3 |
| 19:42 | cemerick | accel: Clojure has a number of reference types; vars are just one of them. |
| 19:42 | akhudek | jdbc transactions that is |
| 19:43 | hiredman | accel: if your cursor is lexically scoped, then you can just recur around it |
| 19:43 | accel | alright you guys win. I will read page 172- of the clojure book; then decide if I want to use vars. |
| 19:44 | dnolen | accel: if you need to maintain some state why don't atoms work? |
| 19:44 | cemerick | Yes, we won! :-D |
| 19:44 | pandeiro | dnolen: do you know anything about https://github.com/bobby/trail (clojurescript mvc) ie where it went? |
| 19:44 | accel | http://paste.lisp.org/display/126589 <-- what my code currently looks like; I need to provide functions (nl, sr, sl, drawstring) that other functions can call |
| 19:44 | hiredman | accel: I dunno if any clojure book as a decent treatment of vars |
| 19:45 | brehaut | wow. defstruct |
| 19:45 | brehaut | and an underscore |
| 19:45 | hiredman | actually I just rewatched rhickey's talk on clojure and concurrency and he said something like "I could talk for 2 hours about vars" |
| 19:45 | hiredman | "well, why don't you?" |
| 19:46 | accel | brehaut: I'm pretty sure I have more than 1 underscore, I think I have 4. |
| 19:46 | brehaut | accel: make_Cursor should probably be make-cursor, and just stick with a map for the cursor for now; defstructs are deprecated (?) |
| 19:46 | dnolen | defstruct is deprecated in favor of defrecord |
| 19:46 | brehaut | dnolen: but not annotated as such in the code i think |
| 19:47 | hiredman | accel: you should just have an atom you call 'cursor' and (defn nl [cusor] ...) |
| 19:47 | brehaut | http://clojure.org/data_structures#Data%20Structures-StructMaps says 'most uses of StructMaps would now be better served by records' |
| 19:48 | brehaut | infact in this case, i think a protocol and reify looks like a better candidate ? |
| 19:48 | brehaut | (over an atom) |
| 19:49 | hiredman | brehaut: why? |
| 19:49 | brehaut | hiredman: rather than a map of functions? |
| 19:49 | hiredman | oh, sure, no I thought you meant over just an atom |
| 19:50 | brehaut | oh right sorry. i meant _closed over_ an atom |
| 19:50 | brehaut | but i am a muppet. sorry |
| 19:50 | hiredman | (defn make-cursor [x y] {:x x :y y}) |
| 19:51 | accel | defrecord expects me to provide typing |
| 19:51 | accel | how do I provide the types of functions? |
| 19:51 | hiredman | (defn draw-cursor [g s {:keys [x y]}] (.drawString g s x y)) |
| 19:51 | hiredman | hmmm |
| 19:51 | accel | I have a field; its records stores functions. What is the type of a function? |
| 19:52 | brehaut | defrecord doesnt require types |
| 19:52 | hiredman | oh, make-cursor should wrap the map in an atom, so the destructuring won't work |
| 19:52 | brehaut | accel: your code has a very OO factoring. its pretty weird looking clojure code |
| 19:52 | hiredman | but anyway, no need for with-local-vars, no need for passing around a map of functions, no need for reify |
| 19:53 | dnolen | hiredman: I'm not sure if make-cursor should do the atom wrapping. |
| 19:53 | accel | oay; it soudns like I'm doing sommething reallyr eallyw rong |
| 19:53 | accel | so let me repharse my question: |
| 19:53 | accel | I want to render sexps in a java graphics environment |
| 19:53 | accel | I want each () to be on a new line, and to be indenented appropriately |
| 19:53 | accel | how should I solve this problem? |
| 19:54 | cemerick | accel: do you have a text component, e.g. JTextArea, or are you drawing via Graphics2D? |
| 19:54 | hiredman | you are in for a world of pain |
| 19:55 | hiredman | (if not already apparent) |
| 19:56 | brehaut | hiredman: is that for the indenting or the java2d? or both? |
| 19:56 | hiredman | the easiest thing would be to use clojure.ppint to print it, and write it to a jta, but the formatting isn't the best |
| 19:56 | dnolen | accel: I have no comment on how you should do that, but I would write you paste like this, https://gist.github.com/1499686 |
| 19:56 | accel | cemerick: Graphics2D |
| 19:56 | hiredman | brehaut: the first, but the second wouldn't surprise me |
| 19:56 | hiredman | so the third would not either |
| 19:57 | brehaut | :) |
| 19:57 | accel | I have to roll the printing routines myself; I'm actually printing stuff more complicated than just sexps |
| 19:57 | accel | it's like sexps + graphics |
| 19:57 | cemerick | accel: I'd do what hiredman said, and then rasterize the JTextArea to an image you draw to the graphics context. |
| 19:57 | accel | but it's approximately the same problem |
| 19:58 | brehaut | i have bad memories of font metric stuff in java 2d back in the 1.4 days |
| 19:58 | brehaut | (quite possible i was just a muppet though) |
| 19:59 | accel | screw it; enough prermture planning |
| 19:59 | cemerick | No, text rasterization is not an easy thing. |
| 19:59 | accel | let's see where this breaks :-) |
| 20:00 | hiredman | you can mix graphics and text without having draw everything yourself |
| 20:00 | hiredman | depending on how much mixing you are doing |
| 20:01 | cemerick | has anyone worked with canvas much after using Java2D extensively? How scared/enthusiastic should I be about the former in comparison? |
| 20:02 | brehaut | ive dabbled with both. canvas compares nicely for the basics |
| 20:03 | cemerick | and beyond the basics? That's where all the trouble usually happens :-) |
| 20:03 | brehaut | canvas doesnt have many more complex operations out of the box |
| 20:03 | cemerick | I've found 1.6 Graphics2D to be remarkably satisfying. |
| 20:03 | brehaut | i think java2d is better for stuff with masking, image composition etc |
| 20:03 | cemerick | ah |
| 20:04 | brehaut | and things like complex curves |
| 20:04 | cemerick | probably no quads and such |
| 20:04 | brehaut | quads = quadratic beziers? |
| 20:05 | brehaut | if so, then no |
| 20:05 | cgray | midje question: I have a function (foo) that returns a set of vecs like #{["bar" "baz"] ["fred" "ethel"]} ... how do I check for the first vec in the set using midje? (foo) => (contains ["bar" "baz"]) doesn't seem to be working |
| 20:06 | sritchie | contains? |
| 20:06 | sritchie | with a ? |
| 20:06 | clojurebot | contains? is for checking whether a collection has a value for a given key. If you want to find out whether a value exists in a Collection (in linear time!), use clojure.core/some or the java method .contains |
| 20:06 | brehaut | cemerick: last time i tried to use j2d, i couldnt find a push/pop state/matrix operation. does one exist? |
| 20:06 | brehaut | or just the set itself |
| 20:06 | cgray | sritchie: contains? is the normal clojure function right |
| 20:07 | brehaut | ,(#{["bar" "baz"] ["fred" "ethel"]} ["bar" "baz"]) |
| 20:07 | clojurebot | ["bar" "baz"] |
| 20:07 | cgray | brehaut: thanks, that works |
| 20:07 | cemerick | brehaut: sure, Graphics.create(), been there forever :-) |
| 20:07 | brehaut | cemerick: aha :) |
| 20:08 | cemerick | There's no push/pop, you just get another context, so you can work in multiple levels of the "stack" at the same time. |
| 20:08 | brehaut | sure, that makes a bunch of sense |
| 20:08 | brehaut | oh, the other gotcha with canvas is that if you are doing pixel work, then you have to watch out for fun with Number sometimes being an int and sometimes being a float |
| 20:09 | brehaut | (also, whoa that stuff gets slow fast) |
| 20:10 | cemerick | yeah, that's my biggest concern |
| 20:10 | cemerick | aside from the whole programming-in-the-browser thing :-P |
| 20:10 | brehaut | lol :) |
| 20:11 | cemerick | Maybe I'll just do the tiling thing and keep my sanity. |
| 20:11 | dnolen | cemerick: are you going to be doing a lot of pixel level manipulation tho? I've found that even that can surprisingly fast in Chrome and Safari. |
| 20:13 | cemerick | dnolen: Not clear yet, but I suspect I'll have at least one layer doing detail work, even if the body of things are going to be tiled in. |
| 20:14 | brehaut | cemerick: i found that safari and chrome can do a simple 3x3 convolution of a ~1400x1000 within acceptable time |
| 20:14 | brehaut | (it gets a little sluggish to do on resize, but its not unexceptable for other operations) |
| 20:14 | cemerick | But FF and IE 9 dog it I take it? |
| 20:15 | dnolen | cemerick: FF and IE 9 both have good canvas engines, Opera too. |
| 20:15 | brehaut | IE9 didnt exist when i was trying this stuff |
| 20:15 | dnolen | cemerick: but if your operations are compute intensive, Chrome & Safari have the edge. |
| 20:15 | brehaut | its the javascript engine that is the real bottleneck for imagedata processing though |
| 20:16 | brehaut | dnolen: FF has picked up its game. i think it might have an edge over Saf at the moment |
| 20:16 | brehaut | see also http://arewefastyet.com/ |
| 20:16 | brehaut | cemerick: however, you've got no hope of it working acceptably on an iphone or ipad |
| 20:16 | brehaut | (and a lot of android phones dont even have canvas :S) |
| 20:18 | cemerick | oh well |
| 20:18 | dnolen | you can definitely do very complex graphics quickly in canvas. Our cartographers at Times are doing neat stuff with complex maps that used to be done in Flash. |
| 20:19 | cemerick | That's promising then. |
| 20:19 | dnolen | works great on iOS even though you have to render at double resolution on the newer devices. |
| 20:19 | technomancy | I wonder how many professional cartographers there are in the world. |
| 20:19 | brehaut | i would guess that there are a lot more than their used to be |
| 20:20 | brehaut | dnolen: are they drawing vector stuff on the iOS or doing pixel manipulation? |
| 20:20 | dnolen | brehaut: mostly vector stuff, some pixel stuff I think for hit detection, it's all very custom for performance reasons. |
| 20:21 | sritchie | do you guys have any advice for how to think about designing a throttling download manager in clojure? |
| 20:21 | sritchie | this is my first real dive into the concurrency primitives |
| 20:22 | brehaut | dnolen: interesting. i found i couldnt get a full screen image have 1 multiply pass on the iPad. |
| 20:22 | brehaut | certainly the vector stuff is much more attainable |
| 20:23 | brehaut | cemerick: if you are just _drawing_ images to the canvas its obvious very fast btw, its just per px twiddling with JS that can get slow |
| 20:23 | dnolen | brehaut: so far we've seen that JS performance is an order of magnitude slower on iOS. which is not a big deal for many things, certainly for graphics tho. |
| 20:24 | brehaut | dnolen: did you see a noticable bump when the JIT was enabled in safari? |
| 20:24 | brehaut | (in iOS 4.2 or 5 i think?) |
| 20:24 | dnolen | brehaut: I think it was like 25X slower before, now 10X slower. |
| 20:24 | brehaut | right |
| 20:24 | brehaut | thanks |
| 20:25 | cemerick | brehaut: I presume it'd be faster to just put the tiles into a background element and draw detail on an otherwise-transparent canvas on top… |
| 20:25 | brehaut | cemerick: yeah probably |
| 20:25 | brehaut | you dont have to manage the redraw for one thing |
| 20:25 | cemerick | right |
| 20:25 | cemerick | More I can do via DOM/svg, the happier I get. ;-) |
| 20:25 | brehaut | cemerick: i think you can probably just set the background css property on the canvas element too ;) |
| 20:26 | brehaut | :) |
| 20:26 | brehaut | back in a bit |
| 20:26 | dnolen | cemerick: you can also use a canvas for background images. |
| 20:26 | cemerick | sure |
| 20:26 | dnolen | cemerick: this is interesting since then you can draw to one surface and this is efficiently replicated. |
| 20:26 | cemerick | I'd hope I don't have to get that fancy. |
| 20:27 | cemerick | replicated? |
| 20:27 | dnolen | cemerick: it's a shared buffer |
| 20:27 | dnolen | for those elements using that canvas as a background. |
| 20:27 | cemerick | oh, I see |
| 20:48 | brehaut | cemerick: if you do plan on canvas stuff running on iOS devices, you also have to be careful of memory constraints; the browser only allows you a very small portion of the available system memory to be present in memory at once and all your JS objects (including any images) have to be within that allowance |
| 20:51 | cgray | is set/select faster than filter on sets? |
| 20:51 | hiredman | ,(require 'clojure.set) |
| 20:52 | clojurebot | nil |
| 20:52 | hiredman | ~source clojure.set/select |
| 20:53 | gfredericks | that may be the first time I've seen the same object used for the last two args of reduce |
| 20:54 | brehaut | gfredericks: same. clever trick though eh |
| 20:54 | gfredericks | indeed. took a bit to make sense of it. |
| 20:54 | gfredericks | cgray: it's probably at least faster than using filter and putting it back into a set |
| 20:55 | cgray | gfredericks: true, but I could just use the output of filter as is |
| 20:55 | cgray | I suppose it probably depends how many things are returned eh? |
| 20:56 | gfredericks | my naive hunch is that for outputting a seq filter would be better |
| 20:56 | gfredericks | maybe not noticeably |
| 20:56 | gfredericks | I say that because set/select has to muck with the structure of a hash-set |
| 20:56 | brehaut | huh. a quick and dirty time dotimes suggest that select is a few orders of magnitude slower |
| 20:56 | gfredericks | whereas filter is just iterating |
| 20:56 | gfredericks | which select has to do anyhow |
| 20:57 | brehaut | and by a few i mean 3 |
| 20:57 | cgray | orders of magnitude = powers of ten? |
| 20:57 | hiredman | brehaut: will a doall around filter? |
| 20:57 | brehaut | hiredman: aha good catch |
| 20:57 | brehaut | 0 orders of magnitude different |
| 20:58 | TimMc | haha, I always forget doall |
| 20:58 | cgray | ok, i'll just use filter then, because that way i don't have to require clojure.set |
| 20:58 | TimMc | or dorun, really |
| 20:58 | brehaut | filters still a bit faster but not by much |
| 20:58 | brehaut | cgray: use the one that has the semantics you want |
| 20:59 | brehaut | ie if you want a seq use filter |
| 20:59 | cgray | it doesn't really matter in this application... either works |
| 20:59 | brehaut | cgray: sounds like it wants a seq then? you are passing it to a seq consuming function? |
| 21:02 | cgray | brehaut: no, i'm going to choose one of the returned things at random |
| 21:02 | brehaut | cgray: using rand-nth ? |
| 21:02 | cgray | yeah i guess, so probably it wants to be a seq then |
| 21:07 | accel | slightly OT question: should pizza delivery be 10% or 20% tip? |
| 21:07 | gfredericks | that's ironic because rand-nth could probably be faster on a set theoretically... |
| 21:08 | brehaut | gfredericks: now i need to go look at the imp of nth |
| 21:08 | cgray | gfredericks: if only it worked... :P |
| 21:08 | brehaut | ~source nth |
| 21:08 | cgray | the nth of a set doesn't make much semantic sense |
| 21:09 | gfredericks | cgray: no, but I think rand-nth as a direct impl (not using nth) could be faster |
| 21:09 | gfredericks | at least if it could reach into the set's impl as well |
| 21:09 | gfredericks | I'm not suggesting this should exist |
| 21:09 | brehaut | gfredericks: oh right. yes sure |
| 21:11 | gfredericks | though now that I think about it, I think for a hash-set there's maybe not a fast way to do it with an even distribution... :/ |
| 21:12 | cgray | gfredericks: maybe it would be better called clojure.set/rand-element or something |
| 21:12 | gfredericks | certainly |
| 22:14 | devn | best parser combinator library for clojure? |
| 22:25 | devn | Could someone enlighten me w/r/t (derive `Foo `Bar) |
| 22:25 | devn | Is a well-documented pattern? I personally haven't rubbed up against it until recently. |
| 22:25 | devn | Is it* |
| 22:26 | devn | In general I tend to see (derive ::foo ::bar) |
| 22:27 | brehaut | devn: isnt that so you can make heirarchies that include classes? |
| 22:27 | brehaut | although it appears that derive only cares that things are clojure.lang.Named |
| 22:34 | cemerick | brehaut: `Foo yields a namespaced symbol |
| 22:34 | cemerick | devn: decidedly not typical. |
| 22:35 | devn | cemerick: I figured as much. This comes from a library which was a direct port by a Haskell guy. namesLookLikeThis, etc. |
| 22:35 | devn | ,(derive `Foo `Bar) |
| 22:35 | clojurebot | nil |
| 22:35 | devn | ,(ancestors `Foo) |
| 22:35 | clojurebot | #{sandbox/Bar} |
| 22:35 | cemerick | it's not going to hurt anything, but looks damn strange. |
| 22:36 | devn | Since it is a set I suppose you could call it like a fn, though, right? |
| 22:36 | devn | ,(dervice ::foo ::bar) |
| 22:36 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: dervice in this context, compiling:(NO_SOURCE_PATH:0)> |
| 22:36 | devn | ,(derive ::foo ::bar) |
| 22:36 | clojurebot | nil |
| 22:36 | devn | ,(ancestors ::foo) |
| 22:36 | clojurebot | #{:sandbox/bar} |
| 22:36 | devn | There is a subtle difference. Hm. |
| 22:37 | devn | still seems like the latter is to be preferred |
| 22:37 | brehaut | cemerick: oh of course. my bad |
| 22:37 | devn | what with hashmaps being a more regular form of clojurian currency |
| 22:37 | cemerick | what do hashmaps have to do with it? |
| 22:38 | devn | I was just noting that `Foo => #{sandbox/Bar}, and ::foo => #{:sandbox/bar} |
| 22:38 | cemerick | they're both sets |
| 22:43 | devn | cemerick: yes, but one of them lends itself more to being used as a predicate |
| 22:43 | devn | ,(remove #{:foo/bar} [:foo/bar :bar/baz]) |
| 22:43 | clojurebot | (:bar/baz) |
| 22:44 | cemerick | ,(remove #{`bar} `[bar baz]) |
| 22:44 | clojurebot | (sandbox/baz) |
| 22:44 | cemerick | :-) |
| 22:44 | devn | cemerick: yeah I knew that was coming |
| 22:44 | cemerick | I get what you mean, keywords are certainly more common in most places |
| 22:45 | devn | the backticks everywhere is weird |
| 22:45 | devn | s/is/are |
| 22:45 | cemerick | certainly doesn't help readability, and also sets off alarms because they're so rare outside of macros |
| 22:45 | devn | exactly. |
| 22:45 | devn | cemerick: going to clojure/west? |
| 22:46 | cemerick | mmm, hopefully |
| 22:46 | cemerick | need to get my proposal in sometime this week |
| 22:46 | devn | I think I'm going to try my hand at a proposal or two as well. |
| 22:46 | alexbaranosky | dev: go for it! |
| 22:46 | devn | I've been conferencing a bit too much this year to not speak at another one. |
| 22:47 | alexbaranosky | devn: what might you speak about? |
| 22:48 | devn | alexbaranosky: I don't know. I was thinking something about community maybe? |
| 22:48 | cemerick | devn: you should :-) |
| 22:49 | alexbaranosky | devn: that could be really cool depending how you spin it |
| 22:49 | devn | I think maybe I'll just get on stage and talk about all of the people who make clojure so great. I seem to constantly have about 30 tabs open with various clojure stuff in each of them. |
| 22:50 | devn | ...daily... |
| 22:50 | cgray | hmm, am i doing something wrong with marginalia? i've got lein-marginalia 0.6.1 in my dev-dependencies, but when I run lein marg, the docstrings don't get taken out of the function definitions |
| 22:50 | alexbaranosky | I've thought of doing something on TDD in Clojure with Midje, but am procrastinating on a proposal |
| 22:51 | devn | i don't know how the hell I would have found half of the stuff I know about if I had been spending my time in another community |
| 22:51 | alexbaranosky | cgray, I also noticed that, and wondered what I might've been doing wrong |
| 22:51 | cgray | alexbaranosky: ok, at least i'm not crazy :) |
| 22:51 | alexbaranosky | devn: its just an awesome and smart community |
| 22:52 | alexbaranosky | cgray, it seemed to put comented code onto the left margin, but leave the doc strings in place, which seemed wrong to me |
| 22:53 | devn | alexbaranosky: we gotta be careful to keep group hugs alive, but not drown ourselves in a sea of meaningless "awesomeee!" |
| 22:54 | alexbaranosky | devn: it's an age old balance... I think |
| 22:55 | devn | balance seems to be the key word there. i like beer and cake, but it wouldn't be as tasty were it not for the pot of brussel sprouts I ate yesterday |
| 22:55 | alexbaranosky | hehe |
| 22:56 | alexbaranosky | this macroexpand-scan function I wrote seems vaguely useful: https://gist.github.com/1499725 |
| 22:58 | devn | alexbaranosky: forgive me for prying in public, but i met you at the conj, and from that moment until now I've seen you in IRC offering help, etc. all the time. Where were you before?! :) |
| 22:59 | brehaut | cemerick: clutch 0.3 looks like a great change |
| 22:59 | alexbaranosky | devn: didn't use IRC..... :) I've been working on Midje in my spare time, and using the Clojure mailing list every once in a while, or tweeting about Clojure, but didn't realize how cool the party was on IRC |
| 22:59 | cemerick | brehaut: thanks, hope so :-) |
| 23:00 | brehaut | cemerick: i look forward to upgrading my site |
| 23:00 | cemerick | I really want to get a proper CouchDB type in there, and cloudant query support. |
| 23:00 | devn | alexbaranosky: yeah I saw you listed on the contibutors list. Anyway, long story short: awesome you're on IRC; I really enjoyed chatting with you at the conj. |
| 23:00 | cemerick | And if we can get a clojurescript release, I'll bring https://github.com/cemerick/clutch-clojurescript in |
| 23:01 | alexbaranosky | devn: I meant to chat more, but got swept up in the conference and before I knew it it was over |
| 23:01 | devn | cemerick: ah, the question is not *if*, but *when* |
| 23:01 | brehaut | cemerick: that would be excellent! |
| 23:01 | sirvaliance | Where does "lein search" pull its information from? |
| 23:01 | devn | sirvaliance: clojars.org |
| 23:01 | brehaut | im using plain old (crappy) JS views atm |
| 23:01 | sirvaliance | devn: Ahh, thanks ;) |
| 23:01 | devn | sirvaliance: np. :) |
| 23:02 | cemerick | sirvaliance: the maven indexes published by all the repositories you have registered in your project. |
| 23:02 | cemerick | devn: here's hoping :-) |
| 23:03 | devn | cemerick: I think tooling is really what needs to grow, but that's just a gut feeling. |
| 23:05 | cemerick | devn: you mean w.r.t. cljs? |
| 23:06 | brehaut | cemerick: its been a while since i touch my couch code, but the gist you linked in the ML post looks like the api is cleaner / consistent? |
| 23:06 | devn | cemerick: yes. |
| 23:06 | cemerick | brehaut: Yeah, it's gotten a pretty good scrubbing. |
| 23:06 | brehaut | excellent. i found the old api a bit forgetable |
| 23:07 | cemerick | It's still more verbose than I'd like, but there are a *lot* of operations available. |
| 23:07 | cemerick | That's why I want to tie things up with the typical clojure vocabulary. |
| 23:07 | brehaut | makes good sense |
| 23:08 | cemerick | One of the bigger changes that's more subtle is that view results are all lazy now. |
| 23:08 | brehaut | oh cool |
| 23:09 | cemerick | I used to implement that myself off to the side, so it was nice to be able to lift it up in to the lib proper. |
| 23:10 | brehaut | is there any support for serialisation time document processors (ie, to turn date / time objects into strings)? |
| 23:16 | devn | off the top of your head do you know if clojure.contrib.monads, contrib.except, and contrib.error-kit made the leap to 1.3? |
| 23:16 | brehaut | clojure.contrib.monads is clojure.algo.monads, and has a 0.1.1-SNAPSHOT release in the sonatype snapshots repo |
| 23:17 | brehaut | (off the top of my head) |
| 23:18 | cemerick | devn: except and error-kit are both dead-ends IIRC; try slingshot |
| 23:19 | brehaut | cemerick: you could make that argument about a monads lib too ;) |
| 23:19 | cemerick | brehaut: you mean have j.u.Dates round-trip through JSON automatically? |
| 23:19 | brehaut | cemerick: yeah, or jodatime objects |
| 23:19 | cemerick | crap, I don't get any monad jokes :-P |
| 23:19 | brehaut | cemerick: that was a blunt one about the utility or applicability of monads in clojure |
| 23:20 | clojurebot | clojure is a language to use if you want to up your game |
| 23:20 | cemerick | ah-ha |
| 23:20 | brehaut | (and that was a subtle monads joke) |
| 23:20 | amalloy | every time cemerick gets a Maybe MonadJoke, it's Nothing |
| 23:20 | cemerick | brehaut: register a method (or type extension) with clojure.data.json |
| 23:20 | brehaut | amalloy: lol |
| 23:20 | cemerick | amalloy: see, I got *that* one! :-D |
| 23:20 | brehaut | cemerick: aha fantastic :) |
| 23:20 | cemerick | brehaut: that's system-wide though, so… |
| 23:21 | brehaut | cemerick: aha |
| 23:21 | brehaut | not a problem for my app though |
| 23:21 | devn | oh man, I imagine a really terrible comedian doing monad jokes on a tuesday night open mic |
| 23:22 | brehaut | devn: im not sure the audience would have the appropriate comprehension |
| 23:22 | devn | example punchline: "I don't know, *maybe* I will! Thank you. Thank you. You're really too kind. So anyway, I'm writing some haskell." |
| 23:23 | devn | brehaut: that's what would make it so great and terrible at the same time. a comedian completely speaking over everyone's heads but does like a charicature of a comedian. |
| 23:23 | devn | does it like* |
| 23:24 | brehaut | all they really need is liftM audience |
| 23:24 | devn | like "just flew in from the coast and boy are my arms tired. so anyway, monads, right?" |
| 23:24 | devn | "am i right people? how crazy are monads?" |
| 23:24 | amalloy | "I came here with a [[Joke]], but accidentally ran it through the List monad, and now I can't tell one group from the other" |
| 23:24 | devn | "little monad humor for you. dont forget to tip your waitress." |
| 23:25 | devn | amalloy: haha. but now imagine a struggling comedian doing monad humor in a night club with his own laugh track on a portable stereo. |
| 23:26 | amalloy | devn: my version is more fun, sorry |
| 23:27 | devn | more like "more *fn*"! am i right people? little clojure humor for you. |
| 23:27 | amalloy | did you see someone had that on a shirt at the conj? |
| 23:27 | amalloy | Clojure programmers have more fn |
| 23:27 | brehaut | lol |
| 23:28 | devn | I didn't, but seancorfield and dnolen had a great idea: "Actuaries Do It With Prolog" |
| 23:28 | devn | s/With/In -- I'm forgetting which it was |
| 23:28 | seancorfield | Yeah, I worked at a firm of actuaries in England and they had a whole bunch of software written in Prolog |
| 23:29 | brehaut | http://spl.smugmug.com/Humor/Lambdacats/13227630_j2MHcg#960526161_yXhEz |
| 23:30 | devn | brehaut: haha |
| 23:30 | brehaut | imperative cat is quite excellent too |
| 23:31 | devn | expectid type: cat -> tail, infurd type: (cat, tail) |
| 23:31 | leo2007 | there are about 1200 clojars. |
| 23:32 | seancorfield | i wonder how many of those are just forks of other libraries? |
| 23:36 | devn | seancorfield: there's probably a good answer if groups and extra dir structure, group, etc. is stripped from their ns's |