#clojure logs

2014-08-05

02:00michaelr`good morning #clojure
02:01Jaoodmichaelr`: what's your time?
02:09michaelr`Jaood: 9 am
02:10tybot2 What are the most recommended intro clojure materials?
02:27SagiCZ1(doc some?)
02:27clojurebot"([x]); Returns true if x is not nil, false otherwise."
02:34ToBeReplacedcall for open source developers -> i'm tired of not using java.nio.file, so i started writing an extensive wrapper to make it workable from clojure, and i'd love help if anyone else wants to donate time
02:34ToBeReplacedhttps://github.com/ToBeReplaced/nio.file is beginning work... all of Path is complete, and some complicated work on copy and visitors
03:16rritochHi, does anyone know why code that compiles in Windows won't compile in Linux?
03:17rritochIn linux I'm getting a file not found exception
03:17rritochI have verified the the line endings are in linux format on the linux machine so I don't know why it won't compile
03:48andyfrritoch: Does the file not found exception mention any file names in it? What file names do you have? Using Leiningen?
03:56SagiCZ1how can i use functions from another namespace without the slash delimiter?
03:56SagiCZ1I use "namespace/foo" but want to use "foo"
03:56andyfInteractively in a REPL: (use 'namespace)
03:57andyfIn an ns declaration, many people recommend (:require [namespace] :refer :all)
03:57nathan7(require [namespace :refer [foo]])
03:57andyfbut I did that last one from memory and I always forget the proper brackets/parens on it.
03:58nathan7andyf: brackets go around the entire specification of the namespace
03:58nathan7andyf: think of what it'd look like with multiple
03:58SagiCZ1(ns this-ns
03:58SagiCZ1 (:require that-ns :refer :all))
03:59SagiCZ1this doesnt work
03:59SagiCZ1sorry i forgot the brackets
03:59SagiCZ1works now
03:59nathan7:refer :all is generally a bad idea, it becomes hard to tell where vars came from
04:01SagiCZ1nathan7: not for me.. all i do is ctrl+click the variable and it shows me the definition
04:01clgvSagiCZ1: better use :as anyway. you wont even have to ctrl+click ;)
04:01nathan7SagiCZ1: sure, smart editors are nice
04:02nathan7SagiCZ1: what if some dependency gains a var with a name that you already have in scope?
04:02clgvSagiCZ1: if you navigate from one place to the other having to follow a lot of variables you'll get distracted soon
04:02clgvnathan7: than he will cry in pain :D
04:02nathan7being able to just look at the ns form and grok what's going on is a godsend
04:02SagiCZ1clgv: what does :as do?
04:03clgvSagiCZ1: you can provide a short alias to use for this namespace
04:03SagiCZ1so instead of namespace/foo i could say for example n/foo?
04:03clgv(:require [my.very.well.nested.ns :as m]) (m/awesome-fn 42)
04:03clgvSagiCZ1: ^^
04:10SagiCZ1clgv: mmmm okay, i guess that's kind of ok
04:10SagiCZ1clgv: i still cant say i am excited about those slashes.. don't slash my variables clojure :(
04:11SagiCZ1dots would look nicer :D
04:11clgvSagiCZ1: well, like that you easily know where they are from. believe me, you cant navigate to each one in a function definition to get to know that. it'll cost you a lot of time
04:12clgvSagiCZ1: dots are claimed for other syntax ;)
04:20lpvbwhats the function that creates a function with a constant value?
04:20opqdonut,(doc constantly)
04:20clojurebot"([x]); Returns a function that takes any number of arguments and returns x."
04:20lpvboh ok weird name for a function
04:20lpvbI wouldve named it just constant
04:20nathan7it just constantly returns x
04:20opqdonutwell "constantly 3" is a pretty good description of what the return value does :)
04:24clgv(inc opqdonut)
04:24lazybot⇒ 1
04:45clgvreflection/typehint question: why does the following not work? (.myattr ^org.bla.MyClass (somefn arg)) I get a reflection warning that Object does not have "myattr" - but MyClass does
04:45clgvsomefn is not inline
04:47andyfclgv: Not sure, but try (let [^org.bla.MyClass x (somefn arg)] ... (.myattr x) ...) to see if that works for you.
04:49clgvandyf: yes that works. the interesting thing is that it worked before and I just replaced "somefn" and it stopped working...
04:50andyfI am not sure, but I have a vague notion that perhaps in your code snippet the ^org.bla.MyClass is annotating the list, but not the return value of somefn. Don't take that as authoritative, though.
04:51clgvbut usually it works to annotate the list representing the function call
04:51andyfclgv: When you say you replaced "somefn", do you mean you redefined somefn? Or that you had a call to a function other than somefn in your snippet, and then replaced that with a call to somefn?
04:52katoxarrdem: just discovered grimoire (via cider update) -- most awsome, thanks!
04:53clgvandyfn: in fact it was an interop ".get" on an arraylist before - but that also just return Object
04:53clgvandyf: oh I think I know what's going on. "somefn" is a primitive function taking one "long" argument
04:54clgvandyfn: there seems to be an inconsistency to the behavior of regular functions with respect to annotation of non-primitive types
04:54clgvoops.
04:54clgvandyf: ^^
04:55andyfFolks like Bronsa are experts on this kind of thing. I just report hearsay and guesses :)
04:55clgvI dont know if it is worth a ticket?
04:56clgvbut it is certainly odd when you switch to primitive and the external type hint stops working
04:56clgv,(defn f [n] (java.util.ArrayList. n))
04:57clojurebot#'sandbox/f
04:57clgv,(set! *warn-on-reflection* true)
04:57clojurebot#<IllegalStateException java.lang.IllegalStateException: Can't change/establish root binding of: *warn-on-reflection* with set>
04:57clgv:(
04:57andyfI'm also not sure if it is worth a ticket, or whether there might already be one in this area. No big deal if there already is one, as someone will likely notice the duplication.
04:58Bronsaclgv: do you have an example?
04:59clgvBronsa: I'll make one and post the ticket
05:09clgvBronsa: andyf: http://dev.clojure.org/jira/browse/CLJ-1491
05:10clgvdamn one typo
05:10clgvcan I edit the ticket description?
05:11Bronsaclgv: I fixed that for you
05:12clgvBronsa: ah thank you :)
05:13Bronsathat's a weird issue, I never noticed that behaviour
05:13andyfclgv: If you sign the Clojure CA (which can now be done electronically), you can then request to join the Clojure Dev Google group after you are on the list of contributors, and then you get bumped up permissions for editing tickets
05:13clgvme neither until now ;)
05:13clgvandyf: ah ok. so maybe I should consider that ;)
05:13andyfhttp://clojure.org/contributing
05:16clgvBronsa: my code base is split into algorithm code and analysis code. the algorithm code makes heavy use of primitive functions for performance reasons
05:16clgvso I'll find those traps sooner or later ;)
05:16Bronsaclgv: so (let [^java.util.ArrayList al (g 10)] (.add al 23)) works
05:17clgvBronsa: yes, since the type hint is on the local binding
05:17Bronsalooks like the compiler ignores the hint on the invoke form if it can find a primitive arglist, should be easy to fix
05:17clgvbut it is annoying to need a local binding if you need the function result only once
05:17clgvBronsa: that was what I guessed ;)
05:18clgvBronsa: it could even detect inconsistent type hints there. primtive type hint as result of the function and object type hint externally at call site
05:26Bronsaclgv: that could be assumed to be a casting
05:27Bronsaclgv: anyway, I should have a working patch, let me test it first
05:27clgvBronsa: :D
05:33Bronsaclgv: attached to the ticket
05:37Bronsaambrosebs: http://sprunge.us/ThJW?diff
05:37ambrosebsBronsa: oh did you figure it out?
05:38Bronsaambrosebs: look at line 19 of that diff
05:38ambrosebsoh nice catch
05:38Bronsait's trying to push core.cache/core.cache instead of org.clojure/core.cache
05:39Bronsaalso no need to setup the soruce/test dirs, the parent pom takes care of that
05:40ambrosebsBronsa: can I download a raw version of that patch?
05:41Bronsaambrosebs: remove the ?diff segment on the url
05:57mpenet`ambrosebs: any eta for c.cache 0.7.0 ? Also core.memoize (which depends on it)
06:11clgvBronsa: great. now it only needs to succeed in the "integration dance" ;)
06:16clgvBronsa: did you see that one, already? http://dev.clojure.org/jira/browse/CLJ-1432
06:17Bronsaclgv: yes, but I'm not sure about that being a bug
06:18ambrosebsmpenet`: there's a few things I want to roll in before 0.7.0. I've never used core.memoize.
06:19clgvBronsa: no it's more of an enhancement to tell the user what the real error is.
06:20ambrosebsmpenet`: anything in particular you were after i core.cache?
06:20Bronsaclgv: it's not always checkable at compile time though
06:21clgvBronsa: the manifestation where the compiler explictely generates "null.doubleValue()" should be easily checkable, no?
06:21lvhAre optional keyword arguments like (defn f [a b & {:keys [x y]}] ...) considered a hack, or good API?
06:21Bronsaclgv: sure but that's hardly going to happen in real code
06:22lvh(also if I, as a caller, am building a map of keyword arguments, what is the appropriate way to call a function with those arguments?)
06:22clgvBronsa: well it did at least two times here ;)
06:22lvhClojure's equivalent of Python's f(**d), if you will :)
06:23clgvBronsa: it is likely to happen in projects using primtive functions...
06:24TDHi, I am programming a project for school in clojure I have some questions
06:24lvhseems like it'd have to be... (apply f (flatten (seq map))) ?
06:24lvhthat doesn't look too great
06:24Guest97917Hi, I am programming a project for school in clojure I have some questions
06:24Bronsaclgv: meh, the way I see it, if you went the extra mile of explicitely type hinting a function return value with a primitive type, then you're telling the compiler you ARE going to return that primitive type, it's not expecting you to be lying
06:25lvhGuest97917: Yes, you just said that, we read it the first time :-)
06:25Guest97917ok ;p, what does @ do in clojure?
06:25Bronsa'`@foo
06:25clgvBronsa: yeah, that one is most likely when you change function implementation
06:25Bronsa,'`@foo
06:25clojurebot(clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/deref)) (clojure.core/list (quote sandbox/foo))))
06:25mpenet`ambrosebs: the LRU patch and also updated dependency on prio-map
06:25Bronsa,`@foo
06:25clojurebot(clojure.core/deref sandbox/foo)
06:25Bronsadeh
06:26clgv,`@~'foo
06:26clojurebot(clojure.core/deref foo)
06:26ambrosebsmpenet`: ok. I will release a 0.6 version, I don't think those are breaking changes.
06:26clgv,(read-string "@foo")
06:26clojurebot(clojure.core/deref foo)
06:27Guest97917its in something like this: (def foo [a b] (do-something @a)))
06:27BronsaGuest97917: @a == (deref a)
06:27Guest97917what is the difference with just using a
06:28Guest97917deref?
06:28AeroNotixBronsa: those expressions are the same
06:28Bronsa,(doc deref)
06:28clojurebot"([ref] [ref timeout-ms timeout-val]); Also reader macro: @ref/@agent/@var/@atom/@delay/@future/@promise. Within a transaction, returns the in-transaction-value of ref, else returns the most-recently-committed value of ref. When applied to a var, agent or atom, returns its current state. When applied to a delay, forces it if not already forced. When applied to a future, will block if computation n...
06:28lvhGuest97917: well, a is a mutable reference to some (usually immutable) value
06:28clojurebotAlles klar
06:28BronsaAeroNotix: ?
06:28lvhGuest97917: @a gets you the actual value
06:28lvhGuest97917: (deref a) and @a are the same thing, but @a and a are not the same thing
06:28mpenet`ambrosebs: great
06:29lvhGuest97917: Sorry, I'm new to clojure myself, I don't know if there's any documentation that explains references properly
06:29clgvGuest97917: guess it's time for you to read one of those awesome clojure books - that'll save you a lot of time and trouble while learning clojure ;)
06:30lvhGuest97917: you're probably dealing with an atom, so: http://clojure.org/atoms
06:31lvhbut yes, what clgv said; any clojure book will tell you about reference types like ref, atom, var...
06:31Guest97917ok thx guys!
06:32lvhalthough to be fair I didn't quite get why they were *important* until I saw Value, Identity, State for the... sixth or so time
06:33Guest97917so to be clear: in (function [a b] (do-something(a))) you do not get the actual value of a??
06:33lazybotGuest97917: What are you, crazy? Of course not!
06:33clgvGuest97917: you could also start with http://www.braveclojure.com/ in case you are not convinced to buy a book yet ;)
06:34Guest97917it is just for a school project, I am not going to need it in the near future, it is just to finnish the project and pass the course :)
06:34Guest97917and it has to be finnished in 7 days ;P
06:35lvhGuest97917: well, you do get a
06:35lvhit's just that you probably wanted the thing that a is pointing at
06:35clgvnot the optimal attitude to learn something new...
06:35lvhGuest97917: I'm surprised that, since this is a school project, no-one is around to explain to you what it does
06:35Guest97917ah ok: with a you get the value of a, if you use @a you get the object a?
06:36lvhGuest97917: Nope.
06:36nathan7an atom is just a box holding a value
06:36lvhGuest97917: In this particular case, this code is expecting a to be a box with something in it. @a gets you the thing in the box.
06:36nathan7if a is your atom, a is the box. @a is what's inside.
06:36lvhclojure has a few magical kinds of boxes :)
06:37nathan7deref/@ is what you do when the postman comes with your parcel from China
06:37nathan7(though less destructive to the box, I suppose)
06:38Guest97917lvh: about the explanation in school, it is now holliday and I have to finnish the project in second term (do no know if that exist where you guys live) that why I do not have extra explination, everybody is on holliday ;p
06:39Guest97917but ok thanks again for the explination
06:39Guest97917you guys are awsome!
06:58Guest97917New question, when (fun [a b] (ref-set a 2)(do-something a))) is the a in do-something a then two or value given to the func?
06:59lvhGuest97917: a is always a
06:59lvhyou can make a point to something else, but a doesn't magically turn into the value pointed to by a
07:00Guest97917what does ref-set then do?
07:00lvh(so, do-something gets called with a, not 2)
07:00lvh,(doc ref-set)
07:00clojurebot"([ref val]); Must be called in a transaction. Sets the value of ref. Returns val."
07:00lvhGuest97917: It sets the ref (a, in this case) to point to 2
07:00lvhi.e. next time you deref a, it'll be 2
07:01Guest97917so next time I do @a it is 2
07:02lvhwell, unless someone else has set it to something else in the mean while, of course :)
07:02lvhbut yes.
07:02Guest97917so: (fun [a b] (ref-set a 2)(do-something @a)) now do-something is with 2
07:02Guest97917ok thanks lvh!
07:03lvhGuest97917: Also, if you're doings omething like that, odds are that you don't really want the ref-set, and instead just want to call some function with a value, i.e. the (do-something 2)
07:04lvhbut that's a deeper understanding of functional programming and clojure; probably not something I'm qualified to explain, let alone over IRC :)
07:06clgvGuest97917: your best strategy to fast success is to read through some of the available online material on clojure, e.g. http://www.braveclojure.com/
07:07Guest97917this is the code http://pastebin.com/BBctZRWp
07:08Guest97917I got form a buddy of mine, is it good use of ref-set and @
07:09Guest97917clgv: I will read some stuff, but if you have the time could you guys take a quick look at the code
07:09lvhI'm not sure why it's using a ref and not an atom here
07:09lvhI'm inclined to suggest (swap! cache assoc k v) or something?
07:10lvhBut I'm inclined to agree with clgv about tutorials :)
07:10Guest97917ok ;p
07:10Guest97917one last question before I get to reading: what does commute do?
07:10clgvGuest97917: the reading about refs will tell you ;)
07:10lvh,(doc commute)
07:10clojurebot"([ref fun & args]); Must be called in a transaction. Sets the in-transaction-value of ref to: (apply fun in-transaction-value-of-ref args) and returns the in-transaction-value of ref. At the commit point of the transaction, sets the value of ref to be: (apply fun most-recently-committed-value-of-ref args) Thus fun should be commutative, or, failing that, you must accept last-one-in-wins behavior....
07:11clgvGuest97917: without understanding refs an explanation of commute is pointless ;)
07:11lvhYeah, if you don't understand what that means, you should go read the section on refs, and then you will understand what that means :)
07:11Guest97917ok, thanks for the explination guys!
07:19mr-foobarin cljx how I annotate cljs macros ?
07:49wombawombaIs anybody familiar with Korma? I'm trying (and failing) to get it to produce something like "SELECT `A`.* FROM `A` LEFT JOIN `B` ON `A`.`id` = `B`.`id`".
07:51wombawombaer, make that "SELECT * FROM `A` LEFT JOIN `B` ON `A`.`id` = `B`.`id`"
07:52wombawomba(select A (join B (= :A.id :B.id))) gives me "SELECT `A`.* FROM `A` LEFT JOIN `B` ON `A`.`id` = `B`.`id`" (i.e. I don't get any of the fields from B)
08:18lvheh
08:19lvhAre optional keyword arguments like (defn f [a b & {:keys [x y]}] ...) considered a hack, or good API? (also if I, as a caller, am building a map of keyword arguments, what is the appropriate way to call a function with those arguments?) Clojure's equivalent of Python's f(**d), if you will :) (apply f (flatten (seq map))) ?
08:20hyPiRion~mapply
08:20clojurebotYou have to do something like (defn mapply [f & args] (apply f (apply concat (butlast args) (last args)))), which just goes to show why unrolled keyword args are a bad idea
08:24lvhhyPiRion: do you share the opinion that unrolled keyword args are a bad idea? :)
08:25hyPiRionlvh: I think it is much better to pass in an optional map. If you're unsure, I'd recommend you to initially start there, then see if it makes sense or not
08:25lvhokiedokie :)
08:26hyPiRionPersonally I've found out that's the best option, but maybe you have some use case where unrolled kw args make sense
08:26lvhuse case: blake2; it's a hash function, there's a mandatory message input (which may be an empty byte[]), and a bunch of optional arguments
08:26lvhI expect callers to do so in a very static fashion, so I don't expect it will matter much
08:26hyPiRionright
08:27lvhceratinly too many arguments to have them all be positional
08:27lvhbut hey I use semver and that first part of the version is still zero so I just do whatever I want, suckers!
08:27lvhthanks, hyPiRion :)
08:27hyPiRionhaha
08:27hyPiRionno problem, good luck with the project :)
08:28lvhthere's already kalium which does the hard part of binding java to libsodium.so
08:29lvhso it's really just "find a nice clojure api to call these objects with"
08:29hyPiRionah
08:30lvhhyPiRion: this may be a stupid question but why is that function not just in clojure.core
08:30lvhhyPiRion: that may actually turn out to be only a small benefit because kalium has stuff like https://github.com/abstractj/kalium/blob/master/src/main/java/org/abstractj/kalium/crypto/Hash.java#L28 in it
08:30lvhthat doesn't look right (my java is rusty, but that still doesn't look right)
08:32lvhhyPiRion: when I say "that function" I mean mapply of course
08:32hyPiRionlvh: I don't know why it's not in core, a lot of things are not in core and vice versa for strange reasons
08:32hyPiRionlvh: and yeah, that private byte buffer is just strange
08:33lvhhyPiRion: I'm not worried about it being private, I'm worried about it being static
08:33hyPiRionoh whaa
08:33lvhhyPiRion: (I also don't understand why it's not just a local in the method...)
08:33hyPiRionright, that's super suspicious
08:34lvhthis sounds like a threading bug waiting to happen
08:34clojurebotNo entiendo
08:35hyPiRionvery strange that those methods aren't static either
08:36lvhhyPiRion: so, as a non-Java expert, since this is calling into some C functions that are clearly "static" as far as java cares, I would expect public static final blake2(...) and no members (static or otherwise)
08:37lvhi.e. if you do want "I will copy the byte[]" as part of your contract, fine, but that should be local to the static method
08:37lvhright?
08:37hyPiRionright
08:37hyPiRionthat's what I expect too
08:38lvhI don't know jni-ffi but I certainly dont' expect it to stop the world and copy any byte[] you give it
08:38lvh(although maybe that's the only thing it can do, because the JVM can screw with memory layout all it wants, right)
08:38hyPiRionmaybe
08:38hyPiRionStill doesn't make sense to have that thing static though.
08:56aoisdfsioafuhi everyone!
08:56lvhhi :)
08:56pandeirois there a way to make clojure.java.jdbc/insert! return the resulting row with the h2 database?
08:57aoisdfsioafuis this possible: (fun [V] something set-ref V)) when V is a vector?
08:59justin_smithaoisdfsioafu: vectors are immutible, if that's what you mean
09:00justin_smithyou can return a copy that is different, but you can't change the original
09:00TEttingeraoisdfsioafu, you may want an atom to have mutation of a sort
09:00aoisdfsioafuwhat is mutable: list, map?
09:00justin_smithnone of these
09:00lvhaoisdfsioafu: almost nothing
09:01lvhaoisdfsioafu: reference types are mutable, like ref, var, atom...
09:01lvh(and even those are only mutable in a limited sense)
09:01justin_smithan atom can hold a reference to a list, map, or vector, or number, but none of these types themselves mutate - you update the atom to point to a different immutible reference
09:02justin_smithbut good clojure code won't use atoms very much - instead of mutating variables we pass values into functions, and get new ones out again.
09:03clgvlvh: shameless self-promotion: you might have a look at https://github.com/guv/clojure.options and see whether you like it ;)
09:03clgvlvh: plenta usage examples can be found here https://github.com/guv/frost
09:03lvhclgv: cool thanks!
09:06mr-foobarfrom a namespace, can you export a symbol ?
09:07justin_smithmr-foobar: the default is for things to be externally visible, but it will still be qualified by it's owning namespace
09:09justin_smithmr-foobar: in the long term this is actually a good thing, in my experience (ie. having to split a coworker's code into multiple namespaces because it got way to big, when he was using "use" was a pain in the ass, but after switching that to 'require foo-ns :as foo' for eace ns it was much easier to refactor)
09:10mr-foobarjustin_smith: I import debug symbol from macros ns, I want it to be available from tools ns as well
09:10justin_smithmr-foobar: importing is for java classes
09:10mr-foobarmy bad, require
09:11justin_smithmr-foobar: require / use are about mapping to your current ns, and you can't and shouldn't decide how to map to an ns other than the one currently being defined
09:11mr-foobarjustin_smith: doesn't that basically mean clojure doesn't have first class namespaces ?
09:14zanesWhat are some good guidelines for when to expose an API using lazy sequences vs channels?
09:23justin_smithmr-foobar: not at all
09:24justin_smithmr-foobar: namespaces are objects, you can examine their contents, modify them at runtime if needed....
09:24justin_smiththey just don't work the way you may be used to namespaces in other languages working
09:27lvhso, I'm implementing a wrapper for a hash function and I'm trying to add the KATs (known-answer tests, basically I expect h("") to be this string)
09:27lvhthat means embedding long strings in my repository.
09:27lvhany suggestions? base64 in the source file?
09:27lvhor is there a reasonable way to read them if I put them in a file separately
09:28clgv1lvh: the hash functions return byte-arrays?
09:28Bronsalvh: you can put them in a edn file in the resources directory and read them back using clojure.java.io/resource and clojure.edn/read-string
09:29lvhclgv1: yeah :)
09:29clgv1lvh: well you could save them as binary. there are several clojure libs to do that ;)
09:29mr-foobarjustin_smith: in common lisp, the methods are intern and unintern. what are clojure's equivalents ?
09:30justin_smith(doc intern)
09:30clojurebot"([ns name] [ns name val]); Finds or creates a var named by the symbol name in the namespace ns (which can be a symbol or a namespace), setting its root binding to val if supplied. The namespace must exist. The var will adopt any metadata from the name symbol. Returns the var."
09:36mr-foobarjustin_smith: thx ! it's a bit like -- explicit is better than implicit. makes sense.
09:37justin_smithmr-foobar: imo the concern is "magic" - requiring code should not have invisible side effects
09:38justin_smithso don't put side effecting code at the top level of an ns, and alterations to an ns should be declared in the ns being altered, and not be shoved in by another ns just because you decided to access it
09:38SagiCZ1and what things should we group into ns? what is their equivalent in other languages? java package?
09:39SagiCZ1i have trouble understanding what is the proper way to structure large clojure projects
09:39clgv1SagiCZ1: each topic a namespace works
09:40clgv1SagiCZ1: though the definition of "topic" is not absolute
09:40clgv1you can have a look at larger projects like leiningen
09:40justin_smithfor a web site, I have a ns for each page, with functions for GET / POST / handling various query strings for that page
09:40SagiCZ1clgv1: and then how do i connect them or communicate between them? should i also have a "main" namespace from which i call different ns'?
09:40justin_smithplus another ns for common functionality accessed for all pages
09:41SagiCZ1justin_smith: so that common ns is used as a library for others?
09:41clgv1SagiCZ1: usually if you want a runnable program in the end you need some kind of "main" namespace yes
09:41SagiCZ1clgv1: i see
09:41justin_smithSagiCZ1: if you are making a standalone application, then yes you should have a main ns. If making a library, it may be that someone needs x from your lib and not y, so you may have multiple top level namespaces they would access
09:42SagiCZ1clgv1: my project is a complicated desktop application (not necesserily with gui)
09:42SagiCZ1justin_smith: ok that does sound natural
09:42justin_smithSagiCZ1: yes, that common ns is effectively a library the others use. This is a common pattern.
09:42clgv1SagiCZ1: then you need a main namespace that gets that program up and running, e.g. as far as to launch the main window in the GUI case
09:43SagiCZ1and do you usually develop top-down or bottom-up in clojure? do you build the tiny little blocks before the large-scale logic?
09:44nathan7I generally do the blocks first
09:45SagiCZ1nathan7: i see
09:45justin_smithSagiCZ1: I'm sloppy, but I do a bit of each - I write some things in terms of what the final calling code should look like, and some things bottom up from the implementing logic.
09:45SagiCZ1justin_smith: i am used to similar approach from java - bit of both
09:53mr-foobarjustin_smith: could you have a look at https://github.com/harsha-mudi/dbg ?? I want to use a debug macro across clj + cljs
09:54mr-foobari use that macro all the time
09:54testtesthelloworcan I achieve this in closjure: a = 20 (function [a b]) a = 30?
09:54testtesthelloworso that a function changes a
09:55gfrederickstesttesthellowor: variables like that are not a part of the core language; so it depends on what you're trying to accomplish I guess
09:55SagiCZ1testtesthellowor: no
09:56justin_smithmr-foobar: small thing, an if with a nil branch is when
09:57testtesthelloworI want to achieve this: retreive[cache key], this returns the value of something with key in cache, when this value is retrieved the cache needs to update to new state
09:57justin_smithalso, you don't need to require clojure.pprint inside the body of the debug - you can do it at the level of the ns
09:58justin_smithoh - is the issue that you would only want clojure.pprint/pprint under clj?
09:59justin_smithmr-foobar: another note, I don't know for sure what you had in mind for "mock", but check out with-redefs
09:59mr-foobarjustin_smith: yeah pprint for clj and console.log for cljs
10:00mr-foobari want to make it work before I cleanup
10:00justin_smithI think feature expressions simplify this stuff (cljx)
10:01mr-foobarjustin_smith: but macros in cljs have to be in clj :/
10:01justin_smithmr-foobar: right, but you can use the cljx stuff to ensure you get the right bindings per target
10:02justin_smithhttps://github.com/lynaghk/cljx
10:03mr-foobarjustin_smith: i tried that initially, but cljx couldn't apply cljs rules to a .clj file
10:03justin_smithoh, ok
10:04mr-foobarmaybe i f'ed up somewhere. anyways thanks for looking, I'll give it another shot
10:04mr-foobarmight have to ask the cljx guys for some help wrt macro porting
10:06borkdudeWhat is a good IRC channel to ask a question about webdev?
10:06borkdudefront end
10:06borkdudeI have a problem with Chart.js
10:07dnolen_borkdude: #javascript or #clojurescript
10:07borkdudednolen_ sure, thanks
10:13gfrederickstesttesthellowor: is there some library or codebase you're already working with, or are you writing code from scratch?
10:13testtesthelloworI have two libraries: one to simulate storing items away on disk, one for splay trees, this is a datastructure to find stuf in log(O) time
10:13gfrederickstesttesthellowor: in clojure if you need something that is stateful, presumably like the cache you're describing, the idiomatic approach is to model that as a singular reference (e.g. an atom) to an immutable data structure, rather than as a mutable data structure
10:13gfredericksI believe the core.cache library has that approach, so you might take a look at that
10:13testtesthelloworok thx ill take a look!
10:14visofhi
10:15visofis this json responce wrapper right https://www.refheap.com/88933 ?
10:15visofresponse
10:16visofi'm using it to wrap the map of results but sometimes works and not working
10:16justin_smithvisof: with ring, you can just give it a string
10:16visofi don't know
10:16visofjustin_smith: what do you mean
10:16visof?
10:16visofjustin_smith: i'm using ring
10:16visofwhat should i do?
10:17justin_smith{:status 200 :headers {"Content-Type" "application/json"} :body (cheshire/generate-string {:a 0 :b 1})}
10:17justin_smithI don't know what you are doing with these OutputStreamWriter and BufferedWriter objects
10:17justin_smithmaybe i just don't understand what you are doing
10:19justin_smithoh, so you are manually getting the bytes from the stream inside that handler - I would usually use the ring json-params middleware for that
10:20justin_smithbecause otherwise I have the same stream unpacking code in each of my request handling functions
10:58testtesthelloworI have this code: (swap! cache add-to-cache @cache key value-from-store)
10:58testtesthelloworgetting error: ArityException Wrong number of args (4) passed to: cache$add-to-cache clojure.lang.AFn.throwArity (AFn.java:437)
10:58testtesthelloworbut I pass 3 arguments not 4, why does he think I pass 4?
10:58TEttingertesttesthellowor: you don't need the @cache
10:58testtesthelloworah ok
10:58TEttingerswap! takes cache and passes it as the first arg
11:01testtesthellowornow i get this error :s ClassCastException clojure.lang.PersistentVector cannot be cast to java.util.concurrent.Future
11:02Bronsa,@[]
11:02clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.concurrent.Future>
11:03testtesthelloworso I changed it to: (swap! cache add-to-cache key value-from-store)
11:04testtesthelloworcache is a vector and add-to-cache returns a new vector
11:04Bronsacache needs to be an atom
11:04Bronsaswap! works on atoms
11:04Bronsa,(doc atom)
11:04clojurebot"([x] [x & options]); Creates and returns an Atom with an initial value of x and zero or more options (in any order): :meta metadata-map :validator validate-fn If metadata-map is supplied, it will become the metadata on the atom. validate-fn must be nil or a side-effect-free fn of one argument, which will be passed the intended new state on any state change. If the new state is unacceptable, the v...
11:04testtesthelloworin add-to-cache [cache key added-value] i always use @cache
11:05testtesthelloworI have to return an atom from add-to-cache?
11:05Bronsatesttesthellowor: you don't have to, the first arg will be the value of the atom, not the atom
11:05testtesthelloworthen why do I get error?
11:05Bronsa,(let [a (atom 1)] (swap! a (fn [val i] (+ val i)) 1))
11:05clojurebot2
11:05Bronsa,(let [a (atom 1)] (swap! a (fn [val i] (+ @val i)) 1))
11:05clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.concurrent.Future>
11:06Bronsayou don't have to deref inside the function
11:06testtesthellowora ok
11:06TEttinger(inc Bronsa)
11:06TEttingerclojurebot, you ok buddy?
11:06clojurebotCool story bro.
11:07Bronsa(inc TEttinger)
11:07Bronsahe dead
11:07justin_smithit's lazybot that does the incs
11:07justin_smithlazybot is slacking
11:07Bronsajustin_smith: rly?
11:07justin_smithas usual
11:07TEttingerlazybot is indeed not here
11:07justin_smithBronsa: yeah, lazybot is the karma tracker
11:08Bronsaand I thought lazybot was useless.
11:08justin_smith<clgv> (inc opqdonut) <lazybot> ⇒ 1 (from my scrollback)
11:08BronsaRaynes: bring back the bot so I can have my inc <3
11:09vermahey, I have this function which takes a histogram with sorted keys and creates a cumulative histogram out of it, https://www.refheap.com/88937 looks a little too complicated, any suggestions on how to make it less cluttery?
11:09kungiWhen I use a core.async pub/sub channel as a message bus where do the values/messages noone subscribes to go? Are they gathering somewhere?
11:10testtesthelloworBronsa: thanks man helped me alot!
11:10Bronsatesttesthellowor: np
11:12kungi... ok they are dropped
11:17phillordI'm trying to embed nrepl-server with cider-nrepl into an app, and it's giving me a ClassNotFound for javax.swing.text.html.parser.ParserDelegator, which is a bit strange. Anyone got any ideas?
11:17ucbwhich clojure protocol do I have to extend to be able to use as seq a custom Java collection? I've googled around but found nothing that'll help me extend a provided java class to work with clojure's seq fns
11:18phillordList
11:18phillordof ISeq
11:18phillordor, sorry
11:19gfredericksucb: I don't think that's possible, since ISeq and Seqable are interfaces, not protocols
11:19ucbclojure.lang.ISeq? I've tried both (extend-type ...) and (extend-protocol ...) but no dice.
11:19ucbyeah, that's what I thought as well
11:19ucbwell, after doing some reading and trying
11:20ucbit's a shame, since I was looking forward to iterating over my collection using seq fns :(
11:20gfredericksucb: what sort of class is it?
11:20phillordwrite an adaptor
11:20ucbphillord: that's what I'll probably end up doing
11:20ucbgfredericks: meaning whether it's final or not?
11:21lvhso, I have a map of args to expected values, what's the canonical way to make sure that for each of the pairs, (is (= (apply f args) expected)?
11:21gfredericksucb: no, just where it came from, how you use it, etc
11:21lvhI'm using reduce-kv for it now
11:21lvhhttps://gist.github.com/lvh/ed2c356ffc0cd905f282
11:21ucbgfredericks: https://code.google.com/p/fastdtw/
11:21gfrederickslvh: (every? (fn [[args expected]] (= expected (apply f args))) m)
11:21ucbgfredericks: it's a class that wraps a bunch of arrays
11:22gfredericksucb: is it mutable?
11:22ucbgfredericks: yeah
11:22gfredericksucb: kind of an iffy case for the seq interface anyhow, then
11:22lvhgfredericks: will that still give me a useful error message when it fails?
11:23gfrederickslvh: no; what sort of thing are you looking for?
11:23ucbgfredericks: yeah, however in any case, it's just me using them (in my project) and I'd make sure they don't mutate, but I take your point
11:23lvhgfredericks: well, ideally when one of the test cases doesn't work, it would tell me *which one* doesn't work
11:24gfredericks(defn errors [f m] (remove (fn [[args expected]] (= expected (apply f args))) m))
11:24gfrederickslvh: ^
11:24gfredericksreturns a sequence of pairs
11:25lvhoh, and I also just realized that I probably can't use = on byte[]s :(
11:25ucbseems like I'll have to go for something along the lines of http://blog.jayfields.com/2010/04/clojure-converting-custom-collection-to.html
11:25ucbmodulo the macro, etc.
11:25testtesthelloworThanks again guys, thanks to you my project is finished, here is a present: https://www.youtube.com/watch?v=pz4-T3Biusw
11:26lvhgfredericks: and then check that that was empty?
11:26gfrederickslvh: right
11:26lvhnot the most useful error: :D actual: (not (every? #<hash_test$fn__26656$fn__26658 caesium.crypto.hash_test$fn__26656$fn__26658@ff908c7> {[#<byte[] [B@4ed999e7>] #<byte[] [B@247d0d41>, [#<byte[] [B@7905dd2f>] #<byte[] [B@58d05598>}))
11:27gfrederickslvh: if you're using clojure.test I think you can use doseq over the map
11:27gfrederickslvh: and if your map is just a literal in your code, I would look at clojure.test/are instead
11:27gfredericks(doseq [[args expected]] (is (= expected (apply f args))))
11:27lvhoh, right
11:27lvhI forgot about are :)
11:28gfredericksclojurebot: are is ises
11:28clojurebotOk.
11:28ucbgfredericks, phillord: this does the trick https://gist.github.com/99575ee83b2a1ea5d620
11:29gfredericksucb: I bet there's an easier version
11:29ucbgfredericks: I bet! :)
11:29gfredericks,(->> (range (.size ts)) (map (fn [cnt] (.getMeasurement ts cnt 0)))) maybe?
11:29clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ts in this context, compiling:(NO_SOURCE_PATH:0:0)>
11:29gfredericksclojurebot: sorry
11:29clojurebotHuh?
11:30ucbah, yeah
11:30gfredericksadd a doall or change it to mapv if you want it to be eager
11:30ucbno, lazy is fine, thanks for that
11:31lvhis there a trick for comparing byte[] for equality? apparently = isn't it.
11:31lvh(ideally also not Arrays.equal because ick, but okay, if I have to)
11:32gfrederickslvh: how could something be easier than Arrays.equal?
11:32lvhgfredericks: oh, it's plenty easy, just a little ugly imho
11:32clgv1lvh: no thats the preferred/best one ;)
11:32clgv1lvh: you can wrap it in a clojure function if that's prettier ;)
11:33lvhArrays is the one where Java reminds me "see? we can do *just fine* without first-class functions!"
11:33ucbgfredericks: let me share a secret with you: I am an arse
11:34ucbgfredericks: turns out that the TimeSeries objects are created from raw json, and then discarded. I think I'll just keep those around for what I want to do next (with the seq fns)
11:36lvh Unable to find static field: equals in class java.util.Arrays
11:36lvhIs that because there are lots of equalses, and Clojure doesn't know which one at compile time?
11:37gfredericks,(import 'java.util.Arrays)
11:37clojurebotjava.util.Arrays
11:37gfredericks,(def my-bytes (make-array Byte/TYPE 9))
11:37clojurebot#'sandbox/my-bytes
11:37gfredericks,(Arrays/equals my-bytes my-bytes)
11:37clojurebottrue
11:37gfredericks,(Arrays/equals my-bytes 42)
11:37clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: equals>
11:38gfredericks,#(Arrays/equals my-bytes %)
11:38clojurebot#<sandbox$eval144$fn__145 sandbox$eval144$fn__145@1aec528>
11:38gfredericks,(#(Arrays/equals my-bytes %) 42)
11:38clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: equals>
11:38gfredericksnot sure how to reproduce that error
11:38lvh(defn array-eq [a b] (Arrays/equals a b)) ;; Fixed it
11:38lvhI previously had the same thing, but point-free
11:39lvh(where of course clojure doesn't know I mean byte[] as opposed to the myriad of other a[] that exist
11:39gfredericks,Array/equals
11:39clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: Array, compiling:(NO_SOURCE_PATH:0:0)>
11:39gfredericks,Arrays/equals
11:39clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: equals in class java.util.Arrays, compiling:(NO_SOURCE_PATH:0:0)>
11:39gfrederickslvh: actually it's that you can't refer to methods that way
11:39lvhoh
11:39gfredericks,Math/sqrt
11:39clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: sqrt in class java.lang.Math, compiling:(NO_SOURCE_PATH:0:0)>
11:39lvhwhy not?
11:40gfredericksclojure wasn't designed to handle methods as runtime values
11:40lvhif there had been only one such implementation
11:40lvhokay
11:40gfredericksnot sure why; maybe because it'd be slower and so wouldn't want to encourage that?
11:41lvhgfredericks: I don't understand why it would be slower?
11:41lvhI mean, in this case I understand why it really just can't actually do that
11:41lvhbecause there's like 20 things I could mean by Arrays/equals
11:42gfredericksI guess it could automatically wrap it in #(Math/sqrt %)
11:42gfredericksso I don't know why that doesn't happen
11:42lvhno worries I will get over my desire for point-free things in the special case of java interop :)
11:43stain_gfredericks: well, how would Math/sqrt be resolved inside the lambda then?
11:44lvhI did end up writing (defn array-eq [a b] (Arrays/equals a b)) though ;)
11:44lvhstain_: when you call that lambda, you know the types of a and b
11:44lvhso you can happily do dispatch *then* :)
11:44lvhsorry, I should say tag not type in that case
11:44lvhif my rusty java memory serves me right
11:45gfrederickslvh: interop method calls (static & instance) only work in the call position
11:45gfredericksthus:
11:45gfredericks,Math/sqrt
11:45clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: sqrt in class java.lang.Math, compiling:(NO_SOURCE_PATH:0:0)>
11:45gfredericks,(fn [x] (Math/sqrt x))
11:45clojurebot#<sandbox$eval69$fn__70 sandbox$eval69$fn__70@1d20361>
11:46gfredericksreflection, which I think is what stain_ is asking about, is somewhat orthogonal
11:50lvhso, kalium (a crypto lib) supports this weird "Encoder" thing as a convenience method
11:50lvhthe Encoder turns byte[] into String
11:51lvhfor some reason this infects the API for the hash function; if you were using a clojure wrapper around that java lib, would you expect the same API?
11:51gfredericksinfects?
11:51lvhI mean, from clojure, I'd expect (bytes2hexstr (hash some-byte-array))
11:51lvhgfredericks: https://github.com/abstractj/kalium/blob/master/src/main/java/org/abstractj/kalium/crypto/Hash.java#L53
11:51lvhcompare with L61
11:52lvhthe encoding seems totally orthogonal :/
11:52lvhalso, for some bogus reason that code uses .getBytes instead of asking the encoder to decode?
11:53lvhsomething tells me that someone was just using the first method their IDE suggested to get the type errors to stop...
12:13schmeehey all, I'm trying to crawl a page with a simple recursive breadth-first search, but somehow after the first level things get messed up
12:14schmeecan you use map with a recursive call like I've done here? https://gist.github.com/schmee/1eff71c6b24ece20b103
12:15nanishorahi, I have a question.
12:16lvhIf I have a README with some usage documentation in it shaped like a repl session, is there a way to test that automatically?
12:16nanishoraI have a hiccups function that create rows given label vlaue
12:16nanishorabut certain rows are created based ona condition. Since when and do return the last statem,ent I only get last rows from bunch of calls.
12:17nanishoraIs tehre another construct that I could use?
12:22teslanickmap/reduce?
12:22varioustnanishora: are you using map to build the sequence of rows?
12:31jknightonI think the bug mentioned in this last mailing-list post w/r/t core.async is still there https://groups.google.com/forum/#!topic/clojure/vtvk7warLE4
12:31jknightonAnyone interested in confirming with me that I'm not doing something exceptionally stupid? This is very possible
12:40michaelr`hello
13:02sveriHi, I just read that cider-0.7.0 was released, which is great and shiny and new and awesome, whats the easiest way to get started with clojure / emacs and the latest cider?
13:03technomancyI'm adding the ability to turn off implicit middleware and hooks in Leiningen, and also adding a setting to disable all implicit code loading with :implicits false.
13:03technomancyare there any other places that loading like that happens behind the scenes that should also be effected by that setting?
13:07arrdemit'd be nice if you could turn off user.clj, but you can't so I'm just whining
13:10technomancyout of my jurisdiction =\
13:14gfredericksdoesn't it just take the first user.clj on the classpath? You could "disable" it by prioritizing an empty file
13:16meingbgWhat's the most popular way of debugging clojure code nowadays?
13:16technomancygfredericks: true
13:16technomancythis is more about running code in lein itself though
13:18gfrederickssure
13:20justin_smithmeingbg: I hear cursive (built on intellij idea) has a proper debugger
13:20gfredericksI have a half-assed debug-repl setup
13:20gfredericksI tried to make it full-assed but nrepl has tricksy outstanding boogs
13:21justin_smithyeah, I think there are a bunch of (< (ass-count x) 1.0) solutions for debugging clojure out there
13:21meingbgjustin_smith: So nothing good for emacs-based setups?
13:21technomancymeingbg: specifically a stepping debugger?
13:22meingbgtechnomancy: I just want to know what's going on without having to write code for it.
13:22justin_smithmeingbg: amalloy_ says debugger integration in swank works, but I never really figured that out when I used swank
13:22technomancymeingbg: tools.trace is great for that
13:22technomancyI've got an M-x nrepl-toggle-trace command to make that easy
13:24technomancyit also falls under the half-assed bucket, but for different reasons
13:24justin_smithclearly in clojure we have full rational ass-rankings
13:25arrdemwell we can also do perfect hashing and identification using only fractional ass rankings given that [0, 1) is uncountably infinite.
13:25technomancyjustin_smith: we can steal the rankings from http://deskthority.net/wiki/Return_key
13:26justin_smithlol
13:26arrdem(inc technomancy)
13:26arrdemlazybot is dead again I see..
13:26gfredericksthanks obama ; for [0,1) being uncountable
13:28justin_smithlol
13:31Tornado68Hi
13:32Tornado68Someone know if is possible interaction between clojure and cpp?
13:32cbpanything is possible
13:33technomancy(inc cbp)
13:33Tornado68Sure. But its easy?
13:33arrdemis JNI ever easy?
13:34Tornado68More than assembler
13:34Tornado68Some times
13:35justin_smithyou can use jni. But it may be easier and more portable to use a higher level / more loosely coupled ipc. Depends what the cpp should be doing
13:35Tornado68Cpp are hardware driver
13:36justin_smithfor example if you can make the cpp code standalone, and interact via a process stream, this is much easier to coordinate
13:36justin_smithOK, have fun with jni I guess
13:36Tornado68Ok its a good way
13:36Tornado68Thank you justin
13:36justin_smithI dunno, jni is hard to use, but I don't think you have a better option
13:37justin_smithnp
13:38arrdemLua may be a better tool for this than Clojure... you could do real driver/binary interop from Clojure via the JNI but it's probably not really worthwhile.
13:38technomancychicken scheme is famous for good C level interop
13:38Tornado68Im thinking to use over roos
13:39justin_smithor ocaml even
13:39arrdemanything that's not a C variant or raw ASM :P
13:39Tornado68ocaml?
13:40justin_smithin ocaml you can do ffi without having to write any c adaptor code
13:40hiredmanjnr is the new coolness for native interop from the jvm
13:40daviidjustin_smith: in guile too
13:41mockerAnyone played with setting up something like http://deis.io to deploy clojure web apps to?
13:41hiredmanhttp://www.oracle.com/technetwork/java/jvmls2013nutter-2013526.pdf jnr related slides, but it is so new it is hard to find usage information
13:41Tornado68Ok. I will explore ocaml. Thank you both. See you
13:42justin_smithmocker: a lot of the abstractions provided by those cloud platforms are more useful for languages that don't have isolated and predictable dependency resolution. In practice all you need with clojure in most instances is to build an uberwar, and run it with the java command
13:43justin_smithmocker: also I am very suspicious of platforms that want to run git on the production end, I would rather have a separate build server if I am not building locally
13:44technomancyjustin_smith: if I'm reading this correctly, it just uses git as a transport to get code to the build server.
13:44justin_smithtechnomancy: oh, don't mind me on that point then
13:45mockerjustin_smith: It seems like a Heroku for people with their own servers.
13:45mockerOr at least that's how I read it.
13:52amalloyjustin_smith: debugger integration in swank? i wish
13:52mikerodIs it by chance that Java interop for static field access and a static method call with no args can both be written to look like a fn call? e.g. (MyClass/MyStaticField) vs MyClass/MyStaticField vs (MyClass/MyStaticMethodNoArgs)
13:53mikerodI was actually surprised when I realized I could have this (MyClass/MyStaticField)
13:53justin_smithamalloy: must have misremembered - someone was claiming something like that
13:53mikerodbut I know it expands to (. MyClass MyStaticField)
13:53justin_smithmikerod: why are you calling that field?
13:54amalloyjustin_smith: the stacktraces are a bit nicer and interactiver than in nrepl/cider
13:54justin_smithor, the better question I guess, why do you want field access to look like a function call
13:54justin_smithamalloy: OK, I think I misfiled that, thanks
13:55mikerodjustin_smith: I didn't expect to be able to have a static field look like a function call. it surprised me that it worked
13:55mikerodI had an enum
13:55mikerod(MyEnumClass/VAL) was equivalent to MyEnumClass/VAL
13:55mikerodthat was the surprising part
13:55mikerodare you supposed to have the parentheses around it or not?
13:56mikerodI see @ http://clojure.org/java_interop it suggests no paren
13:57mikerodwhich I guess the Compiler has some special handling of this symbol then
13:59mikerodWell, I guess I answered myself. The Compiler#analyzeSymbol handles the static field-styled symbol
13:59hiredmanmikerod: . doesn't disambiguate between static fields and methods, so (Foo/Bar) and Foo/Bar both get rewritten in terms of .
14:00hiredmanand end up looking the same to the compiler, which then does reflection to figure out if you meant a static method or field
14:00amalloymikerod: (Foo/bar) as a static field look up is kinda discouraged - it's from back before the bare Foo/bar didn't exist
14:00amalloyer, before it did exist
14:00gfredericks,(Math/PI)
14:00clojurebot3.141592653589793
14:00mikerodhmm I see
14:00gfredericks,(def TAU (+ Math/PI (Math/PI)))
14:00clojurebot#'sandbox/TAU
14:01mikerodYeah, the (Foo/Bar) style surprised me since I just always thought Foo/Bar was the one true way to do it. Then I realized how the macro expands and how static fields still work with the `.`
14:01hiredmanoh, huh, maybe . does disambiguate
14:03mikerodHmm
14:10ToBeReplacedspamming again -> I'd really like a usable version of java.nio.file from Clojure; I did some work on this already, and would love help from anyone else willing to donate time: https://github.com/ToBeReplaced/nio.file
14:12justin_smithToBeReplaced: interesting, checking it out
14:13justin_smithToBeReplaced: do you have a todo somewhere?
14:15justin_smithToBeReplaced: are the arglist annotations that don't match any function body implicit ToDo items?
14:18ToBeReplacedjustin_smith: didn't write a TODO... just gotta run through all of nio.file really
14:19ToBeReplacedjustin_smith: no they aren't. the arglist annotations are there b/c there is protocol dispatch occuring; the arglists make it clear to the user what they can pass in
14:19justin_smithahh, OK
14:24ToBeReplacedjustin_smith: it's nice to be able to (copy "foo" "bar"), or delete all files but leave directories in tact with (walk-file-tree "out" (naive-visitor :visit-file delete!))
14:26justin_smithyeah, it would be nice to have a more clojure-friendly UI to nio
14:26justin_smithI just answered an SO answer about using nio via interop actually
14:32Jaoodhey, run-lisp is not bad :D
14:35Jaoodcompletion rots the mind
14:36justin_smithJaood: heh, I've used it before. But C-M-x that respects the current namespace is handy
14:40hlshipand see if I can track down where the error lies with my "it doesn't recompile" issue; it has to do with overriding (or having multiple) :source-paths
14:40hlshipYes, confirmed, with multiple
14:40drusellersas a simple etag - are there any one liners to turn a clojure map into a 'hash' say SHA1 for giggles
14:41justin_smith,(hash {:a 0 :b 1 :c 2})
14:41clojurebot-757818440
14:41justin_smithwell I guess that isn't what you meant
14:41drusellersif its unique it ain't bad
14:41hiredmanthere is some library for deterministic hashing
14:42justin_smithwell - it's a decent hashing function, but of course it isn't guaranteed collision free
14:42drusellersfor a POC i think it will be good enough.
14:42drusellersI can come back and make it fancy later
14:43hiredmanbbloom_ will rememmber the name
14:43amalloy32 bits doesn't really give you enough to have a hope of uniqueness
14:43hiredmanthe library that does sorting of maps and stuff before hashing is connected to some repl pretty printer bbloom_ likes if I recall
14:44hiredmanor it colors the output or something
14:45amalloywith 2^32 possible hash values, you only need around 80,000 inputs before you're likely to see a collision
14:45justin_smitha silly one
14:45justin_smith,(Sring. (. (java.security.MessageDigest/getInstance "SHA-1") digest (.getBytes (str {:a 0 :b 1}))))
14:45clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: Sring, compiling:(NO_SOURCE_PATH:0:0)>
14:45justin_smith,(String. (. (java.security.MessageDigest/getInstance "SHA-1") digest (.getBytes (str {:a 0 :b 1}))))
14:45clojurebot"�5\b`2����f��r����Nn"
14:46amalloyjustin_smith: the worst one imaginable
14:46amalloysince it isn't even consistent for (:b 1 :a 0}
14:46justin_smithright
14:46justin_smithbut for a string it's all set
14:48amalloygeneric solution: convert each map into a directory structure on disk, commit it to git, and check the commit sha
14:48amalloydetails left as exercise for reader
14:50hiredmanhttps://github.com/greglook/puget#canonical-representation
14:51hiredmanthen sha the bytes from that
14:51hiredman(I found it by going to bbloom_'s github and finding his fork)
14:51justin_smith(inc hiredman)
14:52justin_smiththat looks like the right way to do it, yeah
14:52hiredmanwell, no, it is an easy way
14:52clojurebotIk begrijp
14:53hiredmanthe right way involves not printing, just hashing, but that is more complicated
14:57gfredericksdrusellers: amalloy: justin_smith: hiredman: everybody: https://github.com/weavejester/whorl
14:57oatsadnwhat’s the current best way to build abritrary SVG in clojurescript?
14:58gfredericksoatsadn: crate isn't terrible
14:58technomancyugh
14:58hiredmangfredericks: still printing
14:58amalloygfredericks: i would rather daydream about rube goldberg hashing schemes than use a sensible one
14:58technomancywhat is up with github's terrible rendering of ©?
14:59hiredmangfredericks: and it uses an identity hashmap so equal objects could end up with different whorls
14:59hiredmanseems terrible
14:59gfrederickshiredman: a what
15:00hiredmanoh, no
15:00hiredmanI am wrong
15:00oatsadngfredericks: cool i hadn’t thought of the hiccup approach
15:00hiredmanI saw java.util.WeakHashMap and read java.util.WeakIdentityHashMap or whatever it is called
15:01hiredmanregardless, it still prints stuff, which is a waste
15:03justin_smithwhat about hashing the bytes out of a java.io.ObjectOutputStream?
15:04justin_smithI guess that would not be identical for identical structures
15:04justin_smith*equal
15:05hiredmanbasically you need to do like hash does, get the hash of each element of a collection(in a deterministic order) and mix them together somehow
15:06hiredmanlots of xors and multiplies by 31
15:06gfredericksha
15:09justin_smithhttps://www.refheap.com/88944 using the serialized forms, looks promising
15:10amalloyi don't think hash actually does things in a deterministic order, hiredman; instead it uses a combining operation that is commutative (ie, doesn't do lots of multiplying by 31)
15:11amalloy"The hash code of a map is defined to be the sum of the hash codes of each entry in the map's entrySet() view"
15:15hiredmanamalloy: ah, interesting, the deterministic part as a suggestion that you would want to do that in your clojure sha datastructure code, not that hashing does it, but a commutative operation seems like it would be better
15:15hiredmanthe multiple by 31 was a java string hashing joke
15:15hiredmanhttps://en.wikipedia.org/wiki/Java_hashCode()#The_java.lang.String_hash_function
15:16jewhy does the clojurescript compiler throw a warning when comparing (less than/greater than) to js/Date objects: https://gist.github.com/jacobemcken/04d264257718f2edea35
15:16amalloyhiredman: it made me think of eclipse's autogenerated hashCode implementations
15:16technomancywow
15:16amalloyhttp://stackoverflow.com/questions/11795104/is-the-hashcode-function-generated-by-eclipse-any-good
15:16jethe running code seems to work as expected (being able to compare js/Date objects correctly)
15:17hiredmanje: likely the behviour of > and < on non numbers in clojurescript is undefined
15:17dnolen_je: < is only for numbers in CLJS
15:17dnolen_je: there is not abstract comparable notion in JS to make it work properly
15:17dnolen_w/o a perf hit anyway
15:19dnolen_(< (.valueOf t) (.valueOf (js/Date.)) is the way to do it
15:19jednolen_: awesome thanks... was about to ask ;)
15:20schmeeis it possible to have a lazy-seq where values depend on earlier ones?
15:20hiredmanschmee: it depends what you mean by that
15:21hiredman~google clojure fib
15:21clojurebotFirst, out of 879 results is:
15:21clojurebotClojure Programming/Examples/Lazy Fibonacci - Wikibooks, open ...
15:21clojurebothttp://en.wikibooks.org/wiki/Clojure_Programming/Examples/Lazy_Fibonacci
15:21hiredmanhas a few different styles, I would steer clear of anything that uses def to tie the knot
15:21schmeewell, I'm goofing around with crawling a website, and I'm trying to make a lazy-seq out of the links
15:22schmeebut I only want to add the links to the queue if they haven't appeared earlier in the seq
15:22amalloyschmee: definitely! a simple example is (range), where each element is exactly one larger than the previous
15:22amalloyschmee: you can do that yourself by maintaining a set of already-seen links, but just calling distinct is probably good enough
15:23schmeeamalloy: that's the approach I'm trying, but I'm getting some weird errors so I wanted to make sure I'm not wasting my time :P
15:24schmeeI'll try some more and see if I can get it working, thanks
15:28justin_smithhttps://www.refheap.com/88947 sha-1 of clojure datatypes, works with identical maps, but doesn't hash vector/seq of the same contents equally
15:28justin_smith*equal maps (even if the keys are shuffled)
15:30hiredmancalling .getBytes is terrible
15:31hiredmanjustin_smith: that also doesn't match =
15:31justin_smithyeah, I could specialize serialized-form and just not call str there
15:31hiredmanhash maps won't hash the same as array maps
15:31justin_smithoh, yeah
15:32justin_smithso there would need to be some transition to a canonical form, for any solution
15:32hiredmanand you are still serializing before hashing
15:32hiredmanwhich is not great
15:59cloojure_Is anybody having trouble deploying to clojars today?
16:22mockerWoo, deis seems pretty slick.
16:22mockerhttps://github.com/deis/example-clojure-ring
17:08ben_vulpesanyone playing with the new cider yet?
17:13alpheusI just got it a couple days ago. Is that the new one?
17:14alpheusWhen (class obj) returns something like com.google.appengine.api.blobstore.dev.UploadBlobServlet$2 what does "$2" mean?
17:15hiredmanit is part of the classname
17:15alpheusThe ancestors include javax.servlet.http.HttpServletRequest, but I can't use it as an HttpServletRequest.
17:16hiredmanalpheus: are you looking at the ancestors of com.google.appengine.api.blobstore.dev.UploadBlobServlet$2 or com.google.appengine.api.blobstore.dev.UploadBlobServlet?
17:16hiredmanbecause those are different classes
17:17alpheusI call (ancestors (class (:servlet-request request)))
17:17hiredmanthe java compiler tends to tack $1 or $2 on to the end of the outer classname when to get the name for an annonymous innerclass (at the jvm level all classes have names)
17:17alpheusOh, so I need an inner class.
17:17hiredmanalpheus: and what makes you think you can't use it as a HttpServletRequest?
17:18alpheusjava.lang.ClassCastException: Cannot cast com.google.appengine.api.blobstore.dev.UploadBlobServlet$2$1 to javax.servlet.http.HttpServletRequest
17:18hiredmanthat is a different class again
17:18hiredmannote the $1
17:20hiredmanif the class of (:servlet-request request) is com.google.appengine.api.blobstore.dev.UploadBlobServlet$2 and you get that error then you aren't using (:servlet-request request) there
17:21alpheusCan I paste a couple lines of code?
17:21hiredmanuse a pastebin
17:24alpheushttp://pastebin.com/Lqn7dAU8
17:25hiredman,(doc isa?)
17:25clojurebot"([child parent] [h child parent]); Returns true if (= child parent), or child is directly or indirectly derived from parent, either via a Java type inheritance relationship or a relationship established via derive. h must be a hierarchy obtained from make-hierarchy, if not supplied defaults to the global hierarchy"
17:25hiredmanyou want instance?
17:25schmeeis there something like `take-until`, that works like `take-while` except that it includes the element which caused it to terminate?
17:25hiredman,(doc instance?)
17:25clojurebot"([c x]); Evaluates x and tests if it is an instance of the class c. Returns true or false"
17:25alpheusok
17:26hiredmanand that output is obviously not the output of the pasted code
17:26hiredman(the printed strings are different, etc)
17:27puredangerschmee: http://dev.clojure.org/jira/browse/CLJ-1451
17:28schmeehaha found it at exactly the same time! :D
17:28schmeeso I'm not the only one wanting this :)
17:28puredangerno :)
17:29schmeepuredanger: so is that approved for 1.7? It's marked as unresolved
17:30puredangerno, it's been triaged (by me) as worthy of Rich to look at
17:30puredangerbut he has not yet done so
17:30schmeeI see
17:30schmeeanyway I can just steal the implementation for now :P
17:30puredangerhttp://dev.clojure.org/display/community/JIRA+workflow
17:32schmeemaybe there should be a more general variant which lets you specify an interval around the termination point
17:32schmeeso you can return say, two items before or after termination
17:32puredangerthat seems much less common
17:33puredangerif you need that, that's fine but I think it would be much less likely to be accepted for core
17:33schmeeindeed, I was just thinking that the goal of core is to be as general as possible
17:33schmeebut I guess it's to be as _useful_ as possible
17:34puredangerI'm sure some here would disparage that definition :)
17:35alpheushiredman: didn't mean to mislead. Here's the actual output: http://pastebin.com/ZSdkuuqM
17:35alpheusI forgot to fix the isa?, but added instance?
17:35hiredmansure, so it could be used in more theoretical cases, but if there are no actual uses, is it actually more useful?
17:36hiredmanalpheus: so as you see it is an instance, and the class name is com.Black Mesa.appengine.api.blobstore.dev.UploadBlobServlet$2, and your exception references com.Black Mesa.appengine.api.blobstore.dev.UploadBlobServlet$2$1 a different class
17:36hiredmanoh, sorry
17:36hiredmanI have my web browser automatically replace some words like google
17:37hiredmanplays hell with copy and pasting
17:37alpheusheh
17:37hiredmanbut yeah, those are different classes
17:37hiredmanso you are likely passing the wrong argument somewhere or something
17:38alpheusThat seems likely. Thanks for your help.
17:38technomancyhiredman: I heard a rumor that the same extension resulted in a creative pizza order for someone
17:38technomancyhttps://twitter.com/gregkare/status/494823249373831168
17:38hiredmanhuh, dunno, I use my phone to order pizza
17:40hyPiRionI have some replacements
17:40hiredmanthe script I am using also replaces "witnesses" with "these dudes i know" and "smartphone" with "Pokédex"
17:40hyPiRionliterally → figuratively is the most used one
17:40hiredmanand gandalf -> garfield of course
17:42hyPiRion"Will Blow Your Mind" → "Might Perhaps Mildly Entertain You For a Moment"
17:46gfredericks"one weird trick" → "thing"
17:48alpheushiredman: thanks again. you were absolutely right about passing the wrong argument.
17:50justin_smith"disrupt" -> "bullshit" which, when combined with "cloud" -> "butt" will lead to "new technology to bullshit my butt"
18:52afhammadI have a project with Timbre for logging setup using Luminus however the logs are not very readable. Whats the best way to get nice logs when using ring/compojure ?
18:56justin_smithafhammad: you can set the logger format with Timbre
19:02afhammadjustin_smith: Do you mean in the config (its not very clear)? https://github.com/ptaoussanis/timbre/tree/dev#configuration
19:05justin_smiththe :fmt-output-fn key of the config should have your formatter
19:05justin_smithit gets all the log info as arguments, and can construct the string as it likes
19:07cespareI wish I could make a record that didn't have an auxiliary map.
19:08cespare(assoc r :some-crap 123) should fail.
19:09gfrederickscespare: I bet ztellman's custom map types could do that
19:10cesparegfredericks: what project is that?
19:23gfrederickscespare: https://github.com/ztellman/potemkin#def-map-type
19:27cesparegfredericks: oh, neat. That does seem helpful.
20:02technomancyLeiningen 2.4.3 is out, everybody.
20:02technomancyyou know what that means
20:03technomancyPARTY TIEM
20:04xeqitechnomancy: time to go do sleep and have the download permissions change?
20:04technomancybahaha
20:04technomancypretty much
20:04technomancyxeqi: we're off s3 though, so for real, no more of that nonsense
20:04technomancyalso no more $40 monthly bills for traffic
20:15Jaoodtechnomancy: your wishes have come true, there's melpa-stable now ;)
20:17technomancyJaood: a step in the right direction, for sure
20:17technomancyunfortunately, last I checked it still mangles the version numbers
20:22Jaoodguess it needs time, worked fine for cider 0.7
20:22Jaoodthis conch lib is nice
20:23afhammadthanks justin_smith
20:24Jaoodtechnomancy: did you push 2.4.3 because of the maven central issue?
20:25technomancyJaood: yeah
20:25Jaoodthey added https pretty quick ;)
20:25taliostechnomancy++
20:25technomancyJaood: amazing what getting a story to the top of HN can do
20:26taliosJaood - they were already planning it with contract negs as well. Not that it really does anything. It a false safety net.
20:26technomancyuuuuuh
20:26technomancyit's an important part of a defense in depth
20:27technomancyit's not the be all and end all of security, but it blocks a number of attacks that would otherwise be trivial to perform
20:27technomancynecessary but not sufficient
20:27talios-an- important part. MITM protection yes, but security? god no. You can't really trust arbitrary code, this will let you trust it wasn't altered tho.
20:28technomancysecurity isn't a black and white thing
20:28technomancyyou can't say "this has it, and that doesn't"
20:29taliostrue. plus, given central isn't immutable ( not sure if clojars is? ) - you could deploy a false 1.2 of nnn overwriting the original. new signage, no MITM.
20:29justin_smithtechnomancy: I think we can say "that doesn't" - at least in some very silly examples I could invent
20:30technomancywe should be glad when important steps are made in the right direction, but we shouldn't pat ourselves on the back and say "yay, we made it; we're secure"
20:30talios+1
20:30justin_smithtalios: only works with Snapshots in my experience
20:30technomancythe situation is no longer embarrassingly bad, merely bad =)
20:30TEttinger(inc technomancy)
20:30lazybot⇒ 129
20:30taliosjustin_smith - nope. we did it on the weekend when we released a botch artifact. re-rereleased with the same version
20:31justin_smithtalios: oh, I thought I had seen that fail, yuck
20:31technomancytalios: clojars and central are both immutable modulo "contact support and get them to un-bork you" afaik
20:31technomancy(plus clojars snapshots)
20:32technomancytalios: or were you able to do that without help from sonatype?
20:32justin_smithtalios: oh, you were talking about central, I thought you were talking about clojars
20:32taliostechnomancy - yep. deployed new version to oss.sonatype.org, published the sync replaced.
20:32talios+and
20:32technomancyhuh; I was told that wasn't supposed to be possible
20:33technomancythe policy on clojars is to only perform deletions in the event of leaking sensitive code or license violations
20:33technomancybut it's been proposed to allow users to delete jars they own with zero downloads
20:33xeqi~zero
20:34clojurebotNo entiendo
20:37xeqiusually that happens, but there has been some laziness lately: https://github.com/ato/clojars-web/issues?q=is%3Aopen+delete
20:55gfredericksI just downloaded some code from the internet (lein 2.4.3) that I never read and am not really sure where it came from and it's going to help me make sure I don't accidentally download the wrong code
20:58gfrederickssecurity is fun wheeeee
20:58xeqijust don't run "lein new something something" cause then it will go download more random stuff you've never read and run it
20:59hyPiRionand don't use plugins either
21:00xeqior dependencies
21:00gfredericksor linux
21:00gfredericksor other operating systems
21:01hyPiRionxeqi: can you run dependencies with lein itself? Execpt for run, repl and compile?
21:01gfredericksman I don't know how security nerds sleep at night
21:02hyPiRiongfredericks: it's 3 am here and I'm not even a security nerd.
21:02hyPiRionThey must be in pretty bad shape
21:06gfredericks"Security experts admit the only thing they're sure about is that "foobar" hashes to c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2."
21:07xeqihyPiRion: well, the exploit would need a class to be loaded to hook off of
21:07xeqiso those, test, update-in maybe?
21:09cespareTrying to use def-map-type from potemkin, but I can't get even the example in the README to work. https://gist.github.com/cespare/7c17f04619227f7df60c
21:09cespareany ideas?
21:14gfrederickscespare: can't reproduce
21:14gfredericksmaybe try restarting repl?
21:14cespareI did :(
21:15gfredericksyou're using 0.3.7?
21:15cesparei did just the steps in the gist from a fresh repl
21:15cespareyes
21:16gfredericksversions of clojure & jre?
21:16cespare1.5.1 and 1.7
21:16gfredericksI'm on 1.6.0
21:17cesparei'll try 1.6.0
21:17cesparegfredericks: okay, same result in 1.6.0
21:19danielcomptontechnomancy: would it be a good idea to have an install script that people run to install leiningen for the first time? I'm not crazy about curl -sSL https://get.rvm.io | bash -s stable but it certainly is easier
21:20cesparegfredericks: i'll just open an issue
21:20gfrederickscespare: reproduced
21:20cespareoh?
21:20gfredericksI might have been using an older version due to my user profile
21:21gfredericksyep that's it
21:22gfredericksso potemkin 0.3.4 is what I'm using when it works fine
21:22gfredericksyou could try that and file an issue for 0.3.7
21:23gfredericksit looks like a fun error to investigate but I gotta go put corn in bags and do dishes
21:23dbellhad a quick idiom question: which is preferable: (list var-to-be-resolved) or `(~var-to-be-resolved) for single-member lists?
21:23cesparegfredericks: i'm surprised the tests pass.
21:23cesparegfredericks: they make a map type
21:23gfrederickscespare: it might be a stale README?
21:23cesparegfredericks: (or maybe they don't)
21:23gfredericksoh
21:24cesparegfredericks: oh, actually, the test def-map-type defines with-meta and meta as well.
21:24cesparegfredericks: even though the readme implies you don't need to define those yourself.
21:25gfredericksyep
21:27cesparegfredericks: yeah, defining meta fixes it.
21:30cesparegfredericks: https://github.com/ztellman/potemkin/issues/26
21:30cesparethanks for your help
21:31gfredericksnp
21:40technomancydanielcompton: I don't really see how that's easier
21:41technomancylein is its own install script
21:42danielcomptontechnomancy: or giving people an instruction like: `curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > ~/lein && lein`
21:43xeqichmod +x
21:43technomancyisn't that already in the readme?
21:43technomancyhm; apparently not
21:43danielcomptonNot at http://leiningen.org/#install
21:44technomancydanielcompton: the problem is that not everyone has ~/bin on $PATH
21:45danielcomptontechnomancy: yeah, I agree it's an issue. I'm just thinking about beginners who don't have a solid grasp on the shell and needing to know how to download this file, and check what's on their path
21:48technomancyyeah, I'm a little conflicted on whether people who don't know how to use computers should be learning clojure in the first place
21:48technomancyit's not exactly a friendly introduction to computing
21:50justin_smithyou heard it here first folks, clojure isn't friendly
21:50technomancysame problem as people trying to learn emacs and clojure at the same time
21:50technomancyjustin_smith: the idea that this could be controversial didn't occur to me
21:51justin_smithI was double-jokign
21:51justin_smithnot controversial at all, clojure is weird
21:56cminus1Is it possible to pass a :configurator option to run-jetty as called by lein ring server?
22:00danielcomptontechnomancy: I don't think it's much less friendly than (say) Ruby, it's just that the Ruby community has a bunch of practices and tutorials and 'copy this shell command to execute remote code' which reduce the complexity for a beginner
22:02dbaschdanielcompton it’s not just that. Ruby is very forgiving regarding syntax, and even has different names for the same thing (e.g. inject = reduce)
22:02dbaschall of which is horrifying to me, but more tolerant of beginners
22:03justin_smithalso, it uses a syntax that looks like the math syntax you have been learning since elementary school
22:03danielcomptondbasch: I guess my point is that it is possible to lower the barrier to entry for Clojure further
22:04dbaschdanielcompton: of course, right now it’s relatively high so it wouldn’t be too hard to lower it a bit
22:04danielcomptondbasch: exactly
22:05danielcomptondbasch: I'd love to do some user research with people new to Clojure to see what they find difficult and where they trip up
22:05dbaschbut also, what made ruby explode was having a “killer app” of sorts in rails
22:05technomancyI'm all for getting rid of incidental obstacles, but I am fairly sure that Clojure will never embrace beginners the same way Racket does.
22:06technomancyin this case I would argue the complexity is not incidental; if you don't understand how paths work, you should not be manually installing software like leiningen
22:06kristofWhat does it take to embrace a beginner?
22:08technomancythe people who shape the language need to spend a significant amount of their time interacting with people who are learning it.
22:09technomancyI'd imagine part of why drracket is so good is that it's written by professors who use it for their day job.
22:30Jaoodthe JVM is in good hands http://openjdk.java.net/projects/panama/
22:31brehauti forget, does java 8 or 9 have unsigned primatives?
22:32justin_smith8 does not
22:33justin_smithhttp://stackoverflow.com/questions/22903669/java8-unsigned-arithmetic err... maybe I spoke too soon
22:33justin_smithit doesn't have unsigned data, just methods that treat it as unsigned (?)
22:36ToBeReplacedjustin_smith: lots of updates to nio.file, and some TODOs carved out if you have any interest
22:38justin_smithToBeReplaced: awesome, thanks for the update, I'll check it out
22:41justin_smithToBeReplaced: I forked it onto my github account, and will likely update with PRs
22:42ToBeReplacedjustin_smith: cheers, i'd love that
22:46justin_smithyou'd think that git would add an upstream remote to a forked repo
22:46justin_smithI guess they prefer you do everything via their UI or something
22:47justin_smith*github
22:52brehautits been about 5 months since i last looked at Om; whats the best getting started guide atm?
23:00ddellacostabrehaut: probably dnolen's guides remain the best
23:01brehautddellacosta: thanks
23:01ddellacostabrehaut: meant these in particular: https://github.com/swannodette/om/wiki/Basic-Tutorial, https://github.com/swannodette/om/wiki/Advanced-Tutorial
23:02ddellacostabrehaut: although something appears to be up with the advanced one...
23:02brehauthah yeah thats not super comprehensive :P
23:02brehautits a bit frustrating that the intermediate tutorial wants to have me use datomic too
23:04ddellacostabrehaut: yeah, I guess we really need some more Om tutorials/docs/etc.
23:05ddellacostabrehaut: I would also spend some time checking out the examples, if that is a useful way for you to learn: https://github.com/swannodette/om/tree/master/examples
23:05brehautddellacosta: yeah; i understand why theres not currently (alpha etc) but i have found it a bit tricky to get the hang of
23:05ddellacostabrehaut: and I have a few more random examples, which are not super comprehensive but fill in a few gaps in the default examples: https://github.com/ddellacosta/om-cookbook
23:05ddellacostabrehaut: yeah. :-/
23:05brehautddellacosta: i got completely stumped trying to make a numeric text field last time i was experimenting. it was basicaly the first thing i tried to do
23:06brehautthanks
23:06brehaut(inc ddellacosta)
23:06lazybot⇒ 6
23:06ddellacostabrehaut: some things are really not easy to get at first. I'm so busy that I haven't been spending much time writing docs lately, but I really do want to get more Om docs/tutorials/blog posts out there
23:06ddellacostabrehaut: so on that note, let me know what you think would be helpful...
23:06blris anything special required to use sqlite with ragtime.sql.files? have defined :ragtime {:database "jdbc:sqlite:foo.db"} yet getting exception db-spec ragtime.sql.database is missing a required param
23:06blrhey brehaut :)
23:07brehautblr: hi :)
23:07brehautddellacosta: thank you
23:08ddellacostabrehaut: very welcome. :-)
23:10zeebrahhi the cider docs still recommend putting cider-nrepl 0.7.0-SNAPSHOT in ~/.lein/profiles.clj instead of just 0.7.0 which works without warning
23:11blrbrehaut: I noted your issue on the ragtime github repo from last year with emacs autosaves. I've had all manner of issues with those screwing up things unexpectedly, so ended up saving them all in ~/.emacs.d/autosave and ~/.emacs.d/backup respectively
23:12brehautblr: oh true, i had completely forgotten about that! seems like a good workaround though anyway
23:13blrdon't want all that filthy emacs detritus clutting up your filesystem anyway :)
23:13brehautyeah :)