#clojure logs

2011-10-10

00:01amalloyand the exception seems to be coming from one of the String constructors, though i can't tell which one without the source handy
00:01metajackI'll bring it up on the list. I just wanted to make sure I wasn't missing something obvious.
00:01brehauthttp://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Core/lang/java/lang/String.java.htm
00:02brehauthuh
00:03brehautits coming from the char[] implementation
00:04brehaut(assuming that sort does line up with the errors)
00:30Raynesibdknox: ping
00:32ibdknoxRaynes: pong
00:53halarnold(+ 2 3)
00:53clojurebot*suffusion of yellow*
00:54amalloynice work, clojurebot
01:34duck1123(inc clojurebot)
01:34lazybot⟹ 3
02:32ibdknoxquiet night
03:37thorwilit looks like the jvm is causing a click via a short disc access every few seconds here. can this be alleviated somehow?
03:38amalloythorwil: you've made sure it has enough memory to not swap, i assume?
03:40thorwiluh, using clojure-jack-in, i may find that value in swank-clojure.el?
03:41thorwilstrike that
03:56thorwilso it's -Xms and -Xmx, but there gotta be a mechanism to pass thos args to java when using clojure-jack-in?
03:57Blktgood morning everyone
03:58amalloythorwil: options in project.clj somewhere. see the example lein project.clj
03:59amalloyjust to be clear, you probably want to give it less heap, not more; that will stop it from allocating more memory than it needs, getting it to gc more often instead
04:00amalloythe jvm still uses up loads of memory regardless, so you'll still need a bunch of actual RAM if you want *no* swapping, but at least it won't grow without bound
04:02amalloyeg, 4clojure runs with -Xmx60m, and the jvm's virtual-memory size varies between like 200MB and 600MB
04:06amalloythorwil: ^
04:07amalloyand of course the disk accesses could be something other than swapping
04:08thorwil0.o
04:11amalloyand if you *expect* your application to need loads of memory, then of course give it lots. my point is just that giving it more memory without a plan often makes performance worse, not better
04:13thorwilthe performance is virtually uninteresting on this machine, it's just the regular short disc access driving me nuts
04:14amalloythat's an aspect of performance. i didn't say cpu-performance
04:14thorwilfun thing is, i only started noticing after getting rid of noisy fans
04:16thorwilwell, i will have to experiment. thanks, amalloy
04:37ArafangionGC-based languages tend to behave *badly* in low-RAM situations. :(
04:40Arafangion(There are GC algorithms to address that, but that requires VM and Kernel changes)
04:54thorwilwell, the iotop entries that immediately preceed the noise are: http://paste.pocoo.org/raw/490282/
04:58amalloythorwil: neat, i didn't know about iotop
06:40fhdCan I somehow avoid the "already refers to" warning in Clojure? I'm defining a function named "compile" and it conflicts with leiningen.compile, but I don't intend to use the latter.
06:40pyrfhd: yes
06:41pyr(ns your.ns (refer-clojure :exclude [compile]))
06:41pyrmeh
06:41pyr(ns your.ns (:refer-clojure :exclude [compile]))
06:41fhdpyr: Brilliant, thanks :)
06:49guis there a "zip" function on clojure that takes two seqs and return them paired? like (zip '(1 2 3) ('4 5 6)) -> [1 4] [2 5] ... ?
06:50Chousukegu: (map vector [1 2 3] [4 5 6] ...)
06:52guthanks :9
06:52gu:)
06:53guno, wait
06:53guthat's not what i need
06:53guit doesn't pair them
06:55gu(for [r room m mask] [r m])
06:55guhmmm
06:55guno
07:02babilengu: AFAICT (map vector [1 2 3] [4 5 6] ...) does exactly what you asked for. How does is differ from what you are really expecting?
07:05thorwil,(map vector [1 2 3] [4 5 6] ...)
07:05clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ... in this context, compiling:(NO_SOURCE_PATH:0)>
07:05thorwil,(map vector [1 2 3] [4 5 6])
07:05clojurebot([1 4] [2 5] [3 6])
07:06guoh, it works, sorry, my mistake. thanks
07:07babilenHave fun :)
07:28Blafaselgu: interleave?
07:28Blafasel,(interleave [1 2 3] [4 5 6)
07:28clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
07:28Blafaseloops
07:28Blafasel,(interleave [1 2 3] [4 5 6])
07:28clojurebot(1 4 2 5 3 ...)
07:32BlafaselAfter playing with the basics of clojure and messing with 4clojure/project euler for a while: Can anyone suggest some good resources? I'm looking for blogs/mailing lists with examples for stuff that _aren't_ math challenges for a change. Maybe introductions to agents, stm, interfacing with the world maybe (good IO practices, both local/network, DB stuff).
07:33BlafaselBasically I want to move from 'neat toy to express fibonacci' to 'can use it for real work, albeit I'm still starting'
07:38thorwilon the way from simple puzzles to "useful" software, complexity explodes and describing it becomes so much work
07:39BlafaselRight, but I guess there will be something DB related, a couple web projects and a bunch of things about agents/stm at least
07:40BlafaselMaybe I'm just looking for decent blogs of people that are way ahead of me in the clojure learning graph
07:41thorwilBlafasel: maybe have a look through http://www.reddit.com/r/clojure
07:42BlafaselHmm.. Good point, haven't even thought of reddit for a looong time.
07:42BlafaselThanks!
07:43thorwilBlafasel: but also consider to just study code (via github), even if not accompanied by blog posts. and nothing will beat having your own project you actually care about getting done
07:48babilenBlafasel: I also like http://www.4clojure.com/ a lot. The "Practical Clojure" book might also come in handy ... If you find a good resource on I/O in Clojure let me know.
07:50babilenBlafasel: Another nice stream of clojure related information can be found on http://planet.clojure.in/
08:01Blafaselbabilen: Thanks. Regarding hardcover books: Thinking about it right now. Need to learn to trust the mail here and find a good reseller or give Amazon a try.. :)
08:21ArafangionHmm, this guy: http://www.philcalcado.com/2011/10/08/on_the_testing_in_clojure_debate.html
08:21ArafangionCan anyone suggest some more good websites that discuss that point he's making?
08:22ArafangionSee, I'm practically a TDD fanatic, but it does seem that TDD doesn't work for all projects (There's no silver bullet, after all), but I'm interested in knowing why it tends to be less used for functional languages, or even in C.
08:23ArafangionPerhaps in functional languages (and C), TDD is still very useful but one has to be more aware of what defines a "unit" (Because it sure as heck isn't a function)
08:25gfredericksthe foo# syntax in macros just does some obvious busywork with gensym, right?
08:26gfredericksI have something like `(foo# ~`(foo#)) and I don't think the foos match when you do that, so I'm considering doing it by hand
08:26gfrederickswait I can check if they match...
08:26gfredericksright so they don't
08:29gfredericksand doing it by hand with gensym worked just fine.
08:58fhdIs there a way of adding a JAR that is not a Maven/Leiningen project to the classpath in leiningen?
09:04dbushenkofhd: yep, just copi it to lib/
09:05fhddbushenko: Thanks
09:05dbushenkoadd ":disable-implicit-clean true" to your project.clj
09:05fhddbushenko: No declarative way?
09:05dbushenkowhat do u mean?
09:07fhddbushenko: Something like :jar-dependencies "/wherever/some.jar"
09:07dbushenkono. but you may add your jar to maven repository
09:07dbushenkojust add a dummy definition of your jar to project.clj
09:07dbushenkorun lein deps
09:07fhddbushenko: I guess I'll do that, thanks
09:07dbushenkoand leiningen will tell you how to add your jar to m2
09:38tfnicoany ideas how I can get 'lein pom' to generate a pom with <packaging>war</packaging>?
09:53ian__I'm looking for the de facto clojure.contrib/java.jdbc reference. When I navigate from clojure.org, I get to this page, https://github.com/clojure/java.jdbc#readme, which is not too helpful for a noob
09:53lnostdalian__, https://github.com/clojure/java.jdbc/tree/master/doc/clojure/java/jdbc
09:54ian__lnostdal: thanks!
10:02cemericktfnico: you might be able to hook into leiningen.util.maven/make-model
10:02cemericktfnico: what are you really trying to do?
10:03tfnicocemerick: I'm trying to deploy a war built with lein into a maven repository
10:04cemerickwhy?
10:04clojurebotwhy not?
10:05cemerickMaven repositories are fundamentally for housing dependencies; .war files are generally not useful as dependencies.
10:06tfnicocemerick: I find them fine for hosting deployable artifacts, whether they are jars or wars
10:07cemerickfair enough
10:07cemerickhooking make-model to set the packaging as you like is probably your best bet at the moment
10:08tfnicoanyhoo, I found a workaround: I use mvn deploy-file to upload into the repo. Specifying -Dpackaging=war overrides the (default packaging=jar) value in the pom.xml
10:08tfnicocemerick: thanks anyhow
10:08cemerickheh, that's certainly simpler
10:16ian__I'm trying to run a simple test. I'm getting this error:
10:16ian__Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate java/jdbc__init.class or java/jdbc.clj on classpath:
10:16ian__Caused by: java.io.FileNotFoundException: Could not locate java/jdbc__init.class or java/jdbc.clj on classpath:
10:16ian__My project.clj has the following:
10:16ian__(defproject words "1.0.0-SNAPSHOT"
10:16ian__ :description "test"
10:16ian__ :dependencies [
10:16ian__ [org.clojure/clojure "1.3.0"]
10:16ian__ [org.clojure/java.jdbc "0.0.6"]
10:16ian__ [mysql/mysql-connector-java "5.1.6"]])
10:16ian__Any tips on debugging this?
10:18pyrwhat's the protocol str uses again ?
10:18pyr(or println for that matter)
10:18raekian__: the namespace you should require/use is clojure.java.jdbc, not java.jdbc
10:19ian__raek: Thanks. That did it
10:19raekbut the readme fails to deliver this cruicial piece of information...
10:19raek(why is this *so* common?)
10:19devnbecause people don't work on documentation
10:19devnthey work on features and bugs
10:20raekwell, some readmes have tons of examples
10:20raekbut they often forget the ns line
10:20devnlots of readme's are written /from/ the project
10:21devnnot /to/ the project
10:21devnalso I should clarify I don't like weak docs or anything
10:21devnI don't disagree with you raek
10:22tomojraek: that one bugs me too
10:29bsod1what should I do to use clojure.contrib.string functions like string/partition instead of clojure.contrib.string/partition?
10:29cark(ns my-ns (:import [clojure-contrib-string :as string]))
10:30carkerr
10:30carkclojure.contrib.string
10:30carkof course =P
10:30carkdamn i'm bad today
10:30carkit's :require instead of :import
10:31carksorry =/
10:31karchiedoes anyone know what happened to doc, find-doc, and source in 1.3?
10:31karchieThere's a mention in the 1.3 changes that they've been moved to the repl
10:31fliebelkarchie: moved to core.repl
10:31carkthey're in clojure.repl now
10:32cark,(clojure.repl/doc reduce)
10:32clojurebot"([f coll] [f val coll]); f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is returned and f is not called. If val i...
10:32karchiethere it is. thanks!
10:34raekbsod1: clojure.contrib.string is available as clojure.string since clojure 1.2
10:34raekhttp://clojuredocs.org/clojure_core/clojure.string
10:36ian__I'm seeing this warning now:
10:36ian__WARNING: resultset-seq already refers to: #'clojure.core/resultset-seq in namespace: words.model, being replaced by: #'clojure.java.jdbc/resultset-seq
10:36bsod1raek: thanks. I'm wondering which one is better, using java API or clojure for string operations and file IO?
10:36ian__Any tips figuring out what's going on?
10:36clojurebotTitim gan éirí ort.
10:39stuarthallowayian__: don't :use clojure.java.jdbc, :require it
10:41ian__stuarthalloway: thanks! that did it. I will now re-read about :use and :require
10:41stuarthallowayian__: np
10:43raekbsod1: you may need to use the java api for io if you read from streams directl. clojure.java.io has a lot of convenience functions that eleminates the biolerplate you'd need to write in java
10:45raekfor example, (io/reader "filename") corresponds to new BufferedReader(new InputStreamReader(new FileInputStream("filename"), "UTF-8")):
10:46bsod1I want to print a 80 character long line, is (println (apply str (take 80 (repeat "-")))) idiomatic way to do this?
10:49carkseems good to me =)
10:49chouser(repeat 80 "-")
10:49tordmorWhy would you want to generate the line at runtime?
10:49carkoh nice
10:49chouserbsod1: but the rests seems fine.
10:50chouserMan, dart sure nails the easy-to-start-playing-with metric.
10:51bsod1tordmor: I don't want to generate the line at runtime, what is your alternative? (println "-----------------------------------------------------------") ?
10:51raflis there a builtin or contrib function that'd provide me with what many other languages call "zip", i.e. going from the two lists ("a" "b") and (1 2) to the list (("a" 1) ("b" 2))?
10:52tordmorbsod1, yes.
10:53carkchouser: ah nice lambda syntax too, that's a major problem with javascript
10:54ian__I'm attempting to run a test that updates a database. The test is wrapped in a (sql/transaction (sql/set-rollback-only) ...) form. The function that the test is calling is wrapped in a (sql/transaction ...) form. The rollback is not happening. Any idea what I'm missing? The docs seem to say that this is only one outermost txn.
10:54Chousukerafl: no, but you can use map in combination with list or vector
10:54raflfair enough. thanks. just figured i might be missing the builtin function
10:55ian__Oh, maybe it's because I also have multiple sql/with-connection forms wrapping both sql/transaction forms
10:55ian__Is there a way to get the "current" connection or create a new one?
10:55ian__"current" could be tied to the thread
10:56ian__maybe (find-connection)?
11:12ian__When I try and use clojure.java.jdbc/find-connection it does not seem to work. I get an error saying
11:12ian__java.lang.IllegalArgumentException: db-spec com.mysql.jdbc.JDBC4Connection@5e89c116 is missing a required parameter
11:12ian__Any idea what's going on here?
11:18gu_how can i check if a function exists given its (eventual) name as a string?
11:19stuarthalloway,(ns-resolve 'clojure.core '+)
11:19clojurebot#'clojure.core/+
11:23Blafasel,(doc partition)
11:23clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
11:24thoeferwhat´s the easiest way to simply extract an element from a collection that fulfills a predicate? Almost like filter, but instead of filtering the original list I want to get the specific element...
11:24Blafaselsome
11:24thoeferI think this is "detect" and "select" in ruby...
11:24thoeferok, I try :)
11:24thoeferthanks!
11:26thoeferNo, it´s not some :(
11:27thoefersome returns a boolean and not the element
11:28Chousuke(first (filter foo? coll))
11:29arkhthoefer: filter is lazy so it would be efficient to use (first (filter pred coll))
11:29thoeferyes that´s my current implementation :) is this the only way?
11:30thoeferI think about sth like (detect pred coll)
11:31zerokarmaleft,((comp first filter) odd? [1 2 3 4 5])
11:31clojurebot1
11:32arkhI can't think of a common function that performs that but you could always write your own detect ;)
11:33Blafasel,(some #{2} [ 1 3 5 7 2 ])
11:33clojurebot2
11:33thoeferOf course I could but... I think this is a very common idiom and should therefore be implemented in clojure itself.
11:33gu_how about this? (defn callable? [fn-name] (try (eval (read-string (str "(fn? " fn-name ")"))) true (catch Exception e false)))
11:34ipostelnikthoefer, some returns the result of the predicate
11:35thoeferipostelnik: but just a boolean, I want the element itself
11:36ipostelnikthoefer, make your predicate return nil for false, or element for true
11:36Blafaselthoefer: No, your predicate returns (that's why it's a predicate) a bool
11:36ipostelnikor do (first (filter ...)) like was suggested above
11:36Blafasel(some #(if (= 2 %) % nil) [1 2 4 6])
11:36thoeferipostelnik: oh, moment but this sounds good :)
11:36Blafasel,(some #(if (= 2 %) % nil) [1 2 4 6])
11:36clojurebot2
11:37thoeferworks
11:37thoefercool solution!
11:38ipostelnikthoefer, you should really use (first (filter)) that's effectively what some does
11:39thoeferthanks guys, will go on with some... still not as nice as (detect pred coll) but ok
11:39zerokarmaleftdefine detect then?
11:40ipostelnikthoefer, there's no reason why you can't write (detect) in about 3 lines
11:40Blafaselzerokarmaleft: Guess 'first element for that pred returns true or nil'
11:40ThreeCupsThe macros for composing functions that use DB connections and transactions described here: http://boss-level.com/?tag=clojure seem to be pretty common. Is there a de facto implementation of these?
11:41thoeferyes, like Blafasel said...
11:41zerokarmaleft,((comp first filter) odd? [2 4 6 8])
11:41clojurebotnil
11:41zerokarmaleft,((comp first filter) odd? [ 2 4 1 8])
11:41clojurebot1
11:42zerokarmaleftthoefer: didn't you want the element or nil?
11:44thoefer(detect #(= % 2) (list 1 2 3 4)) --> 2
11:44thoeferThat´s the semantic I know from ruby
11:45zerokarmaleftusing some is idiomatic in that case
11:46zerokarmaleft,(some #{2} [1 2 3 4])
11:46clojurebot2
11:47BlafaselUsed that above, I guess he just didn't use the map and went with (= ..) instead
11:55cemerickWhat is the equivalent of the assembly plugin in leiningen? e.g. I want to build a jar that has all the contents of directories X and Y, and contents of jars A, B, C.
11:56cemerick(not looking for uberjar here)
12:03chousercemerick: don't know about lein, sorry. But I do have a maven question for you. :-)
12:03cemerickchouser: ut-oh
12:04cemerick:-)
12:04chousercemerick: do you happen to know if it's possible to declare a dependency only for Java 1.5?
12:04chouserJava 1.6 has built-in the dep we need, but 1.5 doesn't.
12:05cemerickYes
12:05chouserwoo!
12:05cemerickDefine a profile that is active only when the jdk version is XXX.
12:05cemerickInclude your 1.5-only dependency in that profile.
12:06chouserbeautiful. thanks!
12:06cemerickNow, that's a *build-time* profile; has nothing to do with what happens at runtime, or in the build processes of dependent projects, etc.
12:06chouserright, but I think that's what we want
12:07cemericknifty
12:07chouseran alternative would be to provide two artifacts, one that always has the dep, one that never does
12:07chouserthis is for data.xml
12:07cemerickoh, the stax parser?
12:08chouserbut if we did that, then any intermediate lib that depends on data.xml would have to choose one or the other, potentially providing two artifacts itself.
12:08chousercemerick: yes
12:08cemerickOK, so profiles are not what you want.
12:08chouseroh
12:08cemerickYou're hoping for a runtime or dependent-project-build-time determination of which dependencies to use.
12:09chouserI don't see how it could be runtime, but yes as late a decision as possible.
12:09cemerickYeah, I was speaking generally there.
12:09cemerickSo does data.xml need stax all the time, or is it just a perf improvement?
12:10chouserwe're discussing changing it to require some kind of pull parser all the time.
12:11cemerickpresumably the jdk 1.5 stax parser is in a different package than the java 6 standard one?
12:11chousercemerick: ah, probably.
12:11chouserhadn't thought that far ahead yet.
12:12chouserso would require at least a little bit of runtime code to create the right kind of factory.
12:12chouserruntime sniffing scares me
12:12cemerickwell, simply declaring the hard dependency and then using the standard library implementation preferentially is a good first approximation
12:12cemerickhah!
12:13chouserso maybe it's best to have two modules. a "legacy" version for 1.5 with a dep, and the standard lib with no dep but only works >= 1.6
12:13cemerickall of reflection is runtime sniffing
12:14chouserheh, well, that's true. But swapping out whole libs based on what's in the classpath is a whole different level of scary
12:14chouserthat's what lazy-xml does and it continues to cause confusion and distress
12:15cemerick*shrug* that's what javax.xml.parsers has always done
12:15cemericknot that that's much of a recommendation
12:16cemerickJDK-specific dependency sets are tough
12:17cemerickbuilds usually just reuse the JDK used to invoke the build tool, which rarely has anything to do with the state of affairs where you're deploying
12:17chousertwo modules would allow most apps to just target >= 1.6, but people with specific customer requirements could still use 1.5
12:18cemerickSure
12:18cemerickIt's all a question of where you want the complexity: build process (multiple modules) or runtime sniffing (with e.g. an optional dependency).
12:19chouserI think the way javax.xml is doing it is causing us problems on contrib hudson right now.
12:20cemerickI can absolutely believe that.
12:35duck1123_I've found that when I use pmap to parallelize a process, it will take up a whole bunch of virtual memory. Does anyone have any ideas what I can do to keep that down?
12:36duck1123_The resident memory is about where I would expect
12:39technomancyhas anyone implemented a simple pdoseq?
12:39technomancyseems like that comes up every so often
12:40duck1123_that would be cool, in this case I'm doing this for side effects
12:40technomancyyeah, it seems like 50% of pmap usages are for side-effects
12:40technomancyand it takes a while before people realize what's wrong with doall+pmap
12:40jamiltronIs there an easy way to tell if an input is contained in the union or intersection of a variable-number of predicates?
12:40technomancyerr-dorun rather
12:41jamiltronSomething similar to comp but more like the 'or' or 'and' of several functions?
12:43thorwiltechnomancy: hi! do you know what these are about? http://paste.pocoo.org/raw/490282/ (running via clojure-jack-in, as reported by iotop)
12:44technomancythorwil: there's a process for leiningen, and one for your project
12:44technomancythorwil: for some tasks you can use "lein trampoline $TASK" to make there only be one process, but I don't know if that works with jack-in.
12:45Vinzentjamiltron, every-pred and some-fn, no?
12:46thorwiltechnomancy: i had those appear every few seconds, causing very audible disc accesses, while letting the jvm idle
12:51thorwiltechnomancy: so i take it one can not infer why they access the disc
12:52Bronsais there a way that permits me to do something like
12:52Bronsa(def a-map {:foo "bar" :baz (:foo a-map)}) ?
12:52technomancythorwil: sorry, no. is it telling you that they're both causing io?
12:53thorwiltechnomancy: both entries make the top if iotop's list regularly, immediately before i can hear the disc access
12:54technomancyI could understand having the project JVM have some daemon that hits the disk, but having the outer lein JVM have disk IO is inexplicable
12:55technomancythat process is literally doing nothing but blocking on the project JVM. if the JVM had exec like a real unix runtime, it wouldn't even be resident anymore.
12:56thorwiltechnomancy: well, thanks for the explanation so far, bbl
12:59technomancysure
13:18thoefercan anyone take a short look at this macro https://gist.github.com/1275819... why doesn´t it print out 3? damn...
13:20chouser~env-with-actions will cause all the args to be evaluated immediately
13:20clojurebotTitim gan éirí ort.
13:21chouserthoefer: I'm not quite sure what you're trying to do, but as written it could be done as a function instead
13:22thoeferyou´re right as the function needs to be called... I´m aware of it, but thanks anyway. I want to try something for a moment...
13:25chouseranother problem is that ~env-with-action is a list, so it expands to something like ("test" #(+ 1 2) ...) and complains it can't call "test" as a function
13:25chouserbecause it's a string
13:26thoeferdamn you´re good, that was exactly the error message...
13:54daniel___how to i pass arguments to java -jar blah.jar ? i'm passing -> 20 string string and it complains string cant be cast to a number
13:54daniel___does it take 2 as a string?
13:54daniel___20*
13:54daniel___'20 string string' 3 arguments
13:54daniel___1 int, two strings
13:55ibdknoxeverything that comes from the commandline will be a string
13:55daniel___right
13:55daniel___no way around that?
13:55daniel___i have to convert the argument in my code
13:55daniel___before i use it
13:55ibdknoxas far as I know
13:55daniel___ok, thats alright
13:55daniel___at least i know
13:55daniel___cheers
13:59thoeferchouser: implemented it as function, fits much better. thanks for your help!
14:01chouserthoefer: quite welcome.
14:15ibdknoxIf anyone is looking for a Clojure job in the Bay Area, they should shoot me a message :)
14:22amalloyibdknox: do you guys ever stop hiring?
14:23ibdknoxonly when we've found every one worth hiring ;)
14:24chouser...that lives in the Bay Area. :-)
14:24ibdknoxwell
14:24ibdknoxchouser: for someone awesome, that becomes less of a requirement ;)
14:25chouseribdknox: who do you work for?
14:25ibdknoxhttp://www.readyforzero.com
14:26ignacio_i work with Chris there. it's a great place to work! :)
14:50kylpoibdknox: Is that a rails website?
14:51ibdknoxkylpo: currently, it's a django site, but there's a Noir-based site (very nearly finished) that will replace all of that :)
14:54ibdknoxkylpo: why?
14:55kylpoibdknox: Ah, Noir! Very cool. Is that integration going pretty smoothly? I just like the looks, so was curious (and hopeful that it was clojure-based)
14:57ibdknoxkylpo: Yeah it's been relatively straightforward. For the internals we went with a very JS heavy approach, using the server primarily for data retrieval and computation. That aspect has had some nastiness to it, simply because it's somewhat difficult to manage large javascript apps.
14:58ibdknoxkylpo: In terms of the Clojure part, I think my only complaint is that I want a better SQL layer... so I started building that recently :)
14:58kylpoOh, cool. The Noir creator is on your team!
14:58amalloyhah
14:58amalloykylpo: you're talking to him
14:59kylpoibdknox: Aha! It all adds up :)
14:59kylpoibdknox: are you using clojurescript for the javascript, too?
15:00ibdknoxkylpo: I would've liked to, but it was a bit too early to use CLJS
15:01kylpoibdknox: understandable
15:01daniel___amalloy: ready to evolve hello world? :p
15:01ibdknoxkylpo: we'll be using it internally though :)
15:02daniel___can anyone see what the problem is in https://gist.github.com/1276194 ?
15:03kylpoibdknox: do you know of any attempts to make a blog using Noir? I'm trying to find an excuse to tinkering with it; a blog would be just that.
15:03daniel___i get a 'value out of range for char'
15:03daniel___when not using a very low number of generations
15:03hiredman(char (inc (int (nth source i))))
15:03amalloydaniel___: you only ever increment the character value
15:03hiredmanthe resulting number is too large to be a character
15:04ibdknoxkylpo: http://webnoir.org/tutorials at the bottom is an example I wrote of a blog
15:04amalloyeventually, it gets above 64k
15:04kylpoibdknox: Sorry, just saw your github blog example: https://github.com/ibdknox/Noir-blog
15:04kylpoibdknox: I'll check it out.
15:05daniel___amalloy: yes
15:05daniel___amalloy: oh, i see what you mean
15:05daniel___lol
15:05amalloyor, i guess, above 32k, which would be the relevant barrier
15:06daniel___is there an elegant way of writing inc || dec
15:07amalloy#(+ % -1 (* 2 (rand-int 2))) probably works
15:07amalloy&(map #(+ % -1 (* 2 (rand-int 2))) (range 10))
15:07lazybot⇒ (-1 2 3 4 5 4 7 6 7 8)
15:08daniel___or raise -1 to rand-int 2
15:09daniel___would give either -1^0 = 1 or -1^1 = -1
15:09amalloysure
15:10amalloyyou'll really start to feel the pain of not using a candidate pool, though. ie, you're not really selecting based on fitness at all in your algorithm
15:10daniel___amalloy: i know, one step at a time :p
15:10amalloydaniel___: well, specifically, evolve should at least choose between the parent and the child based on which is more fit
15:11daniel___its more an exercise in clojure than a serious endeavour
15:11amalloyas it stands you're taking x, mutating it into y, and then continuing to evolve y even if it's a step in the wrong direction
15:12daniel___no, i have the filter statement which at least means the child is fitter than the parent
15:12amalloydaniel___: yes, but it's not an interesting filter at all
15:12daniel___agreed
15:12amalloybecause you iterate mutate - within a single call to evolve, you continue evolving y
15:13daniel___yeah, i agree with you - as soon as it works like this, that's where ill go
15:13amalloyokay
15:14daniel___is there a way of raising to the power with a core library function?
15:14daniel___,(pow 2 2)
15:15clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: pow in this context, compiling:(NO_SOURCE_PATH:0)>
15:15chouser,(Math/pow 2 2)
15:15clojurebot4.0
15:15daniel___,(** 2 2)
15:15clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ** in this context, compiling:(NO_SOURCE_PATH:0)>
15:15daniel___ok cheers chouser
15:15gfredericks,(.pow (biginteger 3) 99)
15:15clojurebot171792506910670443678820376588540424234035840667BIGINT
15:16ibdknoxlol
15:16gfredericksfloats are wussy
15:24daniel___still get a value out of range for char -1
15:24daniel___maybe instead of int, i do in fact need codepoints
15:24daniel___maybe it handles the end cases better
15:25daniel___no, its char thats the problem anyway
15:27daniel___,(rand-nth [-1 1])
15:27clojurebot-1
15:27daniel___i decided thats the best way of inc || dec
15:28hiredmanhave you considered treating the goal as a sequence of numbers, then you can just generate numbers and only care about characters one you've reached the goal and have to convert the numbers into characters
15:29daniel___hiredman: i hadn't, but it might be an idea
15:29daniel___still might get the exception though, if it doesnt get close enough to the goal
15:30daniel___ideally i want it to be able to run it for x generations
15:35amalloy(inc hiredman)
15:35lazybot⟹ 4
15:36daniel___(inc daniel___)
15:36lazybotYou can't adjust your own karma.
15:36daniel___oh
15:36Bronsadum da tsh
15:49gfredericks(inc daniel_____________)
15:49lazybot⟹ 1
15:49daniel___:D
15:50ibdknoxlol
16:20daniel___is it <= or =< ?
16:21daniel___,(<= 2 2)
16:21clojurebottrue
16:22gfredericksdaniel___: don't you have a repl going yet?
16:22daniel___yeah, i do
16:22daniel___i was just extremely lazy
16:22daniel___:/
16:23daniel___no idea why my **** won't work https://gist.github.com/1276401
16:24daniel___now if i call (start x "bob" "jim") i end up with "bob" no matter how many generations i do
16:24daniel___and i want "jim"
16:25daniel___just because i made it filter <=
16:25daniel___if the fitness gets down to 0 (= target), then otherwise it would iterate forever unless i had <=
16:27amalloyso uh...you could use some punctuation other than newlines. you're kinda filling up the whole scrollback now
16:28daniel___aye, that i could
16:43alpheusHi, I'm back after about 6 months away from Clojure. What do people use now if they just want to connect to a relational database (postgresql) and do some queries?
16:45grumpytoadecho "select whatever from nojvm" | psql database
16:45morphlingalpheus: https://github.com/clojure/java.jdbc
16:46alpheusmorphling: "The library formerly known as clojure.contrib.sql." Exactly what I needed to know.
16:47daniel___ (filter #(<= (fitness %) (fitness source))
16:47alpheusgrumpytoad: Thanks for the shell 101 help!
16:47grumpytoadnp ;-)
16:50fliebelSo has ClojureQL fallen out of grace?
16:52brehauti don't think 'out of grace' but theres certainly been enough use that people have things that they'd prefer were different
16:55fliebelbrehaut: My brain sleeps. You mean people don't like the syntax and are missing features?
16:55brehautfliebel: more that some times it feels like its being too clever
16:56brehautpersonally i find myself fussing with it quite a bit to get it to generate a query that i could write easily in SQL
16:56ibdknoxthe focus on relational algebra is a fun idea, but I think it's distracting as opposed to useful
16:57ibdknoxthe queries it generates are often rather weird
16:57gfredericksI've found the composition element to be quite useful
16:57ataggartpersonally I find myself fussing with sql to get it to generate a query plan that I could write easily in clojure.
16:57ibdknoxHas anyone written a "lazy" map?
16:58ataggartmap is lazy
16:58gfredericksbut I definitely keep c.j.jdbc around for the half the time that it's more natural
16:58ibdknoxwhere a key's value would not be generated until accessed
16:58ibdknoxsorry
16:58brehautibdknox: thats just a map with delays as values
16:58ibdknoxmap datastructure
16:58ibdknoxbrehaut: yes, but then you have to explicitly force them, right?
16:58ataggartibdknox: sounds like memoize
16:59brehautibdknox: yes thats true
16:59brehautibdknox: but surely not too hard to write a wrapper type for
16:59ibdknoxthe use case: let's say I specify a relation that would require a second query (like in a has-many situation)
16:59ibdknoxideally that query wouldn't execute until I actually accessed that key of the returned map
17:01amalloyibdknox: map with delays as values is really the best you can do
17:02ibdknoxamalloy: darn
17:05kylpoibdknox: you're a vim user? Not emacs?
17:05ibdknoxkylpo: yeah
17:06chouserThere's should be a Clojure Vimmer's Anonymous group somewhere
17:06chouser s/'s//
17:06kylpoibdknox: Do you have use an alternative to SLIME and swank?
17:06gfredericks(inc chouser)
17:06lazybot⟹ 7
17:06gfredericks~second
17:06clojurebotMotion seconded and carried. Next agenda item.
17:06kylpoDo you use*
17:06ibdknoxchouser: haha, I'm always waiting for the stones to fly
17:07ibdknoxkylpo: vimclojure with nailgun
17:07brehautibdknox: those off use not using vim don't live in the stone age; not so many rocks around here
17:07ibdknoxhaha
17:07brehauti guess we could try throwing the future at you…
17:07daniel___ibdknox: im trying to get nailgun set up, could you share what you did?
17:07brehaut;)
17:07ibdknox(inc brehaut)
17:07lazybot⟹ 4
17:07daniel___i add vimclojure/server as a project dependency but it seems it has broken dependencies
17:08ibdknoxdaniel___: use a lein plugin
17:08daniel___lein-nailgun?
17:08ibdknoxhttps://github.com/ibdknox/lein-nailgun
17:08daniel___ok, cheers
17:09ibdknoxkylpo: http://blog.darevay.com/2010/10/how-i-tamed-vimclojure/
17:09ibdknoxdaniel___: that might be useful for you too ^
17:09kylpoibdknox: thanks
17:10gfredericksha: "Like windows users at a ruby conference..."
17:11kylpoI doubt this would be enough to get me off of emacs. I was just curious.
17:14ibdknoxkylpo: probably a good call, I only use vim because of many years of muscle memory :)
17:14brehautno text editor is good enough to make me change from the pile of crap I've currently acclimatized myself to
17:15chouseryeah, if you're at all comfortable with emacs, I think I'd have to recommend spending time investing in that rather than learning vim
17:16daniel___ibdknox: there is no avoiding downloading the ng client and adding it to your path right?
17:17daniel___the dev-dependency is just for the server jar
17:17ibdknoxdaniel___: you don't need to add the ng client to your path, you just need to point VIM to it
17:17ibdknoxdaniel___: let vimclojure#NailgunClient = "/users/chris/.vim/bundle/vimclojure-2.3.0/lib/ng"
17:18daniel___ok ibdknox
17:18brehautdaniel___: i dunno about lein vim stuff, but lein swank can be installed as a plug in for lein itself, rather than as a dev dependancy, so that other people don't have to download it if they don't use swank
17:19brehautdaniel___: lein plugin install foo
17:20daniel___i used vundle to install vimclojure
17:21daniel___nvm, its still in .vim/bundle/vimclo...
17:24daniel___the link to download ng no longer works
17:24daniel___nvm, the link in the above blog post works
17:28hiredman
17:33brehauthow do i get lein's repl to use clj 1.3?
17:33scottjwait till there's a new lein release or run lein repl in a project?
17:34daniel___no such file or directory: ~/.vim/bundle/VimClojure/lib/nailgun/ng
17:34brehautscottj: thanks
17:34daniel___yes there is
17:35daniel___hmm, i need some classpath stuff
17:36babilenbrehaut: Just use ":dependencies [[org.clojure/clojure "1.3.0"]]" in your project.clj and run "lein deps" ... Or am I missing something here?
17:39brehautbabilen: you can use the lein repl outside of a project
17:39daniel___ibdknox: how do you start the ng server? what classpath?
17:39ibdknoxdaniel___: you don't do anything other than lein nailgun
17:39babilenbrehaut: Sure (wasn't sure what you are referring to)
17:39ibdknoxdaniel___: assuming you set it up as they suggest in that article
17:40dafrahi, i am struggling to append a div to window.document
17:40dafra(gdom/appendChild window/document (dom/element "p" {} []))
17:40dafragdom = goog.dom, dom = twitterbuzz.dom-helpers
17:40dafraany idea ?
17:40ibdknoxdafra: js/document
17:41dafrai got disconnected
17:41dafrajs/document gives the same error
17:42babilendaniel___: I just use lein-nailgun personally. A new (i.e. for 1.3) version of it can be found on http://clojars.org/org.clojars.ibdknox/lein-nailgun -- Install it with 'lein plugin install org.clojars.ibdknox/lein-nailgun "1.1.1"' -- You can then start it with "lein nailgun &"
17:42dafraappendChild fails
17:43ibdknoxdafra: with what error?
17:43dafrasomething like dom hierarchy error 8
17:44dafraalso twitterbuzz.dom-helpers/element :p creates an invalid element name
17:44babilenibdknox: Ah, did not realise that you are, in fact, you :) -- Do you have any intention of maintaining lein-nailgun? These 200 versions on clojars are just confusing and a maintainence/documentation mess.
17:44dafrai have to use element "p" instead
17:45ibdknoxdafra: pinot takes care of this for you: http://github.com/ibdknox/pinot
17:45dafraibdknox: appendChild fails
17:45daniel___babilen: still getting no such file or directory: ~/.vim/bundle/VimClojure/lib/nailgun/ng
17:45dafranot with pinot :)
17:45ibdknoxdaniel___: absolute path
17:46daniel___ibdknox: kk
17:47daniel___no idea if it worked or not, no buffer appearing anymore
17:47ibdknoxbabilen: I can. There's really nothing to it and I'll need to keep it working since I use vim lol :)
17:47daniel___what command can i try
17:47ibdknox\sr
17:48daniel___error detected when buff auto command something or other
17:48babilenibdknox: I know -- I did the same, but the problem is not that it is hard to maintain the problem is that nobody is really doing it. This just forces everyone to fork his/her own version ..
17:49dafraibdknox: to use pinot, no need to put your cljs somewhere in the project ?
17:49ibdknoxdafra: hm? To use pinot you just need the pinot jar on your classpath
17:50dafraibdknox: and cljsc will find them ?
17:50ibdknoxdafra: if you're using the compiler directly (which I don't suggest for web stuff), you need to put it in the CLOJURESCRIPT_HOME/lib dir
17:51dafraon my box (windows) leiningen clojurescirpt plugin and cljs-watch both fail :(
17:51daniel___so i ran make and my ng file is where it should be...i also did lein plugin install org.clojars....
17:51ibdknoxdafra: someone has a cljs-watch that works for windows
17:51daniel___still not working
17:52dafraibdknox: i misread clojurescript_home, ok
17:52ibdknoxdaniel___: you need the server jar next to ng as well
17:53ibdknoxls ~/.vim/bundle/vimclojure-2.3.0/lib/
17:53ibdknoxng server-2.3.0.jar
17:53daniel___ok, doesnt lein plugin install take care of that though :(
17:53daniel___i dont like having all these manual dependencies
17:53ibdknoxdaniel___: I actually don't remember if that's important, but the first step is to get it working, then refine it :)
17:55daniel___got server-2.2.0.jar next to ng, still doesn't appear to work
17:56daniel___i took it from my project/lib directory
17:57daniel___i guess lein plugin install org.c..... put it there?
17:58ibdknoxdaniel___: running lein nailgun does I believe
17:58daniel___i tried setting up ng about a month ago and never got it to work, so i jsut reverted to using vimclojure offline
17:59ibdknoxhm
17:59ibdknoxAll I did was drop vimclojure in my bundles, build ng, put that in bundles/vimclojure/lib
17:59ibdknoxthen added a bunch of lines to my .vimrc
17:59daniel___i have it in bundle/VimClojure/lib/nailgun
17:59daniel___but that shouldnt matter
18:00daniel___ibdknox: i think its those lines in your vimrc
18:00ibdknoxgisting
18:00ibdknoxdaniel___: https://gist.github.com/1276688
18:01dafraibdknox: should (dom/append js/document (html/html [:p [:em "hey"]])) work, with pinot.dom and pinot.html ?
18:01ibdknoxdafra: I've never tried to append directly to the document
18:01ibdknoxdafra: let me try
18:01babilendaniel___: What is the content or your ~/.lein/plugins/ ?
18:02babilens/or/of
18:02lazybot<babilen> daniel___: What is the content of your ~/.lein/plugins/ ?
18:04daniel___org.clojars.ibdknox-lein-nailgun-1.1.1.jar
18:04daniel___it's almost as though it works...slight pause when vim loads up, no errors
18:04daniel___but \sr brings up two empty buffers and i get some error at the bottom
18:05ibdknoxdafra: looks like the goog libs don't let you append to document
18:05dafraibdknox: (dom/append (dom/query "#toto") (html/html [:p [:em "hey"]])) fails too: Undefined nameToPath for goog.dom.query
18:05daniel___arg, i had two nailguns running
18:05daniel___now i get an error....connection refused :S
18:05dafraibdknox: with <div id="toto"></div>
18:05ibdknoxdafra: you need the goog-jar.jar that includes the third party extensions
18:05daniel___Error executing Nail! (230)
18:05babilenWhat are those errors? Did you run "lein nailgun &" ?
18:05daniel___connect: Connection refused
18:06daniel___yeah, i did
18:06daniel___i remember, this connection refused is where i gave up about a month ago
18:06babilendaniel___: What is the output of that? Something like " NGServer started on 127.0.0.1, port 2113" ?
18:07ibdknoxdafra: the goog.jar that you get from clojurescript's bootstrap doesn't include the third party stuff, I created a special one that does
18:07daniel___nope, just [1] 17827
18:07daniel___the ps id
18:08ibdknoxdon't run it in the background
18:09daniel___so just lein nailgun
18:10dafraibdknox: this still doesnt work, but no error messages any more, i'm on the right track
18:10dafraibdknox: thanks
18:11ibdknoxdafra: you can just do (dom/append (.body js/document) (html/html [:p "hey"]))
18:11daniel___ok yes, NGServer started on 127...
18:11ibdknoxdevn: you could capture the output, and run clj-tagsoup ;)
18:11dafraibdknox: INVALID_CHARACTER_ERR: DOM Exception 5
18:12daniel___opening vim....just a blank buffer as though its still loading the contents
18:12daniel___aaah, here it is
18:12daniel___contents eventually loads, press \sr, get two blank buffers again
18:13ibdknoxdafra: something else is going on then, I know that works :)
18:13dafraibdknox: when i replace :p with "p" it loops forever :)
18:13ibdknoxhaha
18:13ibdknoxhm
18:14dafraibdknox: i always get a wrong tagname
18:14ibdknoxdafra: that works too
18:14ibdknoxdafra: just did this: (dom/prepend (.body js/document) (html/html ["p" "woot"]))
18:14daniel___dunno, maybe i have a binding that is conflicting with another plugin
18:14daniel___im gunna go to bed
18:14daniel___night all, thanks for your help
18:16dafraibdknox: i get the same error as with twitterbuzz, so it's not you :)
18:16dafraibdknox: my tag name is "﷐'p" when i request a :p
18:17dafraibdknox: invalid character, etc.
18:17ibdknoxdafra: are you using HEAD?
18:17dafraibdknox: clojurescript HEAD ?
18:17dafraib ibdknox noidi
18:17dafraibdknox: no
18:17ibdknoxdafra: try it against head
18:18dafraibdknox: build it ?
18:18dafraibdknox: i'll try taht
18:18ibdknoxdafra: huh? you just need to do git pull and run script/bootstrap
18:19ibdknoxdafra: then go in there and delete that goog.jar it puts in there. You just want my goog-jar.jar
18:19dafraibdknox: ok, that's what i did, but some weeks ago
18:19ibdknoxdafra: I don't know that it'll fix your issue, but a lot of good things have happened in the past couple weeks, it can't hurt
18:21dafraibdknox: thx, bye
18:22devnhowdy all
18:22gfredericksdevn: howdy.
18:22devnhow goes the clojuring?
18:23brehautdevn: mind changing
18:35devnbrehaut: in a positive way I hope
18:36brehautdevn: of course :)
18:36devnYeah I sat down the other day and began a list of things I've learned about as a result of using other languages since I started with Clojure
18:37devnbrehaut: the results were pretty staggering -- I'm thinking that might make a good talk if anyone is reading this
18:37brehautdevn: i think so
18:38devnI didn't know a lisp before I started Clojure -- I had done a little elisp and read a tiny bit of the PCL
18:38brehautone thing I've noticed since getting deeper into functional programming and clojure is that my brain has been rewired to focus on compositional code far far more pervasively than i did with procedural and OO
18:38devnyeah brehaut -- it's really a mind fsck. It's kind of a problem and a solution
18:39brehauthaha literally a mind fsck :P
18:39brehautchecked and repaired
18:39devnI'm feeling like I'm sort of in this transition phase
18:39devnit's like having one of those really "middle" beards
18:39devnit's not a bear, and it's not stubble. it's just -- there.
18:39brehauteverything is itchy?
18:39devnI'm slowly developing the full-on philosopher beard
18:40brehautexcellent
18:40devnbut that's exciting -- and it's why I think a lot of other languages just don't "do it" for me the way they used to
18:40brehautlikewise
18:40devnIt's like the research on GUI environments versus the command line
18:40devnthere is a sharp learning curve on the command line compared to GUI environments
18:41devnbut the "dead end" states in GUI programs eventually creep up
18:41devnthere is a plateau where there isn't in a CL environment
18:42devnAnyway, I'm ranting as usual, I've just really grown as a programmer since I started learning Clojure a couple of (maybe even 3 years?!) ago now
18:42devnand when I wrote that list it was just a torrent of topics and lands I had never seen or considered before
18:43brehautthe bad old days of snapshot jars and no leiningen
18:44devnbrehaut: :) let's not be all "those were the days"
18:44devnthat's going to make me feel like a snob
18:44brehauthaha
18:44devn(and potentially old)
18:46brehauti don't think anyone can feel old by recalling the early days of clojure :P
18:47brehaut(except maybe raynes i guess)
18:49amalloyheh, emacs knows what i like to complain about. `Il` offers to be completed as `IllegalStateException`
19:22Raynesbrehaut: Yeah, man. I grew all sorts of new hair after I first found Clojure.
19:22RaynesCould have been puberty, but I think it was the Clojure.
19:23brehautits the result of a high concentration of lambda particles
19:23brehautsee also http://homepages.inf.ed.ac.uk/wadler/Pics/philtiebig.jpg
19:27RaynesBowties are cool.
19:27brehautbow ties with lambdas are cooler
19:37devnI ordered a clojure license plate
19:37devnMy errands for the day
20:08ignacio_ibdknox: overriding lookup might help with your map question
20:08ignacio_eg:
20:08ignacio_http://stackoverflow.com/questions/5583841/overloading-keywords-in-clojure
20:09ibdknoxignacio_: yeah, I could wrap a map relatively easily, seems somewhat hacky to me though
20:11ignacio_well, at some level you want to change their behavior
20:12zippy314Has anybody here had any luck getting clojurescript to work with goog.ui.Select? I can't get it insert MenuItems...
20:12ignacio_and i agree that for what you're looking for, wrapping is probably not very elegant
20:12zippy314(or goog.ui.Options) for that matter either.
20:12ignacio_but modifying the behavior at a low level seems like the best way to accomplish what you want
20:13ignacio_unless you have a neat magical solution already :)
20:14ibdknoxignacio_: nope lol, I was thinking of just changing the expectation
20:15ibdknoxignacio_: basically saying that if you do (with some-has-many-rel) that relationship will be evaluated as soon as you consume the parent element
20:15ibdknoxignacio_: if that's not what you wanted, my argument would be that you shouldn't be using with, and you should just do it conditionally
20:16ignacio_but you may not know at query time that you actually want it
20:17ibdknoxhm?
20:17duck1123ibdknox: wouldn't just about any operations on a map cause that value to be realized
20:18duck1123I'm willing to bet that most of the function weren't written with the laziness of maps in mind
20:18ibdknoxduck1123: lookups wouldn't, since this a database result set, I don't imagine you'll be doing too much else
20:18ibdknoxduck1123: I'd be surprised if assoc caused lookups of unrelated elements, but I haven't looked into it
20:19zippy314Here's a gist with clojurescript to produce a select: https://gist.github.com/1276936 It includes the actual html produced which doesn't include the added menu items. Any ideas why?
20:19duck1123well, not assoc, but a lot of the other ones
20:19ibdknoxduck1123: like?
20:20duck1123trying to think of examples, and you're right, the ones that realize you probably wouldn't do on a db result
20:20ignacio_ibdknox: if get some entity in the db
20:20ibdknoxzippy314: I don't know that you're going to find a lot of help here on the gclosure lib stuff, sadly :(
20:20duck1123probably things like keys
20:20ignacio_i may not know what exactly i want to do with that element in the future.
20:21ibdknoxignacio_: yeah, and then when you need that extra information you could do something like (select my-has-many (for my-current-user))
20:21zippy314ibdknox: thanks anyways. I'll try the mailing list..
20:21ignacio_ic
20:22ignacio_but that would not populate a nested datastructure the way that (with ...) would
20:23ibdknoxignacio_: maybe for takes the current object and assocs to it, the difference *could* be transparent
20:23duck1123You're trying to achieve something like DataMapper's lazy loading of associations, right?
20:23ibdknoxduck1123: What's DataMapper?
20:23ibdknoxI see
20:23ibdknoxit looks like it, yes
20:24duck1123DataMapper is what I use in Ruby. clj-record is no replacement though
20:26ibdknoxduck1123: I'm trying to replace clj-record/ClojureQL with Korma
20:27duck1123watched
22:32dnolenanybody see any problems with true and false hashing to 0 and 1 in ClojureScript? fixes this - http://dev.clojure.org/jira/browse/CLJS-64
22:35ibdknoxdnolen: If you had a map with true false 0 1 that would be a problem. Of course I can't think of any situation where you'd have that off the top of my head...
22:36ibdknoxas keys that is
22:36dnolenibdknox: not true, that just works, ClojureScript deals w/ hash collisions
22:36ibdknoxoh?
22:36ibdknoxhm
22:36ibdknoxah, right.
22:36ibdknoxdnolen: then no
22:37dnolenk pushing it out then
22:38amalloy&(map hash [true false])
22:38lazybot⇒ (1231 1237)
22:38amalloyhuh. who knew
22:39ibdknoxlol
22:40ataggartso long as hash is consistent with =, it shouldn't matter
22:41ataggartare there any other codec people really use other than base64? Trying to decide what ns the base64 stuff should go into.
22:43amalloyataggart: it won't cause incorrectness, but if every object hashed to 0 that would be a problem
22:43amalloyjust because of performance
22:43ataggartamalloy: true, but the inverse would be incorrect, i.e., different hashes for = values.
22:44amalloyright
22:44ataggartnow I'm curious, if true/false can't be map keys in js, what is the actual key used in the map?
22:47dnolenataggart: 1/0 w/ my patch
22:48ataggartso what happens with {true :bool 1 :num}
22:49dnolenataggart: the map implementation handles hash collisions, so you get {true :bool 1 :num}
22:49ataggartbut if the true is actually a 1, then it's not just a hash collision, but an equivalence collision (or is there some other magic going on?)
22:49tomojhmm, I see cljs.core.HashMap.fromArrays([!0,!1],[1,3]) for {true 1 false 3}, with a pretty old compiler
22:49tomojwhat are those ! for? binary not?
22:50dnolenataggart: true is not actually a 1 tho.
22:50ataggartheh, ok then back to my original question, what is the actual key when the ostensible key is true?
22:51dnolentrue is the key.
22:53amalloydnolen: i think the most interesting question is "why couldn't booleans be used as keys to begin with, and what did you do to remedy it"
22:53dnolenJS objects only supports string keys
22:54dnolenso ClojureScript map implementation uses buckets when different keys hash the same. the arrays look like [k v k v …]
23:05dnolenibdknox: any opinions about this? http://dev.clojure.org/jira/browse/CLJS-50
23:05dnolenor anyone else for that matter :)
23:05dnolensolution would be to return a lazy seq with conj is called
23:05dnolens/with/when
23:05lazybot<dnolen> solution would be to return a lazy seq when conj is called
23:06dnolenhuh actually that's probably not even necessary since we have cons
23:08dnolenyup that works.
23:27ibdknoxdnolen: cons was the way to go :)
23:27dnolenibdknox: yep
23:55scottjis there a builtin function like group-by but instead of {true [a b] false [c d]} returns ([a b] [c d]) ?
23:56amalloy(comp vals group-by)? :P
23:57scottjahh it's seperate from c.c.seq-utils that I was thinking of
23:58amalloyscottj: that is very different from group-by; separate is (juxt filter remove)
23:59scottjthe "like group-by" was imprecise. thanks I'll have to note that juxt code it's shorter than writing my own or requiring something
23:59amalloyclojurebot: amalloy?
23:59clojurebotamalloy is <amalloy> just use juxt, it'll be great